Skip to content

Parser #1

@bubach

Description

@bubach

Hi and let me be the first to congratulate you on what (at a very quick glance) looks to be very impressive work - on many levels!

I haven’t done a proper deep-dive into the sourcecode yet, but this will definitely motivate me to also get more familiar with Rust.

There is many parts about your approach that aligns with my own ideas for a toy language compiler, and I look forwards to study it closer and follow your future progress.

I do have some questions around the scanner, lexer, parser parts - regarding modularity and possible decoupling from the python grammar.

Would it be possible to have the parsing rules defined in some form of traversable data structure that the different modules just iterate over without it affecting performance too much - or is it just to integrated with the code generator bits to be worth it?

Most other parsing libs I’ve seen so far is either generated by yacc / bison type tools, to what I personally consider a rather ugly output - or they start out with string encoded BNF/PEG type rules when I’m on the lookout for a middle ground where there’s an API (or just predefined structs) for defining the actual syntax rules and corresponding actions.

Maybe I’ll just give it a go and see what I might cook up… or more likely, break, locally. 🤣

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions