Code Monkey home page Code Monkey logo

elmc's Introduction

A compiler for the Elm language written in ANSI C99.

Usage

The compiler is intended to be used either as a standalone compiler and virtual machine for executing Elm code, or embedded as a static or dynamic library in a larger program.

Features

The compiler is currently targeting Elm 0.19, but is not yet feature complete.

Language features

The following core language features have been implemented so far:

  • Single line comments
  • Multiline comments
  • Boolean literals
  • Int and Float literals
  • String and Char literals
  • Multiline string literals
  • Expressions
  • Indentation sensitive parsing
  • Infix operators
  • Lists
  • Tuples
  • Records
  • If-then-else conditionals
  • Case-of conditionals
  • Pattern matching
  • Function declarations
  • Anonymous functions
  • Structural typing (function arguments)
  • Function application
  • Higher-order functions
  • Arithmethic operators with type inference
  • Let expressions
  • Modules
  • Qualified imports
  • Type annotations
  • Type aliases
  • Custom types
  • Ports
  • Effect managers

Kernel

The kernel contains native implementations of some core functions used by packages in the elm namespace (e.g. elm/core and friends). These packages typically contain native code written in Javascript. The elmc compiler instead provides versions of these functions written in C or Assembler.

Optimizations

When compiling Elm code the compiler will generate an Intermediate Representation (IR) of the source code. This IR is then analysed and optimized before being passed to the code generator step. The following optimizations are currently implemented:

Just-in-Time (JIT) compiler

After the optimization step the IR is transformed to executable machine code by the JIT compiler.

elmc's People

Contributors

niho avatar

Stargazers

 avatar  avatar

Watchers

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