Commit Graph

49 Commits

Author SHA1 Message Date
Stephen Chang
31c3bba5c9 add current-host-lang; fix reuse to work with non-strs
- other various stx conveniences
- provide more require/provide forms in default mod-beg
- fix tests and examples to work with current-host-lang
2017-03-22 17:04:48 -04:00
Stephen Chang
01799a12da add with-ctx shorthand 2017-03-21 17:55:45 -04:00
Stephen Chang
3d9ef8424c start dependent types example 2017-03-10 17:03:30 -05:00
Stephen Chang
0bccf822ad type= handles literals 2017-03-06 13:21:49 -05:00
Stephen Chang
8be9371ed2 fix mlish chameneos test 2017-02-17 11:27:58 -05:00
Stephen Chang
f68308c38d fix stx->datum 2017-02-16 17:59:56 -05:00
Stephen Chang
fd389086ef increase timeouts for typeclass tests 2017-02-08 13:27:53 -05:00
Stephen Chang
115aae8e73 completely separate type and kind api, etc; generalize type environment
Previously, "type" functions were reused a lot to manipulate kinds, and other
metadata defined via `define-syntax-category`, but this meant it was impossible
to define separate behavior for some type and kind operations, e.g., type=? and
kind=?. This commit defines a separate api for each `define-syntax-category`
declaration.

Also, every `define-syntax-category` defines a new `define-NAMEd-syntax` form,
which implicitly uses the proper parameters, e.g., `define-kinded-syntax` uses
`kindcheck?`, `current-kind-eval`, and the ':: kind key by default (whereas
before, it was using typecheck?, type-eval, etc).

This commit breaks backwards compatibility. The most likely breakage results
from using a different default key for kinds. It used to be ':, the same as
types, but now the default is '::.

This commit also generalizes the contexts used with `define-NAMEd-syntax` and
`infer`.
- all contexts now accept arbitrary key-values associated with a variable
- all contexts use let* semantics, where a binding is in scope for subsequent
  bindings; this means that one environment is sufficient in most scenarioes,
  e.g., type and term vars can be mixed (if properly ordered)
- environments allow lone identifiers, which are treated as type variables by
  default
2017-02-08 13:07:24 -05:00
Stephen Chang
ba15bbd32f delete ad-hoc "run all" test scripts; use raco test instead
- add test-include-paths to run mlish test files
2017-01-25 21:22:06 -05:00
Stephen Chang
9c0b046d54 add some test timeouts 2017-01-25 16:36:46 -05:00
Stephen Chang
6618f0e038 remove dependency on typed racket and sweet-exp 2017-01-25 10:47:42 -05:00
AlexKnauth
232127da6f transfer srclocs so that check-syntax arrows work 2017-01-13 16:56:24 -05:00
Stephen Chang
995926e735 do some optimizations in typecheck.rkt: as much as 85% speedup in benchmarks
- move 'env prop logic to infer.rkt
- eliminate some dup expands (eg type-evals)

some before/afters --------------------
macrotypes/run-all-tests:      2m11s/20s 85%
macrotypes/mlish-general:      117s/34s  71%
macrotypes/mlish-shootout/rwo: 81s/31s   62%
macrotypes/mlish-typeclasses:  179s/149s 17%
turnstile/run-all-tests:       2m31s/29s 81%
turnstile/mlish-general:       139s/46s  67%
turnstile/mlish-typeclasses:   181s/155s 14%
2016-11-18 16:55:16 -05:00
Stephen Chang
ba1c954b96 start Bens "trivial" example 2016-10-18 17:08:25 -04:00
Stephen Chang
28fa5dd033 split def-kinded-stx from def-typed-stx; split any-type? from type?
- the former prevents using current-typecheck-relation at type/kind level
- the latter differentiates "well-formed" types (star)
  from valid types (any kind)
- move define-*ed-syntax and *-eval into define-syntax-category
- turnstile must wrap define-stx-category to define new define-*ed-syntax
- add any-*? pred and any-* stx class in def-stx-category
- fixes #44
- fixes #45
2016-10-14 14:16:49 -04:00
Stephen Chang
98568ceb99 add define-internal-type-constructor and define-internal-binding-type
- add fomega-no-reuse example
2016-10-13 21:21:05 -04:00
Stephen Chang
1c0fa751d6 split out a define-binding-type from define-type-constructor
- document #:arg-variances and variances; #:arr
- fixes #36
- start to split type constructor macro into (not working yet)
  - ty-: expands to expanded type representation
  - ty: performs kindchecking and expands to ty-
  - this makes it easier for programmers to implement their own kind
    system, but still get some turnstile conveniences like pat expanders
2016-10-13 15:20:30 -04:00
Stephen Chang
8a7d487e14 check if valid type when instantiating a type alias; fixed #5 2016-10-12 16:13:45 -04:00
Stephen Chang
a3433b9193 remove * version of pattern expanders 2016-10-12 14:10:03 -04:00
Stephen Chang
691ba9c51c Turnstile forms no longer automatically provide; add type-out
- not auto-providing more closely adheres to idiomatic Racket
- this commit changes:
  - define-typed-syntax
    - removed #:export-as option
  - define-base-type
    - removed #:no-provide option
  - define-type-constructor
    - removed #:no-provide option
- type-out helps with providing defined types
- in examples, move define and define-type-alias to ext-stlc
- fix bug in reuse where renamed id not provided
2016-10-12 10:46:05 -04:00
Stephen Chang
639a34c678 hide some test scripts from raco test
- these files should be manually run
- this hopefully prevents timeouts on the pkg server
2016-10-11 10:28:08 -04:00
Stephen Chang
fc5731de00 dont auto provide define-primops; add typed-out 2016-10-09 18:12:12 -04:00
Stephen Chang
8cce856e08 dont compile tests during install 2016-10-07 10:20:08 -04:00
Stephen Chang
362b0f310d manually merge mlish.rkt from adhoc branch to mlish+adhoc.rkt 2016-10-03 14:28:15 -04:00
Stephen Chang
da21e04a60 delete some temporary examples 2016-09-30 12:53:36 -04:00
Stephen Chang
e308dad709 add more #:no-provide options; add eval'ed doc examples
- cant get scribble/example to automatically catch and print type errs
2016-09-29 16:04:47 -04:00
Stephen Chang
df4c26dd8d type=? handles binding types by default
- closes #32
2016-09-29 14:27:17 -04:00
Stephen Chang
df63a0bf57 predefine "type" stx-category and define-primop in typecheck.rkt (and turnstile) 2016-09-24 16:43:17 -04:00
Stephen Chang
088635c33a check define-typed-stx has > 0 clauses to match stx-parse; add other paper abbrvs 2016-09-24 15:12:45 -04:00
AlexKnauth
ccdb667fac move default-type-eval into typecheck.rkt 2016-09-17 09:15:41 -04:00
Stephen Chang
60fa8ab91f fix syntax taint errs produced by srcloc workaround in #%app 2016-08-31 12:58:56 -04:00
Stephen Chang
10a143a16d add verify, evaluate; and debug, render in separate libs 2016-08-30 16:58:15 -04:00
Stephen Chang
efbf03c258 start stlc+union 2016-08-22 09:30:30 -04:00
Stephen Chang
f7b4dde15b fix more src locs in typecheck.rkt 2016-08-22 08:58:44 -04:00
Stephen Chang
3707d90531 enable use of define-type-alias in language implementations
- using \tau.norm in define-type-alias implementation causes
  "invalid type" errors when the file is compiled
2016-07-20 18:44:15 -04:00
Stephen Chang
f90c464a19 disable some overloading tests to avoid marshalling error 2016-07-20 18:40:51 -04:00
Stephen Chang
e17ae9e5fe update extends and reuse in typecheck.rkt to:
- support paths instead of filenames
- require prefix-in by default
- fix srclocs of extends
2016-07-19 15:42:35 -04:00
Stephen Chang
2f60ad5e27 finish typed-bv lang: typechecks all easy/med/hard tests 2016-07-19 11:48:43 -04:00
Stephen Chang
990619e9c9 turnstile provides postfix-in 2016-07-11 19:23:54 -04:00
AlexKnauth
d59c510941 factor out do-tests macro 2016-07-01 12:43:01 -04:00
AlexKnauth
1d50b065b9 copy over the rest of the mlish tests 2016-07-01 12:05:26 -04:00
AlexKnauth
7677a6de28 copy over the rest of the non-mlish tests 2016-06-30 18:23:52 -04:00
AlexKnauth
a8f1634baa start copying tests over to macrotypes/examples/tests 2016-06-30 17:42:23 -04:00
AlexKnauth
6e2f9a4a16 implement occurs check 2016-06-28 14:01:54 -04:00
AlexKnauth
310087cc97 implement turnstile/examples/infer.rkt 2016-06-28 14:01:28 -04:00
AlexKnauth
da3ecfa780 refactor type-constraints a bit 2016-06-28 13:51:50 -04:00
AlexKnauth
103086a62c rename typed-lang-builder -> turnstile 2016-06-28 13:35:51 -04:00
AlexKnauth
644deddc5f fix lam-testing.rkt 2016-06-28 13:23:02 -04:00
AlexKnauth
358f997065 reorganize 2016-06-28 13:22:58 -04:00