In which I have Opinions about parsing and grammars - by Simon Tatham
https://www.chiark.greenend.org.uk/~sgtatham/quasiblog/parsing/
The tiny but complete #JSON #parser that I wrote in #Haskell years ago is now featured in the 200-and-change collection of programs by @dubroy: https://pdubroy.github.io/200andchange
Had an enjoyable afternoon building a custom #cli #parser to replace #argparse in our internal tooling. I like its ease of use. But it is a custom parser and works only for my specific use case, but for use case it does more than argparse can and is simpler to use. #comandline #python
#Development #Launches
ESLint can now lint HTML · The code linter delivers a new language plugin https://ilo.im/163v4b
_____
#ESLint #OpenSource #Coding #Linter #Parser #HTML #Npm #WebDev #Frontend
P : yml -> nix & yml -> python
T : yml -> python
#parser
I finally got around to wrapping up and publishing a first version of my #Rust crate ts-typed-ast. It's a crate inspired by Rowan that automatically generates a typed AST from a tree-sitter grammar. You can find it here: https://crates.io/crates/ts-typed-ast
It works similarly to Rowan and Swift's libsyntax. tree-sitter provides the green nodes, while this crate generates the red nodes.
I've used it a few times already, to prototype various toy programming languages. You write a grammar in tree-sitter, and then either evaluate the ts-typed-ast tree directly, or convert it to some other IR.
Using tree-sitter as the parser generator for a toy project is pretty nice. You get a powerful, declarative way to create a parser, and at the same time you benefit from the whole tree-sitter ecosystem. Things like incremental parsing, syntax highlighting, structural editing, and formatting with Topiary.
Main downside is that tree-sitter does not (yet) offer good error reporting and recovery, so when parsing fails it's often in dramatic, unhelpful ways. Not a big issue for experimenting, which is what this crate is for. Production-ready languages probably need bespoke parsers anyway.
A high-throughput parser for the Zig programming language
Red Green Syntax Trees - an Overview | by Will Speak (aka Plingdollar):
https://willspeak.me/2021/11/24/red-green-syntax-trees-an-overview.html
To the #Rust #rustlang community: I once started to write a #compiler / #parser with #nom #crate. However I had some struggles with it of how to provide **multiple** errors with line+column indicators for a parsed context.
Now I read a tiny bit about #syn and #chumsky
Are they the right crates for me? Are there others?
I do not parse rust-code, but a completely custom language (similar to pugjs)
(Boost for reach )
#lispyGopherClimate #lisp #programming #podcast #live Wednesday 0UTC https://archives.anonradio.net/202503050000_screwtape.mp3
#climateCrisis #haiku and #risk #inequality #essay by @kentpitman
https://netsettlement.blogspot.com/2013/08/lien-times-for-startups.html
#libre #archive update from @hairylarry https://gamerplus.org/@hairylarry/114106383066762290
https://www.european-lisp-symposium.org/2025/index.html
#ELS2025 submissions extended to Sunday. #LaTeX #ACM #primer / past #proceedings
Notes from my first #language #parser #commonLisp #mcclim #chess
If there are guests, there are guests(?)
nom 8 has been released, https://unhandledexpression.com/nom-8/.
nom is a parser combinator library, and a damn excellent one! @geal has put a lot of awesome new features in it, check it out!
Trying to improve my Tree-sitter #parser for my new #esolang Bespoke, so that it recognizes things like commands and comments.
Trouble is, I can't figure out how best to handle block comments. And when I tried a workaround...it crashed my computer.
This is gonna be tough.
In Bespoke, words are first turned into digits, then the digits are turned into commands.
Block comments start and end with 0...0, where ... is an arbitrary digit sequence.
I need the digits before I can detect the commands, so I'm unsure how to handle this with Tree-sitter.
輸入:
@foo
{@foo|@bar|12\|}
輸出:
Any[Main.uahgi.Parsing.ID("foo"), "\n",
Main.uahgi.Parsing.SEQ(Any[Main.uahgi.Parsing.ELE(Any[Main.uahgi.Parsing.ID("foo")]),
Main.uahgi.Parsing.ELE(Any[Main.uahgi.Parsing.ID("bar")]), Main.uahgi.Parsing.ELE(Any["1", "2",
Main.uahgi.Parsing.ESC_CHAR("|")])])]```
Parsec這樣還是很不錯的。(參考:
https://repo.kianting.info/yoxem/uahgi/src/branch/main/src/parsing.jl )
#Julia #Parser #ParserCombinator