Closed Lobarr closed 6 years ago
Seems beyond the scope of Anko
Okay, Thanks
@Lobarr I made an encoder
/decoder
for anko.
So basically, you can compile your source into a binary format and execute it:
anko -o myapp myapp.ank # compile 'myapp.ank' into binary file 'myapp'
anko myapp # execute the compiled binary 'myapp'
or if you use it as a library, I added the following methods:
func (e *Env) Compile(src string) ([]byte, error) {}
func (e *Env) ExecuteCompiled(src []byte) (interface{}, error) {}
Concept:
source -> ast -> encoded AST in binary file
Then encoded -> ast -> execute
My goal was to have "closed-source" sharable scripts that are executable at runtime. Ping me, if you want to know more.
PS: I'm also working on having compile-time errors instead of runtime errors.
Does anko compile to bytecode and would it be possible to execute bytecode in the vm?