29 ms·
Pseudo Scheme: Scheme Implemented on Top of Common Lisp
- Zambyte 2y agoI feel like one of the major benefits of using Scheme is how easy it is to interoperate with just about any environment. Want to embed Scheme in your C application? Take your pick from GNU Guile, Chibi, Gambit, or Chicken. How about the JVM? Kawa is solid, option. .NET? IronScheme has got you covered. Javascript? There is LIPS or BiwaScheme.
- interpunct 2y agoI agree. I recently started using an R4RS Scheme called "STk", the precursor to STklos, which I modded into a build system (replacing Make and Sh, for the most part) and a graphics DSL front-end to C. The author wrote a demo app web browser with Scheme as a scripting language, as was the original plan with Mozilla, and Tk as the GUI. Writing extensions in C is a breeze too, as it supports dynamic loading: https://github.com/egallesio/STk https://github.com/egallesio/STk I like Common Lisp too, although not as much as Scheme day-to-day--it is nice now to have both. I was thinking about adding a TinyCLOS using Common Lisp. Pseudo Scheme transpiles source to CL, so I might be able to do it with CLOS underlying it instead of how TinyCLOS does it. Jonathan Rees, the original author, has a Pseudo Scheme repo up on Github, with a branch that uses ASDF (which I am testing with SBCL). https://github.com/jar398/pseudoscheme https://github.com/jar398/pseudoscheme Thanks for your comment, and thanks to the maintainers of both of the linked Scheme implementations.
- fourthark 2y ago> Pseudoscheme consists primarily of a Scheme to Common Lisp translator that is written in Scheme. To obtain a version of the translator that runs in Common Lisp, it is applied to itself. Yes!
- vindarel 2y agoIn the CL world: to embed CL in your C app: ECL; interface with the JVM: ABCL and LispWorks; for .NET: Bike (https://github.com/Lovesan/bike/ https://github.com/Lovesan/bike/). JS: JSCL and Valtan (might need more love).
- lispm 2y agoCLASP in C and C++ via LLVM. LispWorks and Allegro CL as shared libraries in various environments. LispWorks in iOS and Android Apps. SBCL, I think, now possibly works also as a shared library.
- wavemode 2y agoI've sometimes done the opposite - when working in scheme/racket, searched for implementations of things like loop, defmacro or tagbody. (They have their quirks, but when they're a good fit for a problem they can save a lot of typing.)
- bjoli 2y agoDefmacro is trivial to implement in syntax-case, but you are in for a world of pain if you want to use bindings across modules. In have an implementation of tagbody for guile scheme somewhere, using delimited continuations. I have seen it for racket as well. There is an implementation of loop for racket, but it relies heavily on set! which will tank performance, since chez and racket (and many schemes) is pretty bad at not boxing mutable values. I wrote this which is definitely not as powerful as loop, but definitely more powerful than rackets for loops: https://git.sr.ht/~bjoli/goof-loop https://git.sr.ht/~bjoli/goof-loop
- rmrfchik 2y agoDefmacro isn't hygienic, while syntax- is. Is there way to use arbitrary names in hygienic syntax- macros?
- shawn_w 2y agoIf you know the name ahead of time, syntax parameters[1] (if your scheme supports them) work well. syntax-case lets you break hygiene to insert new names in a controlled fashion (but has issues with names known ahead of time; see linked paper). Renaming macros do too, I believe. 1: http://scheme2011.ucombinator.org/papers/Barzilay2011.pdf http://scheme2011.ucombinator.org/papers/Barzilay2011.pdf
- bjoli 2y agosyntax-case can introduce arbitrary bindings using datum->syntax.
- shawn_w 2y agoChicken has a Common Lisp style `loop` egg: https://wiki.call-cc.org/eggref/5/loop https://wiki.call-cc.org/eggref/5/loop I think it's based on a more generic Scheme version but I don't have a link to the original. SLIB has an implementation of pretty much the entirety of CL's `format` that I ported to Racket: https://docs.racket-lang.org/slib-format/index.html https://docs.racket-lang.org/slib-format/index.html I also implemented a bunch of other CL stuff for Racket in https://docs.racket-lang.org/soup-lib/index.html https://docs.racket-lang.org/soup-lib/index.html (but not `tagbody`. Yet.)
- ReleaseCandidat 2y agoLike almost always, there are chapters about that in PAIP: 22 Scheme: An Uncommon Lisp[what a pun!] https://github.com/norvig/paip-lisp/blob/main/docs/chapter22.md https://github.com/norvig/paip-lisp/blob/main/docs/chapter22... 23 Compiling Lisp [Scheme] https://github.com/norvig/paip-lisp/blob/main/docs/chapter23.md https://github.com/norvig/paip-lisp/blob/main/docs/chapter23...
- bandrami 2y agoI'm curious how it handles call/cc. I at least think you would have to make your own continuation stack, unless there's some way to get at the internals of unwind-protect that would make doing it natively possible.
- ReleaseCandidat 2y agoThat's how PAIP does it, their interpreter uses continuation passing style: 22.5 An Interpreter Supporting Call/cc https://github.com/norvig/paip-lisp/blob/main/docs/chapter22.md#225-an-interpreter-supporting-callcc https://github.com/norvig/paip-lisp/blob/main/docs/chapter22... 23.2 Introducing Call/cc [see the next chapter, 23.3 The Abstract Machine, for the implementation in bytecode] https://github.com/norvig/paip-lisp/blob/main/docs/chapter23.md#232-introducing-callcc https://github.com/norvig/paip-lisp/blob/main/docs/chapter23...
- deleted 2y ago[deleted]
- wdkrnls 2y agoHas someone ported this to Emacs?