Epic’s Verse Programming Language
dev.epicgames.com
dev.epicgames.com
It's pretty elegant.
for:
Y->CellRow:Cells
X->Cell:CellRow
AdjacentX:=X-1..X+1
AdjacentY:=Y-1..Y+1
AdjacentCell := Cells[AdjacentY][AdjacentX]
Cell<>AdjacentCell
AdjacentCell.Mined?
do:
set Cell.AdjacentMines += 1So mcbrit's quick snippet to the rescue! :D
eta: I do wish programming language pages would all just put a small code sample right there on their landing page, at least as a supplement to whatever else they want to say. Mostly it's going to be experienced developers who look, and we don't want/need a lot of fluff; we're reasonably likely to fairly quickly grok most of what's interesting about a language from a well-crafted example, and that's more likely than anything else to prompt us to dig deeper if it tickles something inside us.
Seconded. As someone who doesn't work with Fortnite/UE5 development I suspect this page isn't really meant for me. But I would at least have assumed they'd want to have a few little standalone examples front-and-centre to entice any potential users
Also make sure your learnxiny page is up to date and appealing.
GDScript (godot) has one: https://learnxinyminutes.com/docs/gdscript/
Offtopic examples:
Nim: https://learnxinyminutes.com/docs/nim/
Crystal: https://learnxinyminutes.com/docs/crystal/
After reading those, how can you say no to nim or crystal?
I didn't even understand the Verse sample, I'd need to see the equivalent c++ (or other common language) to really get what made it appealing. Maybe also more explanation on why. A good learnxiny page might have done that for me.
I said failable above, but they might be some other kind of functions. They have a total effect type (functions that are guaranteed to terminate), which could be safely called by the type checker.
They don’t have as much familiarity with camelCase or snake_case as us programmers do.
CapitalCase is friendlier to a wider audience.
Only if the variable is a proper noun... otherwise it's pointlessly contrarian.
The C++ Concepts work with the same idea except it is at compile-time and applies to the whole function or a type/class.
That sounds quite neat
How does that square with performance? To implement transactions there has to be a copy of whatever state is manipulated by the transaction. That is potentially a huge amount of state that has to be copied.
The less you mutate, the more you can reuse without copying.
I really wonder whether people making claims that "something would be slow for games" actually bother benchmarking if that's true and how much.
The fact that something might be faster theoretically isn't really relevant if the calculations stay on a very small scale.
I know for example that EnTT, a C++ ECS project has snapshots available to allow you to save the game state in the background without blocking gameplay as an example.
This persistent data is what you use transactions on, and there are past experiments of doing things like fully double-buffering this state (Each frame, recreate the full state into a different buffer, with the code doing so only touching the previous frame, never reading from the current one. Great for multi-threading!)
Beyond Functional Programming: The Verse Programming Language [pdf] (peytonjones.org)
Verse-as-a-scripting-language-for-a-game-engine is an interesting experiment. The million script writers who use it are not going to have any understanding of the functional language underpinnings. They're going to copy-and-paste until things work. There's going to be a lot of superstition and cargo cults.
I guess Tim Sweeney has a long history of successfully using exotic custom scripting languages in game engines, from ZZT to various generations of UnrealScript. So he probably knows what he's doing.
I just can't imagine that working at scale. I bet they add semantic versioning support pretty quickly.
I haven’t watched the Simon Peyton Jones presentation yet (wasn’t even aware of it until yesterday) but seeing that he’s involved lends it some serious credibility. I had misunderstood that this was going to be a lightweight scripting language a la GDScript, but I’m now wondering whether they see this long-term as standing shoulder-to-shoulder with C++ in UE.
They're also aiming to release the language with a permissive open source license so others can add it to their software.
Here's the start of that presentation from their livestream: https://youtu.be/teTroOAGZjM?t=22503
But I feel like they had a list of features and a specific syntax that they wanted to give to game developers, and they then had to shoehorn "the good bits" (the semantics) into these arbitrary features. Some things are truly bafling, like it has both significant indentation and {}, at programmer's choice. Wat.
Also I think the documentation is not great. It says reference in the title, but as a reference is not very thorough, in fact it's more like a tutorial, but the sequencing is not very pedagogical to be a tutorial either. In general the concepts are explained at a very basic level, but then sometimes it throws very technical concepts at you out of the blue, like type polarity. Also a lot of the links are 404 and they hijacked middle click. Ugh. They also publish memes in the documentation. In fact all images published as part of the documentation are kinda pointless.
I suppose I'm not the target user here, but I really wish there was a way to play with the language outside the Unreal editor. Surely this has to be possible, if anything, just for their own developing team's sanity. (Edit: after watching the video linked in the thread, apparently this is coming, they are going to release it as open source!)
In any case, I am really excited about this new language, quirks at all, and I am really waiting for the next papers the team will publish. The first paper was really great!
In fact I think that `class` and other constructs are some sort of compile-time macro. I suspect some syntactic idiosyncrasies are about making the language homoiconic.
Verse has effects, but not algebraic effects. The set of effects is finite and fixed, and there's no way to define arbitrary handlers. All effect processing happens in language constructs like if and for (which might be macros, so maybe there will still be some user-level support for handlers after all). Because it does not have a full blown effect system, concurrency and monadic composition had to be baked into the language, with an effect system these features could have been implemented in a library instead.
Notice how effects are negative types. They are a promise about what a function will not do, not an indication about what a function might do. This is the opposite of other languages with effects.
defer is not needed if you have linear types. I suspect they considered linear types too difficult for the average programmer, so they went with what they consider a good-enough solution.
The type system is probably very novel, I suspect it is the most interesting part of Verse but so far has not been explained or talked about at all. I suspect it might have some form of dependent types.
https://www.youtube.com/live/teTroOAGZjM&t=6h15m
Skip to the 6 hour 15 minute mark for the Verse section. YouTube won’t let me copy the time stamp for some reason.
It takes me to a screen with random current live streams
why in the world would you do that? even going out of your way to _call it boolean_ in the description, and then :fu: in the actual language
> indented comment: Anything that appears on new lines after <#&> and is indented four spaces over is part of the code comment. The first line that isn't indented four spaces over is not part of the code comment and ends the code comment.
Interesting. I see later on that code blocks also tolerate Python-ish syntax but _also_ brace syntax https://dev.epicgames.com/documentation/en-us/uefn/code-bloc...
Can't believe it has taken them this long when entire games were already possible with skookum. And it's still not even released.
Sweeney totally bought skookum and threw it away and then just so happened to reinvent all the same keywords.
No repl, no interpreter, no compiler, nothing?
Probably a good candidate to compete with Minecraft (assuming the entire stack can be made easy to access).
Secretly I still dream we are able to build a 2023 version of an ultima online verse.
https://dev.epicgames.com/documentation/en-us/uefn/verse-lan...
My personal tastes,
Out:
- Kotlin, I don’t live in Java
- Rust, too complex
- Golang, nothing in particular to recommend it
In:
- Zig, simple, focus on C interop
- Jai, looking into it
Others popping up everywhere!