Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any possibility to add support to Scheme? #666

Open
RadioNoiseE opened this issue Jul 10, 2023 · 9 comments
Open

Any possibility to add support to Scheme? #666

RadioNoiseE opened this issue Jul 10, 2023 · 9 comments

Comments

@RadioNoiseE
Copy link

I was trying to write scheme in a-shell.
After a glance at the Implementations section at scheme.org, I chose s7 since it exists as two files: s7.c and s7.h.

But the problem is the implementation includes setjmp.h which is not supported by web assembly.
Also I know nothing about iOS development so compile it and side-load the new version of app is not very possible.

So I wonder if a-shell could include s7 as pre-complied binary (and maybe a simple repl mentioned here/here as well?).

But I am aware that scheme is not a widely used language (also s7 is not a perfect implementation of scheme compared to chez scheme), but since it's a 2-file problem, I think it's feasible and should (really?) benefit some people.

Thanks a lot for considering this(

@RadioNoiseE
Copy link
Author

Oh and I think another thing I should mention is that s7 is under BSD license, and I'm not sure if there's any problem with it.

@rcarmo
Copy link

rcarmo commented Aug 28, 2023

I've been poking at various options for this myself ever since I started using a-Shell. I'd love to use Guile, but since that is AGPL I don't think there is much of a chance.

Things I've tried:

  • I've got fennel working with the built-in Lua and Hylang under Python, but neither are really Scheme...
  • I couldn't get Janet working under WASI (and it's not really Scheme either)
  • Chez might work (it's Apache licensed, and arguably the best thing on my list), but I'm not sure if the JIT can work (or be disabled) cleanly.
  • Picolisp is borderline awesome (despite not being Scheme) and would be "good enough" for me, but, again, couldn't build it under WASI.

The lack of "setjmp.h" is something I've come across quite a few times during the above, too, but even getting a copy off a Linux system the required functions just aren't there in the runtime (or weren't the last time I tried).

@holzschu
Copy link
Owner

holzschu commented Jul 18, 2024

Hi,
The new SDK for wasi had support for setjmp, which means I could compile s7, at least (as you said, with only two files, it was the lowest hanging fruit). Now I’m wondering how to distribute it, since the executable expects the .scm files to be in the same place. I’ll also try to have the curses-version.

But in the meantime, you can use repl here:
s7.tar.gz

@RadioNoiseE
Copy link
Author

Thanks a lot! Finally I can write scheme on iOS.

@rcarmo
Copy link

rcarmo commented Jul 19, 2024

That's amazing. I might try my hand at compiling PicoLisp (or, even better, GNU Guile) again. Guile in particular has an almost Python-level amount of batteries included, so I've been quite interested in getting it to work.

@holzschu
Copy link
Owner

If you manage to do it, please send it my way so I can add them to pkg.
I've added s7 to pkg, so pkg install scheme-s7 will work (and I've given up on the curses version).

@rcarmo
Copy link

rcarmo commented Jul 19, 2024

I'll let you know. I need to rebuild my WASI setup from scratch, going to see if I can do a Docker container or something like that for a reproducible environment.

@holzschu
Copy link
Owner

If you are on OSX, I now provide a ready-so-use SDK here: https://github.com/holzschu/wasi-sdk/releases/download/wasi-sdk-aShell-19/wasi-sdk.tar.gz

It contains the binaries (clang, ar, wasm-ld...) and the sysroot, with a bunch of auxiliary libraries.

@rcarmo
Copy link

rcarmo commented Jul 19, 2024

Ah, right. I'm on everything, I just default to Linux for building stuff because I like my sandboxes away from my laptop :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants