Skip to content
This repository has been archived by the owner on Apr 13, 2021. It is now read-only.

mhuesch/poly-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

poly-rs

archived

this project has been moved to https://github.com/sacredcapital/ReputationDSL.

…​

a polymorphic language using Hindley-Milner type inference, based on on sdiehl’s poly_constraints language and his tutorial.

reimplemented in Rust 🦀 of course. and featuring LISP syntax for ease of parsing.

building & running

$ nix-shell

# enter repl
$ cargo run --bin polyi
< repl appears >
< ctrl-d to exit >

# interpret code from a file
$ cargo run --bin poly ./examples/ex1.poly
< output >

optional: building & running with lorri and direnv (more for developers)

  • install lorri

  • install direnv (including shell hook)

  • in root directory of project: direnv allow

you’ll probably need to start lorri daemon somewhere, so that builds with be evaluated.

the advantage of this approach is that lorri will constantly rebuild & manage nix dependencies, and will cache them nicely. nix-shell will sometimes leave you in a lurch if e.g. your network goes down and it decides it needs to re-fetch everything. lorri, by comparison, would just allow you to use an old build, and would wait to update the build when network access was restored.