Live data from Hacker News

Type system of Fortnite's Verse language

brianmckenna.org

131–140 of 159 posts

Re: Type system of Fortnite's Verse language

#131
Coming 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 [2] https://simon.peytonjones.org/assets/pdfs/verse-conf.pdf [3] https://dev.epicgames.com/documentation/en-us/uefn/verse-lan...

Re: Type system of Fortnite's Verse language

#132

Earlier quoted context omitted.

One thing I noticed when I was in college was that the basics of FP is not hard, in fact it seems way easier (from my data annecdote). In my university CS course, we start with FP (using Haskell), and in a course with one of the biggest number of dropouts un the first year, FP wasn’t really a reason for it, in fact, from the ten 1st year classes FP was in the top half in success. BUT what I actually took from that ex…

what about scala?

In general it's a mess. Very big language, so C++ issues. Different communities liking different subsets. Plenty of people "having to" use it, causing annoyance/hate.

It's not great for teaching due to not only being big, but tooling for first time usage is also not great, and it doesn't hit the nice things about FP for first time programers:

* functional syntax very similar to the way you defined functions in high school math class, or intros in college.

``` f : Z -> Z f(x) = x + 1 ``` is

``` f :: Int -> Int f x = x + 1 ```

in haskell (you can also omit domains/types/sets/signature in both). Familiarity is very important, which is why most programers do not like functional, and most people that haven't learned to program yet can start with it arguably more easily

just not having statements, and everything being immutable is really nice (x=x+1 is cancer).

Scala then has a whole lot of "class" stuff on top.

Re: Type system of Fortnite's Verse language

#133
post #94

There'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 w…

> There's a lot of bummed out comments in here about the syntax Consider the target audience - first time programmers. Verse has a syntax without the historical baggage of C, but still rather conventional. They avoided going off into functional strangeness land. ("Daddy, what's a monad?") Define and initialize := Equality test = Assignment set a := b And and Or or Reasonable enough.

Programming languages have settled on '=' for assignment and '==' for equality comparison. Teaching people non-standard syntax because you think it might be easier is just doing them a disservice. Everyone I know that started with Pascal was mostly pissed that they didn't learn a language actually used in industry and had to re-learn the syntax. It's not like mathematical notation is intuitive in some way either - humanity needed several thousand years before we came up with something ergonomic, plus '=' is used for assignment in math just as often too. At least I do not know of any mathematician who uses ':=' to denote assigning a value to a name.

Re: Type system of Fortnite's Verse language

#134
post #91

There'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 w…

The 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…

I 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.

Re: Type system of Fortnite's Verse language

#135
post #76

I 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.

> 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.

Re: Type system of Fortnite's Verse language

#136
post #83
post #79

Earlier quoted context omitted.

LOGO was written decades before TCL and even half a decade before Smalltalk (which Wikipedia lists as one of the languages that LOGO influenced). > The first four years of Logo research, development and teaching work was done at BBN. The first implementation of Logo, called Ghost, was written in LISP on a PDP-1. The goal was to create a mathematical land where children could play with words and sentences. Modeled on…

Few would consider Smalltalk to be a LISP.

I'm not claiming that Smalltalk is a LISP.

I am saying that LOGO is old. It was written the same year that BCPL (the predecessor for C) was written. To say that LOGO is a member of {language family}, it should be restricted to languages that were in use at that time.

LOGO is a member of the LISP language family. From there, it also went on to influence many other influential languages.

Re: Type system of Fortnite's Verse language

#137
post #133
post #94

Earlier quoted context omitted.

> There's a lot of bummed out comments in here about the syntax Consider the target audience - first time programmers. Verse has a syntax without the historical baggage of C, but still rather conventional. They avoided going off into functional strangeness land. ("Daddy, what's a monad?") Define and initialize := Equality test = Assignment set a := b And and Or or Reasonable enough.

Programming languages have settled on '=' for assignment and '==' for equality comparison. Teaching people non-standard syntax because you think it might be easier is just doing them a disservice. Everyone I know that started with Pascal was mostly pissed that they didn't learn a language actually used in industry and had to re-learn the syntax. It's not like mathematical notation is intuitive in some way either - hu…

Most programming languages but not all. Three prominent examples are Pascal which you mention, OCaml, and the POSIX `test`/`[` command which all use `=` for equality. (More specifically, for structural equality, in the case of OCaml.)

More intuitive to complete beginners and definitely not unheard of.

In mathematics, I have seen both `:=` and `\equiv` for assignment. But Go and Pascal also use `:=`. Of these, I would consider Go quite widely used in the industry.

Re: Type system of Fortnite's Verse language

#138
For 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

Re: Type system of Fortnite's Verse language

#139

Earlier quoted context omitted.

One thing I noticed when I was in college was that the basics of FP is not hard, in fact it seems way easier (from my data annecdote). In my university CS course, we start with FP (using Haskell), and in a course with one of the biggest number of dropouts un the first year, FP wasn’t really a reason for it, in fact, from the ten 1st year classes FP was in the top half in success. BUT what I actually took from that ex…

> So we need an FP language doing what GoLang did to C++. What we need is an FP language that doesn't pretend that outside world doesn't exist. A pragmatical one. This is why Erlang/Elixir or even C# or hell even Javascript/Typescript are better FPs for the vast majority of programmers (and beginner programmers, too) than Haskell.

We have a few of those, they just aren't popular. Ocaml and F# both fit, as well as ocamlish langs like rescript, which is really underrated imo.

There's also racket, which I think people give too much credit to as a teaching language, but is genuinely good and lets you easily separate FP from immutability semantics which tend to get conflated in this conversation. Janet, same, but with a different approach to that. Clojure, which is very practical and enforces the kind of constraints that make you think in a functional way.

If I was teaching programming from scratch to a beginner without a specific end goal I'd likely use one of these. I have taught total beginners and have observed a moderately functional style is intuitive to them. Rarely see a totally new programmer bust out the for loop once you show them map, etc.

Unfortunately when I've taught programming before it was with the specific goal of web development so JS was the only real choice.

Re: Type system of Fortnite's Verse language

#140

There'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 w…

One thing I noticed when I was in college was that the basics of FP is not hard, in fact it seems way easier (from my data annecdote). In my university CS course, we start with FP (using Haskell), and in a course with one of the biggest number of dropouts un the first year, FP wasn’t really a reason for it, in fact, from the ten 1st year classes FP was in the top half in success. BUT what I actually took from that ex…

True story: when I started programming at age 11, in the book I saw a pair of assignments like:

  x = x + y
  y = y + 1
(or whatever). I was thinking, what, that has no solutions!

It's just due to notations; abusing the sacrosanct equal sign for something different. People otherwise have no problem with the idea of a datum being updated in place; it's part of everyday experience.

Post reply on HN