-
Notifications
You must be signed in to change notification settings - Fork 30
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
REPL on the sneklang website #38
Comments
This would be cool, but I fear it would be very difficult to prevent abuse and make it secure. |
Maybe the Unix binary can be adopted by TryItOnline (their source @ github)? They have some experience in jailing interpreters and compilers. |
Maybe this could be done with Emscripten to compile it down to WASM that executes the code client-side in the web browser? |
MicroPython has a REPL built with Unicorn.js. |
Unicorn is an emulator. If there is another emulator in JavaScript for Linux (or OS that supports what is needed for Posix Snek) that supports a CPU for which gcc and the dependencies for Snek exist, that might be an easy way to get Snek running in a browser. I found this example of an Arduino UNO emulator: Then I changed the loop() function to something that is more like a REPL:
This is also open source: https://github.com/wokwi/avr8js If one could make Snek into a library that could be called from an Arduino sketch then that Wokwi system could be used to get the Snek REPL running in a browser. |
Katie Bell just gave a presentation at LCA 2022 where she compiled CPython with enscripten to wasm and ran the result in a browser. I suspect doing that for snek would be less work. |
I could not find that presentation on YouTube. I tried to compile Snek for ia32 (x86) and upload it to a x86 emulator running Buildroot Linux https://copy.sh/v86/?profile=buildroot and https://github.com/copy/v86. It would not work because of dynamic libraries. Then I tried to compile it statically, but I could not get it to compile. I compiled it on Ubuntu 18.04.6 LTS (GNU/Linux 4.15.0-166-generic i686). These were my changes to Makefile in ports/posix:
|
As you can see, I hacked up the posix port to allow it to be built without readline so that it can be linked -static. If you're up for trying this again, please let us know! |
Hi I'm new to this and just started Ive read through the manual but have a questions How do I write to serial port as I would with arduino C++ How also do I address pins for lets say writing to a LCD in nibble mode , byte mode using the snek programming language Could you perhaps provide some examples I could follow Thanking you Mark Harrington |
@markh2016 This issue is about another topic, here is the answer to your question: #80 |
A Snek REPL on the sneklang website.
The text was updated successfully, but these errors were encountered: