5 ms·
It's time for a new old language (2017) [pdf]
- dang 3y agoDiscussed at the time (of the talk): It's Time for a New Old Language – Guy Steele [video] - https://news.ycombinator.com/item?id=15473199 https://news.ycombinator.com/item?id=15473199 - Oct 2017 (45 comments)
- vidarh 3y agoI can't help but agree with Temporal's comment in that thread: it reads like a practical joke. Both.the extensive pointless histories, presenting unreadable grammars, then BNF variants, then dismissing the BNF variants for a variant over the unreadable grammars. At the same time I don't think it was a joke. So many CS papers are infested with excessive use of formalisms that makes the papers less accessible for no gain.
- dang 3y agoVideo: https://www.youtube.com/watch?v=dCuZkaaou0Q https://www.youtube.com/watch?v=dCuZkaaou0Q
- sixthDot 3y agoThe only limit I've ever reached with BNF is that you cannot express permutations of given set of rules, you really have to write every possibility literally.
- _anti_meh 3y ago[flagged]
- owlstuffing 3y agoPersonally, I would avoid a language that pushed that limit
- vidarh 3y agoI interpreted (maybe misinterpreted) that as lamenting having to write out priorities of operators, as that's the most common set of rules in BNF where you end up with near identical permutations. E.g: term = term2 [op1 term] term2 = term3 [op2 term2] ... and so on for every precedence level. A lot of BNF grammars for simpler languages are dominated by rules following that pattern.
- vidarh 3y agoIt takes fairly small extensions to BNF, though. When I write parser generators (sentences I didn't think I'd write, but it's been quite a few), there are a few things I'd often add extra constructs for. One being lists (term = value ("," term)? or variants occur often enough that introducing a list syntax that reduces pointless recursion is helpful), and other being patterns, e.g. when defining operator precedence, which I'm guessing is what you're thinking of? Being able to recursively generate a rule-set where each level takes the head of a list is very useful.
- rbanffy 3y agoIt's at times like this that being an engineer instead of a computer scientist becomes an issue. I feel exhausted from reading it and I know I'll need to make notes to properly digest what they are talking about - I was exposed only to a subset of the many notations used and it'll take some work to correlate them.
- pjmlp 3y agoIn my Informatics Engineering degree, this kind of stuff was part of compiler design and programming languages lectures, and on my time they weren't optional. So it is more a matter of what an university decides to make available than being a CS.
- rbanffy 3y agoMy course was more focused on hardware, silicon design and low-level programming.
- the-smug-one 3y agoRacket has a DSL for describing programming language semantics called "PLT Redex", tutorial here: https://docs.racket-lang.org/redex/tutorial.html https://docs.racket-lang.org/redex/tutorial.html It has its own renderer, so you can take your code and render it for insertion into a paper. It uses Felleisen-style reduction syntax, which is useful because it exposes the current continuation of a program explicitly.
- sgift 3y agoHuh. This got me into a (short) internet trip to look up what he's doing these days - still on the research track: https://labs.oracle.com/pls/apex/f?p=labs:bio:0:120 https://labs.oracle.com/pls/apex/f?p=labs:bio:0:120 (Links to publications of various types below his CV)
- mikewarot 3y agoI really like the railroad diagram style, it can easily be understood and then converted into code. Thats something BNF and kin just don't let you do.
- mrkeen 3y agoIn parsing, BNF lines up almost exactly with its implementation in parser combinators.
- Jtsummers 3y agoAnd not even just parsing as most people interpret it. Most practical custom data types can be expressed using a BNF grammar or something close to it (formally in the language, or informally by understanding the language and its representations). The structure of the code falls out of that in many situations (though certainly not all) as it determines what can be done at any particular point.
- vidarh 3y agoOh, how I wish more protocols in particular had been defined in something like BNF, and asked themselves for very good reasons why they insist on something that makes that hard. So many abominations of data structure and protocol designs have come out of people not bothering to write down a grammar of any type until after they'd already come up with something broken.
- vidarh 3y agoIn fact, I'm hacking on a Ruby implementation where just operator overloading and some simple methods is sufficient to get a BNF variant written as code to return a structure encoding parser combinators on execution. (There's nothing new about that, it's been done before, other than perhaps the sick and twisted levels of abuse of the Ruby syntax I'm toying with thanks to a newish feature (refinements) to make it look closer to plain BNF). And if course, automatically "compiling" bnf into parser combinators is easy.
- mort96 3y ago