u/nbittich - curious if you've tried to use your language as as a scripting language inside other apps? I took a peek at your browser wasm environment, and think we could hook up the `compute` entrypoint you have here[0], but I'm not certain what the `ctx` does without going super deep, and if it could be passed into an Extism function[1] (which is how I'd try to run it from within 16+ other languages).
Re:Show HN: Now my pet programming language can run in the b...
by nbittich on Saturday February 10, 2024 @03:15PM
(#39329773)
Thank you for having a look at it! I didn't know extism, will definitely have a look at the readme right after I finish to write this comment.
The ctx variable is a piece of memory, kind of the heap where functions and variables are stored during the script execution; I did it that way because I wanted to keep whatever is in that memory after each script execution, so in a prior version you could define a variable x, run the script, then re-run a completely different script, but still have access to the x variable. I removed it at the end because I wasn't sure if it was a good idea, or at the very least should be documented, but I kept the ctx thing there (could easily remove it tho)
Re:Show HN: Now my pet programming language can run in the b...
by nilslice on Saturday February 10, 2024 @03:24PM
(#39329858)
ah that makes sense! so `compute` can still execute a script with an empty memory (just to test things out)?
feel free to join us on Discord if you’d like: https://extism.org/discord — happy to chat about it there. I think your language embedded in a bunch of apps as a scripting lang (beyond Rust) would be really cool to see.
Re:Show HN: Now my pet programming language can run in the b...
by beardyw on Saturday February 10, 2024 @12:30PM
(#39328213)
I think there is a role for a scripting language in the browser akin to scripting in a spreadsheet. Sadly I don't see an accepted standard. Key would be what it can't do (access the document model, access the internet etc), not so much what it can.
Re:Show HN: Now my pet programming language can run in the b...
by javajosh on Saturday February 10, 2024 @02:07PM
(#39329224)
I agree, but I imagine there either is or will be a js-in-wasm project that can suitably truncate the environment. Not that js is actually not good at this sort of application (triple equals get old fast), but people already know it.
Re:Show HN: Now my pet programming language can run in the b...
by zamadatix on Saturday February 10, 2024 @07:00PM
(#39331456)
Figma has actually gone along this line of thinking for plugins since ~2019 https://www.figma.com/blog/an-update-on-plugin-security/ albeit their choice was from securing the existing plugin model rather than providing a minimal new scripting system.
Re:Show HN: Now my pet programming language can run in the b...
by x-cmd on Saturday February 10, 2024 @12:04PM
(#39327906)
Hi friend,
If you can provide build for different plaforms, and think it is now stable enough for user to use as script engine, we would like to put it into x-cmd pkg system.
Re:Show HN: Now my pet programming language can run in the b...
by ZoomerCretin on Saturday February 10, 2024 @12:26PM
(#39328169)
Ah. I was curious about the Rust-style function returns (just having the name of the variable on the last line without a "return" statement or keyword), but knowing that the language is written in Rust answers my question of why that design decision was made ;)
Re:Show HN: Now my pet programming language can run in the b...
by nbittich on Saturday February 10, 2024 @03:18PM
(#39329804)
I may try writing something about my experience building this project, I'm terrible at writing but it was so much fun, I think it is worth the effort :)
https://modsurfer.dylibso.com/module?hash=ab6f4b2de9db171347...
u/nbittich - curious if you've tried to use your language as as a scripting language inside other apps? I took a peek at your browser wasm environment, and think we could hook up the `compute` entrypoint you have here[0], but I'm not certain what the `ctx` does without going super deep, and if it could be passed into an Extism function[1] (which is how I'd try to run it from within 16+ other languages).
[0]: https://github.com/nbittich/adana/blob/master/adana-script-w...
[1]: https://github.com/extism/extism
The ctx variable is a piece of memory, kind of the heap where functions and variables are stored during the script execution; I did it that way because I wanted to keep whatever is in that memory after each script execution, so in a prior version you could define a variable x, run the script, then re-run a completely different script, but still have access to the x variable. I removed it at the end because I wasn't sure if it was a good idea, or at the very least should be documented, but I kept the ctx thing there (could easily remove it tho)
feel free to join us on Discord if you’d like: https://extism.org/discord — happy to chat about it there. I think your language embedded in a bunch of apps as a scripting lang (beyond Rust) would be really cool to see.
It will be a pleasure to discuss it on discord, I'll already join the server and will contact you in a few days hopefully.
And of course there's lua.
If you can provide build for different plaforms, and think it is now stable enough for user to use as script engine, we would like to put it into x-cmd pkg system.
More about x-cmd: https://www.x-cmd.com/ More about x-cmd pkg, let take bun as an example: https://www.x-cmd.com/pkg/bun