Creating a language that extends typed/racket

21 views
Skip to first unread message

Alexis King

unread,
Aug 30, 2015, 6:30:09 PM8/30/15
to dev
(Disclaimer: I think this question may have been visited before on this mailing list, but I couldn’t find any resolution, so I’m going to ask again.)

I would like to write a language that extends typed/racket or typed/racket/base. Specifically, I have a collection, called “envy”. I would like to create a `#lang envy` that is just like #lang typed/racket/base, but also includes (all-from-out envy). My first instinct was just to create a language using syntax/module-reader, along with a simple module language:

#lang typed/racket/base
(require envy)
(provide (all-from-out envy typed/racket/base))

Unfortunately, this doesn’t work. The `envy` module defines a macro called `define-environment`, but attempting to use it in this `#lang envy` fails:

Type Checker: Macro define-environment from typed module used in untyped code in: (define-environment)

So that doesn’t work. For some reason, the typechecker thinks `#lang envy` is untyped (though it seems to typecheck properly when not using macros). However, I realized that `#lang typed/racket` is a module language that obviously extends typed/racket/base. It uses typed-racket/minimal, but using that instead of typed/racket/base didn’t alleviate my problem.

Is it possible to create a custom language that extends typed/racket/base? How does typed/racket itself do it?

Alexis
Reply all
Reply to author
Forward
0 new messages