If youâve been following me on Dev.to for the last few months, your probably asking yourself- where have you been? Well, Iâve been busy running a non-profit and so havenât had the time to write. Sorry!
But, weâve been working on some cool stuff and through the next couple of days we are going to be sharing it- so stay posted.
Whatâs the code simulator?
Weâve been working on a system similar to Repl.it but we came upon a realization: we need to run the code that people write with our tool. So, how do you run code?
Most companies that do REPL (Read Eval Print Loop), just use code execution engines in the cloud. These engines are just monolithic computers with tons of programming languages installed on them. Whenever a language needs to be run, it just uses the languageâs CLI on the machine. But, this requires an internet connection.
A large number of the people using our application wonât have an internet connection, and so we have to build the system to work for these people too. We could put an entire code execution engine onto their computers, but that would take up way too much disk space. So, the alternative is simulating the behaviors of each programming language.
The simulation is actually quite simple, we are just translating all of the code into a common Abstract Syntax Tree (a tree based way to store information about a program), and from there, we just interpret the Abstract Syntax Tree like itâs any other language.
Help if you can!
This sounds really simple in practice, but itâs not. And so, if you have any experience working with flutter, dart, or programming languages, we could really use some help. Feel free to check out the project and contribute!