3 ms·
Racket has a lot of fancy features that might have runtime support. Glancing through the reference: Contracts, threads, futures, custodians, impersonators, will
by MichaelBurge 5y ago
Racket has a lot of fancy features that might have runtime support. Glancing through the reference: Contracts, threads, futures, custodians, impersonators, wills & executors, ephemerons, etc.
How feasible is it to run an arbitrary Racket application on top of this small core? (Even if all these features are implemented badly for ease-of-implementation)
Standard Scheme seems to allow a small base, but Racket has a lot of things built-in and I'm not sure how much can be done as a library vs. needing runtime support.
- bjoli 4y agoI believe all of #lang racket is written in #lang racket/base. Zuo is only superficially like racket. You likely can't do any of the fancy things in it.
- klibertp 4y agoThere actually is a small base, called racket/base. It excludes a lot of built-in features - you can see a lot of "this module is provided by racket but not racket/base" in the docs - and people tend to use it for modules that don't need the full functionality, because it tends to make the code faster.
- MichaelBurge 4y agoAre there any actual separate implementations of it? Could r7rs Scheme be used to write a library that allows running any racket/base program, for example?
- klibertp 4y agoI'm sorry, I don't know that much about it. I don't think there are any separate implementation of it. I'd guess that as long you have call/cc you could do it, but Racket has its own specific macro system (syntax-parse, but syntax-rules and syntax-case are supported), and I don't know how much of the racket/base is built on syntax-parse; or, on the other hand, how syntax-parse is itself implemented and if it would be possible to port easily to other Schemes. The good news are that once you have racket/base, most other things in stdlib should work.
- JHonaker 4y agoWhat exactly do you mean by this question? R7RS could totally be used to write a library that allows running any racket/base program. It's called an interpreter :D. The nice thing about Racket is the #lang system allows you to work with many different languages in the same project. Racket has an R5RS [1], R6RS [2], and R7RS-small [3] implementation as a #lang. [1] https://docs.racket-lang.org/r5rs/index.html https://docs.racket-lang.org/r5rs/index.html [2] https://docs.racket-lang.org/r6rs/index.html https://docs.racket-lang.org/r6rs/index.html [3] https://github.com/lexi-lambda/racket-r7rs/blob/master/README.md https://github.com/lexi-lambda/racket-r7rs/blob/master/READM...
- MichaelBurge 4y agoI'm looking for one alternate implementation of a subset of Racket so that I can justify using the language for things. All of your links are someone implementing Scheme in Racket, not Racket in Scheme. So that would make Scheme "safe", but not Racket. It would be possible to write an interpreter in any language, but I can't tell if that would take weeks or years before it could run most racket/base programs.
- JHonaker 4y agoI’m still not sure what you mean by “safe.” Are you worried about Racket becoming unmaintained? Racket itself is written on top of Chez Scheme, so does that satisfy your safety condition?
- klibertp 4y ago> I’m still not sure what you mean by “safe.” Probably means "portable". If I'm reading it correctly, they want to be able to run Racket programs using a portability layer instead of writing a full interpreter. That would be something like using WINE vs. VirtualBox running Windows inside. > Are you worried about Racket becoming unmaintained? This is quite understandable concern, and even if it doesn't happen, having an "exit strategy" prepared is not a bad thing. > Racket itself is written on top of Chez Scheme, so does that satisfy your safety condition? Right, I forgot about it! After the rewrite/porting to CS Racket should have become easier to port to further platforms. I think much of Racket's reader and macro-expander was rewritten in pure Scheme. @MichaelBurge - take a look at the blog[1] and follow links from there[2]. Racket was ported from a custom JIT-capable implementation to Chez Scheme. It took 4-5 years, but it was finished last year. The performance is now at the same level it was before, but a lot of C code is now written in Scheme. [1] https://blog.racket-lang.org/2020/02/racket-on-chez-status.html https://blog.racket-lang.org/2020/02/racket-on-chez-status.h... [2] migration done post: https://blog.racket-lang.org/2021/01/racket-status.html https://blog.racket-lang.org/2021/01/racket-status.html