10

Hello,

I have been learning rust and want to make something exciting so I though why not build a Lisp compiler in Rust B)

so here what I did today. https://gist.github.com/anon2834678263/bcaa06e934f7b478be79203553f170ee

the tokenizer isn't ready and might have horrible bugs but at least I got comfortable declaring immutable variable by default, not surrounding stuff with parentheses unnecessarily. oh and also Enums which is most powerful thing in rust as people say.

I am still not satisfied though since the code looks more like C than Rust xD

maybe some experienced people can correct me :)

you are viewing a single comment's thread
view the rest of the comments
[-] ghodawalaaman@programming.dev 3 points 2 days ago

Thank you kind stranger!

I will take notes and will make these changes. after improving this I will move to create AST which would be more fun! again thank :)

[-] TehPers@beehaw.org 2 points 2 days ago

FYI once you're done you should take a look at some of the parsing libraries out there. Some I'd recommend looking at:

  • pest - grammar based
  • lalrpop - more traditional LR(1) parser generator
  • winnow or nom - parsing combinators, probably the easiest of these to use (and most flexible)
this post was submitted on 06 Jun 2026
10 points (100.0% liked)

Rust Programming

9286 readers
8 users here now

founded 7 years ago
MODERATORS