enso/engine/runtime
Jaroslav Tulach 172f72941b
Two findExceptionMessage methods to extract exception messages consistently (#5684)
Creating two `findExceptionMessage` methods in `HostEnsoUtils` and in `VisualizationResult`. Why two? Because one of them is using `org.graalvm.polyglot` SDK as it runs in _"normal Java"_ mode. The other one is using Truffle API as it is running inside of partially evaluated instrument.

There is a `FindExceptionMessageTest` to guarantee consistency between the two methods. It simulates some exceptions in Enso code and checks that both methods extract the same _"message"_ from the exception. The tests verifies hosted and well as Enso exceptions - however testing other polyglot languages is only possible in other modules - as such I created `PolyglotFindExceptionMessageTest` - but that one doesn't have access to Truffle API - e.g. it doesn't really check the consistency - just that a reasonable message is extracted from a JavaScript exception.

# Important Notes
This is not full fix of #5260 - something needs to be done on the IDE side, as the IDE seems to ignore the delivered JSON message - even if it contains properly extracted exception message.
2023-02-20 11:27:16 +00:00
..
src Two findExceptionMessage methods to extract exception messages consistently (#5684) 2023-02-20 11:27:16 +00:00
README.md Add a markdown style guide (#1022) 2020-07-21 13:59:40 +01:00

Enso Runtime

The Enso runtime is responsible for the actual execution of Enso code. This means that it encompasses the following functionality:

  • Parsing: Taking Enso code as input and generating an AST that maintains a sophisticated set of information about the input.
  • Desugaring: Reducing the user-facing Enso code into a simplified language known as Core.
  • Type Inference: Inferring the types of bindings in the user's code.
  • Type Checking: Checking that the inferred and provided types for bindings match up across the codebase.
  • Optimisation: Static optimisation processes to improve the performance of the user's program.
  • Code Execution: Actually running the Enso code.
  • Introspection Hooks: Providing hooks into the running code to allow the language server to inspect information about the code as it runs.

Truffle Nodes creation convention

All Truffle nodes that are expected to be created as part of ASTs should implement a public, static build method for creating an instance. If the node is DSL generated, the build method should delegate to the autogenerated create method, so that nodes are always created with build. Such a convention allows us to easily switch node back and forth between manual and DSL generated implementations, without the need to change its clients.

The only exception are nodes that are never expected to be a part of an AST e.g. root nodes of builtin functions, for which an asFunction method should be implemented instead.

This convention should be implemented for every node throughout this codebase if you see one not obeying it please fix it.