r/ProgrammingLanguages • u/SirKastic23 • Jul 24 '26
Discussion Unreal's 6 scripting language has an effects system
https://www.youtube.com/watch?v=ebqKYLKjL6UI was very surprised to see it. Could this be what finally brings algebraic effects to the mainstream?
105
Upvotes
63
u/SwingOutStateMachine Jul 24 '26
I'm not entirely surprised - Epic has been hiring and working with some really excellent programming language and compiler folks for the past few years. A notable example is that Simon Peyton-Jones is an Engineering Fellow there.
9
u/Inconstant_Moo 🧿 Pipefish Jul 25 '26
I don't see this succeeding as a games scripting language. It's a heavyweight language in an unfamiliar paradigm.
Algebraic effects for what? How much of its time would a games scripting language spend doing IO?
28
u/EggplantExtra4946 Jul 25 '26
tl;dw:
in Verse, functions that can fail and that indicate the failure through the effect system, but not those indicating failure through the type system by returning an optional type, have to be called using square brackets
func[params]around the arguments instead of parenthesesfunc(params)the "climax" at the end:
array index lookups can also fail and also use square brackets
array[index]to access elements27
u/teerre Jul 25 '26
Last time I superficially read the docs it's a very limited implementation of effects with some predefined effects that you can compose around. You can't have a "db effect" that you define inline
Maybe they changed it
1
u/Inspired_Software 1d ago edited 1d ago
It has adhoc effects in its type system like many other languages. It doesn’t have user-defined algebraic effects like Koka, but I hope we see that become mainstream. It would fit pretty naturally in many existing languages.
-10
u/AnArmoredPony Jul 25 '26
a[i] slop 👎👎👎