Wrangling Untrusted File Formats Safely
Wuffs seems fascinating and I really wanted to like it. But when I look at the code for the JSON decoder it seems so low level, and full of places for bugs to hide. JSON is a pretty simple spec and this obscures it (although to be fair it's also handling UTF-8).
Yes it prevents buffer overflows and integer overflow, but it can't prevent logical errors.
I'd rather see efficient code generated from a short high level spec, not an overwhelming amount of detail in a language verified along one dimension.
Logical errors in parsing also lead to security vulnerabilities. For example, here is an example of parser differentials in HTTP parsing:
I think the canonical example is forging SSL certificates to take advantage of buggy parsers, but I don't have a link handy. Again, this has nothing to do with buffer or integer overflows.
(aside: while googling for that I found the claim that mRNA vaccines work by parser differentials: https://twitter.com/maradydd/status/1342891437537505280?lang... If anyone understands that I'd be curious on an opinion/analysis :) )
At the very least, any language for parsing should include support for regular languages (regexes). The RFCs for many network protocols use this metalanguage, and there's no reason it shouldn't be executable. They compile easily to efficient code.
The VPRI project claimed to generate a TCP/IP implementation from 200 lines of code, although it's not really a fair comparison because it hasn't been tested in the wild: https://news.ycombinator.com/item?id=846028 .
Still I think that style has better engineering properties. Oil's lexer, which understands essentially all of bash, is generated from a short source file
(which goes on to generate 28,000 lines of C code)
Haxe - The Cross-Platform Toolkit
Learn any GitHub repo in 59 seconds. Onboard AI learns any GitHub repo in minutes and lets you chat with it to locate functionality, understand different parts, and generate new code. Use it for free at www.getonboard.dev.
Maintainable configuration files
> If you add constraints (like not being able to feed the program to itself as is done in the halting problem and not allowing unbounded loops) then it is possible to determine if a program will terminate or not.
Dhall is a good example - https://github.com/dhall-lang/dhall-haskell .
GitHub - tokay-lang/tokay: Tokay is a programming language designed for ad-hoc parsing, inspired by awk.
1 project | /r/programming | 14 May 2022
Hacker News top posts: May 13, 2022
2 projects | /r/hackerdigest | 13 May 2022
Tokay Programming Language
2 projects | news.ycombinator.com | 12 May 2022
A Proven Correct C Compiler (Used by Airbus)
7 projects | news.ycombinator.com | 26 Jun 2021
The Vale Programming Language
1 project | news.ycombinator.com | 27 Nov 2023