Skip to content
プロジェクト

概要

Valen プログラミング言語のコンパイラ

言語・ランタイム

この数値の測り方

計測したスター増加

24時間
-1
7日間
0
15日間
+6
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

Valen

Valen is a programming language that aims to be not only fast and memory-safe, but also easy and flexible.

NOTE: Valen is still a prototype and barely past the proof-of-concept stage. There are holes and sharp edges. For example, String and HashMap require some more Rust-interop work. After a few months of solidifying and stabilizing, we'll release a 0.1 version that's nice and usable for basic cases. Stay tuned!

Our plans for Valen:

  • Ecosystem: Valen is able to call into existing Rust libraries, see The Golden Spike, and Resurrecting the Vale(n) Programming Language
  • Speed: Valen is AOT compiled to LLVM, statically-typed, and aims to be the fastest safe language, by giving more fine-grained aliasing information to LLVM.
  • Safety: For memory safety and data-race safety, it uses the new group borrowing technique, which is like a more flexible borrow checking, with mutable aliasing.
  • Flexibility: We'll be adding generational references and reference counting, which should be usable without Cell, RefCell, etc.

Running a Valen Program

  1. Build the Valen compiler:
    • Clone the repo, git clone https://github.com/valen-lang/valen ~/valen
    • cd ~/valen
    • cargo build --bin valec
  2. Make a directory for your Valen project:
    • mkdir ~/my_valen_project
    • cd ~/my_valen_project
    • mkdir src
    • Make a src/main.valen containing exported func main() int { return 42; }
  3. Compile and run your Valen project:
    • Compile: ~/valen/target/debug/valec build --no-std --builtins-dir-override ~/valen/src/builtins/resources main=src
    • Run: build/main
    • See the result: echo $? (should be 42)

Running a Valen Program with Rust Libraries

  1. Install and compile the patched version of rustc. WARNING: This is a version of rustc that we modified, it is NOT the official rustc!
    • git clone https://github.com/valen-lang/rust ~/rust
    • cd ~/rust
    • git checkout per-instance-mir (This is the branch with our rustc patches)
    • Add to config.toml:
      [llvm]
      download-ci-llvm = false
      link-shared = true
      
    • ./x build
    • ./x build --stage 2
    • rustup toolchain link rustc-for-valen ~/rust/build/host/stage1
    • ln -sf ~/rust/build/host/stage0/bin/cargo ~/rust/build/host/stage1/bin/cargo
  2. Build the Valen compiler:
    • Clone the repo, git clone https://github.com/valen-lang/valen ~/valen
    • cd ~/valen
    • cargo +rustc-for-valen build --features rust_interop --bin valenc-rs --bin valen
  3. Make a directory for your Valen project:
    • mkdir ~/my_valen_project
    • cd ~/my_valen_project
    • Add a Valen.toml:
      [project]
      name = "test_project"
      version = "0.1.0"
      edition = "2021"
      
      [rust-dependencies]
      chrono = "0.4"
      
      [[bin]]
      name = "main"
      source = "src/main.valen"
      
    • Make a src/main.valen:
      import chrono.TimeDelta;
      
      exported func main() i64 {
        d = TimeDelta.seconds(42i64);
        return d.num_seconds();
      }
      
  4. Compile and run your Valen project:
    • Compile: COMPANION_RUSTC=$(rustup which --toolchain rustc-for-valen rustc) ~/valen/target/debug/valen build --manifest-path Valen.toml
    • Run: target/valen-build/target/debug/main
    • See the result: echo $? (should be 42)

Let us know if the above sequence of commands doesn't work for you.

Historical Notes

Valen is the successor to the Vale programming language.

Thank you to everyone who sponsored Vale! Vale existed because of your support, and Valen exists because Vale existed. Thank you to all of Vale's sponsors:

関連プロジェクトを探す

読み込み中…