#415 Build 1.0.36

brian Sun 14 Dec 2008

The latest and greatest build is available for download and the online docs have been updated.

Far and away the biggest feature of this build (and biggest of the year) is Java FFI support. I've actually written this up in a separate blog post.

Another big new feature in this build is the first version of the JSON API. Kevin has done a nice job with this API to easily read/write Fan objects to JSON. Simple example:

obj := ["name": "Homer Simson", "age": 39, "kids": ["Bart", "Lisa", "Maggie"] ]
Json.write(obj, Sys.out)

// prints
{"age":39,"name":"Homer Simson","kids":["Bart","Lisa","Maggie"]}

Andy has done lots of work to bring the .NET runtime to parity with the Java runtime including all the value type and nullable type changes. Just about all of the test suite now passes for .NET (we still don't support sql and fwt on .NET yet). Note that these changes include renaming the term "net" to "dotnet" - see post.

Build 1.0.36 (13 Dec 08)

  • Java FFI
  • Use dotnet to denote .NET instead of net
  • Initial json API
  • Remove compiler support for for(...); and while(...);
  • DateTime toJava, fromJava
  • Reorganize icons
  • Fan launcher -fcodeDump option to disassemble a Fan script
  • List, Map eachBreak -> eachWhile
  • Emacs support adm/tools/emacs/fan-mode.el

jodastephen Sun 14 Dec 2008

It might be worth explicitly mentioning how Decimal maps (I assume to BigDecimal), as for Fan it is a key type for most of its decimal numbers.

BTW, I found the examples using java.util.Date more confusing than they need to be because they have to handle the 1900 base year and 0 based months. Maybe we could write the docs around a simpler JDK class?

Otherwise it is looking very good.

katox Sun 14 Dec 2008

Cool, now we don't have to write every piece of Java codebase again ;)

There seems to be a bug in docCompiler. It throws NPE if the input file ends prematurely. Here is a fix for uri parsing (but there are probably other similar cases):

 diff --git a/src/docCompiler/fan/html/FanToHtml.fan b/src/docCompiler/fan/html/FanToHtml.fan
 index 1831284..c3015a7 100644
 --- a/src/docCompiler/fan/html/FanToHtml.fan
 +++ b/src/docCompiler/fan/html/FanToHtml.fan
 @@ -187,12 +187,14 @@ class FanToHtml
      out.print("<span class='").print(classUri).print("'>")
      out.writeChar(in.next) // start quote
      ch := in.next
 -    while (ch != '`')
 +    while (ch != null && ch != '`')
      {
        safe(ch)
        ch = in.next
      }
 -    out.writeChar(ch)  // end quote
 +    // end quote
 +    if (ch == null) out.writeChar('`')
 +    else out.writeChar(ch)
      out.print("</span>")
    }

brian Sun 14 Dec 2008

There seems to be a bug in docCompiler. It throws NPE if the input file ends prematurely.

Thanks for the report. Also I should note that docCompiler does not yet handle APIs which use the Java FFI (it barfs).

Also if you are doing bootstrap builds to hack the compiler, note that compilerJava is now part of the bootstrap process (since it uses Java FFI itself to do the reflection).

Login or Signup to reply.