Inspiration

Our desire to learn about the nitty-gritty operations of computing, which is quite opaque to the average person and hard to get into.

What it does

Upon a user entering a valid, well-formed arithmetic expression, it will go to our backend C++ lexer, parser, tokenizer and compiler, and return a pseudo-Assembly instruction set that can be followed and understood. There is a stack pointer there to better help understand. There is also a table which represents memory, where we can see the memory fill up, and subsequently clear. These visual methods can be used to teach, learn, and understand low-level arithmetic better.

How we built it

Our project uses React as the front end, ExpressJS as our webserver, and NodeJS as our runtime environment, all this hosted on an AWS EC2 server. Once a user clicks the Send button, the data is sent to our backend, written in C++, where the AEX is validated, tokenized, and parsed into an Expression Tree. We then traverse the expression tree using a DFS like algorithm to extract the data necessary that is posted on the front end. There are also instructions written in a pseudo-Assembly manner that show what a computer would see if the AEX was compiled by a real computer language. Afterwards, we use the data to make cool animations with D3JS.

Challenges we ran into

We ran into a lot of problems, but the most notable ones were animating (i.e. timing) and parsing. We had to learn a lot about many different frameworks such as D3 and Express, as we had heard of them, but never knew how to use them. We also had no idea how AWS works and had to learn how to use it from scratch, however, it was one of the lesser challenges as we all had a very strong Linux grounding that helped.

Accomplishments that we're proud of

  • Completing most of what was planned out on Sunday night on time.
  • Making a working compiler, lexer, parser
  • Getting hosting up and running (before making it I thought that's where all my time would be invested, but I got it done by 10 am on Saturday)
  • Working well as a team
  • Getting reasonable sleep

What we learned

We learned that non-commutative operators destroy syntax trees. Moreover, we learned how to use many frameworks and packages, as well as learning how systemd and AWS work. And of course, the main theme of this project is to learn low-level computer functions, which was done extensively

What's next for Bitulator

  • Finding more efficient methods for calculating and compiling.
  • Adding more features that we wanted to have but were limited by time constraints (i.e. describing the actual parsed tree, which we were close to having and were returning a JSON object of the tree from the compiler, however, didn't have the 2 hours required to implement)
  • Adding a more friendly learning environment, right now we have a lot of text, and it's very self-guided.
  • Add more operations (sqrt, modulo arithmetic, factorials)
Share this project:

Updates