flp: A layout spec language for memory managers implemented in Rust.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Please see the README on GitHub at https://github.com/cronburg/flp#readme


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.0.0
Change log ChangeLog.md
Dependencies array (>=0.5.3.0 && <0.6), base (>=4.7 && <5), containers (>=0.6.0.1 && <0.7), deepseq (>=1.4.4.0 && <1.5), flp, haskell-src-meta (>=0.8.3 && <0.9), pretty-simple (>=2.2.0.1 && <2.3), prettyprinter (>=1.2.1.1 && <1.3), template-haskell (>=2.14.0.0 && <2.15), th-lift (>=0.8.1 && <0.9), transformers (>=0.5.6.2 && <0.6) [details]
License MIT
Copyright 2019 Karl Cronburg
Author Karl Cronburg
Maintainer karl@cs.tufts.edu
Category Compiler
Home page https://github.com/RedlineResearch/floorplan#readme
Bug tracker https://github.com/RedlineResearch/floorplan/issues
Source repo head: git clone https://github.com/RedlineResearch/floorplan
Uploaded by KarlCronburg at 2020-01-27T23:18:28Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for flp-0.1.0.0

[back to package description]

Floorplan compiler

A language for specifying the layout of a one-dimensional address space, particularly for garbage collectors and manual memory managers written in Rust.

Building and running

Floorplan is written in Haskell and must be built with stack. Once you have stack installed on your system, you should be able to run the build command and everything should just work:

$ stack build
...
Completed 2 action(s).

At which point you can compile the file examples/immix/layout.flp with the build-immix script:

$ ./build-immix
...
   Compiling immix_rust v0.0.1 (/home/karl/w/flp/examples/immix)
   Finished dev [unoptimized + debuginfo] target(s) in 4.56s

This script ensures the Floorplan compiler is built, installs it for your current user, and then builds the Immix project which itself invokes the Floorplan compiler to build the file examples/immix/src/heap/layout.flp.

In order to run the compiler against some other .flp file, the compiler can be run directly as follows:

stack exec flp [path/to/layout.flp] [path/to/generated.rs]

Note that in order to subsequently build a Rust file generated in this manner, you must include the flp-framework to your Cargo dependencies, and flp-compiler to your cargo build-dependencies. The later is simply a wrapper for calling out to the (already stack-installed) flp compiler, and the framework crate contains necessary macros and address types that generated Rust code uses.

The skeleton of a Rust cargo project is given in the gen/ directory of this repo, which can be copied over and modified to support the needs of a memory manager other than immix-rust.

Dependencies

A customized version of the language-rust package is included in the deps/ directory of this repo, which adds support for directly splicing of host language expressions into quasiquoted Rust code. This is the mechanism by which Floorplan generates Rust code.

Testing and contributing

If you want to help maintain or contribute new code to this project, feel free to make a pull request or better yet start an issue in the the Issues tracker so that you can get our feedback along the way. A number of avenues for work on the compiler exist, including but not limited to: