core-typed

Typed Clojure, an optional type system for Clojure
2020-02-15T02:07:05.063100Z

@whilo turnstile's been a big inspiration for where it's heading. the main difference is that turnstile actually integrates into racket's macroexpander, core.typed will manage it's own macroexpansion. plus, a turntile typing rule is a macro+typing rule rolled into one, a core.typed rule is a typing rule, and the macro is a separate entity

2020-02-15T02:09:54.064200Z

I mean, turnstile is way more sophisticated because it stands on the shoulders of racket's hygienic expander. in comparison I'm doing pretty straightforward things.

2020-02-15T02:10:31.065Z

the important thing I learnt from turnstile is the main difference between a macro and a typing rule is the latter has an expected type argument

2020-02-15T02:11:39.066300Z

I took that insight and ran with it. clojure's evaluation model is way different from Racket's (more like CL) so there's unique challenges compared to racket. clojure doesn't have phases for example, or at least they're interleaved instead of sequential

2020-02-15T02:13:13.067Z

the biggest challenge in porting turnstile's ideas to clojure has been the fact that macroexpansion and evaluation is interleaved in clojure

2020-02-15T02:13:55.067800Z

so that means that a typing rule also has to manage evaluation. that simply isn't a concern in turnstile afaik

whilo 2020-02-15T21:37:15.069600Z

yes, it seems to me that the macroexpansion in clojure is not made to have extensible meta-programming in a similar way that racket has. racket makes a very strong distinction between compile-time and runtime though, which might also not be really ideal, but should be fine for core.typed functionality.

whilo 2020-02-15T23:01:50.070900Z

having seen a lot of papers about racket macroexpansion lately, i am curious whether we could replace or wrap the clojure macroexpansion somehow with something that allows to port more of rackets functionality onto clojure