enso
enso copied to clipboard
Removing last node from main graph makes execution error
As in description: the error appears:
And then nothing can be done in the graph.
Not reproducible on c2842df8d83139702f9ba712452f0ea84f98524e
Still getting the error message in enso-win-x64-2024.1.1-nightly.2024.4.30.exe
Removing last node from the graph leaves behind code main =
, which is invalid:
The engine sends in on of executionContext/executionStatus
messages that this is an invalid syntax. Which is expected.
Later, when I try to create a new node in an empty graph, the GUI sends executionContext/executeExpression
for something in the component browser, and engine responds with an executionContext/executionFailed
as expected.
I believe that the problem is on the side of the GUI, that should ensure that once a graph is empty, it should not leave an empty block behind resulting in invalid syntax.
After a discussion on Discord, we came to a conclusion that the following snippet:
main =
Should be semantically equivalent to:
main =
Nothing
Also note that for parser, the assignment operator without rhs is not an error. For example, the following code:
main =
operator1 =
operator2 =
is parsed as
(BodyBlock #(() (Function (Ident main) #() () "=" (BodyBlock #((Function (Ident operator1) #() () "=" ()) (Function (Ident operator2) #() () "=" ())))) () ()))
After all, the problem can be solved on the Engine side somewhere in https://github.com/enso-org/enso/blob/develop/engine/runtime-parser/src/main/java/org/enso/compiler/core/TreeToIr.java#L248-L251
GitHub
Hybrid visual and textual functional programming. Contribute to enso-org/enso development by creating an account on GitHub.
Unassigning, because once engine will support empty function blocks, the GUI should work just fine. If it won't just reassign -gui
and me.
Because we don't implicitly import builtins, the following code
main =
will fail with error: The name Nothing could not be found.
Because we don't implicitly import builtins, the following code
main =
will fail with
error: The name Nothing could not be found.
But this code
main =
operator2 = 13
Does not fail with any error, while still returning Nothing.
Ok, that makes sense, so the
main =
should result in
main = ()
where ()
is an empty block that when evaluated, result to Nothing
Dmitry Bushev reports a new STANDUP for today (2024-05-23):
Progress: Started working on the issue. Investigating what is happening during the execution of a method with an empty body. Added support for functions with empty bodies in parser. Working on the runtime support for empty method bodies. It should be finished by 2024-05-25.
Next Day: Next day I will be working on the #9172 task. Continue working on the task