Get Started
The following pre-built binaries are available for download:
- hex v0.2.0 for Linux (x86_64)
- hex v0.2.0 for MacOS (x86_64)
- hex v0.2.0 for MacOS (ARM64)
- hex v0.2.0 for Windows (x86_64)
- hex v0.2.0 (αcτµαlly pδrταblε εxεcµταblε)
- hex v0.2.0 (WebAssembly — very experimental)
A note on the WASM buildThe main purpose of the WASM build is to power the playground. If you try to run it with NodeJS, the REPL will also somewhat work, except that file support and executing processes doesn't seem to behave, at the moment, and neither does `printf` unless you add a new line so... use at your own risk, or please use one of the other builds.
Building from Source
Building from source is easy: just run make
after cloning
the repo to build the hex executable for
your platform.
This assumes that you have a C compiler like GCC and the make command installed. On Windows, you may want to look into MSYS2.
Note that make
will first generate a single, amalgamated hex.c
file containing all
the concatenated sources in the right order. You can use this file for easily embedding hex in your own
C projects.
You can also:
- Run
make test
to run the test suite. - Run
make ape
to generate an αcτµαlly pδrταblε εxεcµταblε (requires Cosmopolitan). - Run
make wasm
to generate ahex.js
and ahex.wasm
(WebAssembly) file (requires the Emscripten SDK).
Command Line Options
Running hex -h
will print the following list of all the available command line options for the
hex
executable:
_*_ _ / \hex\* *\_/_/_/ v0.2.0 - (c) 2024 Fabio Cevasco * USAGE hex [options] [file] ARGUMENTS file A .hex or .hbx file to interpret OPTIONS -b, --bytecode Generate a .hbx bytecode file. -d, --debug Enable debug mode. -h, --help Display this help message. -m, --manual Display the manual. -v, --version Display hex version.
If you do not specify any option or argument, a simple REPL will be started.
Alternatively, you can also pipe input from standard input:
echo "0x2 0x2 + puts" | hex
Syntax Highlighting
If you use the Vim editor, you can use hex.vim to highlight hex files.
If you use Visual Studio Code, you can use the hex extension to highlight hex files.