Live data from Hacker News

Type system of Fortnite's Verse language

brianmckenna.org

141–150 of 159 posts

Re: Type system of Fortnite's Verse language

#141
post #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 d…

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

Re: Type system of Fortnite's Verse language

#142
post #137
post #133

Earlier quoted context omitted.

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…

Go only uses := for declare & assign. For simple assignment it's =, and equality is still ==. So I would say it is barely different to the norm.

POSIX `[` is clearly insane so let's ignore that.

Which leaves Pascal and OCaml both of which are quite niche.

I think he's right. It's definitely not worth going against the grain with this syntax, and it's debatable if it's even that bad in isolation. I seriously doubt beginners struggle with it.

Re: Type system of Fortnite's Verse language

#143
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…

You’ve picked a poor example. ‘=‘, ‘==‘, and ‘===‘ constantly trip up new coders and have led to some not-insignificant bugs.

A lot of style guides even had to include guards against the worst one:

‘if (variable = “string”)’

I think that putting guardrails there by making the assignment operator stand out was a smart move. Annoying to use, but smart.

Re: Type system of Fortnite's Verse language

#144

Earlier quoted context omitted.

As a non-programmer: when you say slowest, do you mean most verbose? Or, most runtime overhead? Or, something else?

Runtime; there are things you can do, but generally Python takes more time and memory to do things than other languages/platforms. It got better in 3.11 but AFAIK it's still the slowest.

Thanks.

Re: Type system of Fortnite's Verse language

#145

Earlier quoted context omitted.

Runtime; there are things you can do, but generally Python takes more time and memory to do things than other languages/platforms. It got better in 3.11 but AFAIK it's still the slowest.

Thanks.

No prob! :)

Re: Type system of Fortnite's Verse language

#146
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…

> Programming languages have settled on '=' for assignment and '==' for equality comparison.

Certainly not all. "=" is a poor choice for assignment as it has a totally different meaning in maths. Algol and Pascal got this right with ":=". Fortran got it wrong here.

> plus '=' is used for assignment in math just as often too

No it's a relational operator in math, so "x = x + 1" does not have the same meaning as assignment to a mutable variable.

Re: Type system of Fortnite's Verse language

#147

Earlier quoted context omitted.

> I would expect people who know about game programming first, and about language design second. Well, one of the authors is Tim Sweeney. > There's a reason C/C++ and even C# are the go to languages for game programming, and not Haskell. It's interesting that you list those because none of them were originally designed for games. Well, C++ sort of was if you consider network simulations to be game-like. I share your…

> It's interesting that you list those because none of them were originally designed for games. And yet, people are using those. So, an introduction of a "programming language for game programming" should at least have: - what are the challenges in game programming - how they are solved or not solved by existing languages, and why people are using them - what exactly this new language is bringing to the table, and ho…

> And yet, people are using those.

And yet, none of those languages were pitched with a clear value proposition for games when they launched.

Re: Type system of Fortnite's Verse language

#148
post #85

Earlier quoted context omitted.

Roblox uses Lua, right? I think Redstone in Minecraft are good examples of introduction to programming via visual programming languages. Something you can really feel and play around with. I'm not sure how Verse or Lua are integrated into their respective games but it's really hard to imagine kids being able to get into these languages without something that gives immediate visual feedback

Minecraft redstone is a terrible example. The idea of it is great, the implementation, not so much. It's super non obvious for a lot of thing, have got behaviour that changes based on location in the world, etc... It' not uncommon for people to dive into the code to figure out how redstone works or watching tutorials from people who have done so.

The only people who can use redstone are those who just memorize the standard gates and treat them as black boxes. That's no longer redstone then, that's just normal boolean logic stuff.

Re: Type system of Fortnite's Verse language

#149

Earlier quoted context omitted.

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

Yeah, Lua is super common. Not exactly sure why, but it really is.

A few reasons:

1. Extremely permissive license.

2. Very simple embedding API.

3. Fairly efficient for a scripting language.

4. Simple and relatively easy to learn.

Re: Type system of Fortnite's Verse language

#150
post #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 d…

Just 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, th…

Yeah 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.
Post reply on HN