> Thanks, much more well put. If only we knew someone who made an easy way to 
> embed the Nim interpreter. ;)

Hey @pmunch did give me an idea I've slowly started to chip away at. Exposing 
the NimVM with a C-api to reduce the compile time and also reduce the file size 
of a program using Nimscript. This can be seen in use: 
<https://github.com/beef331/nimscripter/blob/dll/tests/lib/helloworld.c>

Truthfully I attempted to avoid `ref T` but it's the only memory safe way of 
doing it that I can tell. Even though I use `ref T` and inheritance my UI is 
fully statically dispatched, not that it's that streamline due to dispatch 
logic being a bit convoluted for what is the 'most specific'. To me using 
closures and `ref` really is the best experience as it "just works" and there 
is no real "How do I pass X to Y in some way". Just make a closure that 
captures a reference and you're good. Want to change an unrelated element on 
hover, just grab the node you want then change it's fields. Plus UI elements 
are self contained, you do not need to manually pass a value to them for them 
to work. I do think using a signal system would be nicer for passing things 
around over my callback hell, but meh. 

Reply via email to