Coder Social home page Coder Social logo

ayazhafiz / plts Goto Github PK

View Code? Open in Web Editor NEW
32.0 4.0 3.0 161.3 MB

A collection of programming languages and type systems.

Home Page: https://ayazhafiz.com/plts

OCaml 90.87% Makefile 0.21% Forth 0.02% Shell 0.46% Dockerfile 0.11% JavaScript 0.94% TypeScript 6.53% CSS 0.03% Standard ML 0.12% Agda 0.03% Vim Script 0.01% FLUX 0.02% HLSL 0.08% MDX 0.58%
programming-language-theory type-systems programming-language compiler interpreter

plts's Issues

[gtlc] Optimize: remove unused parameters/variables

Finding unused variables is trivial, but removing them safely is trickier. If we remove an unused parameter, we need to update all places a value for that parameter is passed, which is non-trivial to figure out (consider using a graph representation of types here to make this easier; we only need to update the type once and then look at all values elaborated with that type).

The other issue to be careful of is the interaction with references. This is best illustrated by an example; consider the program

let a = ref (\x: _. 0) in
a := (\x: nat. x);
!a 1

applying the optimization naively would yield

let a = ref (\: 0) in
a := (\x: nat. x);
!a ()

but the problem is that a now has the type ref ([] -> nat), but then assigned a value of type [nat] -> nat, and the optimized-away call at the end is now unsound.

Nevertheless there are ways to handle this; as an initial pass, we could simply avoid modifying functions later used inside references.

[gtlc] Better UX for inferred types

  • Mark inferred types as `T, not just when being inferred
  • Autofix/hover provider to show inferred type in playground
  • Make program expression printing prettier

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.