Update README.md

This commit is contained in:
Maxwell 2025-01-11 20:03:48 +11:00
parent 4dbbcc910a
commit d93b2c39bb

View File

@ -14,11 +14,63 @@ Maybe one day the NodeJS community will find it and obsess over it in it's unopt
## How do I Okto?
First, download the source code and your favourite C++ compiler. Next, clone the repo (`git clone https://git.maxwellj.xyz/max/okto`) and CD into it. Compile the code (if the GCC is your poison, `g++ src/okto -o okto`) and run the binary.
Okto uses features from C++ 17, so make sure you have an updated compiler. I recommend gcc. Here are some instructions:
*Sidenote:* Okto has been tested extensively on Linux, and is known to compile for a Windows build target. I'm working on automating tests and builds for Windows, Linux and MacOS.
### Linux (and most other Unix-like)
*Less Important Sidenote:* How is Haiku more developer friendly than Windows and MacOS? g++ out of the box! It's almost as if they want people to develop for it...
First, install `gcc` or another C++ compiler.
Clone the repository, CD into it and run:
```bash
g++ src/main.cpp -o okto
```
If needed, statically link with `-static`.
Run `./okto` to run, and test with `./okto example.okto` (assuming you did clone the repository)
### MacOS
First, install Xcode and accept the agreement.
Then, clone the repository CD into it and run:
```bash
g++ src/main.cpp -o okto -std=c++17
```
If needed, statically link with `-static`.
Run `./okto` to run, and test with `./okto example.okto` (assuming you did clone the repository)
### Windows
There are three ways to compile for Windows: through Linux (I personally recommend, can be done through WSL), through MSYS2 or Cygwin, or through Windows.
#### Through Linux
Install your distro's mingw GCC package. On Arch Linux, it's `mingw-w64-gcc`. Compile with:
```bash
x86_64-w64-mingw32 src/main.cpp -o okto.exe -static
```
If you're not using WSL, you may want to use Wine to test the build. At the time of writing, all Okto features should work when run with Wine.
#### Through MSYS2/Cygwin
Refer to the documentation for these platforms. Steps should be similar to compiling for Linux.
#### Through Windows
Search for a package including g++ through `winget`, and install your preferred option. Compile with:
```powershell
g++ src/main.cpp -o okto
```
If needed, statically link with `-static` **This is highly recommended if distributing to other Windows machines.**.
Now we can start writing our code!