Share your repls and programming experiences

← Back to all posts
A semi-functional Lua Interpreter!
CSharpIsGud (414)

Very buggy but it indeed works and all the parsing and interpreting is done by hand and with love.
if statements, while loops, variables, and limited table functionality are implemented right now.

Commentshotnewtop
MatthewDoan1 (336)

Cool. I like the use of an interpreted language being interpreted by a compiled one, since there are advantages to that.

amasad (2382)

That's very cool! And the code is really neat. Can you describe some of the technical details? Why did you decide the parse by hand instead of using a parser generator?

CSharpIsGud (414)

@amasad For fun mainly, if I had used a parser generator it surely wouldn't have as many parsing related bugs but it also would of taken less effort. I read some articles on abstract syntax trees to do that part but the main issues are with the tokenizer and function/condition bodies.

[deleted]

remove global variable functionality

CSharpIsGud (414)

@TaylorLiang That is how globals and locals work in lua, so they will remain.

[deleted]

very nice use of C#'s Nullable