dyon
dyon copied to clipboard
Compile to byte-code or obfuscate(uglify)
Often developers don't want to distribute script source in plain text, so compiling to byte-code (or obfuscation) is very useful, is this possible in the future of dyon?
Yes, I believe this is a possibility. I wonder if I get time to work on it, though.
Dyon executes code from AST, so the code is very high level if we serialize the AST. Breaking changes to the AST will break the code.
An alternative is storing meta data from Piston-Meta. This will make it possible to load code faster.
Nice to know it's possible!
I'm not a PL expert, but I guess it's easier to do obfuscation with the AST rather than compiling to byte-code? Right?
For example renaming symbols to meaning-less a/b/c/d
, like the uglifier for Javascript, I personally think this is more than suffice for a scripting language.
Please correct me if I'm wrong.
You could also use the meta syntax to rewrite the source code (using Piston-Meta to get the location of variables) and then inline the code with include_str!
.
I'll check it out, Thanks!