# What exactly is #lang

**URL:** <https://racket.discourse.group/t/what-exactly-is-lang/1675>\
**Category:** Questions & Answers\
**Tags:** question\
**Created:** [January 30, 2023, 11:34am UTC](https://racket.discourse.group/t/what-exactly-is-lang/1675 "2023-01-30T11:34:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Panadestein](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/panadestein/32/949_2.png) [@Panadestein](https://racket.discourse.group/u/Panadestein)\
**Post date:** [January 30, 2023, 11:34am UTC](https://racket.discourse.group/t/what-exactly-is-lang/1675/1 "2023-01-30T11:34:10Z")

</div>

Hi, very basic question here. What is the correct name of "#lang" in Racket ? Is it a "reader form", a "directive", a "reader macro", or something else?

---

<div class="post-metadata">

**Author:** ![soegaard](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/soegaard/32/19_2.png) [@soegaard](https://racket.discourse.group/u/soegaard)\
**Post date:** [January 30, 2023, 12:05pm UTC](https://racket.discourse.group/t/what-exactly-is-lang/1675/2 "2023-01-30T12:05:49Z")

</div>

From [1.3&nbsp;The Reader](https://docs.racket-lang.org/reference/reader.html)

> lang starts a reader extension use; see [Reading via an Extension](https://docs.racket-lang.org/reference/reader.html#%28part._parse-reader%29)

---

<div class="post-metadata">

**Author:** ![Panadestein](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/panadestein/32/949_2.png) [@Panadestein](https://racket.discourse.group/u/Panadestein)\
**Post date:** [January 30, 2023, 12:09pm UTC](https://racket.discourse.group/t/what-exactly-is-lang/1675/3 "2023-01-30T12:09:27Z")

</div>

Thanks for the reply! Exactly in this section, they refer to `#reader` and `#lang` as "reader forms", or simply "forms". That's why I asked. I guess the former is the right name.

---

<div class="post-metadata">

**Author:** ![robby](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/robby/32/7_2.png) [@robby](https://racket.discourse.group/u/robby)\
**Post date:** [January 30, 2023, 2:06pm UTC](https://racket.discourse.group/t/what-exactly-is-lang/1675/4 "2023-01-30T14:06:46Z")

</div>

That answer is a technically correct answer, given a deep understanding of the guts of Racket, but typically one encounters `#lang` at the start of a file and it is more simply (and still accurately) thought of as a declaration of the language of that file. One could say that the parser for Racket is simply checking for `#lang ` and then handing it off to some more specific language to continue parsing (and expansion and compilation, etc) from there.

---

<div class="post-metadata">

**Author:** ![bremner](https://avatars.discourse-cdn.com/v4/letter/b/aca169/32.png) [@bremner](https://racket.discourse.group/u/bremner)\
**Post date:** [January 30, 2023, 2:38pm UTC](https://racket.discourse.group/t/what-exactly-is-lang/1675/5 "2023-01-30T14:38:18Z")

</div>

Robby Findler via Racket Discussions  
[notifications@racket.discoursemail.com](mailto:notifications@racket.discoursemail.com) writes:

> That answer is a technically correct answer, given a deep  
> understanding of the guts of Racket, but typically one encounters  
> `#lang` at the start of a file and it is more simply (and still  
> accurately) thought of as a declaration of the language of that  
> file. One could say that the parser for Racket is simply checking for  
> `#lang ` and then handing it off to some more specific language to  
> continue parsing (and expansion and compilation, etc) from there.

For something in between these two answers, see

```
https://docs.racket-lang.org/guide/languages.html

```

I was happy to see this material added to the guide (at least I never  
noticed it before).

I have yet to follow it through and see if I can answer my own question  
about using brag as a module language inlined in a file by calling  
#reader.

d
