We have posted build 1.0.82 for download and updated the online docs.
Fanc
We are introducing a new command line tool fanc as the hub for all compiler and transpiler tools. This initial version provides access to existing JavaScript transpiler tools. Plus we are introducing a brand new feature to transpile Fantom to Java source code.
Java Transpiler
Using fanc you can now transpile a set of Fantom pods into Java source code. This provides some advantages over using JarDist in that it integrates more cleanly into Java projects for build and IDE tools. See docLang/Java for more details. We also spend quite a bit of effort to make the Java APIs more ergonimic including making Fantom List/Map Java generic types and they now implement their respective java.util interfaces.
Java Changes
In order to support a more ergonomic Java API for Fantom code we did introduce some breaking changes to the Java implementation of Fantom classes:
fan.sys.List now implements java.util.List and uses Java generics
fan.sys.Map now implements java.util.Map and uses Java generics
List constructors replaced with List.make
Generic types are package private
Use Type.makeFunc and makeMap to construct generic types, or Map.make(k, v)
Use Type.x to access generic parameters if required
Some methods and List/Map prefixed with _ so then can implement java.util APIs
Chained List.add needs to be _add now
Unicode in Java
Under the covers we have made several changes to improve Java support for surrogate pairs for Unicode chars above plane 0 including emojis. We have also added support for a new Unicode escape sequence \u{xxxxx} that works just like JavaScript for hex code points that are over 16-bits.
JavaScript Design Transition
Starting in build 1.0.81 we are no longer implementing new methods in the old JavaScript code, only in the new ECMA design. We are now defaulting WebJsMode to es for all FilePack APIs. The current plan is to fully remove support for the old JavaScript design in build 1.0.83.
ChangeLog
Build 1.0.82 (26 Jun 2025)
New fanc tool for transpiling to Java source
Java make List/Map generic types
Java List implements java.util.List
Java Map implements java.util.Map
Java make fan.sys.Type subclasses package scope
Java make all Map and List constructors package scope
Compiler: rename CParam.paramType to type
Compiler: rename CMethod.returnType to returns
Compiler: rename CField.fieldType to type
Compiler: rename MethodDef.ret to returns
Compiler: rename FuncType.ret to returns
Default default WebJsMode to es
Add File.withIn and File.withOut
Add StrBuf.joinNotNull
Add Win.devicePixelRatio
Add Stroke.scale
Add Doc.hasFocus
Add Win.hisState
Add concurrent ActorContext
Add util::SyntheticFile
Date convenience methods for quarter, year
ES support for IntArray and FloatArray
New docs: Interop, Java, and Fanc
Add string literal escape sequence for \u{xxx}
Improve surrogate pair support in Java
France locale change start of week from Sun to Mon
Naren SYesterday
Hi Brain,
Firstly, thank you for adding all the new features to Fantom — I really appreciate the team’s effort and improvements so far.
However, I haven’t seen any changes implemented by the team on the
echo function
and append "+" operator
so far in release notes.
I have identified a bug with the parameterised echo function. It works fine when printing a simple string message, but it fails whenever I try to print a parameter or variable value.
The same if I tried to append a variable value into any string
brian Thu 26 Jun
We have posted build 1.0.82 for download and updated the online docs.
Fanc
We are introducing a new command line tool
fanc
as the hub for all compiler and transpiler tools. This initial version provides access to existing JavaScript transpiler tools. Plus we are introducing a brand new feature to transpile Fantom to Java source code.Java Transpiler
Using
fanc
you can now transpile a set of Fantom pods into Java source code. This provides some advantages over using JarDist in that it integrates more cleanly into Java projects for build and IDE tools. See docLang/Java for more details. We also spend quite a bit of effort to make the Java APIs more ergonimic including making Fantom List/Map Java generic types and they now implement their respective java.util interfaces.Java Changes
In order to support a more ergonomic Java API for Fantom code we did introduce some breaking changes to the Java implementation of Fantom classes:
Unicode in Java
Under the covers we have made several changes to improve Java support for surrogate pairs for Unicode chars above plane 0 including emojis. We have also added support for a new Unicode escape sequence
\u{xxxxx}
that works just like JavaScript for hex code points that are over 16-bits.JavaScript Design Transition
Starting in build 1.0.81 we are no longer implementing new methods in the old JavaScript code, only in the new ECMA design. We are now defaulting WebJsMode to
es
for all FilePack APIs. The current plan is to fully remove support for the old JavaScript design in build 1.0.83.ChangeLog
Build 1.0.82 (26 Jun 2025)
Naren S Yesterday
Hi Brain,
Firstly, thank you for adding all the new features to Fantom — I really appreciate the team’s effort and improvements so far.
However, I haven’t seen any changes implemented by the team on the
so far in release notes.
I have identified a bug with the parameterised echo function. It works fine when printing a simple string message, but it fails whenever I try to print a parameter or variable value.
The same if I tried to append a variable value into any string
eg. welcome := "Hello, "+name
//Test class
class FantomTest {
}
and compilation error:
CompileJs ERR: Internal compiler error sys::UnknownSlotErr: sys::Method.inheritedReturnType
BUILD FAILED [269ms]!