Back to Enso

Enso Polyglot Support

docs/polyglot/README.md

2025.3.42.0 KB
Original Source

Enso Polyglot Support

Enso supports robust interoperability with other programming languages - e.g. Enso is a polyglot programming languge.

interoperability with Java

Unlike many other programming languages the system language of Enso (e.g. the language that is used to do low-level operating system tasks) is Java. As such a lot of attention has been dedicated to make interoperability with Java as smooth as possible:

  • Java: Detailed info about the Java polyglot bindings.

Many Standard libraries are using these polyglot java import statements. Custom projects and libraries are encouraged to do the same. Interoperability with Java is a first class citizen in the Enso programming language.

Interoperability with Python, JavaScript & co.

Enso greatly benefits from the polyglot ecosystem of GraalVM and easily interops with any language from that ecosystem. Including JavaScript, Python, R, etc.

  • Python: Specifics of the Python polyglot bindings.

Interop with these dynamic languages is primarily supported via foreign function definitions. When accessing Python, as well as other dynamic languages, the same pattern is used. Enough include the language support in the distribution and the language gets automatically exposed via foreign directive to Enso programs.

Implementation

Additional overview is provided in following documents:

  • Polyglot Bindings: A document providing an overview of the mechanisms provided to work with polyglot bindings in Enso.
  • Typing Polyglot Bindings: An exploration of how we can provide a modicum of type safety for the polyglot bindings in Enso.

Implementation details are described in EpbLanguage javadoc.