4 ms·
I like Chicken Scheme's take on this. Since Chicken's compiler always generates C code, which is then compiled by GCC (or Clang), one just releases both the sou
by outworlder 11y ago
I like Chicken Scheme's take on this. Since Chicken's compiler always generates C code, which is then compiled by GCC (or Clang), one just releases both the source and the compiled scheme files(which are C sources).
Then, it's just "make" as usual.
I've even used this strategy to run a scheme program on iOS, trivially. You just have to ask it to stop at the C code generation and not invoke the C compiler. You then insert both chicken's C code and your program's in the xcode project, and call libchicken's initialization code from Objective-C. And then compile the whole blob with clang.
EDIT: :%s/compiled C/compiled scheme/g
- davexunit 11y ago>like Chicken Scheme's take on this. Since Chicken's compiler always generates C code, which is then compiled by GCC (or Clang), one just releases both the source and the compiled C files. Shipping a pre-built binary is what Guile purposely doesn't do to avoid the trust issue. Chicken's technique doesn't cut it.
- outworlder 11y agoSorry, my bad. I said "compiled C files" when I meant said "compiled scheme files", which are C sources, not binaries.
- davexunit 11y agoThey are binaries, effectively. They are not source code, just like minified JavaScript code is not source code. Thanks for pointing this out to me. I work on a package manager with a Chicken package where this sort of thing is unacceptable, so I've filed a bug. Does anyone who works on Chicken know how bootstrap it?
- outworlder 11y agoYou may want to ask on the chicken-users list (chicken-users@nongnu.org, subscribe at https://lists.nongnu.org/mailman/listinfo/chicken-users https://lists.nongnu.org/mailman/listinfo/chicken-users). The current list of maintainers is at (http://wiki.call-cc.org/maintainers http://wiki.call-cc.org/maintainers), you could also contact them directly. Or on free node's #chicken Now, the C source is not included in the repository itself, so if you are (somehow) building from that(for instance, you already have a working chicken), you are ok. They are only included in the "release tarballs". How does your package manager get around bootstrapping compilers, in general? Guile's approach requires maintaining a one-shot interpreter/compiler in C, that's only ever used once. I don't think all projects do that.