3 ms·
Seems like a very cool language. Fibers are really just coroutines, right? The `Fiber.run` method allowing you to completely wreck the stack seems a bit dangero
by pierrec 12y ago
Seems like a very cool language. Fibers are really just coroutines, right? The `Fiber.run` method allowing you to completely wreck the stack seems a bit dangerous at first glance.
The everything-is-a method approach is also really neat. For example, it's neater than C#'s half-arsed approach where you can have public fields but it's not recommended. However, I find there should still be an easy way of creating public properties. It's useful when all you want is a structure holding a bunch of values instead of a full-featured class. From what I can see, the shortest way of creating a public property in Wren seems to be:
class Cat {
new { _name = defaultName }
name { _name }
name=(value) { _name = value }
}
That can be a lot of boilerplate, especially when you need lots of public properties. But that's just a minor nitpick, of course. I'm looking forward to actually trying this language, but I'm not sure about its level of completeness right now. It seems like everything is pretty complete, apart from some parts of the documentation.
- munificent 12y ago> Fibers are really just coroutines, right? Yup! I picked "fiber" mainly because it's shorter. > The `Fiber.run` method allowing you to completely wreck the stack seems a bit dangerous at first glance. In most cases, you'll use "call", but "run" is the fiber equivalent of tail call elimination. > However, I find there should still be an easy way of creating public properties. I'm trying to keep things minimal, but, yes, I'll likely add something for that. Wren grew out of a prototype-based language called Finch and the latter has "property definitions" that let you define a private field and accessor in one go: http://finch.stuffwithstuff.com/objects.html http://finch.stuffwithstuff.com/objects.html > I'm not sure about its level of completeness right now. A lot of language features are implemented and everything that's implemented has pretty solid tests. There's still a bunch of more minor stuff to do, but what it really lacks is real-world usage. I've been hacking on it in isolation (because implementing the language itself is the real fun part for me), but an embedded scripting language needs to be embedded in some real apps to get the critical feedback needed to make it useful. To make some progress there, I'm starting to hack together a little game engine using Wren (think something like Löve2D), but I haven't put much time into that yet.