I understand that compiling any DLR-language to C#-like libraries is quite difficult / impossible, because of the dynamic features. And I also think it's not so important.
It has been a while since I last read the DLR specification but to the best of my recollection it still requires compilation (at some stage) to CIL. CIL is highly portable and works across all .NET languages
, even with Java and native C. IronAHK compiles directly to CLS-Compilant
CIL in a very direct and sophisticated fashion thanks to Tobias' thorough understanding of the core specification. However I agree with you, the DLR is not necessary and is beyond the scope of our development goals at this stage.
But compilation to a *.exe file is needed (for IA) IMHO.
Yes, compilation is a fundamental aspect of the project and my last two commits fixed some parts of a major bug in the compiler which Tobias and I had run into.
Intuitively, I'm guessing that the main problem is ahk's dynamic types. If that's the case I wonder if a .net type could be constructed that would emulate ahk's variable behavior in entirety, and if this would allow scripts to be compiled as libraries and be used by any .net language, not just IA scripts.
IronAHK supports this in full already. It does this by making extensive use of boxing and casting. While admittedly expensive, it is the most portable and flexible approach.
if IA supported classes one day, it may be difficult to use them from e.g. C#, because dynamic features such as adding new methods on runtime is difficult to emulate. The same is true for the other DLR languages (I think).
Adding new methods at runtime is not really difficult, it can be done by emitting opcodes
or sometimes even by reflection. I've done similar things in Java many times with ASM
and the principals are the same.
This is the only problem which the current architecture of the IA generated code has: It is kind of a unreachable Blackbox.
This is true to an extent, but unavoidable due to features
in AutoHotkey like dynamic variable names which is a concept that doesn't exist in any other language I know of. It is possible to bridge them over with public accessors, which is something planned for later.