Brussels / 3 & 4 February 2024

schedule

The Challenges of Running the Fuzion Language Natively on the OpenJDK


The Fuzion language is a hybrid functional and object-oriented language that in many respects behaves exactly diametrical to Java. Nevertheless, the JVM has turned out an excellent target platform for Fuzion and in this talk I will present why that is the case and what challenges had to be overcome.

Fuzion uses algebraic types, i.e., product types and tagged union types. All types can be parametric, but unlike Java not using type-erasure but monomorphisation.

Unlike Java, where user defined types have reference semantics, Fuzion has value semantics by default, reference semantics only for types that are explicitly declared so.

I will present how these are implemented in the new JVM byte-code back-end and what trade-offs and optimizations are made. In particular, I will

  • present several levels of optimizations for tagged union types when mapped to efficient to byte-code

  • show how product type with value semantics are implemented, where the JIT compiler creates surprisingly efficient code and how we all could profit form project valhalla

  • explain how type parameters (generics) are implemented using monomorphisation including support for basic types as type parameters and what benefits this brings.

  • analyze the JVM's black magic of method dispatch and its impact on implementing dynamic dispatch for multiple inheritance in Fuzion.

  • show how the classfile verifier helped to fix bugs in the C backend

Links: - github: https://github.com/tokiwa-software/fuzion - Fuzion portal: https://flang.dev

Speakers

Photo of Fridtjof Siebert Fridtjof Siebert

Attachments

Links