Skip to content

vanam/rust2llvm

Repository files navigation

falsum -- Rust to LLVM compiler

Created for educational purposes!

This project aims to create educational compiler from Rust language to LLVM in Haskell.

Dependencies

  • Haskell - sudo apt-get install haskell-platform
  • clang - sudo apt-get install clang
  • llvm-3.8 - sudo apt-get install llvm-3.8 libedit-dev

How to compile and run programs in LLVM source inputs

LLVM source files have *.llvm file extension. Files can be compiled using clang.

clang hello.ll -o hello

Development

Stack Tool

It's a management tool (similar to cabal). Here is a guide for the installation.

Build & Run

How to build our falsum app:

stack build

How to run it:

stack exec falsum

Tests

Tests are executed by:

stack test

Source code formatting

You have to install hfmt:

stack install hfmt

and run the formatting itself:

stack exec hfmt -- -w

Licence

The MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published