Live data from Hacker News

The Verse Programming Language [pdf]

simon.peytonjones.org

151–160 of 387 posts

Re: The Verse Programming Language [pdf]

#152
post #45

Earlier quoted context omitted.

I'll be the first to hate on C++, but the only reason C++ might be considered a "don't learn it as a first language" language, is because it's huge. It's got 40 years worth of baggage, and it's "standard" libraries are an absolute mess. Javascript has a super simple syntax, and it's standard libraries though sometimes a bit idiosyncratic are comparatively clean and pragmatic. If you just removed like 90% of C++'s use…

> 90% of C++'s useless standard library, The Python library is even larger and doesn't seem to be a barrier. If you know `std::vector`, ` > C++ would also not have been deprecated by Rust. That's an overstatement, to say the least.

I don't think it is an overstatement to say that that imaginary world C++ would have been deprecated by Rust.

C++ complexity is also its strength. Highly backward compatible, even with C, and multiparadigm. It has classes, but you don't have to use them, it has exceptions, but you don't have to use them, it has templates, lambdas, smart pointers,... and again, you don't have to use them, but they are here if you need them. Even the "deprecated" features of C++ (like most things related to raw pointers) are heavily used today, even in new projects, because they are useful.

Strip 90% of "deprecated" C++ and what you get is essentially Rust, but worse because it still has its C baggage without the advantage of being mostly compatible with C.

Re: The Verse Programming Language [pdf]

#154
post #104
post #8

I'm not sure about the "learn it as a first language" bit. x:=(1|2); y:=(7|8); (x,y) This stuff just doesn't seem intuitive to me. It's not verbose enough to be obvious to someone who doesn't know what's going on. Looks interesting though; that's a really bright group of people. Be curious to see where their project ends up.

It's the cartesian product. Think of it as a table with x labeling the top (x-axis) and y labeling the left side (y-axis). The cells of the table are the result of the product. x 1 2 y |-------------- 7 | (1,7) (2,7) 8 | (1,8) (2,8)

Except, as the slides indicate, sequences of values are not sets. They are ordered. You can also, as they mention, refer to "y" in the definition of "x". This is like set union, but it is, again, sensitive to ordering of elements.

Re: The Verse Programming Language [pdf]

#155
post #26

This looks incredibly ambitious: - There are no booleans in the language! Conditionals can still succeed or fail, but failure is defined as returning zero values and success is defined as returning one or more values. - Verse uses a so-called 'lenient' evaluation strategy which is neither strict nor lazy, but somewhere in-between ("Everything is eventually evaluated, but only when it is ready") - an expression does n…

> sequence of zero or more values You can try this type of programming at home, say in JavaScript Make any result or argument be an Array. The problem with nulls goes away because "not there" is represented simply by an empty Array (a.k.a "sequence"). And you will not get null-errors because you can write: newValue = someValue.filter(...) . map(...) ; You don't need to test whether filter() returns an empty array or…

Because now you can't differentiate between an actual empty array or an error. That's horrible.

Or, you actually have to use nested arrays to describe that the result might be an error or an array. But now you have to deal with an array which might contain... zero errors or even multiple ones.

That's really not a great way of doing things. Instead, do it the other way around and make null treatable in the same way as arrays are. And if you do that, you end up with what languages like Haskell do.

Re: The Verse Programming Language [pdf]

#156
post #151
post #148

I suppose this is a relatively minor thing, but being able to have conditionals like "if (0 < x < 20)" has been on my "things I wish just worked" list for awhile.

I believe you can do this in Python

Yup, you can. Also in Clojure, like this:

( true

Re: The Verse Programming Language [pdf]

#158
This essay opens with comments about utility for the metaverse but then switches to a description of a grammar without strongly connecting back to why it is so valuable for programmers to learn a new language to better build the metaverse. It may be helpful but is it that much more helpful?

I understand this is a pet project for these folks but I think that a metaverse grammar should not fe functional but procedural - it should be extremely simple and accessible to novices. We want these tools to be accessible to everybody I think - unless we as programmers want to be responsible for building all interactions for all users.

But I mostly think a grammar today isn’t just about the literal parser - instead it is more about the parser and surrounding tooling. Rust for example is surrounded by tooling that helps - cargo/crates are a nice helpful way to make rust developers effective.

If I was going to devote significant energy to this topic I’d solve other problems. Any code that users write needs to be late binding - allow software agents to be pushed to the cloud and participate in already running simulations or models. Code should allows users to define granular security around libraries and components to prevent them from doing bad things. Code should be highly portable; able to run across many devices at speed - not something new that has low cross platform support.

I think a better way of thinking about this isn’t the grammar itself but the kind of “computational sandbox” one is offering - the grammar container or app runner.

WASM is a good example of thinking in a better way - portable, secure, performant. It’s more like a metaverse tool than the above grammar.

What’s especially curious to me is that Tim’s project Unreal is almost the anti-metaverse. It is utterly fixated on and built around an extremely heavy high fidelity renderer - that is not portable - that does not run across many devices. Unreal uses an old school compilation philosophy that requires behaviors to be precompiled - so if you want to add a single feature you have to tear down all the instances, recompile them, recompile the server too, distribute a new build to all participants and restart the sim. It’s a tool designed for a different era and a different ecosystem… in a sense AAA games are the opposite of a participatory constantly evolving online shares consensual world. So maybe he should fix that first.

Re: The Verse Programming Language [pdf]

#159
post #45

Earlier quoted context omitted.

I'll be the first to hate on C++, but the only reason C++ might be considered a "don't learn it as a first language" language, is because it's huge. It's got 40 years worth of baggage, and it's "standard" libraries are an absolute mess. Javascript has a super simple syntax, and it's standard libraries though sometimes a bit idiosyncratic are comparatively clean and pragmatic. If you just removed like 90% of C++'s use…

> 90% of C++'s useless standard library, The Python library is even larger and doesn't seem to be a barrier. If you know `std::vector`, ` > C++ would also not have been deprecated by Rust. That's an overstatement, to say the least.

Python as a language is smaller even if the library is larger.

You can do many many things in Python without needing to know much other than working with dictionaries.

In C++, doing a sort or a string search is an ordeal. So much of common programming requires so much cognitive overload.

C++ is not an easy language. Not by a long shot.

Re: The Verse Programming Language [pdf]

#160
post #159

Earlier quoted context omitted.

> 90% of C++'s useless standard library, The Python library is even larger and doesn't seem to be a barrier. If you know `std::vector`, ` > C++ would also not have been deprecated by Rust. That's an overstatement, to say the least.

Python as a language is smaller even if the library is larger. You can do many many things in Python without needing to know much other than working with dictionaries. In C++, doing a sort or a string search is an ordeal. So much of common programming requires so much cognitive overload. C++ is not an easy language. Not by a long shot.

I absolutely agree, but this comment referred to the library size as a major burden.
Post reply on HN