Its been long overdue, but we have finally posted 1.0.68!
Dom Changes
There have been many breaking changes to the dom APIs. This is in preparation for the development of a brand new UI toolkit called domkit which we hope to open source later this year. Domkit replaces FWT as our toolkit for developing HTML5 user interfaces in Fantom. See topic 2466 for more details, and please review change log for list of changes.
Windows Launcher
We have replaced the Windows executable launchers with batch scripts. For example you now use fan.bat instead of fan.exe to launch a Fantom program. This allows a single set of launchers to work for both 32-bit and 64-bit JVMs. Plus it cleans up how to handle substitutes for bootstrap so that things are consistent with Unix.
Running as Windows Services
This build also introduces a new Window’s program called fansc.exe which makes it easy to configure Fantom programs to run as Window’s service in the background. See docs for details.
JavaScript Source Maps
Compiling Fantom to JavaScript now generates source maps so that stack tracing and debugging in the browser shows Fantom source and Fantom source code line numbers (you have to wire up a WebMod to show source though).
JavaScript Optimizations
Two important JS compiler optimizations:
closure call sites are optimized to reuse reflection data to significantly reduce allocation of temp objects
we now support a fairly compressed JS file that can load the entire timezone database in the browser (its precompiled and stored in etc/sys)
HTTPS
Wisp now supports HTTPS out of the box. When running in HTTPS, both a http and https port are configured and all http traffic is redirected to the https socket. To enable this feature you must setup your keystore in PKCS12 format under /etc/inet/keystore.p12. See docs for details on how to setup. This change deprecates the port field in favor of httpPort.
WebSockets
This build includes a prototype for both client and server side web::WebSocket. The server side isn’t quite complete because I still want to enhance it a bit to pull it off the wisp actors.
Actors
We have deprecated support for serialized messages in actors. If you are not using immutable messages, then you will receive a gaint dump to stdout warning you not to use serialization for messages. That feature caused a lot of subtle bugs and performance problems. I will completely remove support for non-immutable messages in the next build. See topic 2428 for full discussion.
We have also enhanced the Future API to be completed through an API calls versus just an actor response. As part of this change we added a FutureState enum you can query and tweaked some of the API terminology.
Param Reflection
You can now reflect the expression used by a method parameter default. For example:
static Str foo(Str bar := "baz") { bar }
method := type.method("foo")
param := method.params[0]
defVal := type.method(“foo”).paramDef(param) // evaluates to “baz”
Immutable Bufs
At long last you can lock down an in-memory sys::Buf as an immutable object. This makes to safe to pass Bufs between actors or store in a const field. All that is needed is to call sys::Obj.toImmutable on the Buf instance. This only works for in-memory buffers:
Buf().print(“hello”).toImmutable
Making a Buf immutable is a cheap operation because it creates a shallow copy, but to ensure its immutable it “steals” the byte[] from the source to avoid a memcopy. This means the original Buf is effectively cleared.
Buf PBKDF2
A new sys::Buf.pbk method provides support for PBKDF2 with SHA-1 and SHA-256. This functionality is implemented for both JVM and JS environments.
Returning Void
We slightly modified the language to allow a return statement with an expression inside a Void method per topic 2403:
// old way
if (!file.exists) { res.sendErr(404); return }
// new way
if (!file.exists) return res.sendErr(404)
brian Thu 7 Apr 2016
Its been long overdue, but we have finally posted 1.0.68!
Dom Changes
There have been many breaking changes to the
dom
APIs. This is in preparation for the development of a brand new UI toolkit calleddomkit
which we hope to open source later this year. Domkit replaces FWT as our toolkit for developing HTML5 user interfaces in Fantom. See topic 2466 for more details, and please review change log for list of changes.Windows Launcher
We have replaced the Windows executable launchers with batch scripts. For example you now use
fan.bat
instead offan.exe
to launch a Fantom program. This allows a single set of launchers to work for both 32-bit and 64-bit JVMs. Plus it cleans up how to handle substitutes for bootstrap so that things are consistent with Unix.Running as Windows Services
This build also introduces a new Window’s program called
fansc.exe
which makes it easy to configure Fantom programs to run as Window’s service in the background. See docs for details.JavaScript Source Maps
Compiling Fantom to JavaScript now generates source maps so that stack tracing and debugging in the browser shows Fantom source and Fantom source code line numbers (you have to wire up a WebMod to show source though).
JavaScript Optimizations
Two important JS compiler optimizations:
HTTPS
Wisp now supports HTTPS out of the box. When running in HTTPS, both a http and https port are configured and all http traffic is redirected to the https socket. To enable this feature you must setup your keystore in PKCS12 format under
/etc/inet/keystore.p12
. See docs for details on how to setup. This change deprecates theport
field in favor ofhttpPort
.WebSockets
This build includes a prototype for both client and server side
web::WebSocket
. The server side isn’t quite complete because I still want to enhance it a bit to pull it off the wisp actors.Actors
We have deprecated support for serialized messages in actors. If you are not using immutable messages, then you will receive a gaint dump to stdout warning you not to use serialization for messages. That feature caused a lot of subtle bugs and performance problems. I will completely remove support for non-immutable messages in the next build. See topic 2428 for full discussion.
We have also enhanced the Future API to be completed through an API calls versus just an actor response. As part of this change we added a FutureState enum you can query and tweaked some of the API terminology.
Param Reflection
You can now reflect the expression used by a method parameter default. For example:
Immutable Bufs
At long last you can lock down an in-memory
sys::Buf
as an immutable object. This makes to safe to pass Bufs between actors or store in a const field. All that is needed is to callsys::Obj.toImmutable
on the Buf instance. This only works for in-memory buffers:Making a Buf immutable is a cheap operation because it creates a shallow copy, but to ensure its immutable it “steals” the
byte[]
from the source to avoid a memcopy. This means the original Buf is effectively cleared.Buf PBKDF2
A new
sys::Buf.pbk
method provides support for PBKDF2 with SHA-1 and SHA-256. This functionality is implemented for both JVM and JS environments.Returning Void
We slightly modified the language to allow a return statement with an expression inside a Void method per topic 2403:
Bit I/O
We have added bit-level support to the I/O APIs:
sys::InStream.readBits
sys::OutStream.writeBits
Partial bytes are buffered in the stream until complete 8-bit bytes can be read or written.
Change Log
Build 1.0.68 (6 Apr 2015)
SlimerDude Thu 7 Apr 2016
Awesome Brian, this is welcome news indeed!
Many thanks, Steve.
LightDye Fri 8 Apr 2016
That is great news! Thank you!