enso/engine/runtime
Jaroslav Tulach 4b4167fc06
Curried and lambda function invocation should be both fast (#3979)
Benchmark to compare _curried and lambda_ based function invocations and a fix to make _curried_ invocation (at least) as fast as the _lambda_ one. Allows us to use _curried invocations_ in standard library again without loosing any speed.

# Important Notes
Execute as:
```
sbt:runtime> benchOnly CurriedFunctionBenchmarks
```
Prior to subsequent bugfixes in this PR the benchmark results were:
- `averageCurried` runs in 0.290 ms
- `averageLambda` runs in 0.122 ms

e.g. _curried invocations_ is more than twice slow. That confirms our findings from the `Array_Proxy` vector benchmarks. The problem is that _function object is not compilation final_. After fixing it we have following results:
- `averageCurried` runs in 0.102 ms
- `averageLambda` runs in 0.111 ms

e.g. both operations are of similar complexity.
2022-12-16 07:12:24 +00:00
..
src Curried and lambda function invocation should be both fast (#3979) 2022-12-16 07:12:24 +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.