How do you compile an executable in a circuit?

I want to make an executable for the following code. This is a diagram written in Dr.racket. How will this be done? It would be better if it could be standalone, and if I can open it on iOS and Windows. Thank you so much for your time!

#lang racket (require racket/gui/base) (require compiler/embed) ; Make a frame by instantiating the frame% class (define frame (new frame% [label "GUI"] [width 200] [height 200])) ; Make a static text message in the frame (define msg (new message% [parent frame] [label "This box is empty"])) ; Show the frame by calling its show method (send frame show #t) 
+4
source share
1 answer

As @dyoo pointed out, in Racket you can create an executable file from the menu and (depending on the selected / available options) package the necessary libraries; read the instructions. You can also create executables for other platforms using the tools command line.

For a more general and portable solution, consider compiling C code first and then compile from C to your own executable; look at the raco tool (section 9.3) or look at an implementation of a circuit designed for simple C compilation, such as a chicken circuit or a gambit circuit .

Getting the code to run under iOS may be more difficult, a quick search returned the Gambit REPL for iOS, try it, but I don’t know. I think there is support for compiling to native Objective-C code, although Gambit claims to have "full integration support for C compilers ++ and Objective-C ", you will have to experiment a bit with it.

Finally, note that the Racket-specific GUI (e.g. the one asked in the question) will almost certainly not be portable across different implementations / platforms of the circuit ...

+5
source

All Articles