> 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.
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:
But it's definitely not as convenient as Erlang's Dialyzer, TypeScript, Dylan or similar success/gradual/occurrence/soft-typing solutions for sure.