4 releases

0.0.4 Oct 17, 2024
0.0.3 Jun 30, 2024
0.0.2 Jun 18, 2024
0.0.1 Jun 7, 2024

#1001 in Programming languages

Download history 4/week @ 2024-07-19 14/week @ 2024-07-26 1/week @ 2024-08-02 6/week @ 2024-08-09 4/week @ 2024-08-16 9/week @ 2024-08-23 8/week @ 2024-08-30 4/week @ 2024-09-06 24/week @ 2024-09-13 32/week @ 2024-09-20 19/week @ 2024-09-27 6/week @ 2024-10-04 130/week @ 2024-10-11 62/week @ 2024-10-18 10/week @ 2024-10-25 8/week @ 2024-11-01

210 downloads per month
Used in 6 crates

GPL-3.0 license

40KB
1K SLoC

Pin1Yin1-rustc

Pin1Yin1Yu3Yan2's compiler written in rust.

Backends

There are two code generation backends: llvm and c. By default, both are enabled. You can disable all of them by using the --no-default-features flag.

e.g. enable c backend only

cargo build --release --no-default-features --features=backend-c

LLVM Backend

The version of llvm is llvm@18, by default, it's preferred to dynamic link to the system's llvm library.

If you want to use a different version of llvm, or you want to statically link to the llvm library, you can order the feature flags of inkwell

cargo build --release --no-default-features --features=backend-llvm,inkwell/llvm18-0-force-static

Enable the feature flag backend-llvm to not enough to compile, you must also enable one of the inkwell feature flags.

C Backend

C backend is just a code printer, it doesn't need any extra dependencies.

Feature flags

  • default: Enable all features follow, and inkwell/llvm18-0-prefer-dynamic.
  • backend-llvm: Enable llvm backend.
  • backend-c: Enable c backend.
  • parallel-declare: Enable parallel type declaration of items(like functions).

Note

  • In archlinux, llvm is installed in /opt/llvm and only dynamic library is provided. If you want to compile and use llvm backend, you must set the LD_LIBRARY_PATH to /opt/llvm/lib.

Dependencies

~0.3–0.9MB
~20K SLoC