4 ms·
>To the best of my knowledge Typed Racket does support gradual typing If you take a Racket program and change the language to Typed Racket, you'll get flooded
by logicchains 12y ago
>To the best of my knowledge Typed Racket does support gradual typing
If you take a Racket program and change the language to Typed Racket, you'll get flooded with compiler errors. Or at least that's been my experience.
>Racket is not Scheme anymore
I'll update the post to note this, thanks.
- kuschku 12y agoYou can use typed/racket with optional types, it’s kinda easy.
- klibertp 12y agoHow? The docs say (http://docs.racket-lang.org/ts-guide/more.html#(part._when-annotations~3f) http://docs.racket-lang.org/ts-guide/more.html#(part._when-a...) that you have to provide type annotations in certain cases.
- klibertp 12y ago> If you take a Racket program and change the language to Typed Racket, you'll get flooded with compiler errors. Or at least that's been my experience. That's because when using `#lang typed/racket` you literally change the language you're writing and that includes the syntax of some very fundamental forms (like define or struct). You can mix typed and untyped code freely as long as they are separated by module boundaries. Something like this: #lang racket/base (module with-types typed/racket (provide a) (: a (-> String Integer)) (define (a x) 0)) (module without-types racket (require (submod ".." with-types)) (provide a)) But it's definitely not as convenient as Erlang's Dialyzer, TypeScript, Dylan or similar success/gradual/occurrence/soft-typing solutions for sure.