All Projects β†’ vijayphoenix β†’ Compiler-written-in-Haskell

vijayphoenix / Compiler-written-in-Haskell

Licence: MIT license
A Turing complete language πŸ˜‰

Programming Languages

haskell
3896 projects

Projects that are alternatives of or similar to Compiler-written-in-Haskell

heyoka.py
Python library for ODE integration via Taylor's method and LLVM
Stars: ✭ 45 (+45.16%)
Mutual labels:  llvm, just-in-time
heyoka
C++ library for ODE integration via Taylor's method and LLVM
Stars: ✭ 151 (+387.1%)
Mutual labels:  llvm, just-in-time
JitCat
A C++17 library for parsing and executing expressions. Allows easy exposure of variables and functions from C++ through built-in reflection functionality.
Stars: ✭ 16 (-48.39%)
Mutual labels:  llvm, jit-compiler
dmjit
.dmJIT is a Rust-based JIT compiler using modified auxtools, dmasm and Inkwell LLVM wrapper for boosting Byond DM performance without any hassle! (formerly known as dm-jitaux)
Stars: ✭ 18 (-41.94%)
Mutual labels:  llvm, jit-compiler
Pure Lang
Pure programming language
Stars: ✭ 209 (+574.19%)
Mutual labels:  llvm, jit-compiler
llvm-hs-typed
Type Safe LLVM IR ( Experimental )
Stars: ✭ 47 (+51.61%)
Mutual labels:  llvm, llvm-hs
jingle
πŸ”” Jingle is a dynamically-typed, multi-paradigm programming language designed for humans and machines.
Stars: ✭ 34 (+9.68%)
Mutual labels:  llvm, jit-compiler
Clangkit
ClangKit provides an Objective-C frontend to LibClang. Source tokenization, diagnostics and fix-its are actually implemented.
Stars: ✭ 330 (+964.52%)
Mutual labels:  parsing, llvm
Batch-First
A JIT compiled chess engine which traverses the search tree in batches in a best-first manner, allowing for neural network batching, asynchronous GPU use, and vectorized CPU computations.
Stars: ✭ 27 (-12.9%)
Mutual labels:  llvm, jit-compiler
CastXMLSuperbuild
Build CastXML and its dependencies (LLVM/Clang)
Stars: ✭ 32 (+3.23%)
Mutual labels:  llvm
angel.co-companies-list-scraping
No description or website provided.
Stars: ✭ 54 (+74.19%)
Mutual labels:  parsing
pymlir
Python interface for MLIR - the Multi-Level Intermediate Representation
Stars: ✭ 84 (+170.97%)
Mutual labels:  llvm
anvill
anvill forges beautiful LLVM bitcode out of raw machine code
Stars: ✭ 228 (+635.48%)
Mutual labels:  llvm
SwiftTreeSitter
Swift wrappers for the tree-sitter incremental parsing system
Stars: ✭ 116 (+274.19%)
Mutual labels:  parsing
f-flat node
Fβ™­ (pronounced F-flat) is a toy language.
Stars: ✭ 22 (-29.03%)
Mutual labels:  toy-language
llvm-epp
Efficient Path Profiling using LLVM
Stars: ✭ 16 (-48.39%)
Mutual labels:  llvm
libvcs
βš™οΈ Lite, typed, pythonic utilities for git, svn, mercurial, etc.
Stars: ✭ 43 (+38.71%)
Mutual labels:  parsing
dr checker 4 linux
Port of "DR.CHECKER : A Soundy Vulnerability Detection Tool for Linux Kernel Drivers" to Clang/LLVM 10 and Linux Kernel
Stars: ✭ 34 (+9.68%)
Mutual labels:  llvm
llvm-hs-kaleidoscope
Kaleidoscope Tutorial using llvm-hs
Stars: ✭ 68 (+119.35%)
Mutual labels:  llvm-hs
kaliningraph
πŸ•ΈοΈ Graphs, finite fields and discrete dynamical systems in Kotlin
Stars: ✭ 62 (+100%)
Mutual labels:  parsing

Build Status CircleCI

Implementing a JIT Compiled Language with Haskell

About

The project aimed to implement a simple procedural language.
We named it HASKULL :-)
The frontend is written in Haskell and the backend it managed LLVM-hs-pure package.
The project extensively uses Monads, State Monads, Applicative functors and Transformers.

Built With

You will need GHC 7.8 or newer as well as LLVM 4.0.

Installation

Clone the repository:

git clone https://github.com/vijayphoenix/Compiler-written-in-Haskell.git

Browse to the directory where all the files of this repository are located.

Run the following command to build the project.

stack build 

Usage

Run the following command to get an interactive console.

stack repl

Type "main" in the interactive console.

Write any code using the following Syntax rules.

Syntax rules: 
[A] means optional arg. of type A .

All the symbol starting with lower-case letter are terminal(lexer units).
All the operators are left associative

Command = Expr ;
Expr : DeclarationStmt| FuncCallStmt | LiteralStmt | ifthenStmt | (Expr)

DeclarationStmt : ExternDecl

ExternDecl : extern Name([ArgList]) : Type 

Type : int 
VList: Name[, VList]

FuncCallStmt : Call 
Call : Name ( [Args] ) 

BinOpCallStmt : BinOpCall
BinOpCall : Expr Op Expr 

Op : + | - | * | / | ; | <
reserved keywords: int char def extern string if then else
Args : Expr[, Args]

LiteralStmt : IntLiteral 
IntLiteral  : integer

Name : ident
ArgList : Type Name[, ArgList]

Func : def Name([ArgList]) : Type { Command-list }
Command-list = Command [Command-list]

Command = Expr ;

Some sample example functions are provided in examples.txt file. For more insight on the language grammar, refer to Language.hs, AST.hs files.

Documentation

This project is documented under Haddock Documentation

To generate documentation run:

stack haddock

Authors

License

Acknowledgments

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].