3 ms·
Ketos: Lisp dialect scripting and extension language for Rust programs
- ibraheemdev 5y agoCool language, it'd be great if there was a code block example in the README.
- gleenn 5y agoLooks close to Scheme to me. Very cool. Anyone know how much of the Rust memory safety you're going to lose using this? It looks relatively strict a la the immutable local variables but are they just going to garbage collect those somehow? Or is this done in a way that the borrow checker remains happy when interopting with normal Rust code?
- Jweb_Guru 5y agoThe data look fully immutable, which means no cycles, so I'd bet on some form of reference counting being used for garbage collection (though I haven't looked closely). As for memory safety, there are just five well-encapsulated uses of unsafe in the whole repository; you can inspect them and decide for yourself :)
- brabel 5y agoGNU Guile was designed for embedding and is very light... maybe just use that instead?
- outworlder 5y agoOr Chicken Scheme, or Gambit Scheme, which can be used standalone, embedded, or as glue with their great C interop. I love seeing Scheme(or Lisp) implementations, they are kind of a Rosetta Stone of programming languages. We can study them and learn the target languages. They seldom become implementations in widespread usage on their own, though.
- m0th87 5y agoI wrote up some rust low-level bindings for guile [1]. The problem is that Guile liberally uses setjmp/longjmp, which breaks rust destructors. It might be possible to fix this by wrapping every call the way rlua does [2], but I'm not familiar enough with Guile to know. 1: https://github.com/ysimonson/guile-sys https://github.com/ysimonson/guile-sys 2: https://github.com/amethyst/rlua/issues/21 https://github.com/amethyst/rlua/issues/21
- vindarel 5y agoIf you're seeking performance, stick to Common Lisp? https://renato.athaydes.com/posts/how-to-write-slow-rust-code.html https://renato.athaydes.com/posts/how-to-write-slow-rust-cod... they sweat to great lengths to beat the non-optimized original Lisp program^^ (for ML-style type checking, check out the newly released Coalton library) TLDR; when talking Lisp, CL has still much to show.
- outworlder 5y agoCommon Lisp is wonderful. It was really ahead of its time - and, in some cases, still is. We would also have avoided many cycles of markup and configuration languages. That said, having a small Lisp or Scheme script in a Rust (or C) program can be helpful. Although I would honestly look into just adding Chicken, Gambit scheme or Guile at this point. Scheme and all Lisp likes are deceptively simple - you can implement an interpreter in a weekend. Then spend a lifetime trying to make it efficient.
- fouric 5y agoExactly. Python : Lua :: CL : Guile. Python and CL are much more capable general-purpose languages than Lua and Guile, but the latter are better for embedding into larger programs, partially because of their limited scope and features (which, among other things, simplify the amount of work that the embedding program has to do, as well as the FFI between the two).
- m0th87 5y agoI messed around with and contributed to this project a bit. The biggest challenge I saw in day to day usage was that line numbers aren't included in error messages: https://github.com/murarth/ketos/issues/11 https://github.com/murarth/ketos/issues/11