Monday, January 30, 2006

Factor 0.80 is out

Factor 0.80 is now available.
  • New help system, browsable in the UI and via the HTTP server (/responder/help). In the UI listener, invoke handbook to read the documentation root, and invoke \ foo help to look at documentation for the word foo.
  • Sequences:
    • Association list words assoc*, set-assoc, acons and remove-assoc are gone.
    • The repeated virtual sequence type is gone. Instead, the <array> word takes an initial element in addition to an initial size.
    • The fill word to create a new string with an initial character repeated a certain number of times has been renamed to <string>.
    • Add a new interleave ( seq quot between -- ) combinator that applies a quotation to each element of a sequence, calling another quotation in between each pair.
    • Add a new <=> ( obj1 obj2 -- n ) word for comparing two objects using an intrinsic order. For numbers this is the standard order, for strings this is lexicographic order, and for words, this compares word names.
    • The natural-sort ( seq -- seq ) word replaces number-sort, string-sort and word-sort.
  • Hashtables:
    • hash* ( key hash -- [[ key value ]] ) is now hash* ( key hash -- value ? )
    • hash-clear is now clear-hash
    • hash-each, hash-each-with, hash-all?, hash-all-with?, hash-subset, hash-subset-with now pass the key and value separately on the stack to the given quotation, instead of passing a cons cell
    • Literal syntax change: H{ [[ key value ]] ... } is now H{ { key value } }
  • Math:
    • The sum and product words have been moved to contrib/math/.
    • The mod word is now supported for ratios and floating point numbers.
    • The truncate, floor and ceiling words are now supported for floating point numbers.
    • The NaN, positive infinity and negative infinity floating point numbers now parse and unparse as 0.0/0.0, 1.0/0.0, and -1.0/0.0 respectively.
    • The NaN value is now equal to itself under =.
    • Negative and postive zero are no longer equal under =. However, the new zero? word tests if the top of the stack is a zero, and it tests for both positive and negative zero.
  • Streams:
    • stream-format ( string style stream -- ) now takes a hashtable rather than an association list for specifying style information.
    • stream-write and stream-terpri are now generic words, and there is a new with-nested-stream generic word. You can wrap your output streams in a <plain-writer> to avoid implementing these.
  • C library interface:
    • Some alien word changes:
      <foo> ==> "foo" <c-object> <foo-array> ==> "foo" <c-array>
    • Support for binding to Objective C libraries is now included.
      • Normal usage of Objective C classes and methods is done using the OBJC-CLASS: and OBJC-MESSAGE: parsing words. See the example in examples/cocoa-speech.factor.
      • Objective C runtime introspection functions and structures are defined in the objective-c vocabulary.
    • Added a pair of words for between Factor strings and C strings, alien>string and string>alien.
  • Compiler changes:
    • AMD64 compiler backend.
    • Fixed some problems with compilation of inlined recursive words.
  • UI changes:
    • Fixed invalid OpenGL calls which caused problems on Windows machines with ATI drivers, and Linux machines with the MesaGL implementation.
    • The listener looks different now. An expandable top area is used for browsing objects, words and help, and the stack display has been shrunk to a single status line at the bottom of the window.
    • A left click on a presentation now invokes the default command. A right click shows a menu of possibilities.
  • Bootstrap changes:
    • Source files are no longer loaded in the stage-2 bootstrap. Since stage-2 bootstrap runs in the interpreter, this reduces bootstrap time by a few minutes. Instead, all source files, including the compiler backend, are loaded in stage-1 bootstrap, and thus boot images are now CPU-specific. Boot images can be created as follows:

      USE: image
      "x86" make-image
      "ppc" make-image
      "amd64" make-image
  • Contributed libraries:
    • All libraries in contrib/ have been tested and updated for recent language changes, and you can run contrib/load.factor to load all of them at once (Trent Buck)
    • Updated contrib/x11/ with many more examples (Eduardo Cavazos)
    • Added splay tree library in contrib/splay-trees.factor (Mackenzie Straight)
    • Improved AJAX support in contrib/httpd/. The "prototype" JavaScript library is now included (Chris Double)

No comments: