Language plait and gui

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

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

Error :

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

Following code fails too:

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

Error

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

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.

1 Like

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:

#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.

1 Like

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.

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