Embeddable?
Hi! I was wondering if this lang had support for being embedded in Rust? It looks super cool, and I would like to use it.
There is some stuff exposed in src/lib.rs. I'm in the middle of rewriting this entire thing though, so don't expect any forward compat.
Alright. I see. Thanks. I'll be looking forward
Edit: Btw do you have Discord? Or some other chat. I wanna ask a couple of questions/discuss related to Slither, if it's okay of course.
you can just ask here.
I would rather not discuss it all here, but basically I'm looking for using it as a scripting language for a web engine I'm working on. Like JS (fx V8). And I was wondering if such would be possible? And what would be the best way for me to implement custom builtin types? Like Document, Node, etc. and how I would initialize each value. Would it be possible to do from the "Rust interface"? Please let me know if you don't think such would be possible. As I would then need to make my own language.
Thanks in advance
you can't make new types, there are just the primitives (null, string, symbol, number, object, tuple). you can define new classes (which are just sugar for functions). Many of the semantics of this language match JavaScript so your intuitions about that should get you pretty far.
you can define new classes (which are just sugar for functions)
What does this mean? Is it like JS, where functions are used to make prototypal objects?
@tech6hutch yes it's the same system as js.
you can't make new types, there are just the primitives
Yes. Excuse me for saying that gibberish. What I meant was I want every script to have/use a "builtin" class. I then also want every script to automatically instantiate a new instance with some values from within Rust. I was wondering how I would go about doing so?
Many of the semantics of this language match JavaScript
This was not what I meant when I said it would work like JavaScript and web engines work. I meant that it should work/interact the same way with the engine, as JS does. Fx Blink & V8
As you would in js, you can create a function (either from slither or from rust) and then add more functions to its prototype object to add methods.
And how would I create functions/classes from Rust? To use in files. And how would I then initialize a variable for each file? Would I just need to add a line manually in the top of the file?