by plainOldText
6 subcomments
- Reminder the creator of Wren wrote the awesome Crafting Interpreters book [0].
[0] https://craftinginterpreters.com/
- I was working on a custom runtime for minimal wasm apps recently. I didn't want to have to write all apps in C or Rust, so I went looking for tiny scripting languages. Lua is pretty small, but I wasn't able to get it to compile to wasm IIRC due to POSIX dependencies. This turned out to be quite easy with Wren[0].
[0]: https://github.com/wren-lang/wren/issues/1199
- Popular in 2022 (301 points, 130 comments) https://news.ycombinator.com/item?id=32631553
2020 (122 points, 54 comments) https://news.ycombinator.com/item?id=23660464
- I once considered Wren for a situation where I (to a first approximation) wanted to allow users to write 'plugins' that link against my internal C application symbols but using a language focusing more on ease of use (rather than C).
Unfortunately, neither Wren nor any of the other major 'embeddable scripting languages' (e.g., Lua) were really a good fit for this, because they commit fully to the 'all-numbers-are-floats' thing and generally don't seem to even try to provide a general equivalent to the C++ `extern "C" { ... }` thing.
Of course, I know this isn't really the target use case of Wren/Lua/etc., but if anyone knows of a good embeddable scripting language for this I'd love to hear about it. Eventually I went with CPython (which provides ctypes to solve my problem) but it's a huge pain to embed properly.
- Wren is the primary scripting language for the Luxe game engine, currently in development: https://luxeengine.com/
- This seems like a nice alternative to Lua. I've always liked embedding Lua in other software, but I confess I have never really liked Lua as a language.
- Wren ties with Phix for most tasks done on Rosetta Code [1].
[1] https://rosettacode.org/wiki/Rosetta_Code/Rank_languages_by_...
- I would love to replace JS as the scripting language in one of my native macOS apps and I wonder if Wren would be suitable.
The two biggest questions I’d have are:
1) how easy it would be to bridge Obj-C objects to Wren-space and vice versa (a big win of using JavascriptCore)
2) how easy would it be to implement script debugging? This is not exactly a strength of Javascript core but it is at least possible by connecting the Safari web inspector.
There’s lots I don’t like about JS and JSCore but i’ve yet to find a better alternative.
- Looks very nice! Erlang's concurrency isn't 'cooperative' though - it has a scheduler, so even a runaway process won't bog down the whole system.
by reactordev
2 subcomments
- This looks super cool up until I got to the point where it says inherited classes don’t share the same metatable. Meaning if you want to provide the same method on your inherited classes, you have to write the same thing and do a super.method() which means a lot of work if you’re into OO design so I’m not sure if classes is the right construct here. Am I wrong or did I miss something from the documentation? Other than that it looks like fun to use as an embedded scripting engine.
by aj_hackman
0 subcomment
- Interesting that this is back on the front page, as I've recently released a small-yet-growing standard library for Wren (which comes with its own modular plugin interface amongst other things):
https://github.com/adamschackart/wrench
- The first time I saw Wren was as an option for programming inside TIC-80. It caught my attention. I recently saw it again being mentioned by Gustavo (from pikuma.com) in his compilers course. Neat language and the VM code in C is quite easy to understand.
by jossephus01
0 subcomment
- wren has that minimalism from lua and syntax familarity from js that i always want to have in a scripting language. I was playing with it to build a raylib binding for it using zig a while ago and the language experience was too nice. You can checkout some examples of what you can achieve with raylib + wren here. https://github.com/jossephus/talon
by gabrielsroka
0 subcomment
- 2016
by mathieudombrock
0 subcomment
- Wren is super neat. I've written a few small games for TIC-80 using it. It's a really fun language to write.
by NetMageSCW
0 subcomment
- Is Wren still under development? The last release appears to be 4.5 years old.