Giter Club home page Giter Club logo

emblem-lang's Introduction

Emblem

Emblem is static language that compiles to JavaScript.

Emblem Source

    scope {
        int l = 0
        string f

        l = 3 + 3 * 3
        f = 'foo' * 2

        bool o = true == true
        o = 2 != 2 && 'foo' == 'foo'

        string m = 'Hello World'
        int len = #m

        int i = 2
        i += 4
    }

Resulting JavaScript

    {
        var l = 0;
        var f = '';
        l = 3 + 3 * 3;
        f = (new Array(2 + 1).join('foo'));
        var o = true === true;
        o = 2 !== 2 && 'foo' === 'foo';
        var m = 'Hello World';
        var len = m.length;
        var i = 2;
        i = (i + 4);
    }

Development Status

The Project just started, only initial development is done.

Belows a list of upcoming milestones and their targets.

  1. Milestone

    • Compile in emblem runtime on demand

    • Finish support for slicing operators - Done

    • Support list literals and slicing - Done

    • Support map literals - Done

      • Map keys must be int or string or castable to any of those two - Done
      • Support weakmaps?
    • Add full import / export support - Halfway Done

  2. Milestone

    • Support ranges
    • Support constant variables
    • String interpolation
  3. Milestone

    • Add support for warnings
      • warn about re-defined operators
  4. Milestone

    • Support if / else / elif
    • Support try / except / finally
    • Support forin
  5. Milestone

    • Support properties
    • Support struct types
  6. Milestone

    • Support functions
    • Allow for overloading call operator

Below's a extremely incomplete listing of other both done and outstanding tasks.

Type System

  • Primitives

    • bool ✓
    • int ✓
    • float ✓
    • string ✓
    • Grammar for Declarations ✓
  • Operator Overloading

    • Infix Operators and code gen ✓
    • Unary Operators and code gen ✓
    • Postfix Operators and code gen ✓
    • Index Operators and code gen ✓
    • Call "Operator" and code gen
  • Lists

    • Grammar for declarations ✓

    • Grammar for list literals ✓

      • Validation of type unity in list literals ✓
    • Compile time generation item type variants ✓

  • Maps

    • Grammar for declarations ✓

    • Grammar for map literals ✓

      • Validation of key/value type unity in map literals ✓
    • Compile time generation of different key/value pair variants ✓

  • Properties and Functions on Types

  • Structs

    • Basic Structs
    • Struct Inheritcance
    • Default Values
  • Functions

    • Support for "function" typed variables
    • Support for signature validation
    • Support for closures and compile / run time function generation
  • Classes

    • Support of "nullables" (still undecided whether or not to have nullables)
    • Support for "class" typed variables
    • Grammar for Class Statement
    • Grammar for Class Expression
    • Definition of operator overloading

Others

  • Compiler errors show token / source code region of error

  • Module System

    • Basic import / export for testing ✓
    • Fully, correct working import / export system (probably Python alike)
      • missing export as module support and module type with constant properties for correct lookup

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.