Giter Club home page Giter Club logo

pisces's Introduction

pisces <>< Build Status

What is pisces?

I wanted to learn how to write a compiler in Haskell using parser combinators. So pisces is a very basic programming language with the syntax inspired a little bit by the Rust programming languge. The compiler provided in this repository targets LLVM and emits LLVM assembly language.

A simple pisces program looks like this (extern functions calls are not yet implemented, so no "Hello World" ๐Ÿ˜ž):

fn add(a: i64, b: i64) -> i64
{
  var c: i64 = a + b;
  return c;
}

fn main () -> i64
{
  return add(4, 5);
}

Usage

In order to build it you need LLVM 5.0. From here it's just stack build.

Compile and run a program:

stack exec pscsc main.pscs
llvm-as a.ll
lli a.bc

To build a native executable:

...
llc -filetype=obj a.bc
clang a.o
./a.out

Documentation

pisces's People

Contributors

fpar avatar

Stargazers

 avatar  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.