Blog Post

#1785 Build 1.0.62

brian Fri 24 Feb 2012

New build is posted and online docs updated.

Enhanced Constructors

A couple of really nice enhancements to make Fantom constructors more flexible:

  • construction syntax now works with every method tagged with new keyword and allows overloading by parameter types
  • static constructors now allow you tag static factories methods with new keyword
  • static constructors don't inherit into subclass namespace, keeps flexibility for your constructor naming
  • all make and fromStr static factories in core have been changed to static constructors

Notes for these changes related to existing code bases:

  • it is possible that recompiling from source will generate new "Ambiguous constructor" errors. The simplest fix is to use explicit constructor name.
  • using a static make or fromStr with construction syntax will report a warning. Fix is to change those methods to static new methods.

For more detailed discussed see ticket #1776.

Java Support

There have been significant enhancements to the Java FFI subsystem:

  • compilerJava now uses a disassembler instead of relying on reflection
  • compilerJava now includes pod dependency chain as classpath
  • Java runtime now includes pod dependency chain as classpath
  • compiler support for easily wrapping JARs as Fantom pods

For more detailed discussed see ticket #1780.

JavaScript Support

Andy has fixed many tickets related to the JavaScript compiler and runtime. Note that the JavaScript compiler now checks that @Js types don't use non @Js types. This might uncover some new compiler errors in your code (we had a few occurrences of this in our codebase).

Doc Compiler

Quite a bit of work was done back in December to compilerDoc. Most all the data structures were refactored to be immutable. This allows this code to be more easily used with actors and caching engines. On http://skyfoundry.com/ we are now running online documentation and the search engine straight from a fanr repository. That work was the final pieces we need to upgrade this site to the new sidewalk stack. So hopefully we'll be doing that in the next month or two.

Decimal Literals

Per discussion topic #1743, I have changed the "d" suffix on decimals to be required. This was actually a much needed change and I was surprised how many places in my own code I had stuff screwed up. So now all float/decimal literals will be explicitly readable in code.

Fant Scripts

The fant tester can now accept a script file in addition to pods, types, and slots. This is a useful little feature if you want to try out stuff quickly or want to post test scripts on the forum.

New Compiler Visibility Checks

I noticed the compiler wasn't checking type visibility in is, isnot, as, and casting expressions. If you had expressions using an internal type in another pod they will now be compiler errors.

Prototype PathEnv

There is a bit of prototype code in this build to setup a PathEnv from your directory structure instead of using environment variables. The runtime will look in your current directory upwards to see if it finds a directory with a "fan.props" file. If it does that is considered your working directory. The "fan.props" file can define intermediate paths using "path" key. The thinking is that this model would make Fantom paths work more like Mercurial where your current "project setup" is based solely on your current working directory.

This is just a prototype and in no way official. We are going to work with it for a few months and see what we think. Its one baby step on the need to rethink launchers, configuration options, and complex multi-project Fantom development environments. But you are welcome to start using it and provide your feedback.

ChangeLog

Build 1.0.62 (24 Feb 2012)

  • Add gedit config file
  • Tweak compiler to omit fcode/types.def if no types
  • Refactor Compiler.depends
  • Redesign compilerDoc
  • Add localeTestMode for JS environment
  • Fix fanlauncher to work in Cygwin
  • Fix Decimal to handle non-terminating divide
  • SmtpClient SSL support
  • Zip limit checks
  • Add locale keys for Duration.toLocale
  • Require "d" suffix for Decimal literals
  • Fant can now run script files
  • Add classfile disassembler to compilerJava
  • Switch Java FFI to use disassembler instead of reflection
  • Fix resource handle to allow jars to be bundled with pods
  • Fix compiler/runtime to search dependencies for Java classfiles
  • Compiler check for type visibility for is, isnot, as, casting
  • Prototype for "fan.props" PathEnv
  • #1143: js: Method.call fails for some core types
  • #1385: js: sys::List API problems
  • #1577: js: exception when Map->size
  • #1652: js: Type.params not implemented
  • #1683: JS: Assignment operator complie error
  • #1684: JS: Call super field
  • #1718: Require func param types when used in slot signatures
  • #1722: Cycle-dependent pod
  • #1738: Ambiguous slot issue
  • #1776: Proposal: Enhanced Constructors
  • #1778: Map#findAll() and Map#exclude()
  • #1780: Enhanced Java Support
  • #1782: js: Support for overriding virtual fields
  • #1783: js: checks for type dependencies

Login or Signup to reply.