Enso Compiler 2.0 (Alpha 2) #806
Labels
--breaking
Important: a change that will break a public API or user-facing behaviour
p-medium
Should be completed in the next few sprints
Summary
The current interpreter treats the entirety of the static analysis and compilation phase as an afterthought, but this is not a state of affairs that can be maintained if we want to evolve the language.
In order to support the new syntax and more sophisticated language features, including typechecking in the future, we need to have a proper 'compiler' front end to the Enso interpreter. This, along with the interpreter and the language server, is what makes up the totality of the Enso Engine. The compiler is intended to support the following capabilities:
The initial compiler implementation is based purely on the existing machinery, but it is organised in a fashion more amenable to evolution and further development.
Value
The first phase of the development of the compiler component aims to provide all the facilities necessary for integrating the new syntax with the interpreter. This will start off with a limited subset of the syntax, and then evolve the featureset to support all the necessary capabilities, giving us a usable form of the new syntax as soon as is possible.
Specification
The following elements are presented in order as a plan for integrating the new parser and new compiler front-end with the existing interpreter. After the completion of each of these steps the interpreter should be in a working state.
AST
(the parser AST type) toAstExpression
(luna-package fails to compile on Windows #276).SourceLocation
information from core through the compiler transformations (Class fields have incorrect spans #290).It should be noted that these steps provide gradual support for syntactic sugar. This is in order to ensure that analysis passes do not have to cope with extraneous nodes from
Core.Sugar
, and can instead deal (where relevant) only withCore.Primitive
structures.Acceptance Criteria & Test Cases
The text was updated successfully, but these errors were encountered: