Skip to content

Comparison to Typed Racket

LuxLang edited this page Jan 18, 2017 · 1 revision

Typed Racket offers optional typing; Lux offers full static typing:

Racket is a dynamically typed language, and no project is ever going to change that.

The best that Typed Racket can offer is a means for individual programmers to annotate their own libraries with types, and sort-of monkey-patch foreign libraries (including Racket's own libraries), in case they're missing typing information.

Because the typing is optional, and most Racket programmers are fine with using dynamic types, the ecosystem is very dependent on the whims and needs of library providers, which often don't match the needs of library users who want types.

This forces library users to provide the types for the libraries they're consuming, instead of being able to just expect the types to be present (a practice that gets old rather quickly).

In contrast, Lux's type-system is a part of the language, and not subject to the whims of users.

There is an implicit contract between library providers and library consumers, that types will be present and that code will conform to the types, and won't deviate from expected behavior.

Typed Racket offers subtyping; Lux offers no subtyping:

Racket inherits Scheme's numerical tower as an aspect of the language, and Typed Racket must accommodate this, and other usages of subtyping in the language.

Lux's type-system is not dependent on any host platform, and does not support subtyping (since, in the future, Lux may be hosted by platforms which lack this).