Giter Club home page Giter Club logo

refscript's People

Contributors

benjamincosman avatar ddeunagomez avatar panagosg7 avatar ranjitjhala avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

refscript's Issues

Catch `tsc` errors

rsc should catch type-checking (or other errors) thrown by tsc
and raise them and exit gracefully. This will let us (eventually) use
rsc as a drop in replacement for tsc.

See for, example: tests/todo/tscErr.hs

(This may be a good project for @bmcfluff to dip his toes in the code base.)

Var init

@panagosg7 why is this not supported? There is no reason we can't handle this, adding a bogus "undefined" assignment is bad because

https://github.com/UCSD-PL/RefScript/blob/varinit/tests/pos/misc/init-00.ts
https://github.com/UCSD-PL/RefScript/blob/varinit/tests/pos/misc/init-01.ts
https://github.com/UCSD-PL/RefScript/blob/varinit/tests/pos/misc/init-02.ts

A. it forces us to weaken the type (to X + undefined) and
B. that weakened union pervades throughout and is in general unnecessary.

The whole point of the SSA was to support potentially different types and undefined vars in exactly these kinds of cases...

`in` operator

Slow startup due to tsc?

Why things are taking so long. e.g.

time rsc tests/pos/simple/error.ts

5.62 real         5.40 user         0.16 sys

The actual body of the file is just

throw new Error("");

And so, the time in fixpoint is instantaneous.

This is not the biggest issue but worth looking into at some point...

Never mix `scrapeQualifiers` into cons-gen

We should not be mixing scrapeQualifiers into constraint generation, that should be a strictly external and heuristic process. In other words, scrapeQualifiers should not ever be (transitively) called from consNano and code like:

consCall g l fn es ft0 
  = do (xes, g')    <- consScan consExpr g es
       -- Attempt to gather qualifiers here -- needed for object literal quals
       ts           <- mapM scrapeQualifiers [envFindTy x g' | x <- xes]

should be undone.

Variadic calls

Managing union refinements

It turns out it's not safe to even drop the refinements of the union top-level to the parts of the union:

{ t1 + t2 + ... | p } ---> { t1 | p } + { t2 | p } + ...

The reason is that p could include predicates of the form v = x which would cause "sort mismatch" if dropped to the tis. Even dropping a K-var could be dangerous as a seemingly non-existing predicate of that sort could emerge as part of a K-var instantiation and violate a sort check.

Here's an example that throws an exception due to sort mismatch:

https://github.com/UCSD-PL/RefScript/blob/union_preds/tests/pos/unions/noundef-02.ts

Primitive BitVector support

Examples:
https://github.com/UCSD-PL/RefScript/blob/master/tests/pos/simple/bitVector.ts
https://github.com/UCSD-PL/RefScript/blob/master/tests/neg/simple/bitVector.ts
Are working already but with manual manipulation of bitvectors.

Also:
https://github.com/UCSD-PL/RefScript/blob/master/tests/todo/features/bitVector.ts
Is not working yet, because we haven't encoded axioms like:

 a non-zero number has at least one bit non-zero

or

A & B has at most as many 1s as A or B has

and so on

`map` and `filter` on arrays

See:

https://github.com/UCSD-PL/RefScript/blob/arrayspec/tests/pos/arrays/map-00.ts
https://github.com/UCSD-PL/RefScript/blob/arrayspec/tests/pos/arrays/map-01.ts
https://github.com/UCSD-PL/RefScript/blob/arrayspec/tests/pos/arrays/filter-00.ts
https://github.com/UCSD-PL/RefScript/blob/arrayspec/tests/pos/arrays/filter-01.ts

The first of the filter tests, is actually about subtyping: currently we get:

/Users/rjhala/research/liquid/RefScript/tests/pos/arrays/filter-00.ts:14:28-14:34: Error: TC-ERROR
Function type '(x:number + undefined) => boolean' is not a subtype of '(x:number) => boolean'

but of course, the subtyping does hold...

Polymorphic types and subtyping

Assume we have a type:

interface A {
  c: int;
  f: forall T . (T) => T; 
}

Then for doing the subtyping:

A <: { f: (int) => int }

we'd have to first unfold A into

{
  c: number;
  f: forall T . (T) => T; 
}

Then deeply instantiate all quantified types:

{
  c: number;
  f: (T0) => T0; 
}

Unify: T0 := int

Finally, do the subtyping:

{ c: number; f: (T0) => T0; } [T0: int] <: { f: (int) => int; } ~> UPCAST

Example:
https://github.com/UCSD-PL/RefScript/blob/poly-subt/tests/pos/simple/contextual.ts

Errors while parsing TS specs.

Currently when running the following

I get the following parse errors:

$ rsc liquid keys-0.ts 
EXEC: tsc --outDir ./.liquid --refscript keys-0.ts
rsc: Error while parsing: "forall T . ( map: {  } ) => [ string ]"
At position: /Users/rjhala/research/liquid/rs-benchmarks/d3/src-ts/arrays/keys-0.ts:3:15-7:2
$ rsc liquid values-0.ts 
EXEC: tsc --outDir ./.liquid --refscript values-0.ts
rsc: Error while parsing: "forall T . ( map: {  } ) => [ T ]"
At position: /Users/rjhala/research/liquid/rs-benchmarks/d3/src-ts/arrays/values-0.ts:3:17-7:2
$ rsc liquid entries-0.ts 
EXEC: tsc --outDir ./.liquid --refscript entries-0.ts
rsc: Error while parsing: "forall T . ( map: {  } ) => [ { key: string; value: T } ]"
At position: /Users/rjhala/research/liquid/rs-benchmarks/d3/src-ts/arrays/entries-0.ts:3:18-7:2
$ rsc liquid permute-0.ts 
EXEC: tsc --outDir ./.liquid --refscript permute-0.ts
rsc: Error while parsing: "forall T . ( array: [ T ], indexes: [ number ] ) => [ T ]"
At position: /Users/rjhala/research/liquid/rs-benchmarks/d3/src-ts/arrays/permute-0.ts:3:18-7:2

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.