C-- is C++ but reversed and flipped. Yes it just reverses the code and compiles it using a regular C++ compiler, but I read that we were graded on quality. Granted this code is probably not quality either. You can check the
examples
folder for C-- code, C++ code, Windows executables, and Unix (Linux/MacOS) binaries.
But to make it a bit more quality, I added an online compiler which compiles Windows executables, over HTTP.
java -jar cli.jar [..arguments]
.
- Download the jarfile
- Write a C++ program
- Convert it to a C-- program using
java -jar cli.jar ToCMM file.cpp
- Compile the file using
java -jar cli.jar compile file.cmm
- Download the jarfile
- Write a C-- program
- Compile the file using
java -jar cli.jar compile file.cmm
ToCMM
, FromCMM
, and compile
- ToCMM: ToCMM just turns C++ code into C-- code
-
-o
: Specify output of conversion
-
- FromCMM: FromCMM turns C-- code into C++ code
-
-o
: Specify output of conversion
-
- compile: Compiles the C-- code
-
-o
: Specify output of compilation -
-on
: Whether to use online compiling or not -
-c
: Which compiler to use (e.g. g++)
-
So a few hours into this project I realised that C++ compilers are stupid and annoying and i hate them
Although the CLI does support local compiling, it also has an online compiler which compiles code on a server, and returns the code. It only works for Windows (64bit) operating systems, but it works.
also it doesn't work with includes not built in with C++
- Mingw-w64 (not tested)
- make
- g++
In the (Golang) online compiler, I used the Gin framework for HTTP, and a bunch of _built-in_ modules for strings, logging, input/output, etc.
The online compiler is also hosted under https://compile.cmm.danky.dev/ and is integrated into the CLI.