Live data from Hacker News

Why we chose Elm for Humio’s web UI

humio.com

131–137 of 137 posts

Re: Why we chose Elm for Humio’s web UI

#131

Earlier quoted context omitted.

What do you do when network requests fail for essential parts of the application?

I'm not a language researcher/expert but real life code is full of colaterals and side effects, specially having to deal with things like network the expectation that f(x) will always resolve to a valid answer without resorting to result being of another sort even if normalized to the expected type (eg, you are doing a simple integer calculation and define that the negative numbers will be used as error codes to deal…

> you are doing a simple integer calculation and define that the negative numbers will be used as error codes to deal with side-effects

I had to come back to this because this kind of in-band signaling is how I've introduced bugs many-a-time in my old life. In FP it's so cheap to just make this function that can fail in some way return a wrapped up value that tells you what failed and how and _prevents_ you from doing math with what should be an error code (for instance).

Re: Why we chose Elm for Humio’s web UI

#132

Elm is the only technology I'd consider for serious frontend development. It's a pity the leadership / dictatorship means package management is a massive pain and support for some features is not available (unless you FFI to JS). It feels like what react + redux + saga should be like. Amazing developer experience. The only cons is availability of content online / hiring.

Have you had bad experience with hiring for Elm? As written in different comment my Elm hiring experience was stellar, but now I wonder if it might be because we're fully remote team (not, say, Czech company hiring only Czechs from a radius of 30km around one city. I can imagine how that would limit the talent pool.)

I've hired several Elm engineers for my company. Fact is, none of them knew Elm to begin with.

In my many years of experience, learning a new language or framework or API is simply part of the job description. What matters is critical thinking, software *engineering* experience, aptitude, attitude, a willingness to continue learning, and a desire to help others learn.

Every one of my engineers picked up Elm quickly and has come to enjoy using it. There is literally a world of (future) Elm engineers out there to hire.

Re: Why we chose Elm for Humio’s web UI

#133
post #124

Earlier quoted context omitted.

I'm not a language researcher/expert but real life code is full of colaterals and side effects, specially having to deal with things like network the expectation that f(x) will always resolve to a valid answer without resorting to result being of another sort even if normalized to the expected type (eg, you are doing a simple integer calculation and define that the negative numbers will be used as error codes to deal…

You don't expect a function that hits the network to always return a valid answer though. That function would return a Result type which has Ok and Err constructors which you match against. Here's a self contained example that explains it better than I can[0]. > if we managed to program in a "multidimensional-state paradigm", where you could call a "multidimensional f(x)" where in one dimension of the state it will a…

In most languages you can have more than one result or pack multiple values in a struct like object and that would simply solve this problem. Another way would be to return just the status code, knowing if it failed or succeeded and passing a closure to be called when the operations finish, either with 'ok' or 'failure' signal and the possible result.

Ok, we can do all of this now, but in this vision, you would have some sort of Ohad Rodeh btree, which would track all the states (it basically needs to be some sort of GC and handle all the state allocations).

With this btree you would be able to create branches of the whole universe of states in a memory cheap way. Once theres a possible state change a new branch is created, and once consolidated(not just one, but it might change many states of the tree) it would be passed as the "front state".

If a side-effect prevented the change in state from occurring nothing would happen as the original state would keep the same.

I know this sounds trouble and that we kind of have the tools for this, but i've noticed that we have a "fractured state" problem where we end up doing much more work that it would be not actually needed if we managed to pack it all in a ubiquitous initial signal that would get 'sliced' into other signals with transforms, but would be consolidated into one again.

Rendering got that right, with a back buffer with a bunch of intervening state that is flipped as front once its all set. If things are breaking in the back buffer, just try it again or fail the whole state tree all at once, keeping the last good state intact.

We already do this manually in code, but we manage a lot of fractured states giving we don't have the bird-eye view perspective.

If you had something managing it all, looking at diffs, etc, my intuition(maybe wrong) says that it would make a more efficient and stable program, more performant, with more memory efficiency and easier to reason about from the developer perspective.

Re: Why we chose Elm for Humio’s web UI

#134
post #124

Earlier quoted context omitted.

You don't expect a function that hits the network to always return a valid answer though. That function would return a Result type which has Ok and Err constructors which you match against. Here's a self contained example that explains it better than I can[0]. > if we managed to program in a "multidimensional-state paradigm", where you could call a "multidimensional f(x)" where in one dimension of the state it will a…

In most languages you can have more than one result or pack multiple values in a struct like object and that would simply solve this problem. Another way would be to return just the status code, knowing if it failed or succeeded and passing a closure to be called when the operations finish, either with 'ok' or 'failure' signal and the possible result. Ok, we can do all of this now, but in this vision, you would have…

> In most languages you can have more than one result or pack multiple values in a struct like object and that would simply solve this problem.

There are structs/records in like every FP language. The advantage of FP is that you can have the error code and description OR you can have the OK state value, but you can't have both in the same scope and the compiler guides you to that. And that rocks.

Re: Why we chose Elm for Humio’s web UI

#135
post #85

Earlier quoted context omitted.

I had a runtime TYPE error not too long ago. Integers in elm are a lie. I got scientific notation for a float back when an integer went over the limit of javascript floats. It was a stupid bug on my part that numbers got that big obviously but still. Take the no runtime errors with a grain of salt.

Did you try out https://package.elm-lang.org/packages/cmditch/elm-bigint/lat... ? I've used that for things that I know exceed the browsers limits with JS numbers. Had to use it recently with something that returned a JS BigInt (which was a whole other buggy problem).

The problem with that is that by the time you have a problem it's too late.

Python has real integers that don't overflow. Elm does not.

Re: Why we chose Elm for Humio’s web UI

#136
post #125
post #83

Earlier quoted context omitted.

Of course the community is friendly: all dissent is ruthlessly crushed and removed. It feels very friendly and nice until you start to dissent, then it turns on you hard. I posted an article saying I now recommended elm and was a part of the reason we chose it for our product. But I also said some things I disliked about elm. So I was banned. No warning.

Banned from where the discourse?

Reddit

Re: Why we chose Elm for Humio’s web UI

#137

Earlier quoted context omitted.

Is Evan still working for NoRedInk? It looks like he vanished sometime around May last year.

He's not. It wasn't exactly a happy separation. The company had some internal strife last year and I'm not sure if the CTO and the head of tech want to work together anymore

Head of tech here. We had COVID-induced layoffs, like many companies, not internal strife. Our CTO is one of my favorite coworkers I've ever had.

What a cruel thing to make up and then say.

Post reply on HN