.. _getstarted: .. highlight:: d Getting Started =============== The Neat compiler is at the moment only tested on 64-bit x86 Linux. However, it *should* work on other 64-bit platforms, and be able to be ported to 32-bit platforms with little effort. There are two available versions, depending on backend: LLVM 15 or GCC based. Note that both versions will require gcc to be installed for certain macros to work. Also, while the LLVM backend release may use the gcc backend, the gcc backend release cannot use LLVM, because it will not be built against it. The primary question, thus, is which backend you expect to use "by default." However, to my knowledge, aside the inherent differences of LLVM's and gcc's backend, both Neat backends are equally capable. The choice is thus largely down to personal preference. The installation instructions assume, and are tested with, Ubuntu 22.04. Take required steps as equivalent for your system. Install on Windows ------------------ Warning: as I don't have any Windows computer around, very little testing effort has gone into this deployment. The testsuite passes on Wine, that's about all I can say. 1. Install `llvm-mingw with LLVM 15 `_. 2. Ensure that the 'bin' folder of llvm-mingw distro is in the `PATH`. 3. Download the latest win64-gcc release from https://github.com/neat-lang/neat/releases 4. Execute `build.bat`. This should (eventually) create a file `neat.exe`. 5. Test the compiler: save a file 'hello.nt':: module hello; import std.stdio; void main() { print("Hello World"); } Then compile it with:: neat hello.nt hello.exe If that printed "Hello World", your Neat compiler is now ready for use! Install with LLVM ----------------- 1. Install required packages: .. code-block:: bash apt-get install -y --no-install-recommends \ ca-certificates clang-15 curl file gcc git \ llvm-15 llvm-15-dev xz-utils unzip 2. Download the latest release from https://github.com/neat-lang/neat/releases 3. Unpack the archive:: tar xf neat-v*-llvm.tar.xz cd neat-v*-llvm 4. Build the compiler:: ./build.sh 5. Symlink the compiler somewhere that's in your path:: mkdir -p "$HOME"/.local/bin ln -s "$PWD"/neat "$HOME"/.local/bin/neat 5. Test the compiler:: cat > hello.nt < hello.nt <`_. The required version of a package can be specified in the following ways: - `*`: Any version will do. - `^x.y.z`: Any version *semver-compatible* with `x.y.z` will do. That is, it must be equal on `x` and greater or equal on `y.z`. - `>=x.y.z`: Any version newer or equal to `x.y.z` will do. - `<=x.y.z`: etc. - `>x.y.z`: etc. - `