Giter Club home page Giter Club logo

boreal's Introduction

Boreal

Syntax

The syntax is Haskell-like.

module Expressions where

type MyBool = MyTrue | MyFalse

expr x = x * 2 + 3

fun =
  let x = 3
   in x + 1

and its most advanced backend produces Lua code:

-- Expressions
local prelude = dofile("/home/hecate/Code/boreal/build_/libs/Stdlib/Prelude.lua")

-- Sum types are created as tables with keys
local MyBool = {MyTrue = {}, MyFalse = {}}
local function expr(x)
    local prim_mul0 = x * 2
    return prim_mul0 + 3
end
local function fun()
    local x = 3
    return x + 1
end
-- Functions are then collected to produce an export list in the form of…
-- a table.
local Expressions = {fun = fun, expr = expr, MyBool = MyBool}

-- Importing this module within Lua makes the export list available
return Expressions

CLI

A rudimentary CLI is available.

$ cabal run boreal -- build tree-sitter-boreal/datatype-declaration.bor
$ cat build_/libs/Expressions.lua
-- Expressions
prelude = require("./build_/libs/Stdlib/prelude")

local Optimisation = {O1 = {},
                      O2 = {}}

Development

Consult the development wiki for more information

boreal's People

Contributors

kleidukos avatar dependabot[bot] 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.