# Prelude Modules

**URL:** <https://racket.discourse.group/t/prelude-modules/3864>\
**Category:** General\
**Tags:** terminology\
**Created:** [July 20, 2025, 10:17pm UTC](https://racket.discourse.group/t/prelude-modules/3864 "2025-07-20T22:17:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bakgatviooldoos](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/bakgatviooldoos/32/1381_2.png) [@bakgatviooldoos](https://racket.discourse.group/u/bakgatviooldoos)\
**Post date:** [July 20, 2025, 10:17pm UTC](https://racket.discourse.group/t/prelude-modules/3864/1 "2025-07-20T22:17:05Z")

</div>

Hi, Racket Discourse.

I was reading @notjack's post about what they call [prelude modules](https://whtwnd.com/did:plc:7oyzfpde4xg23u447zkp3b2i/3lnhsln7l662v), and I find the term to be an interesting addition to the nomenclature, should it take hold. One can become friends with a named concept.

Long-story short, the term describes the module `prelude` imported by a module `foo` upon instantiation (if that's the right word), which provides its initial bindings:

```scheme
(module foo prelude
  ... body ...)

```

The comparison being drawn toward the end of the post, is to Haskell, which of course employs this term to mean something very similar.

* * *

What do you think about this term; have you any pet term that you like to use to describe this concept? I see the docs simply say, ["initial module"](https://docs.racket-lang.org/guide/Module_Syntax.html#(part._module-syntax)), for what it's worth.

On a more whimsical note, it might be cool to have something like:

```scheme
#lang foo
#:prelude bar

```

to abstract over this concept, where applicable.

---

<div class="post-metadata">

**Author:** ![ryanc](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/ryanc/32/71_2.png) [@ryanc](https://racket.discourse.group/u/ryanc)\
**Post date:** [July 21, 2025, 1:05am UTC](https://racket.discourse.group/t/prelude-modules/3864/2 "2025-07-21T01:05:54Z")

</div>

> [@bakgatviooldoos](#):
>
> What do you think about this term; have you any pet term that you like to use to describe this concept? I see the docs simply say, ["initial module"](https://docs.racket-lang.org/guide/Module_Syntax.html#(part._module-syntax)), for what it's worth.

I would call that the module's "language" or perhaps "initial language". The term "language" is overloaded nowadays; we tend to think of "language" as something that can follow `#lang`, so maybe "initial language module" to disambiguate. (Any module that exports a binding for `#%module-begin` can act as a "language module".)

> [@bakgatviooldoos](#):
>
> On a more whimsical note, it might be cool to have something like:
> 
> ```scheme
> #lang foo
> #:prelude bar
> 
> ```

Something like this already exists, in the form of "meta-languages" such as `s-exp` and `at-exp`. For example, the line

```
#lang at-exp racket/base

```

starts a module declaration using the `at-exp` reader (like Scribble) with `racket/base` as the initial language module.

---

<div class="post-metadata">

**Author:** ![greghendershott](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/greghendershott/32/98_2.png) [@greghendershott](https://racket.discourse.group/u/greghendershott)\
**Post date:** [July 21, 2025, 9:54pm UTC](https://racket.discourse.group/t/prelude-modules/3864/3 "2025-07-21T21:54:24Z")

</div>

Although tangential to your main point, not to mention that my Haskell odometer reads only-driven-Sundays levels:

My impression is that `#lang racket` would be roughly the "prelude" for `#lang racket/base`.

(Or maybe `racket/base` is the prelude for `#%kernel`.)

---

<div class="post-metadata">

**Author:** ![hendrikboom3](https://avatars.discourse-cdn.com/v4/letter/h/b5e925/32.png) [@hendrikboom3](https://racket.discourse.group/u/hendrikboom3)\
**Post date:** [July 22, 2025, 1:13am UTC](https://racket.discourse.group/t/prelude-modules/3864/4 "2025-07-22T01:13:55Z")

</div>

As far as I remember, the use of the term 'prelude' dates back to 1968.  
in the Algol 68 Report, the standard initially available definitions  
were gathered together in what they decided to call the standard prelude,  
whih was considered to precede the regulr program, and defined things like  
addition, real, complex, and so forth.

There was also a standard postlude, consisting of the definition of the  
label exit, which on could goto to end pogram execution.

These were not called modules back then; modules in the modern sense  
hadn't really been invented yet.

-- hendrik

---

<div class="post-metadata">

**Author:** ![notjack](https://avatars.discourse-cdn.com/v4/letter/n/e47774/32.png) [@notjack](https://racket.discourse.group/u/notjack)\
**Post date:** [July 22, 2025, 6:00am UTC](https://racket.discourse.group/t/prelude-modules/3864/5 "2025-07-22T06:00:22Z")

</div>

> I would call that the module's "language" or perhaps "initial language". The term "language" is overloaded nowadays; we tend to think of "language" as something that can follow `#lang`, so maybe "initial language module" to disambiguate.

I think the word "language" is too overloaded to be suitable for this, personally. Especially because this concept can show up in places where `#lang` isn't involved at all, such as submodules or files written without `#lang`. That's why I like having a more concise and specific word like "prelude" for it.

---

<div class="post-metadata">

**Author:** ![bakgatviooldoos](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/bakgatviooldoos/32/1381_2.png) [@bakgatviooldoos](https://racket.discourse.group/u/bakgatviooldoos)\
**Post date:** [July 22, 2025, 8:20am UTC](https://racket.discourse.group/t/prelude-modules/3864/6 "2025-07-22T08:20:11Z")

</div>

Besides the overloadedness, I feel like the semantics of the word "prelude" tends to put one closer to the attractor of the space, than say "language".

Although not strictly relevant, the etymology of "prelude" derives from the Latin _praeludere_, meaning "to play beforehand for practice, preface," which is neat.

---

<div class="post-metadata">

**Author:** ![greghendershott](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/greghendershott/32/98_2.png) [@greghendershott](https://racket.discourse.group/u/greghendershott)\
**Post date:** [July 22, 2025, 12:28pm UTC](https://racket.discourse.group/t/prelude-modules/3864/7 "2025-07-22T12:28:29Z")

</div>

> [@bakgatviooldoos](#):
>
> What do you think about this term; have you any pet term that you like to use to describe this concept?

Oh I forgot to mention [Languages as Dotfiles](https://blog.racket-lang.org/2017/03/languages-as-dotfiles.html).

(Although that's encouraging people to make personal and/or project languages -- not proposing terminology AFAICT.)
