Flutterby™! : Rust, C, and parsing

Next unread comment / Catchup all unread comments User Account Info | Logout | XML/Pilot/etc versions | Long version (with comments) | Weblog archives | Site Map | | Browse Topics

Rust, C, and parsing

2024-05-01 18:52:36.980865+02 by Dan Lyke 0 comments

It's not in the current development path, but some features prototyped for work use a prefix notation math system, and that's bugged me, and wrote a little framework that let me use Objective-C to specify a parser in Backus–Naur form, and because that created an in-memory tree and had some good intermediate information that I could use for command completion.

I've done stuff with the peg/leg recursive descent parser generators in C, and realized that I want the ability to introspect the parse tree better, for things like command completion and better error messages.

I've been both thinking that this is a tool I'd like to have generally for implementing configuration and scripting kinds of things, and that this might be my opportunity to learn a new language. I've been thinking that I should learn Rust, although as I dig through a lot of it it (and Go) feel pretty prescriptive, on the other hand I've also looked at some of the side effects that sneak into Perl and Python and realize that whipupitude is not always great for long term maintenance of the code.

Anyway, I started thinking about what it might look like in C++, and that reminded me of how much the language informs my design thinking, even as I think that many of those ideas are portable across languages. Which got me back towards Rust, although...

LogLog Games: Leaving Rust gamedev after 3 years is a fascinating look at how Rust's proscription about memory management can make it difficult to build. Especially as we start to think about "data oriented design" as a response to Object-Oriented design, maybe that isn't a great idea.

On the other side, The Brain Dump — One year of C is some musings about C99 (vs C89) and thinking about design and memory in C vs C++, and it's making me think that maybe I even need to go back to my preprocessor abusing ways and implement this thing in C.

[ related topics: Games Weblogs Perl Open Source Invention and Design Software Engineering Work, productivity and environment Monty Python Mathematics Graphic Design Python hubris ]

comments in ascending chronological order (reverse):

Add your own comment:

(If anyone ever actually uses Webmention/indie-action to post here, please email me)




Format with:

(You should probably use "Text" mode: URLs will be mostly recognized and linked, _underscore quoted_ text is looked up in a glossary, _underscore quoted_ (http://xyz.pdq) becomes a link, without the link in the parenthesis it becomes a <cite> tag. All <cite>ed text will point to the Flutterby knowledge base. Two enters (ie: a blank line) gets you a new paragraph, special treatment for paragraphs that are manually indented or start with "#" (as in "#include" or "#!/usr/bin/perl"), "/* " or ">" (as in a quoted message) or look like lists, or within a paragraph you can use a number of HTML tags:

p, img, br, hr, a, sub, sup, tt, i, b, h1, h2, h3, h4, h5, h6, cite, em, strong, code, samp, kbd, pre, blockquote, address, ol, dl, ul, dt, dd, li, dir, menu, table, tr, td, th

Comment policy

We will not edit your comments. However, we may delete your comments, or cause them to be hidden behind another link, if we feel they detract from the conversation. Commercial plugs are fine, if they are relevant to the conversation, and if you don't try to pretend to be a consumer. Annoying endorsements will be deleted if you're lucky, if you're not a whole bunch of people smarter and more articulate than you will ridicule you, and we will leave such ridicule in place.


Flutterby™ is a trademark claimed by

Dan Lyke
for the web publications at www.flutterby.com and www.flutterby.net.