Hacker News
Wren: A classy little scripting language
plainOldText
|next
[-]
thw_9a83c
|root
|parent
|next
[-]
smnplk
|root
|parent
[-]
SatvikBeri
|root
|parent
|next
[-]
(There are fewer options for the second half, since you need more control over memory management.)
Conscat
|root
|parent
[-]
pansa2
|root
|parent
[-]
Does it? I know it uses metaprogramming (a Java program that outputs another Java program), but that’s probably easier in other languages than in Java. In my Python implementation I was able to significantly simplify that part of the code by using `eval`.
thw_9a83c
|root
|parent
|next
|previous
[-]
BTW, I'm not the author of either of those books, but I have read both of them.
nine_k
|root
|parent
|next
|previous
[-]
l9o
|root
|parent
|next
|previous
[-]
manveru
|root
|parent
[-]
ronbenton
|root
|parent
|next
|previous
[-]
apitman
|next
|previous
[-]
MattJ100
|root
|parent
|next
[-]
You may also be interested in this project: https://github.com/fengari-lua/fengari
Imustaskforhelp
|root
|parent
|previous
[-]
Thank you for your service in self-hosting. I had so much fun trying to break nats with awesome tunneling projects and I even created my own but it actually requires a custom patch of ssh with pinggy to work without nat (let me know if you are interested, as I had discovered this a year ago but I just am a little lazy haha)
I have created only one issue on the awesome tunneling but let me tell you some of them don't work in nat's/broke
https://freedomhascost.bearblog.dev/
Just created the bearblog post, not sure why the name but just wanted to say thank you and wanted to share any knowledge I have in the process as well to strengthen the hacking/tinkering community. Thanks once again
Also its just a bit of a coincidence that we are talking on a wren page as I was literally reading about wren once again and playing with it just yesterday and joined their discord server yesterday or day before that to tinker with it. Wren is really elegant and I feel like I want to write more software which integrates it instead of lua as a thought experiment as well and wasm seems a cool idea too in that regards.
gnabgib
|next
|previous
[-]
2020 (122 points, 54 comments) https://news.ycombinator.com/item?id=23660464
ksymph
|next
|previous
[-]
bragr
|next
|previous
[-]
versteegen
|root
|parent
|next
[-]
There are loads of scripting languages but very few of them have an embedding API as powerful as Lua or Squirrel's. (My benchmarks: what's the overhead of a userdata pointer? Is there a proper debug API? Can you suspend a co-routine from inside a called C function? Very few languages even have coroutines.) Last I looked at it years ago, Wren was one of the best. Of course, the most featureful embedding API of all belongs to LuaJIT.
teo_zero
|root
|parent
[-]
Is it still active? Last release was in 2022...
pansa2
|root
|parent
|previous
[-]
Wren looks a bit more orthodox, although it's heavily built around class-based OOP - you can't even define and call a top-level function without extra syntax to (1) turn it into an object, and (2) call one of that object's methods:
var sayHello = Fn.new { System.print("hello") }
sayHello.call() //> hello
pcfwik
|next
|previous
[-]
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.
0x0203
|root
|parent
|next
[-]
Ones that might be of interest to you are Umka, tcl, and berry.
There's also a lot of others listed that range from someone's experimental side project to professional grade and well supported languages. Kinda fun to see different people's approaches to things, and no matter what your preferred programming style, there's probably a few in there that will mesh pretty well.
dkersten
|root
|parent
|next
|previous
[-]
spooky_deep
|root
|parent
|next
|previous
[-]
user____name
|root
|parent
|next
|previous
[-]
pansa2
|root
|parent
|previous
[-]
That sounds a lot like what LuaJIT’s FFI provides: https://luajit.org/ext_ffi.html
tromp
|next
|previous
[-]
[1] https://rosettacode.org/wiki/Rosetta_Code/Rank_languages_by_...
davidw
|next
|previous
[-]
reactordev
|next
|previous
[-]
nick__m
|root
|parent
|next
[-]
...In more prosaic terms, this means that static methods are not inherited.
pansa2
|root
|parent
|previous
[-]
I'd be interested to hear more details about the issues with that approach. I've not had any problems with it, and occasionally found it useful. For example, in one situation I needed a hierarchy of static constructors that matched the hierarchy of instance constructors.
[0] Ruby also has "the meta-metaclass hierarchy matches the metaclass hierarchy" and "the meta-meta-metaclass hierarchy..." ad infinitum. It's a beautiful design really - it means that in Ruby (unlike Smalltalk), it's always true that "the superclass of the metaclass is the metaclass of the superclass".
Edit: Here's the quote I was remembering:
> My hunch is that we don't want metaclass inheritance. From talking to a few old Smalltalkers, they generally consider it a mistake there. Also, Java, C++, C#, etc. have semantics more similar to not allowing metaclass inheritance (in other words, static methods aren't inherited), and it seems to work well there.
https://groups.google.com/g/wren-lang/c/LkKg51fEUg4/m/0GOK0P...
reactordev
|root
|parent
[-]
sandbags
|next
|previous
[-]
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.