Get the comet compiler
One small program, comet, that runs and builds your .cmt files. It turns your code into C++ and calls g++, so the Windows package carries a GCC toolchain inside, and the Linux build uses the g++ already on your system.
Windows (64-bit)
Download the installer- Run
comet-setup.exe. No admin rights needed: it installs into your user folder and puts it on your PATH (user environment variables) by itself. - Open a new terminal (Windows Terminal, PowerShell or cmd) in your project folder and run
comet hello.cmt. - New versions: comet tells you once a day when one exists;
comet updateinstalls it. Uninstall from Settings → Apps, like any program.
Prefer no installer? The portable zip (28.4 MB) has the same files; unzip it anywhere and call it by its full path, or add that folder to your PATH yourself.
SHA-256 installer fe8b4ee8cf80d5cb90dec533bdc2001a69d7468d2fe944a1a1dba2ddfee6f4de
SHA-256 zip 4e552ff164edb8b5f0d03e84438edbfa1b552cbc764621d3a51bb3053c91c754
Linux (x86-64)
curl -fsSL https://comet.okak0.com/dl/install.sh | sh
- The script downloads the compiler to
~/.local/bin/cometand adds that folder to your PATH in your shell start-up file if it is not there yet. - Install a C++ compiler if you do not have one:
sudo apt install g++(Debian/Ubuntu) orsudo dnf install gcc-c++(Fedora). For window programs (use gui) alsosudo apt install libx11-dev. - Open a new terminal and run
comet hello.cmt.
Or download the binary (3.3 MB) yourself: chmod +x comet and put it somewhere on your PATH, for example /usr/local/bin.
SHA-256 595295947ab2c6608a5dd0fd423915154e0edd0c5dfa6a06aa474f978e422e66
Using it
comet hello.cmt # run in the terminal (compiles on first use, cached after)
comet hello.cmt alice bob # with arguments: args()
comet compile hello.cmt # makes hello.exe (Windows) / hello (Linux) next to it
comet compile hello.cmt -o app # choose the name (optional)
comet make hello.cmt # make hello.exe and run it straight away
comet compile hello.cmt --portable # exe for any 64-bit PC (default: tuned for this CPU)
comet check hello.cmt # errors only
comet cpp hello.cmt # see the generated C++
comet help make # what a command does, its options and examples
Every command shows compile errors with the line and a caret before anything runs. A compiled executable does not need comet or g++ to run; copy it to any computer with the same operating system. On Windows it is fully static. The installer prepares the compiler for your CPU once; after that small programs compile in a fraction of a second and unchanged programs start instantly.
macOS: the Linux binary will not run, but the compiler builds from source with any C++20 compiler (xcode-select --install, then build src/main.cpp). Ask on chat.okak0.com if you need a hand.
Android app
comet for Android
Download the app- Open the downloaded file on your phone. Android asks once to allow installs from your browser; say yes.
- The app has a code editor with colours, a row of quick keys for braces and brackets, an input box, the example programs and the Learn page.
- Press Run: the program is compiled and run on comet.okak0.com and the output appears below the code. Nothing is installed on the phone besides the app.
SHA-256 b915c5b1c35e81967fbf9508c73fa58a88657a4089d4ec7f7addb5f38e2fa9e7
Good to know
Programs run in the same sandbox as the website's playground: up to 10 seconds each, no network, no files kept. Your code and input stay saved in the app between visits. Files ending in .cmt open in the app from a file manager.
Android 8 or newer. The app checks for new versions by itself and offers to install them.
VS Code extension
comet for VS Code
Download the extension- The Windows installer adds it to VS Code by itself when VS Code is installed. Otherwise:
- In VS Code open the Extensions view, click the … menu at its top, choose Install from VSIX… and pick the file. Or from a terminal:
code --install-extension comet.vsix
SHA-256 a3d05484e6654edb8fac165d07b11a10d48554c422e0eeae18364d20ea24af8d
What you get
Colours for keywords, builtins, numbers, strings with their {embedded} expressions, comments, struct and function names. Brackets close and indent by themselves; // comments toggle with Ctrl+/.
Snippets: type main, fun, struct, if, for, forin, while, printl or input and press Tab. Run the file from the built-in terminal with comet run file.cmt.