GithubHelp home page GithubHelp logo

doytsujin / micro-mitten Goto Github PK

View Code? Open in Web Editor NEW

This project forked from doctorn/micro-mitten

0.0 1.0 0.0 88 KB

you might not need your garbage collector

Home Page: https://mitten-lang.org/

License: GNU General Public License v2.0

Rust 99.89% Shell 0.11%

micro-mitten's Introduction

micro-mitten

metal's too hot? wear a mitten!

Build Status

micro-mitten??

micro-mitten is a bare-bones Rust-like programming language, stripped down to simplify control-flow structures and the type system.

Like Rust, micro-mitten offers a static approach to memory management; however, micro-mitten's approach is significantly different from Rust's. Rather than depending on single ownership and a complex lifetime system, micro-mitten uses a series of data-flow analyses to statically approximate heap liveness. This means that it maintains the ability to insert freeing code at appropriate program points, without putting restrictions on how you write your code. The theory behind the approach is documented in this thesis (Proust 2017).

Long story short, this is an attempt to see if we really can have unrestrictive compile-time garbage collection.

How can I use it?!

The project depends on libgc and the LLVM-8 toolchain. Cloning this repository and running the following should get you set up with a working copy of mmtnc (the micro-mitten compiler).

./tools.sh # installs `mitten-test`, `mitten-bench`, `knit` and the language runtime
cargo install --path ./ --force # installs `mmtnc`

mmtnc compiles .mmtn files to LLVM IR (.ll) and just dumps the textual representation. Much more helpfully, you can get binaries directly using knit. To build a binary (example) from a source file (example.mmtn) use:

knit --src example.mmtn --gc-strategy=proust 

The --gc-strategy argument is optional, but the default is to use no garbage collection (your computer will hate you). The other options are proust (uses static memory management) and bdw (uses libgc).

Notes

To get an idea of the language syntax, check out the examples in src/test/. If you get something wrong, the compiler shoud moan at you. Otherwise, please open an issue!

Please note, micro-mitten is purely a research language and its performance is not brilliant when using static memory management. For a full run-down, see my dissertation. Most of the examples in src/test/ will run with static memory management, but there are some notable exceptions and one or two memory leaks.

micro-mitten's People

Contributors

doctorn avatar

Watchers

 avatar

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.