"Coccinelle is a tool for automatic program matching and transformation that was originally developed for making large scale changes to the Linux kernel source #code (ie, C code)."
Many people say that #Rust is very hard to #prototype with or to #refactor. This couldn't be further from the truth! It is the exact opposite!
Let me share with you one of the most profound experiences I had with #RustLang on a casual sunday - a thread 🧵
I'm currently rewriting my #transpiler from #nom to #chumsky and until now everything has turned out great so far, until I've hit the following road block:
Implementing parsers by using #parser functions that have indirect #recursion.
Currently in the process of rewriting my #transpiler from #nom v4.2 to #chumsky v1.0.0-alpha.6 🤓
It is a lot of fun so far, but I have to say these type signatures are wild!😄
I'm still struggling with it far more than I'd like, but I guess it is just a matter of time until intuition kicks in and it will become more and more natural.
Exciting project ahead!🙂
I'm even able to parse string literals with escape sequences - something I haven't even achieved with nom!
One concept (among others!) I haven't learned yet, but will run into, is #recursion in chumsky. I know, there are good docs on it - it's just something I haven't gotten to yet.
All in all, I'm very happy with chumsky so far. Kudos to its maintainers! 🙂 🎩
Bluesky just removed their login wall, now posts and profiles can be accessed freely.
Any user can disable this for their account (it's still reachable with 3rd party apps through federation but it adds friction).
Hi all. I've gotten some positive feedback on my accessible "story mode" for Repeat the Ending, but I could use maybe two more testers. If you dislike playing parser games but would consider "reading" one, get in touch. Details:
@jsbarretto#Parsers are so fascinating, aren't they!? At first you think: "Hm...what should be so special about a parser?", but then you go down the rabbit hole and you'll probably never return to the surface. 😄
Regarding error recovery: You probably already know the following article, by matklad, but just in case you don't:
"A frequently missed feature of PEGs is left #recursion, which is commonly used in Context-Free Grammars (#CFGs) to encode left-associative operations. We present a simple conservative extension to the semantics of #PEGs that gives useful meaning to direct and indirect left-recursive rules, and show that our extensions make it easy to express left-recursive idioms from CFGs in PEGs, with similar results."
Uh, ohhh... I think it's time for me to migrate away from #nom v4.2 😮
Yeah, I know, I've procrastinated on this a lot. This will probably be a lot of work and "slow me down" for a bit. 😪 On the upside, though: I can correct all my mistakes along the way (like having spans).
I'll probably migrate to #chumsky, but #winnow also looks really nice. 🙂
#HowToThing#013 — Building a toy Lisp language and interpreter using the S-expression parser from https://thi.ng/sexpr and polymorphic multiple dispatch functions via https://thi.ng/defmulti. A small language like this can be useful for DSL purposes, user programming or for just learning about interpreters. The entire setup is highly customizable (incl. support for different kinds of S-expressions, see package readme).
Even this tiny example includes the following features: variadic math ops, ability to define new symbols/variables & functions, lexical scoping, numeric & string values...
Some example invocations are included at the end...
#puzzle for #python fans:
where does this error come from?
In my opinion, one of the great things about #python is that it's simple and straightforward - you don't get unexpected surprises. But there are a few exceptions, as this example shows.😉
winnow is a parser combinator library written in Rust that started as a fork of #nom.
Not sure yet, if I should migrate from nom 4.* to #winnow or #chumsky. I really do like the good error recovery and parsing capabilities for PEGs of chumsky.🥰
"In this work, we present Forest, a structural code editor that aims to bridge the gap between the interactiveness of code editors and the expressiveness of refactoring scripts."
I have several #interactiveFiction#parser#textAdventure#games works in progress, that I'm in various stages of developing. Suddenly had great idea last night for one of them, reframing the opening and overall structure. Making frantic notes now before I totally forget it all. Typing into comments in my #Inform7 source code. Feeling invigorated. Hoping that my #neuro#illness allows me enough good time to complete this #game and the others satisfactorily. #IndieGames#GameDev#creativeWriting
The weld-parser crate wasn't happy with its name. Now, we must refer to it as weld-object. This crate has ambitions for its life!, like supporting Elf32, MachO, COFF, and more object formats, look at this little cheeky!