- Compiler built as part of the term project for the course CS F363 - Compiler Construction. Original Github Repo to view development of compiler: https://github.com/Saujas/Compiler-Project-CS-F363
- Play around with the language at: https://bits-compiler.herokuapp.com/
- View language specifications here: https://github.com/rohitrajhans/Compiler_IDE/blob/master/compiler/Language%20specifications.pdf
- Make sure the binaries for the compiler exist. If not, run
make -C compilerfrom the root directory - Run
go run main.goto start the server - Visit
localhost:3000to open the Web App
- Client-side: JavaScript, JQuery
- Server-side: Go
- Compiler for Toy Language: C
For more details on the compiler implementation check this out
Deplyoment is not straightforward since gcc libraries are not installed by default on the Heroku cloud host. Follow the steps listed here to deploy the Go app. To add the runtime gcc environment, I followed these steps
- Add two additional buildpacks: For C and to install other apt-dependencies.
- The buildpack for C requires a Makefile in the root directory of the project. Build the compiler binaries when building the app. Add
make -C compilerto the Makefile in the root directory to create compiler binaries while building the app. - Create an Aptfile in the root folder to install the apt-dependencies. Add the following dependencies to the Aptfile. These will be installed while building the app.
- build-essential
- nasm
- gcc-multilib
- libtool
- glibc-source
- libc-bin
- libc-dev-bin
- libc6
- libc6-dev
- Add
--sysroot=/app/.aptafter each gcc call to use the newly installed dependencies.