Added basic build instructions

This commit is contained in:
Mattia Giambirtone 2023-03-03 00:56:58 +01:00
parent 47ac1be6aa
commit 4cdb92150d
1 changed files with 26 additions and 1 deletions

View File

@ -110,4 +110,29 @@ or open an issue/PR!
- [Art](https://git.nocturn9x.space/art) <3
- Everyone to listened (and still listens to) me ramble about compilers, programming languages and the likes (and for giving me ideas and testing peon!)
- ... More? (I'd thank the contributors but it's just me :P)
- Me! I guess
- Me! I guess
## Ok, cool, how do I use it?
Great question! If this README somehow didn't turn you away already (thanks, by the way), then you may want to try peon
out for yourself. Fortunately, the process is quite straightforward:
- First, you're gonna have to install [Nim](https://nim-lang.org/), the language peon is written in. I highly recommend
using [choosenim]() to manage your Nim installations as it makes switching between them and updating them a breeze
- Once Nim is installed, you should install [jale](https://git.nocturn9x.space/japl/jale), peon's custom line editor
library written by our beloved [Art](https://git.nocturn9x.space/art). This is needed for the REPL to work: just clone the repository, `cd` into it and run `nimble install`; this will install the library on your
system so that the Nim compiler can find it later
- After jale has been installed, clone this repository and run the REPL with `nim r src/main` (in the appropriate
directory of course). If you want to do more than play around in the REPL, I recommend compiling peon in release
mode with `nim -d:release --passC:"-flto" -o:peon`, which should produce a `peon` binary ready for you to play with
(if your C toolchain doesn't support LTO then you can just omit the `--passC` option, although that would be pretty weird
for a modern linker)
- If you want to move the executable to a different directory (say, into your `PATH`), you should copy peon's standard
library (found in `/src/peon/stdlib`) into a known folder and edit the `moduleLookupPaths` variable inside `src/config.nim`
by adding said folder to it so that the peon compiler knows where to find modules when you `import std;`. Hopefully I will
automate this soon, but as of right now the work is all manual (and it's part of the fun, IMHO ;))
If you've done everything right, you should be able to run `peon` in your terminal and have it drop you into the REPL. Good
luck and have fun!