Re:Wren: a small, fast, class-based concurrent scripting lan...
by emsy on Monday May 02, 2016 @01:48PM
(#11613709)
I used to have a program with an embedded Lua interpreter where I sometimes needed to switch back and forth between C++ and Lua. It's insane. Arrays don't start at zero, you create blocks with keywords and then there are some minor annoyances like != being ~= or the lack of a ternary operator. Where Lua really shines though is the binding api. It's really easy to use when you have to do something by hand. The documentation is great and you have a selection of binding tools. You can even create classes with overridable virtual methods.
Since Lua is rather tedious to use for me, I looked for alternatives with a C-like syntax. I found Squirrel and Wren but the last time I looked they lacked the tooling and mailing lists that Lua already has. It's a bit of a chicken-egg problem unfortunately.
Re:Wren: a small, fast, class-based concurrent scripting lan...
by pygy_ on Monday May 02, 2016 @02:22PM
(#11614023)
For Thimbleweed Park, Ron Gilbert considered Lua but found it too "goofy" syntactically, and ended up using Squirrel.
Re:Wren: a small, fast, class-based concurrent scripting lan...
by munificent on Monday May 02, 2016 @03:57PM
(#11614998)
> I found Squirrel and Wren but the last time I looked they lacked the tooling and mailing lists that Lua already has.
Yup, Wren still has a long ways to go in terms of being a mature ecosystem, but it's getting there slowly. It would be moving faster, honestly, if I put more time into it, but there are only so many hours in the day.
Re:Wren: a small, fast, class-based concurrent scripting lan...
by eropple on Monday May 02, 2016 @01:57PM
(#11613794)
An option that might be worth looking at is AngelScript, which I think minimizes the context switch between C++ and the scripting layer really nicely.
Re:Wren: a small, fast, class-based concurrent scripting lan...
by emsy on Monday May 02, 2016 @02:33PM
(#11614134)
I totally forgot about AngelScript. It really has the lowest context switching overhead, but you get to keep the verbose C++ syntax in return, which is a trade-off.
Personally I don't mind if a language differs somewhat, but with Lua I constantly get errors because of basic things like braces, comments and comparisons.
Re:Wren: a small, fast, class-based concurrent scripting lan...
by Pxtl on Monday May 02, 2016 @02:18PM
(#11613983)
I wonder of a language-agnostic computing platform could be developed based on a Lua-like securely-embedded system. That is, something like the JVM, but the client code can only access the things that are explicitly provided to it by the host environment.
You'd be pretty constrained by what concepts of "object" to support, though.
Re:Wren: a small, fast, class-based concurrent scripting lan...
by emsy on Monday May 02, 2016 @02:34PM
(#11614138)
Another thing I forgot to mention was tooling. With Lua you can already get debuggers, libraries and IDEs that other languages still lack.
Re:Wren: a small, fast, class-based concurrent scripting lan...
by commentzorro on Monday May 02, 2016 @01:43PM
(#11613660)
What language bindings are available? Golang by chance?
Re:Wren: a small, fast, class-based concurrent scripting lan...
by munificent on Monday May 02, 2016 @06:26PM
(#11616243)
No Go yet, but a couple:
Re:Wren: a small, fast, class-based concurrent scripting lan...
by untothebreach on Monday May 02, 2016 @01:54PM
(#11613759)
About a year ago I made Rust bindings, but they are out-of-date now, as I kind of stopped participating in the wren community (not their fault, I stopped participating in a lot of communities due to some happenings in my personal life). I will have some more time coming up here soon, and hope to get back into it.
---
There are a few scripting languages used for embedding in applications. Lua is the main one. TCL used to be. There’s also Guile, increasingly JavaScript, and some applications embed Python. I’m an ex-game developer, so when I think “scripting”, I tend to think “game scripting”.
Lua is nice: it’s small, simple, and fast. But—and I don’t mean this as a criticism—it’s also weird if you’re used to languages like C++ and Java. The syntax is different. The semantics, especially the object model are unusual. Anyone can get used to 1-based indexing, but things like metatables really show that objects were bolted onto Lua after the fact.
I think there’s room for a language as simple as Lua, but that feels natural to someone with an OOP background. Wren is my attempt at that.
---
[1]: http://wren.io/qa.html#why-did-you-create-wren