HackerTrans
TopNewTrendsCommentsPastAskShowJobs

bern4444

no profile record

Submissions

Reactive Programming paradigm for Go for event-driven applications

github.com
16 points·by bern4444·hace 9 meses·8 comments

comments

bern4444
·hace 11 días·discuss
Yeah that's the engineering part in software engineer :)

If you have VerifiedUserWithBirthday, any value that fails the parsing function is implicitly UnverifiedUserOrUserWithoutBirthday... No need to define it separately. You get the inverse type for free IE a value that is of type User and not of type VerifiedUserWithBirthday.

A new property doesn't mean a new derived type. Only if that new property impacts what a VerifiedUserWithBirthday should represent should the VerifiedUserWithBirthday type be updated and even then, it's not a new type, just an update to an existing type. Again minimal updates needed.

The compiler handles all the validation and will tell you exactly where there are any issues - the compiler is what makes the maintenance cost quite low.
bern4444
·hace 11 días·discuss
It's pretty trivial to create derived and augmented types with Pick, Omit, Required, Partial. Combined with a few parsing functions that return an object typed to whatever specification you need and you are set IE:

    type User = { name: string; verified: boolean; email?: string; lastName: string; birthday?: string | { year: string; month: string; date: string; }}

    type Birthday = Required<Pick<User, 'birthday'>>;
    type UserWithBirthday = User & { birthday: Birthday } 
    type VerifiedUser = User & { verified: true; email: string; }
    type VerifiedUserWithBirthday = User & UserWithBirthday & VerifiedUser;


    const userHasBDayAndEmail = (user: User): user is VerifiedUserWithBirthday => {
        if (user.email === undefined || user.birthday === undefined) {
            return false
        }

        return true
    }
Any caller of userHasBDayAndEmail knows for the rest of its nested call stack if the provided user is a User object or a VerifiedUserWithBirthday.

The types are cheap to write (they're all derived) and have no runtime impact (types are erased at build/compile time) and these parsing functions are quite small to write

https://www.typescriptlang.org/play/?#code/FAFwngDgpgBAqgZyg...
bern4444
·hace 8 meses·discuss
He calls it a CV and given the education background is British it's more inline with what a CV is meant to represent - a deeper dive into your background and experience - compared to a resume which is a condensed 1 page summary.

In the US we often use the term interchangeably but internationally they are quite different.
bern4444
·hace 9 meses·discuss
> For instance, Math.random and Date constructors are fixed in workflow runs, so you are safe to use them and the framework ensures that the values don't change across replays.

How do you create an environment where everything is deterministic? Do they invoke every supported non deterministic function when creating the environment and rewrite those functions to return the values from the environment's creation time? Is there something more complex happening?
bern4444
·hace 10 meses·discuss
This looks awesome, I had two questions:

Is there a structured concurrency library being used to manage the chained promise calls and lazy evaluation (IE when the final promise result is actually awaited) of the chained functions?

If an await call is never added, would function calls continue to build up taking up more and more memory - I imagine the system would return an error and clear out the stack of calls before it became overwhelmed, what would these errors look like if they do indeed exist?
bern4444
·hace 5 años·discuss
I think this reveals a much more interesting trend that's likely to continue.

It's not that existing jobs will always be automated, we'll come up with tools that completely automate several layers of work.

It's a different view than all current jobs will be automated. Automation can be used to remove several verticals and improve efficiency by magnitudes in the process.
bern4444
·hace 5 años·discuss
Its funny and pokes fun at the larger conversation but I hear you.

Though I think its fair since neo vim is referred to and means new vim. The author here likely believes helix to be more modern than neo vim hence, post modern.

Whatever, I'm sure you understood that. I enjoyed the humor and think its fair
bern4444
·hace 5 años·discuss
The best part is, when you need to do that across multiple files that you can find with a :grep or :Rg command, its trivial. Populate the quickfix/location with grep (or ripgrep or silver searcher etc) and fire off a cdo with a :s/foo/bar/g and watch it run.
bern4444
·hace 5 años·discuss
For the multiple selections feature, how is that different from vim's visual selection paired with additional commands?

For example, in vim I typically visually select a block and then run :s/foo/bar or hit > to indent etc

Is the flow on helix that different? Does it save a keystroke?
bern4444
·hace 5 años·discuss
That's exactly why I really dislike a lot of IDEs and editors. I've been using (n)vim for 3+ years now as my main editor.

A big value of (neo)vim is the lack of clutter and how easy it is to bring up and hide windows/buffers when I need them. Editors like VSCode and IntelliJ are just too noisy and gets in the way of the actual coding.

I know they can all be customized and configured to reduce this issue, but even then it still feels more visually cluttered and those windows usually end up coming back somehow.