elena-lang
elena-lang copied to clipboard
elt crash
Hello,
while running elt, I entered exit command (my habit) causing crash, e.g. starting debugger in postmortem mode.
- OS: Windows 10 Pro 64 bit
- Version: ELENA VM 5.2.17
Thanks. I will check
The bug is fixed in the upcoming version - 6.0.4.
Closing the ticket. @Ilir-Liburn, please, fill free to reopen it if after the release (somewhen around start of July) if the problem still exists for you
Hello,
what is equivalent to elt (Virtual machine console) in upcoming version? Can compiled and linked code use eval (is it possible outside the VM)?
Hi, it will be called - elt-cli.exe
Yes, stand-alone executable can use the scripting as well. See for example this tutorial - https://github.com/ELENA-LANG/tutorials/tree/master/ExpressionTree2 . Of course all used classes and messages should be declared.
The simplest code can look like this:
import extensions;
import extensions'scripting;
public program()
{
var t := new ScriptEngine()
.loadScript("[[ #grammar build ]]")
.loadPath("~\scripts\grammar60.es")
.loadPath("~\scripts\tscript60.es");
var o := t.buildScript("public program() { console.writeLine(""Hello World"") }");
o.eval();
}
Of course, there are things to work on. For example the extensions are not yet supported, I'm working on it. Currently it is done only for windows x86. With time I will migrate it to all remaining platforms
ELENA will support the user-defined grammar for source files as well.
Thanks,
first one is about user defined scripts, second is about executing Elena code, right? If yes, can eval create classes/methods, functions, etc?
User-defined grammar will generate the normal codes with classes & symbols and be executed as a normal code.
Evaluation of the code in run-time will be able to create the classes as well (in ELENA, a function is a special case of a class). Though it is not normal class. It is a mix-in. You can use it but you cannot inherit it (at least currently, maybe some form of inheriting can be implemented). But for the most of the cases, it will be a normal class. You can call a method, pass it further and so on. I'm not yet 100% finish with it, it is possible to create a singleton. I will add support for classes which can be created later. Another limitation, that you cannot inherit from another class. Though I think I will be able to support the interfaces.