Live data from Hacker News

Prism: An Impure Functional Language With Typed Effects

stephendiehl.com

11–14 of 14 posts

Re: Prism: An Impure Functional Language With Typed Effects

#11
> It's functional but in place

This is an abuse of this term, which refers to immutable transformations that reuse memory, as in Roc and Koka, not to hiding effects within a function.

> It's the code you would write in Python with types you get from OCaml and no monads.

It's also the code you could write in OCaml itself.

---

Having used OCaml 5 effects, I'm convinced that the trend of globally scoped effect constructors, dynamically scoped handlers and effect-typed functions are the wrong approach. They couple too many orthogonal features.

Handlers should be consumed as (records of) functions that can't leak from their scope (see 'local' in OxCaml, 'ref struct' in C#) and are passed down as a capability. Now you're using two more general mechanisms to express your effects, and other forms of dynamic scoping or dynamic dispatch can be made orthogonal to effects themselves.

Re: Prism: An Impure Functional Language With Typed Effects

#12

Earlier quoted context omitted.

How can you tell?

This is getting ridiculous. Maybe this comment is Claude, too.

OP is a credible poster so I was indeed curious as to why he wrote that. As for my comments -- em dash em dash -- they are entirely by moi.

Re: Prism: An Impure Functional Language With Typed Effects

#13
i love that effect based languages are getting more popular but how long will it take until one of them moves from unfinished experimental to at least beta?

verse is already used in production but its missing basic features like unions and lambdas, the compiler and runtime are closed source, and its tightly coupled to fortnite but also badly integrated with it at the same time.

koka is way more mature but i couldnt find a single project using it thats more than a demo or personal "lets try a new language" type thing. its explicitly a research language and not going awawy from that any time soon.

Re: Prism: An Impure Functional Language With Typed Effects

#14

I feel the author’s pain. LLMs take over right as we’re finally figuring out the unifying models and algorithms for programming languages. Some time back I went on a tour of the fort at Dry Tortugas. Largest brick masonry fort in the world. Many innovations of the form. It was abandoned right as it was completed because barrel rifling had just been invented, dramatically increasing the penetrating power of artillery,…

Make better typed programming languages should improve agentic ergonomics as well as human ergonomics. I’d expect better performance by the agents if they can encode more constraints in the type system like this.

It’s possible.

Effects allow more aspects of computation to be represented/generalized, but as the author has noted concrete implementations have already been tried in some cases. Rust’s ownership, Java’s exceptions, Typescript’s async are all instances where the language made a choice about and provided syntax for some effect.

Generalized effects are not yet proven (IMO) to improve developer ergonomics for rank-and-file devs. It may be the case that most devs need most decisions to be made for them, and the power of effects is just lost to them. That may also apply to agents. They don’t _need_ to encode the constraint. The constraint was decided when the language was picked.

Post reply on HN