Live data from Hacker News

The front end framework for correctness: built on Effect, architected like Elm

foldkit.dev

21–30 of 53 posts

Re: The front end framework for correctness: built on Effect, architected like Elm

#21
post #9

Just wondering how a matching backend framework for correctness would look like. Ideally something that doesn't repeat the React mess with two routers but fits right in Inertia style.

That is a fair question. Probably one could inspiration by https://github.com/lustre-labs/lustre

Re: The front end framework for correctness: built on Effect, architected like Elm

#22
The project seems super interesting and I've been following since the creator went on an effect podcast I listened to. My only gripe/concern is the fact that the docs are so glaringly AI (likely claude) generated which is something I've come to not expect from technical documentation writing specifically. All in all though, the verbosity tradeoff for explicit design choice here is the right one and I think it does better than elm by remaining in javascript land rather than building a nicer abstraction layer on top that often needs to reach in to do interesting things with the web apis.

Re: The front end framework for correctness: built on Effect, architected like Elm

#23
post #4
post #3

As agentic coding matures, this kind of project is the right direction. The mechanics of writing the code become less important. But having a language framework that naturally resists mistakes will become increasingly useful and important. Similar to how Rust is obviously a better choice today than C++. Who cares if the language is “more difficult” to code in, if the agents are doing the coding. What we need is build…

That's an interesting - and maybe correct - point. Looking at the examples, it seems very long winded and not something I would want to write myself - but maybe I don't need to care about that anymore, as you say!

This time around in the pre-covid days, F# had a surge of popularity, there was Fable and Giraffe and an elm-style set of frontends (the generic pattern is called MVU - Model View Update), it didn't take off because A) we are still a trend/fad-driven industry and B) there was no AI to help hold your hand in refactoring all of your apps.

These days? Doing this FE SPA framework for Effect/typescript familiarity or Fable for F# familiarity and a model-view update pattern can help one do CQRS better, force you to think about stronger Hexagonal Architecture patterns, and overall help your application care about long term correctness more without you having to hand code every discriminated union as such.

The LLM can't replace you, but it can be an enzyme that lowers the activation energy required to switch from bad old MVC mutable tag soup to MVU frontends with strong data interface designs held in sqlite-dbs-per-aggregate (if you are of a DDD or event sourcing taste, which this pattern does not require!)

Re: The front end framework for correctness: built on Effect, architected like Elm

#24

How is Effect, for those who have used it? It's good that algebraic effects are becoming more mainstream.

It took me 3 months to go from “I will never use it” to “I will never not use it”. Plus it’s always fun to watch the creators of Effect get confused about which brackets to where. The syntax is archaic, luckily we don’t write syntax by hand any more.

Re: The front end framework for correctness: built on Effect, architected like Elm

#27

How is Effect, for those who have used it? It's good that algebraic effects are becoming more mainstream.

I use it from years, it's the only sane way to write typescript. The learning curve is steep tho. In any case it's a hard technology to sell, you don't appreciate it from hello worlds. In fact you hate it for trivial programs. It shows it's benefits at scale. Lots of tools like T3 and opencode use it at their core because they solve non trivial problems made of queues, retries, dependency injection, schemas, etc. I'v…

T3? Isn’t T3 just a TRPC boilerplate kinda thing?

Re: The front end framework for correctness: built on Effect, architected like Elm

#30
post #5

I don't know, as far as I can tell the demo on the homepage is bugged? Or maybe I misunderstand how it's supposed to work? If I click reset after 2 seconds and then click add 1 right after it, the reset never fires. What's up with that, that's not what I expected to happen?

Agreed - I hit "Reset after 2 seconds", I hit "Add 1", and sure - it adds one, but it also unexpectedly cancels the reset.

Which I don't expect from the description, and I also don't expect from the code.

---

So outside of the simple "This is broken..." feedback, I want to further pick on this example:

Don't fucking hide the imports.

Especially don't fucking hide the imports if you're showing example code, and you're doing things like

```

import { Match as M, Schema as S } from 'effect'

import { m } from 'foldkit/message'

```

Which I only know because I bothered to dig through the example playground counter (which is a different example entirely!)

It's a huge issue to show demo code where concepts magically appear, and it's just bad manners to use shorthand at the same time.

Post reply on HN