valen-lang/Valen
About
Compiler for the Valen programming language
Languages & RuntimesMeasured star growth
- in 24h
- -1
- in 7 days
- 0
- in 15 days
- +6
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalValen
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
- Build the Valen compiler:
- Clone the repo,
git clone https://github.com/valen-lang/valen ~/valen cd ~/valencargo build --bin valec
- Clone the repo,
- Make a directory for your Valen project:
mkdir ~/my_valen_projectcd ~/my_valen_projectmkdir src- Make a
src/main.valencontainingexported func main() int { return 42; }
- 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 be42)
- Compile:
Running a Valen Program with Rust Libraries
- 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 ~/rustcd ~/rustgit 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 2rustup toolchain link rustc-for-valen ~/rust/build/host/stage1ln -sf ~/rust/build/host/stage0/bin/cargo ~/rust/build/host/stage1/bin/cargo
- Build the Valen compiler:
- Clone the repo,
git clone https://github.com/valen-lang/valen ~/valen cd ~/valencargo +rustc-for-valen build --features rust_interop --bin valenc-rs --bin valen
- Clone the repo,
- Make a directory for your Valen project:
mkdir ~/my_valen_projectcd ~/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(); }
- 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 be42)
- Compile:
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:
- Arthur Weagel
- Kiril Mihaylov
- Radek Miček
- Geomitron
- Chiuzon
- Felix Scholz
- Joseph Jaoudi
- Luke Puchner-Hardman
- Jonathan Zielinski
- Albin Kocheril Chacko
- Enrico Zschemisch
- Svintooo
- Tim Stack
- Alon Zakai
- Alec Newman
- Sergey Davidoff
- Ian (linuxy)
- Ivo Balbaert
- Pierre Curto
- Love Jesus
- J. Ryan Stinnett
- Cristian Dinu
- Florian Plattner
Explore related projects
Loading…