GithubHelp home page GithubHelp logo

andongfan / mlscript-core-language Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hkust-taco/mlstruct

0.0 0.0 0.0 4.08 MB

Codebase for the paper "MLscript: Principal Type Inference in a Boolean Algebra of Structural Types"

Home Page: https://hkust-taco.github.io/mlscript-core-language

Scala 98.82% TypeScript 0.03% CSS 0.43% HTML 0.72%

mlscript-core-language's Introduction

This repository contains an implementation of the core language of MLscript, in a way that is faithful to the paper and that does not contain all the bells and whistles and extra features of the full MLscript.

MLscript Core Language

What would TypeScript look like if it had been designed with type inference and soundness in mind?

We provide one possible answer in MLscript, an object-oriented and functional programming language with records, generic classes, mix-in traits, first-class unions and intersections, instance matching, and ML-style principal type inference. These features can be used to implement expressive class hierarchies as well as extensible sums and products.

MLscript supports union, intersection, and complement (or negation) connectives, making sure they form a Boolean algebra, and add enough structure to derive a sound and complete type inference algorithm.

Running the tests

Running the tests only requires the Scala Build Tool installed. In the terminal, run sbt mlscriptJVM/test.

To run the regression tests continuously as you develop, launch the SBT shell first with sbt and then type ~mlscriptJVM/testOnly mlscript.DiffTests.

Running the demo locally

To run the demo on your computer, compile the project with sbt fastOptJS, then open the local_testing.html file in your browser.

You can make changes to the type inference code in shared/src/main/scala/mlscript, have it compile to JavaScript on file change with command sbt ~fastOptJS, and immediately see the results in your browser by refreshing the page with F5.

mlscript-core-language's People

Contributors

lptk avatar chengluyu avatar fo5for avatar twitu avatar meowcolm024 avatar mahzoun99 avatar elrouille 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.