Skip to content

C# implementation of Lox, from "Crafting Interpreters"

Notifications You must be signed in to change notification settings

rlipscombe/cslox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cslox: C# implementation of Lox

Lox is the programming language from "Crafting Interpreters"; see http://craftinginterpreters.com/

I'm going to write it in C# because I don't know any Java.

Compiling it

dotnet build

Running it

dotnet run
dotnet run input.lox

C# on .NET Core on Linux with VS Code

Follow up

There are a few well-established styles of IRs out there. Hit your search engine of choice and look for “control flow graph”, “static single-assignment”, “continuation-passing style”, and “three-address code”.

Erlang, since 22(?) uses SSA. What did it do before that? What are some other examples?


If you’ve ever wondered how GCC supports so many crazy languages and architectures, like Modula-3 on Motorola 68k, now you know. Language front ends target one of a handful of IRs, mainly GIMPLE and RTL. Target backends like the one for 68k then take those IRs and produce native code.

What languages can be converted to GIMPLE or RTL? What backends to GIMPLE and RTL are there? Are there interpreters for same?


Smalltalk has no built-in branching constructs, and relies on dynamic dispatch for selectively executing code.

Given lunchtime's conversation with Charlie about the fact that if is a statement (or an expression, in Rust), not a keyword, this note about Smalltalk intrigues me.

Further Reading

...being things that were referenced in the "Crafting Interpreters" book (and some that weren't) that I should take the time to read later:

About

C# implementation of Lox, from "Crafting Interpreters"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages