# Language plait and gui

**URL:** <https://racket.discourse.group/t/language-plait-and-gui/1666>\
**Category:** General\
**Created:** [January 27, 2023, 1:20am UTC](https://racket.discourse.group/t/language-plait-and-gui/1666 "2023-01-27T01:20:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![devosalain](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/devosalain/32/546_2.png) [@devosalain](https://racket.discourse.group/u/devosalain)\
**Post date:** [January 27, 2023, 1:20am UTC](https://racket.discourse.group/t/language-plait-and-gui/1666/1 "2023-01-27T01:20:59Z")

</div>

Is it possible to run a gui when the language is plait.  
Following code fails

```scheme
;#lang racket
#lang plait
(require racket/gui)
(require racket/class)
(define window
  (new frame%
       [label "Hello World!"]))
(send window show #t)

```

Error :

```scheme
test.rkt:3:9: require: not a `plait' module
  at: racket/gui
  in: (require racket/gui)
  location...:
   test.rkt:3:9

```

---

<div class="post-metadata">

**Author:** ![devosalain](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/devosalain/32/546_2.png) [@devosalain](https://racket.discourse.group/u/devosalain)\
**Post date:** [January 27, 2023, 1:27am UTC](https://racket.discourse.group/t/language-plait-and-gui/1666/2 "2023-01-27T01:27:05Z")

</div>

Following code fails too:

```scheme
;#lang racket
#lang r5rs
(require racket/gui)
(require racket/class)
(define window
  (new frame%
       (label "Hello World!")))
(send window show #t)

```

Error

```scheme
test.rkt:3:1: require: unbound identifier
  in: require
  location...:
   test.rkt:3:1

```

---

<div class="post-metadata">

**Author:** ![jbclements](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/jbclements/32/11_2.png) [@jbclements](https://racket.discourse.group/u/jbclements)\
**Post date:** [January 27, 2023, 1:38am UTC](https://racket.discourse.group/t/language-plait-and-gui/1666/3 "2023-01-27T01:38:00Z")

</div>

I would not expect either of those to work. The `plait` language is designed exclusively for use with the PLAI textbook, and does not to the best of my knowledge interoperate with other libraries. Similarly, R5RS is a different language, not racket, and does not support the "require" form.

---

<div class="post-metadata">

**Author:** ![jbclements](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/jbclements/32/11_2.png) [@jbclements](https://racket.discourse.group/u/jbclements)\
**Post date:** [January 27, 2023, 1:42am UTC](https://racket.discourse.group/t/language-plait-and-gui/1666/4 "2023-01-27T01:42:29Z")

</div>

This appears to work fine in Typed Racket, though you need to know about the existence of parallel libraries such as `typed/racket/gui` and `typed/racket/class`:

```scheme
#lang typed/racket

(require typed/racket/gui
         typed/racket/class)

(define window
  (new frame%
       (label "Hello World!")
       (width 100)
       (height 100)))
(send window show #t)

```

The window that's created is very very small on my computer, though, so I've taken the liberty of increasing its size to 100x100 by adding "width" and "height" initializers.

---

<div class="post-metadata">

**Author:** ![devosalain](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/devosalain/32/546_2.png) [@devosalain](https://racket.discourse.group/u/devosalain)\
**Post date:** [January 27, 2023, 1:43am UTC](https://racket.discourse.group/t/language-plait-and-gui/1666/5 "2023-01-27T01:43:16Z")

</div>

Bummer.  
In that case i stick with typed-racket language.  
Because being able to create a gui or connecting to a postgresql database is essential for me.  
[And this limits the possible languages i can use]  
typed-racket fullfills all my needs.

---

<div class="post-metadata">

**Author:** ![devosalain](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/devosalain/32/546_2.png) [@devosalain](https://racket.discourse.group/u/devosalain)\
**Post date:** [January 27, 2023, 3:23am UTC](https://racket.discourse.group/t/language-plait-and-gui/1666/6 "2023-01-27T03:23:51Z")

</div>

I found a libraries which can help in describing an abstract-syntax-tree,

> **[GitHub - pnwamk/datatype: (Somewhat) Algebraic Data Types for Racket](https://github.com/pnwamk/datatype)**
>
> (Somewhat) Algebraic Data Types for Racket. Contribute to pnwamk/datatype development by creating an account on GitHub.

> **[GitHub - SuzanneSoy/phc-adt: Algebraic Datatypes for Typed/Racket, with some...](https://github.com/SuzanneSoy/phc-adt)**
>
> Algebraic Datatypes for Typed/Racket, with some special features useful for writing compilers - GitHub - SuzanneSoy/phc-adt: Algebraic Datatypes for Typed/Racket, with some special features useful ...
