Live data from Hacker News

The Verse Programming Language [pdf]

simon.peytonjones.org

201–210 of 387 posts

Re: The Verse Programming Language [pdf]

#201

Text from the "10,000 Foot View" slide: -- Verse is a functional logic language (like Curry or Mercury). Verse is a declarative language: a variable names a single value, not a cell whose value changes over time. Verse is lenient but not strict: Like strict:, everything gets evaluated in the end Like lazy: functions can be called before the argument has a value Verse has an unusual static type system: types are first…

> Like strict:, everything gets evaluated in the end

> Like lazy: functions can be called before the argument has a value

FYI, jq is just like that. In jq in `def f(g): ...;` `g` is a function value that will be applied to some input of `f`'s choice, and `g` is not evaluated unless `f` invokes it. The actual argument to `f` will be an expression which is wrapped in a closure named `g` while `f` is executing.

Lazy evaluation really is just hidden closures.

Lazy evaluation raises questions like:

  How obvious shall the syntax make it that
  you will be passing a closure instead of a
  value?

  Closures of dynamic or indefinite extent?
  Can you choose which?  How intrusive in the
  syntax is that choice?

  Does the use of lazy vs. strict infect
  callees?
  I.e., if I define a function `f` of one
  argument of type `T`, must it be able to
  take an argument that is a closure that
  produces values of type `T`, or must that
  be declared separately?
  If the latter, does that mean I end up with
  two `f`s, one which takes a value of type
  `T` and one which takes a closure that
  produces (a) value(s) of type `T`?
  If so, does that happen automatically or
  must I request it?
  If the latter, what is the default, and
  what happens if some library I want to use
  one option doesn't provide it?
Finding a happy medium with some flavor of lazy evaluation but also which doesn't make it hard to understand the performance considerations of it is just very hard.

Re: The Verse Programming Language [pdf]

#203
post #30

I mean it's either genius, madness, or both. Most programming languages I can least understand the general gist, the core motivation, whatever. I have a lot of respect for Epic Games so I read through most of it but I have to say I'm still non the wiser. If forced to summarize I'd say.. it's some kind of Haskell-ish language where the types themselves are defined by ... runtime functions? With some attempt at also be…

My take, in short: imperative programming is too fragile for the use case of the metaverse, and functional programming is too mathematical.

In a context where you want to have software built by different independent developer teams working on the same persistent world objects, you can't expect them to collaborate on programming style and coordinated libraries, as is done in industry software. Any unexpected side effect or variable aliasing in another library may ruin your runtime execution.

Pure functional programming avoid this by forbidding side effects, but forces a programming style where all state updates need to be declared and carefully handled by the developer. Functional reactive programming (spreadsheet-like updates) is being used a lot in the web to ease that problem (all popular frameworks have a version of it), but it is best suited to processing client/server updates, not full world simulations.

Verse approach seems to bring new expressive capacities suited for dataflow programming, allowing data transform logic to be built with functional expressions and separating these from the techniques needed to link one component to another.

Re: The Verse Programming Language [pdf]

#204

Earlier quoted context omitted.

Can anyone speak to this for Icon? For context, Prolog had a culture of "the built-in search is less than wonderful... but good for crafting a problem-appropriate search". II(fuzzily)RC, Mozart/Oz decoupled nondeterministic code (explicit amb, spelled "dis") specification from search, and allowed managing search over nested spaces of unification constraints and threads. With (very fuzzy) less use of backtrack-driven…

In Icon a function ("procedure") can: fail, return a value, or "suspend" (yield) a value (and then again and again). The difference between returning and suspending being that a generator that returns cannot be resumed again. That difference was needed (IIRC) because the alternative would be to end the generator with failure, which could be confused with failure in a boolean sense. jq gets this better by saying that…

Boolean values are inherently a sign of an insufficient data model. Booleans carry no inherent meaning. They don't tell you where they came from or provide any context about what operations or data they are guarding.

If your language lets you declare your own algebraic data types, there's no need to lean on a built-in Boolean type. You can create types that actually carry all the information you need so that pattern matching provides provenance and data only in the branches that need them.

Robert Harper discusses the idea in some detail here: https://existentialtype.wordpress.com/2011/03/15/boolean-bli...

Re: The Verse Programming Language [pdf]

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

Icon had (has!) "failure is falsity" / "value production is truth", and pervasive generators / backtracking. In Icon a function ("procedure") either: fails, returns a value, or suspends (yields) a value. jq is very much like this too, as it has pervasive generators and backtracking, but unlike Icon jq does not distinguish between "returning" a value vs. "suspending" (yielding) a value. The jq way kinda means you have…

I was suspicious of javascript where number replaces int and double. The fail in verse is a way to replace boolean and null values. I think it is the direction of evolution.

Re: The Verse Programming Language [pdf]

#207
post #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 is utterly fixated on and built around an extremely heavy high fidelity renderer

This is doing unreal engine a significant disservice. Unreal is significantly more than a high fidelity renderer; Unreal's replication system is excellent, as is the gameplay ability system. (To my knowledge, neither of those systems exist in any of the other major engines that are readily available). There's a laundry list of things it does pretty well,distilling it down to a renderer only is very dismissive.

> that is not portable - that does not run across many devices.

Renderers by definition aren't going to be portable, they're pretty intrinsically tied to the hardware (and OS) they're running on. Also it's silly to say it doest run on many devices - it runs in every games console for the last decade, an enormous amount of mobile devices on both android and iOS, and on all major desktop platforms natively. What more do you want?

> Unreal uses an old school compilation philosophy... So maybe he should fix that first.

Unreal definitely has some dated design decisions that are showing their age, but that's to be expected for a codebase that's 25 years old. And if you've been paying attention to what epic are doing over the past few years you would see they are working on that.

(Disclaimer: I worked for epic until recently on exactly the things you're talking about in this comment)

Re: The Verse Programming Language [pdf]

#208

As a programming language - I mean it seems cool but it doesn't seem like much of an innovation when things like Granule, Idris, Unison, Erlang, and more already exist. I want to take a moment to look at the Metaverse angle. If there is going to be a unique programming language for the metaverse, I think it's not going to be textual but instead is going to primarily be a 3D language. This poses a big challenge for a…

We developed 2D text in a 3D world. There isn't really a precedence for 3D text really. We will greatly enhance writing and reading with eye-tracking on the VR/AR headsets, but I don't think we will march into 3D world of text. We might do 2.5D though (or something more of dynamic nature) – https://www.reddit.com/r/badUIbattles/comments/wsk2jz/debugg...
Post reply on HN