Skip to content

Passw/hylo-lang-hylo

Repository files navigation

Val

Val is a research programming language to explore the concepts of mutable value semantics and generic programming for high-level systems programming.

This repository contains the sources of the reference implementation of Val. Please visit our website to get more information about the language itself.

Installation

This project is written in Swift and distributed in the form of a package, built with Swift Package Manager. You will need Swift 5.6 or higher to build the compiler from sources.

You may compile Val's compiler with the following commands:

swift build -c release

That command will create an executable named valc in .build/release. That's Val compiler!

Implementation status

This project is under active development; expect things to break and APIs to change.

The compiler pipeline is organized as below. Incidentally, early stages of this pipeline are more stable than later ones. (Note: completion percentages are very rough estimations.)

  1. Parsing (100%)
  2. Type checking (50%)
  3. IR lowering (30%)
  4. IR analysis and transformations (30%)
  5. Machine code generation (20%)

You can select how deep the compiler should go through the pipeline with the following options:

  • --emit raw-ast: Only parse the input files and output an untyped AST as a JSON file.
  • --typecheck: Run the type checker on the input.
  • --emit raw-ir: Lower the typed AST into Val IR and output the result in a file.
  • --emit ir: Run mandatory IR passes and output the result in a file.
  • --emit cpp: Produce a C++ source file.
  • --emit binary (default): Produce an executable
    • Note: by default, C++ files will be compiled with Clang. Use --cc {CXX compiler} to use another compiler.
    • Note: You can specify parameters for the CXX compiler to use (e.g., --cc-flags O3).
      • Note: Don't add an extraneous -, please use O3 instead of -O3.
      • Note to MSVC users: Don't add an extraneous /, please use O1 instead of /O1.
      • Note: You can also add more than one such option (e.g., --cc-flags O1 --cc-flags g).
      • Note: Do not use --cc-flags to specify output locations; use -o instead.
    • Note to MSVC users: be sure to use Visual Studio Developer Command Prompt or Visual Studio Developer PowerShell.

For example, valc --emit raw-ast -o main.json main.val will parse main.val, write the untyped AST in main.json, and exit the pipeline.

A more detailed description of the current implementation status is available on our roadmap page.

Related video and audio

Lightning Talk: An Object Model for Safety and Efficiency by Definition - Dave Abrahams CppNorth 22

Keynote: A Future of Value Semantics and Generic Programming Part 1 - Dave Abrahams - CppNow 2022

Keynote: A Future of Value Semantics and Generic Programming Part 2 - Dave Abrahams & Dimi Racordon - CppNow 2022

Value Semantics: Safety, Independence, Projection, & Future of Programming - Dave Abrahams CppCon 22

Val and Mutable Value Semantics - Dimi Racordon

Contributing

We welcome contributions to Val. Please read through CONTRIBUTING.md for details on how to get started.

License

Val is distributed under the terms of the Apache-2.0 license. See LICENSE for details.

About

The Hylo programming language

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 97.4%
  • Python 1.8%
  • Other 0.8%