Hacker News new | past | comments | ask | show | jobs | submit login

Algebraic effects are not basically the same as Common Lisp conditions.



I hadn't heard of Common Lisp Conditions before reading this thread, but I looked them up in response to it, and I have to ask -- what is the fundamental difference?

Granted Common Lisp is not statically typed and the type system support for effects is a major part of the utility of algebraic effects in Koka, but otherwise they do look remarkably similar to me, both offering a form of delimited continuation that allows you to write code that can call out to a non-local handler that is set up the call stack, and which can itself return control to the caller.


> what is the fundamental difference

CL's condition system is one of the (possible) applications of an algebraic effect system (implemented using delimited continuations). Schemes have dynamically typed (delimited) continuations, for example.


But going in the opposite direction, could you not also implement arbitrary effects using conditions? (Or delimited continuations in schemes)


I am not sure about conditions (I don't know enough about CL), but the effect system of Koka (and OCaml) uses delimited continuations. So it is doable in Scheme, with shift/reset or prompt/control or whatever primitives are defined.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: