Live data from Hacker News

The seven specification ur-languages

buttondown.email

61–68 of 68 posts

Re: The seven specification ur-languages

#61
post #59
post #56

Earlier quoted context omitted.

> Dijkstra's Guarded Command Language is a specification language, sort of, but it's better looked at as a very simple programming language for use with Floyd/Hoare/Dijkstra's axiomatic semantics. (Which didn't get mentioned at all. Sniff.) This struck me too. There is an ur-language there, but it's not GCL rather it's Hoare triples and subsequently predicate transformer semantics and Boolean structures, as defined b…

For some reason, I ended up calling those "axiomatic semantics"; predicate transformer semantics is a much better name. One of the weaknesses of PTS for common languages is that statements and expressions have very complicated semantics, compared to the relatively simple semantics of GCL and other simple treatments. One of the nice things about Frama-C (and I think the GNAT SPARK tools) is that, when you are using th…

I was doing some work on defining PTS for a subset of Go, so I'm definitely aware of how tricky it can get. While handling early return requires some care, the existence of goto and break in particular caused me considerable trouble defining semantics for the loop construct. Needless to say that's barely scratching the surface, and Go is a pretty small and intentionally simple language as far as popular ones go.

If I were to try again, I think I'd look at building GCL as as simple Lisp and then build higher level constructs as macros that would inherit their semantics from the well-defined GCL's composition rules. Then of course if I wanted to succeed in the marketplace I'd throw that out, rewrite the Lisp part as an AST library, probably in Rust or Go, and then lex and parse it from some squiggly brace syntax. That syntax in turn would probably be a subset of the grammar of some popular language to ease practical use. At then point it could get grafted on as a kind of linter maybe.

I'm also particularly excited about the prospect of deducing appropriate preconditions from stated postconditions/assertions. The very concept of working backward from the desired end to the known beginning is so elegant and intuitive that millions of school children independently discovered it when solving mazes.

I am somewhat familiar with Dafny. It looks really neat and I've written some toy code. I'm not familiar with that book though, so I'll have to add it to my reading list.

Re: The seven specification ur-languages

#62
post #60
post #57

Earlier quoted context omitted.

Ooohhhh, a specification language for specification languages. The grammar that ties together graphical things like Petri Nets and TLA+ is going to be fantastic!

Unrelated but the coolest thing I discovered while researching this piece was that Petri Net reachability is decidable but Ackermann-complete. ACK-COMPLETE is a thing. That's wild.

what does that mean exactly? I skimmed the paper you linked briefly, but couldn't quite tell.

Does it mean that deciding reachability of an N-state petri net takes Ack(N) steps in the worst case? Or that you can can construct a Petri net which has a node reachable after Ack(N) steps?

Those are different I think since you can compute Ack(N) in fewer than Ack(N) steps.

I also wonder if you can more efficiently rule out polynomial-time reachability of a Petri net node, even if it is eventually reachable.

Re: The seven specification ur-languages

#63

> All taxonomies are broken, full stop. Your categories are gonna be completely wrong and everybody’s going to argue over every single thing. There is no such thing as a tree. Is this a serious statement? If so, wouldn't it be incompatible with the theory of evolution? Would an alien taxonomy of human binary numbers not be a legitimate tree?

The thing with taxonomies is that trying to make a category more precise tends to exclude things you want to include in it, and vice-versa. It is especially easy to find examples of this in nature, because nature has existed since long before humans had opinions about how things should be organized. What is a cat? It's a small furry quadruped in family Felidae. - Exception: cats may be quite large (lions, tigers). -…

I've pondered the "taxonomies as trees" as insufficient and broken. What I arrived at as "maybe this will work" is taxonomy as a high-dimensional sponge, where a thing may rest at a given point in high dimensional space (where the dimensions are characteristics of that thing) and may or may not be clustered with other things on certain axes.

Sort of like how word/semantic clustering works in LLMs.

This obviously isn't a fully formed idea, but it might make creating taxonomies easier? Taxonomic clusters? Something like that.

Re: The seven specification ur-languages

#64
post #60

Earlier quoted context omitted.

Unrelated but the coolest thing I discovered while researching this piece was that Petri Net reachability is decidable but Ackermann-complete. ACK-COMPLETE is a thing. That's wild.

what does that mean exactly? I skimmed the paper you linked briefly, but couldn't quite tell. Does it mean that deciding reachability of an N-state petri net takes Ack(N) steps in the worst case? Or that you can can construct a Petri net which has a node reachable after Ack(N) steps? Those are different I think since you can compute Ack(N) in fewer than Ack(N) steps. I also wonder if you can more efficiently rule out…

The former, though it grows a little slower than Ack(N). If I read the paper write, they showed that an 18-state Petri Net has a worst case reachability problem on the order of Ack(3), and then every six states you add, n goes up by one. So a 24 state Petri net can take Ack(4) steps to decide, for a 30 state Petri net Ack(5), etc. This is just the decision problem, not the length of the path.

(The paper is actually works on *Vector Addition Systems*, but VASes are isomorphic to Petri nets.)

Note these are loose boundaries: adding at most six states will definitely bump the hardness by at least 1, but it might grow faster than that. At the end of the paper they note some people have gotten more precise boundaries, that 10-states is "Tower-hard" (Ack(3)), and every 2 states bumps it by 1. So worst case for a 12-state net is on the order of Ack(4), etc.

Re: The seven specification ur-languages

#66
> Everything past this point is much shakier ground and why this is a newsletter and not a blog post, despite being 2500+ words.

ok but lets be real, with substack becoming a thing and hillel’s buttondown hitting HN every week, is there any difference?

Re: The seven specification ur-languages

#68

Earlier quoted context omitted.

The thing with taxonomies is that trying to make a category more precise tends to exclude things you want to include in it, and vice-versa. It is especially easy to find examples of this in nature, because nature has existed since long before humans had opinions about how things should be organized. What is a cat? It's a small furry quadruped in family Felidae. - Exception: cats may be quite large (lions, tigers). -…

I definitely understand that the majority of taxonomies are problematic for the reasons you cited. When OP said "no such thing as a tree", I thought OP meant a taxonomic tree, not a literal plant tree, hence my example of binary numbers! Thanks for clarifying. That said, taxonomic groupings can have both wide consensus and be useful, can't they? (Hand on chin... monotremes? hominids??)

As George Box supposedly said, "All models are wrong, but some are useful."
Post reply on HN