Live data from Hacker News

The Verse Programming Language [pdf]

simon.peytonjones.org

331–340 of 387 posts

Re: The Verse Programming Language [pdf]

#331
post #314

Earlier quoted context omitted.

Writers do something different from programmers. What programmers do is often more akin to mathematics, especially the type of stuff language creators do. And mathematical notation likes to be short.

I rather strongly disagree when it comes to programming. Programming is as much communication between humans and domain modeling as it is instructing a computer to do something. Shortening names seems to be a cultural holdover when name length had some real effect or constraint, and now there’s highly subjective and debatable constraints like being shorter, faster to type, length symmetry, etc. Mathematics uses symbo…

`𝜋` is a mathematical symbol, but you could also write `CircumferenceOfCircleWithUnitDiameter`. The reason everyone prefers `𝜋` should be clear. The same is true for a less extreme case like `fst` and `first`: You don't need to think about what `fst` means, if you are fluent in the programming language it is clear, and more concise than `first`. `fst` becomes an atomic symbol in the programmer's mind, it is not something you need to interpret like `first`. This is not about communicating with other humans or even the computer, it is about efficient representation within your own mind.

Re: The Verse Programming Language [pdf]

#332

Earlier quoted context omitted.

My lecturer in second year, > 20 years ago mind, said we are learning C, because C++ is C with an ugly object oriented graft on top.

Your lecturer did you a disservice; clearly he only knew C, and didn't want to learn any more. The more your C++ code resembles C, the worse it is.

Maybe he only knew C as you say. I did C++ professionally for a while. Not properly, just updating models in derivatives trading systems. I remember reading 3 Scott Meyer books, the Effective Programming series, at the time, they were a tour de force. Loved that guy. I've lost track of everything since 11 or whenever they introduced move semantics. One day I might go back to it.

Re: The Verse Programming Language [pdf]

#333

Earlier quoted context omitted.

Your lecturer did you a disservice; clearly he only knew C, and didn't want to learn any more. The more your C++ code resembles C, the worse it is.

Maybe he only knew C as you say. I did C++ professionally for a while. Not properly, just updating models in derivatives trading systems. I remember reading 3 Scott Meyer books, the Effective Programming series, at the time, they were a tour de force. Loved that guy. I've lost track of everything since 11 or whenever they introduced move semantics. One day I might go back to it.

Nowadays it's "rule of zero": compiler-generated constructors, destructor, assignments, compare. The members are of types smart enough on their own.

Lambdas are generic now, and variadics work most places.

Velocity has shot up. Fun, too.

Re: The Verse Programming Language [pdf]

#334
post #234

Earlier quoted context omitted.

He is asking for reasoning when he doesn't provide any, so his use of it is just idiosyncratic and stubborn. It is a noisy language that is hard to read in bulk and takes up a lot of space. It was invented for what was basically a computer game for kids, so why does he insist on using it for presenting technical material? Using fonts beyond their originally designed purpose with no reason is asinine and actually fash…

What's the big deal, using a font outside of its narrowly designed purpose is certainly not it. Some people venture outside the box

Venturing outside the box is fine. But it's an idiosyncratic choice without much, if any, upside and is ultimately a distraction and hides behind some perceived rational decision to use it. The linked Stack Exchange covers this, and one should consider the appropriateness of the tool being used. I think he'd agree on the same for programming languages.

Re: The Verse Programming Language [pdf]

#335
post #73
post #65

Earlier quoted context omitted.

> I'm not sure about the "learn it as a first language" bit. I think this is very subjective. Our minds have been "poisoned" - or rather trained over years - into a very specific way of thinking about expressions like in the example. A first programming language, however, assumes that the learner hasn't been preconditioned in any way into a certain paradigm. So just keeping the two rules in mind that 1) evaluation is…

I get that to some degree, but that code doesn't look like something most people are exposed to, whereas 'x = 10' or something that says 'foreach' seems like it'd make sense with a minimum of explanation to a lot of people. x:=(1|2); y:=(7|8); (x,y) Doesn't look like any math I'm familiar with.

Cartesian product.

Re: The Verse Programming Language [pdf]

#336
post #288
post #284

Earlier quoted context omitted.

Rust's traits come to mind as one example.

As far as I can tell, from an admittedly short amount of searching and research, is that type classes in Haskell were influenced by Standard ML: https://people.csail.mit.edu/dnj/teaching/6898/papers/wadler... > This paper presents type classes, a new approach to ad-hoc polymorphism. Type classes permit overloading of arithmetic operators such as multiplication, and generalise the "eqtype variables" of Standard ML. Ty…

Phil Wadler, the first author of the paper you cite, was literally a principal designer of Haskell. SML does not have type classes; your quote points out a deficiency in SML that motivates type classes.

My understanding is that "trait" is an unfortunately overloaded term. Traits in Rust are much more closely related to Haskell's type classes than to traits in the OOP sense.

Re: The Verse Programming Language [pdf]

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

I think this pattern is so useful that I've been working on a library to use it for more types of things. https://www.npmjs.com/package/schtate

This includes a state monad that allows you to apply .map just like an array and a maybe monad that let's you do the same on values that might be nullish.

Re: The Verse Programming Language [pdf]

#338
post #320

After reading the paper and watching the lecture, I think I know what it means that Types are first class values. In verse `=` is unification and not assignment or comparison. Meaning its a constraint on the lhs and rhs. Unification is also an expression meaning it can be normalized to a value e.g. `x=3` normalizes to `3` Expressions can be sequenced with `;` but note this is nothing like imperative programming due t…

It is nothing new. See Dependent Types. Used by most formal proof assistants (Coq/LEAN/…) and languages like Agda and Idris.

I highly recommend the book “Type Driven Development” if you want a great introduction to the power of DT.

Re: The Verse Programming Language [pdf]

#339
post #188

I must be getting old. Neither the prospect of spending time in the "metaverse" for "social interactions" nor a language design that requires you to keep in your head not just simple bindings to names but sequences of values, is just not very appealing. What are younger folks thinking how they will be interacting with the metaverse? Less clunky VR glasses you can wear for more than an hour?

The metaverse is already a failure. So no it is not because you are getting old. Most people don’t want to strap a bulky helmet on their head to work or play. Maybe one day, if you just have to wear comfortable light weight glasses, this might change. But until then it will be a niche thing.

Re: The Verse Programming Language [pdf]

#340
I must admit that I am a bit disappointed. Verse doesn’t seem to bring anything new to the table that will make developers more productive.

Perhaps it would be better for the team to work on a runtime environment (think JVM or similar) optimized for the metaverse. With compilers for a number of languages compiling to it.

Post reply on HN