Giter VIP home page Giter VIP logo

voile-rs's Introduction

voile-rs

Crates.io Crates.io Crates.io docs.rs Actions Status dep-svg

Voile is a dependently-typed programming language with a non-dependent version of row-polymorphism, meta variable resolution and implicit parameter syntax. For language description, please head to the docs.rs page.

Voile is the language after minitt, and the next language after Voile is Narc.

Resources

  • Docs.rs documentation, including KaTeX-rendered typing rules
  • Change Log, useful resource for tracking language evolution
  • IntelliJ Plugin, which can export your code as clickable HTML
  • Code Examples, which also acts as integration test suites
  • Utilities Library, a rust crate extracted from Voile's implementation with some util codes
  • Binary Download on GitHub Actions page for Windows, Ubuntu and macOS

The most good-looking example is this one.

Install

The most recommended way of installation is to download the prebuilt binaries from GitHub Actions page. Here's how to find them.

You can install the voile type-checker by this command (cargo installation and rust stable toolchain are assumed):

cargo install voile --bin voilec

After installation, you can type-check a voile file by:

voilec [filename]

You can also start a REPL:

voilec -i

Progress

  • Basic dependent type (minitt-rs things)
  • Universe level support
  • Row-types and kinds
  • Record constructor
  • Record projection
  • Variant constructor
  • Variant eliminator (case-split)
  • Implicit arguments

voile-rs's People

Contributors

anqurvanillapy avatar ice1000 avatar oraluben avatar oxalica avatar zaoqi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

voile-rs's Issues

Code cleanup

Remove these things:

  • TCS::compile
  • eval::Strategy

Use use abs::Abs::* in check::check_type.

Focuses of this new PoC language

This is intended to be a discussion thread about focuses of Voile.

There is also a bikeshedding here: do we need to change the org name to owo-lab for storing these kinds of PoC languages?

Is lambda dbi instantiation really correctly implemented?

First of all, \x.\y.y is Lam(Lam(Dbi(0)).
Instantiate this (e.g. with a value 114514), according to our current strategy, will produce Lam(114514), which means that our implementation is evaluating (\x.\y.y) 114514 to \y.114514.

Junk! Need to fix it asap.

Remove implicit parameters

Due to the presence of Abs, we won't be able to resolve implicit parameters when translating String-based variables to DBI, thus giving up implicit parameters.

Why isn't `VecDbiEnv` a `Vec`?

We can replace VecDbiEnv with a Vec.

These codes are affected:

voile-rs/src/cli/mod.rs

Lines 24 to 36 in 12194c7

// Translate to abstract syntax
// todo: some confusion: https://github.com/owo-lang/voile-rs/commit/237b422574e2d1d2b0446b12303812269cff0b34#r33261393
let abs = trans_decls(ast)
.map_err(|err| eprintln!("{}", err))
.unwrap_or_else(|()| {
eprintln!("Translate failed.");
std::process::exit(1)
})
.iter()
.fold(Vec::new(), |mut vec, (index, decl)| {
vec[*index] = decl.clone();
vec
});

let decl = ctx.remove(&0).unwrap();

let decl = ctx.remove(&1).unwrap();

after all these we can start testing our trans/check functions

Variant semantics?

ConsType(SyntaxInfo),

Currently there's only a label -- without a type expression that represents its argument type.

If I write an expression 'Label ParamType, it'll be parsed as App(ConsType(Label), Expr(Ident)),
which indicates that the type of 'Label is Lam(Type /* param type */, Sum(Ref(0 /* DBI */))), right?

Does that look good to you guys?

Assigned people are supposed to participate the discussion.

`Axiom` should have its own type

Because an axiom can be unimplemented (recursive-calls) or postulated. There can be many kinds of axioms.

Extracting a standalone type will also be helpful for map_axioms.

Unsafe compile

We need a way to compile abs to core without typechecking.

This is useful when we can successfully infer the type of some expressions but we also need their values. These expressions are supposed to be well-typed thus can be unsafe-compile.

Redesign abstract syntax

Currently, we have already got DBI in our abstract syntax.
This is causing problems -- type checking against DBI-based lambdas is difficult.

I want to redesign the abstract syntax according to MiniAgda, which have a similar architecture of Voile (Concrete (syntax-checked), Abstract (scope-checked), Value (type-checked)) but does not use DBI in abstract. Instead, it uses DBI in values but UIDs in abstract.

Desugar state

Currently, the desugar functions have too many repetitive parameters:

  • env
  • global_map
  • local_env
  • local_map

Consider putting them together.

Lambda syntax design & parser

Let's vote.

Option 0 (Haskell, add a ๐ŸŽ‰ to vote for this):

\x -> x
\x y -> y x

Option 1 (Idris, add a ๐Ÿš€ to vote for this):

\x => y
\x => \y => y x

Option 2 (Mini-TT, add a โค๏ธ to vote for this):

\x. x
\x y. y x

Basic REPL

BTW we need to improve the "type check successful" message according to Voile herself:

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.