GithubHelp home page GithubHelp logo

davidgregory084 / inc Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 1.0 57.65 MB

Experiments with incremental compiler construction on the JVM

License: Apache License 2.0

Scala 93.89% Java 3.28% C++ 0.22% Shell 0.57% PHP 0.16% Emacs Lisp 1.02% HTML 0.03% NASL 0.04% ASL 0.68% Pascal 0.09%
compiler compiler-construction functional-programming jvm jvm-languages

inc's People

Contributors

davidgregory084 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

retronym

inc's Issues

Write generators for arbitrary well-typed polymorphic programs

At the moment we have Scalacheck generators for arbitrary well-typed programs but they are very simple and do not exercise any polymorphic code.

It would be very useful to figure out a way to generate arbitrary polymorphic programs so that we can ensure that well-typed polymorphic programs can be compiled.

Write generators for arbitrary ill-typed programs

At the moment we have generators for arbitrary well-typed monomorphic programs. This enables us to test to a limited degree that well-typed programs can be compiled successfully, but it does not provide any reassurance that ill-typed programs will fail compilation.

The only way that I have seen others do this is to generate well-typed programs and then make some small change to the program which breaks one of the inference rules for the type system. This is likely to be very tricky!

Use a union find data structure for type unification

This is the canonical way to implement type inference algorithms with decent performance.

There are several implementations of union find in the Scala ecosystem (e.g. DisjointSets in typelevel/cats-collections) but it may be better to use or implement a mutable one.

Improve parse errors for delimited literals e.g. chars, strings

The test suite generated a random program like so:

module Test.Main.Ku2h6o { let xm = (); let ef = (xg, ufl, m) -> ''' }

I haven't added support for char escapes yet. I changed this to

module Test.Main.Ku2h6o { let xm = (); let ef = (xg, ufl, m) -> '' }

and the output was even more unhelpful than usual. Probably need a special case for chars and strings to avoid this.

Add pretty printing functionality for displaying annotated sources

At the moment there are two formats in which trees can be printed:

  • As pretty-printed sources using functionality provided by typelevel/paiges
  • As pretty-printed Scala data structures using lihaoyi/pprint

The difficulty with this is that the pretty-printed sources display nothing related to the metadata embedded in the trees, whereas the pretty printed Scala data structures are far too difficult to read and interpret.

It would be nice to have some functionality to pretty print the trees as inc source but with name and type annotations added inline.

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.