12 ms·
Type system of Fortnite's Verse language
- AceJohnny2 4y agoTangential, and because I had to look it up: > Verse has been designed by some people who really know what they’re doing: Lennart Augustsson, Joachim Breitner, Koen Claessen, Ranjit Jhala, Simon Peyton Jones, Olin Shivers, Tim Sweeney The listed people are all luminaries of the functional programming world (and adjacent, like theorem proving and software verification), particularly Haskell. Hell, Simon Peyton Jones is one of the creators of Haskell. My point is, the creators of Verse aren't just a bunch of coders (pejorative) who felt like creating Yet Another Language.
- AceJohnny2 4y agoNevertheless, I've yet to see an explanation of what problem Verse aims to solve that isn't solved by other languages out there. It's still very early (while announced last year, it was only just shown at GDC last week!) so I expect we'll be hearing a lot soon. Obviously, the association with Fortnite won't do it any favors. They claim they want
- CharlesW 4y ago> Nevertheless, I've yet to see an explanation of what problem Verse aims to solve that isn't solved by other languages out there. You might find the explanation in TFA helpful: > "A battle royale lobby has just 100 players, which fit within a single compute shard. > "But Fortnite is much more than just battle royale. A huge number of Fortnite players are on custom game modes made by people outside of Epic Games. It’s easy to imagine game modes having a few thousand players which can’t fit within a single shard. How do you scale to handle all that game state, correctly? > "Software transactional memory is at the core of Verse. Computation is categorised by transactions and ability to rollback. The goal is to make it easy to write working software across multiple servers. A big goal; we don’t often see programmers do that successfully!"
- AceJohnny2 4y agoI'm hearing "Haskell mashed with Erlang"
- ABeeSea 4y agoThe pitch for SPJ to leave MS research on Haskell for a video game company must have been pretty compelling so I’m very interested to see how this evolves.
- whateveracct 4y agooh I'm $ure it wa$
- deleted 4y ago[deleted]
- nequo 4y agoI think it may have been desire for impact. SPJ spoke with disappointment about his lack of impact on Microsoft's products. Excel did end up adopting lambdas but that took a decade and a half. Inside Epic, he can roll out functional programming to a young audience that hasn't done much programming before. And from what I can infer, Microsoft Research seems to be paying quite well. Do you have knowledge that indicates otherwise?
- eru 4y agoWasn't he kicked out of MS research for silly regulatory reasons? I mean he had lots of options, so the pitch from Epic must have still been pretty good.
- ClimaxGravely 4y agoCan you elaborate on why he was kicked out? That's news to me.
- 4y ago
- jayd16 4y ago>Nevertheless, I've yet to see an explanation of what problem Verse aims to solve that isn't solved by other languages out there. The major problem being solved is that Fortnite did not fully control the fate of any other language.
- soup10 4y agoit's also well known that if you put a bunch of functional programmers in a room and let them marinate its only a matter of time before they make another functional programming language
- Kiro 4y ago> Obviously, the association with Fortnite won't do it any favors. What do you mean? I can't think of a better way to fast track a language to mass adoption.
- illiarian 4y agoOr they might be just creating a Yet Another Language precisely because they are luminaries of functional programming. Those often tend to chase a yet another unattainable dream of "the one true functional language". When you type the words "the really know what they are doing" when talking about a language for game programming, I would expect people who know about game programming first, and about language design second. There's a reason C/C++ and even C# are the go to languages for game programming, and not Haskell. For example, the only presentation we've seen so far literally talks about Yet Another Language without mentioning a single problem it solves for game programming.
- ClimaxGravely 4y agoC/C++/C# are indeed often used for game programming but when it comes to gameplay logic scripting there's a lot more options. Lua, blueprint, lisp, angelscript, unity's graph language etc..
- paulddraper 4y agoYeah, Lua is super common. Not exactly sure why, but it really is.
- codebje 4y agoLua is super common because it's super easy to embed into a C(++) project.
- Yoric 4y agoIf I remember correctly, one of the main original reasons was that it was super easy to embed.
- paulddraper 4y agoIsn't that true of Python as well?
- 4y ago
- 542458 4y agoAt the same time… the language is interesting, and I’m sure it’s technically very well designed, but I’m not sure it’s a good fit for the task they’ve got. The apparent goal is for this to allow anybody to democratically contribute to Fortnite (a game most popular with a fairly young audience), but the language feels very technical and not-beginner-friendly to me. For example, it’s fairly symbol-heavy (making it intimidating and hard to read), uses inverted pascal case, and has some tricky semantic whitespace (it has indent-based comments!). Bar():int = if (Foo[]): 1 else: 2 Find(X:[]int, F(:int)<decides>:void)<decides>:int = for (Y:X, F(Y)): return Y false?
- CharlesW 4y ago> The apparent goal is for this to be a “now everybody can contribute to Fortnite, democratize content” thing… I don't think so. TFA notes that Verse was created to support a non-trivial use case, which is to make it possible to write software that works across multiple servers in order to support thousands of simultaneous players.
- 542458 4y agoEpic’s very first design goal for Verse is “simple enough to learn as a first-time programmer”, and all of their intro docs are framed around making content for Fortnite. https://dev.epicgames.com/documentation/en-us/uefn/verse-language-reference https://dev.epicgames.com/documentation/en-us/uefn/verse-lan... AFAIK at present time there’s no way of even using Verse outside of Fortnite mods. It certainly seems that it’s best suited for the use case you described, but their site is trying to sell it as a “let’s all learn programming and mod Fortnite” thing.
- waboremo 4y agoYes, but it's not an exclusive design goal. Other goals are listed on that page and you can see how design tradeoffs happened. You don't prioritize simplicity over all and make concurrency a core pillar! And certainly I think they pulled it off. Go through the lessons here to see what I mean in nothing stands out as beginner unfriendly here, but it's also not black boxing much in the way Python would. https://dev.epicgames.com/documentation/en-us/uefn/learn-the-basics-of-writing-code-in-verse https://dev.epicgames.com/documentation/en-us/uefn/learn-the...
- ClimaxGravely 4y agoThey forgot to include Conan Reis who has been at epic working on that stuff for a long time. He authored a game-specific scripting language called Skookum Script. I have used it a small amount on a couple projects. It's an interesting language but I didn't get deep enough to really have a strong opinion. Interesting to see some of the Skookum script async specific features in Verse such as the race keyword.
- eru 4y agoTo add: Lennart Augustsson created the first publicly available Haskell compiler. I worked with him briefly, and also talked over beers. Great chap!
- chinaman425 4y ago[dead]
- kibwen 4y agoI'm unclear on the difference between the "computes" and "varies" effects. Surely a function that only reads constant state is pure by definition?
- eldenring 4y agoI see a bullet point saying Varies is for "random or non-constant state"
- kibwen 4y agoI think I may have been misreading, I was assuming that these effects were meant to be composed, but I guess they're exclusive to each other and form a tower (the preceding line even calls them the "exclusive effects", but I thought it just meant that this was an exhaustive list of effects).
- TigeriusKirk 4y agoI'm curious to hear anyone's experience using the language. Or is it brand spanking new and no one has yet?
- capableweb 4y agoYes, very new, I don't think much information at all about the language was public until just some weeks ago. First release was included in a recently released Unreal Engine update
- super_linear 4y agoIt's a bit tedious to even try it in my experience: you have to use Unreal Engine for Fortnite and interact with the code through that (no publicly available compiler/VM afaik). They have some docs at least on setting it up but still depends on having UEFN which is a little unfortunate: https://dev.epicgames.com/documentation/en-us/uefn/verse-api https://dev.epicgames.com/documentation/en-us/uefn/verse-api, https://dev.epicgames.com/documentation/en-us/uefn/starting-out-in-unreal-editor-for-fortnite https://dev.epicgames.com/documentation/en-us/uefn/starting-...
- pdntspa 4y agoDoes UEFN still have the problem where the framerate for rendering all UI halves each time you open a new window?
- ClimaxGravely 4y agoI've spent about 8 hours with it. It's neat to play with but I'm not yet sure it's the greatest fit for fortnight modding. Part of the problem is getting used to fortnight's device lexicon. Devices are kind of like code fragments or class instances you place in the world, they have a few events you can hookup and do various things. It's certainly WAY more restricted than blueprints in terms of what is exposed. In fact the UEFN editor completely disables blueprint scripting. You can only compose blueprint classes. You can't write any blueprint logic.
- gautamcgoel 4y agoIs Fortnite actually written in Verse? Seems unlikely if Verse is new or a work in progress. Does anyone know what language Fortnite is written in?
- Uehreka 4y agoIt’s built in Unreal, so a lot of C++.
- xcdzvyn 4y agoAm I the only one who thinks this is possibly the least appealing programming syntax they've ever seen?
- winrid 4y agoYeah, it doesn't really look like the kind of thing I'd design for 12-year-olds to use? Lua would probably work just as well and been a better choice...
- foolfoolz 4y agothis comment is wrong on multiple levels - this reduces fortnite’s audience to 12 year olds. the average age of a fortnite player is an adult - fortnite custom mods / modes are nearly all developed by adults (the people who will write in this language) - verse is designed to be used more widely than just fortnite in other games by other game develoment professionals (that are nearly all adults) i don’t understand how anyone can see a game that makes billions each year and think “12 year olds” are the driving force. video games are not just for teenagers and adults are the primary revenue streams because they have the disposable income
- VoidWhisperer 4y agoI'm not necessarily saying you are wrong here in the case of fortnite, but do you have data to back up that the average fortnite player is an adult? It seems like in general it tends to be wildly more popular with younger people, generally kids and teens - although i don't have data for this either, just based off what I've personally seen.
- jibe 4y agohttps://www.businessofapps.com/data/fortnite-statistics/ https://www.businessofapps.com/data/fortnite-statistics/ 62% of Fortnite players are 18-24
- Falkon1313 4y ago
- JackMorgan 4y agoThere's a lot of bummed out comments in here about the syntax, but to me it looks a lot like what someone might see in a reimagined Typescript. Maybe a little Haskell thrown in for good measure. I agree they probably would have been better served just using an existing language with loads of existing tutorials like C# or Python, but if they're going to make something totally from scratch, I think a lot of decisions will actually make the language pretty easy to learn. Everything being an expression should prevent a big trip hazard for new developers. As someone who teaches programming a lot, expressions vs statements vs special forms really confuses new developers. In a lot of ways, this seems like a lot of good ideas from Haskell and Typescript, put into a straightforward syntax. I'd bet I wouldn't even think about the syntax after a week of cranking out code. And the possibly to have dependent types down the road is very exciting! That would make things like STM so much easier, which would help immensely with scaling code.
- pavlov 4y agoThe main problem with using an established language like C# or Python in an embedded context is that they come with an expectation that the existing library ecosystem is supported. And that’s often just not realistic. The security implications of embedding a language like Python can be massive. Even the most basic libraries would be broken (e.g. a sandboxed script won’t be able to read and write files). And it may be just too much of a burden to try to enable decades of legacy cruft built with different assumptions than the host app (e.g. blocking vs async). You end up with a halfway language that has the syntax but none of the ecosystem. And that’s a poor experience for a new developer who googles a Python tutorial, copy-pastes code into Fancy Metaverse App, and is immediately greeted by a horde of mysterious errors.
- qprofyeh 4y agoI don’t see it like that. Because most of the tooling and ecosystem will work fine. No need to reinvent linters, formatters and dependency infrastructure. Perhaps slightly, 20% of the effort. Also, a subset of a language that does not include the batteries/platform is what made Node (and JavaScript as a general purpose language) possible and eventually very popular. Pragmatic communities deal very well with problems like these. Blender uses Python as scripting language and has tons of amazing plugins. I understand that Epic wouldn’t prefer a dynamic language (everything is a mutable object) though.
- Animats 4y agoHas anyone tried Verse in the Fortnite context yet? I haven't used it yet, but I've been reading the documents. Understand, this is a language for object behaviors. You don't write "a game" in Verse. You write behaviors for each type of object, and they interact to produce behavior. So it's a large number of little programs, reacting to events and talking to each other. The main kinds of programs seem to be "devices" and "landscapes". Devices are entities within the scene, and "landscapes" are scenes. "Devices" will not usually have huge amounts of code.
- ClimaxGravely 4y agoI have. At first it seemed a little restrictive because you can only really access other devices but I took a look at some of the example projects and it's relatively powerful for all its restrictions. There's a king of the hill game mode they used as a demo with a UI for class selection and all that. At first I thought that was impossible to do with the provided tools but Verse exposes a lightweight UI system you can use. So it's totally possible. Playing with UEFN is definitely quite restricted but it reminds me of my quake/halflife modding days. I find I really excel in a restricted game development environment.
- lynx23 4y agoI was surprised to see where Simon moved to: https://www.youtube.com/watch?v=832JF1o7Ck8 https://www.youtube.com/watch?v=832JF1o7Ck8 The talk sounded a bit unsubstantial, there being a lot of things he was not supposed to say yet. But still interesting.
- ralusek 4y agoI made this comment elsewhere, but does anybody else find it funny that Epic is releasing an editor for Fortnite, when Unreal Engine started off as an editor for Unreal Tournament? I'm predicting that at some point, Epic will make such a popular game in the new Fortnite editor, that they'll release an editor for that game.
- moogly 4y ago> Unreal Engine started off as an editor for Unreal Tournament Some history: The Unreal Engine predates Unreal Tournament. Both Unreal and Unreal Tournament (UT99) ran on version 1 of UE. Its editor was UnrealEd, which was written in Visual Basic by Tim Sweeney but used the same renderer (Engine.dll IIRC) and shipped with the base Unreal game released in May 1998. UnrealEd 2 was a C++ rewrite that came later with version 420 of UT99 and was then used for UE2 (Gears of War, Unreal 2, etc.) and beyond. It was first developed by ex-Legend Entertainment level designer Warren Marshall. I haven't really kept up-to-date with the Unreal Engine after v2, but I'm willing to bet there's not many lines of code left from that one in the current editor.
- duckqlz 4y agoComing from the paper on Verse Calculus and having watched Simon Peytonjones’ talk last year I was super excited to try Verse in UEFN last week. Much to my dismay instead of a rich functional language I was met with something that looked like a DSL with python inspired syntax. As I played with the language I couldn’t stop thinking about “choice” and the other feature of verseMax I felt I was missing out on but after making a few toy maps I realized that epic had released a language entirely meant for the public. Reading Verse can be accomplished by anyone who can write a python for loop. The language is VERY accessible. From the comments below I can see a lot of people are turned away by the idea of FP and this language was clearly meant to address those concerns. The type system is interesting from a high level view but for non-coders I can see how it would make sense. For instance writing `if var = int` looks perfectly reasonable for someone who has never programmed before and it just works in verse. So all in all while I was upset on a personal level at what Epic has released, I hope it is a stepping stone to their overall goal of verseMax. Furthermore I am excited at the idea of millions of people (kids) learning functional programming as their first language and think this iteration of verse may just be the perfect gateway drug. [1] https://m.youtube.com/watch?v=832JF1o7Ck8 https://m.youtube.com/watch?v=832JF1o7Ck8 [2] https://simon.peytonjones.org/assets/pdfs/verse-conf.pdf https://simon.peytonjones.org/assets/pdfs/verse-conf.pdf [3] https://dev.epicgames.com/documentation/en-us/uefn/verse-language-reference https://dev.epicgames.com/documentation/en-us/uefn/verse-lan...
- HdS84 4y agoI really like FP, but I think most FP language designers are a little too enamored with cryptic symbols and abbreviations. Tried f# but the abbreviations turned me off, e.g. seq instead of sequence.
- Weebs 4y agoFor those wondering why they've created yet another language, keep this in mind: Fortnite content is running code on possibly 100 remote clients simultaneously, and code often has state that needs to be synchronized across clients, which can often require rolling back the system to a specific previous state (which is a context FP languages tend to shine, because of the first class support for working with immutable data giving you easy snapshots of a system and resetting state) It's a difficult problem to put it lightly, so as someone that dislikes new languages for only one tool, I consider this one of the cases where the benefits can outweigh the negatives Interestingly this language has a concept of effect types that as far as I know has been only present in mostly research projects & a few general purpose languages like PureScript. Leaning on that to eliminate certain classes of bug from taking up your mental resources seems promising. Even in an ML I found myself wanting stricter guarantees about execution available while writing a PvP shooter for only a few clients, imagine 100! You can create DSLs to help with these things, but at that point I think it's asking to much for a beginner to learn both a new language and well enough to understand how DSLs can let you describe things with different semantics than you've already learned I noticed they seem to have no mention of tagged enums/algebraic data types, which is unusual for a typed functional language, but there is an Optional type at least. I wonder if it has to do with the differences of their conditionals, which sound like they have far reaching implications, but I'm still not totally clear on how conditionals work in Verse
- illiarian 4y agoJust because functional languages have immutable data locally doesn't make them any more suitable for handling data across "100 remote clients simultaneously". You need a bunch of stuff on top to make it work. Even reacting to state changes on a remote client is a problem in itself, you you can't wave it away with "but immutability". > but I'm still not totally clear on how conditionals work in Verse To be honest, there's nothing clear about Verse at all. It promises to be everything for everybody, but is extremely light on details.
- Weebs 4y agoYeah I'm not saying immutability solves the problem, I am saying that having good support for immutability is helpful for building those synchronization and rollback systems. If I thought immutability was all you needed I wouldn't be bringing up the effects system & pointing out how current languages still fall short in my own experience.
- cannabis_sam 4y agoAn inspired and progressive programming language, trying to advance the status quo, in collaboration with industry professionals… Of course insecure middlebrow devs are gonna complain!