1
0
Fork 0
forked from fun/fun

Some more documentation fun. No code changes. (0.38.11)

This commit is contained in:
Johannes Findeisen 2026-02-11 17:55:04 +01:00
commit 6ee78cc4fb
3 changed files with 11 additions and 11 deletions

View file

@ -6,20 +6,20 @@ All commands assume you are in the repository root.
## Prerequisites ## Prerequisites
- Build the interpreter (see handbook.md). Youll have `build_debug/fun` or `build_release/fun` (paths may vary by your setup/IDE). - Build the interpreter (see handbook.md). Youll have `build/fun` (paths may vary by your setup/IDE).
- Set FUN_LIB_DIR to the repos lib directory when running without installation so `#include <...>` can find the standard library. - Set FUN_LIB_DIR to the repos lib directory when running without installation so `#include <...>` can find the standard library.
Example (Linux/macOS/BSD): Example (Linux/macOS/BSD):
``` ```
FUN_LIB_DIR="$(pwd)/lib" ./build_debug/fun examples/include_lib.fun FUN_LIB_DIR="$(pwd)/lib" ./build/fun examples/include_lib.fun
``` ```
Windows (PowerShell): Windows (PowerShell):
``` ```
$env:FUN_LIB_DIR = "$PWD/lib" $env:FUN_LIB_DIR = "$PWD/lib"
./build_release/fun.exe .\examples\include_lib.fun ./build/fun.exe .\examples\include_lib.fun
``` ```
## Interactive showcase: play.fun ## Interactive showcase: play.fun

View file

@ -18,19 +18,19 @@ To list targets with CMake directly, consult your IDE or run the build system
Debug profile example: Debug profile example:
``` ```
cmake --build build_debug --target test_opcodes && ./build_debug/test_opcodes cmake --build build_debug --target test_opcodes && ./build/test_opcodes
``` ```
Release profile example: Release profile example:
``` ```
cmake --build build_release --target test_opcodes && ./build_release/test_opcodes cmake --build build_release --target test_opcodes && ./build/test_opcodes
``> ``>
If `fun_test` exists in your configuration: If `fun_test` exists in your configuration:
``` ```
cmake --build build_debug --target fun_test && ./build_debug/fun_test cmake --build build_debug --target fun_test && ./build/fun_test
``` ```
You can also invoke CTest to run any tests registered with `add_test()`: You can also invoke CTest to run any tests registered with `add_test()`:

View file

@ -17,14 +17,14 @@ Linux/macOS/BSD:
``` ```
export FUN_LIB_DIR="$(pwd)/lib" export FUN_LIB_DIR="$(pwd)/lib"
./build_debug/fun examples/include_lib.fun ./build/fun examples/include_lib.fun
``` ```
Windows (PowerShell): Windows (PowerShell):
``` ```
$env:FUN_LIB_DIR = "$PWD/lib" $env:FUN_LIB_DIR = "$PWD/lib"
./build_release/fun.exe .\examples\include_lib.fun ./build/fun.exe .\examples\include_lib.fun
``` ```
If `FUN_LIB_DIR` is not set, the interpreter tries a compiletime `DEFAULT_LIB_DIR`, and finally falls back to `./lib` relative to the current working directory. Be mindful of where you run the `fun` binary from. If `FUN_LIB_DIR` is not set, the interpreter tries a compiletime `DEFAULT_LIB_DIR`, and finally falls back to `./lib` relative to the current working directory. Be mindful of where you run the `fun` binary from.
@ -42,7 +42,7 @@ Fix:
``` ```
cmake -S . -B build_debug -DFUN_WITH_REPL=ON cmake -S . -B build_debug -DFUN_WITH_REPL=ON
cmake --build build_debug --target fun cmake --build build_debug --target fun
FUN_LIB_DIR="$(pwd)/lib" ./build_debug/fun FUN_LIB_DIR="$(pwd)/lib" ./build/fun
``` ```
See repl.md for usage tips and features. See repl.md for usage tips and features.
@ -81,11 +81,11 @@ Symptoms:
- Setting environment variables has no effect; include paths remain unresolved. - Setting environment variables has no effect; include paths remain unresolved.
Fix: Fix:
- In CMD use: `set FUN_LIB_DIR=%CD%\lib && build-debug\fun.exe examples\include_lib.fun` - In CMD use: `set FUN_LIB_DIR=%CD%\lib && build\fun.exe examples\include_lib.fun`
- In PowerShell use: `$env:FUN_LIB_DIR = "$PWD\lib"; .\build\fun.exe .\examples\include_lib.fun` - In PowerShell use: `$env:FUN_LIB_DIR = "$PWD\lib"; .\build\fun.exe .\examples\include_lib.fun`
## Getting help ## Getting help
- Run the interpreter with `--help` to see supported flags. - Run the interpreter with `--help` to see supported flags.
- Explore docs/handbook.md and docs/repl.md. - Explore docs/handbook.md and docs/repl.md.
- Check the examples under `examples/` and try `./play.fun` for an interactive tour. - Check the examples under `examples/` for an interactive tour.