Thursday, March 30, 2006

Factor 0.81 now available

Download it from the Factor web site. Lots of new stuff in this release: FFI callbacks, multi-window UI, improved online help, and many updates to the contributed libraries. Also for the first time a pre-compiled Mac OS X (PowerPC) binary package is available! Just double-click on Factor.app and the Factor UI is started, no fuss.

Note that the detailed changelog is now part of the online help system, and so you can view it either from the Factor UI, or in the online documentation responder (as soon as I update the server on factorcode.org to 0.81, anyway).

Monday, March 27, 2006

New browser interface in the UI

Browser windows are what opens up when you click a presentation of an object.

I radically improved them today. Clicking a presentation inside a browser now re-uses the same window, and there is a history of previously-viewed objects. Also, a row of buttons across the top choose between multiple views of the object. This replaces the right-click command menu when clicking a presentation. Indeed, as strange as it sounds, I've removed support for popup menus from the UI altogether.

I also implemented help cross-referencing, analogous to the "calls out" (uses.) and "calls in" (usages.) features for words. You can now find out which articles link to the article you are reading now. This was made possible by implementing a small library to deal with directed graphs. I updated the word cross-referencing code to use this library too.

SCREENSHOT!

Saturday, March 25, 2006

Windows UI backend complete

Doug Coleman has implemented a Windows backend for the Factor UI. I have been debugging X11 and Cocoa, and I implemented a new browser interface for looking at word definitions, reading documentation and inspecting objects.

I'm releasing 0.81 really soon now. I'll just wait for the UI overhaul to settle down, and work on documentation in the mean time.

Wednesday, March 22, 2006

X11 and Cocoa backends are (mostly) done

Today I spent a lot of time working on the X11 UI backend. First I fixed some bugs in GLX setup, then I added event handlers of various types, hooking up X11 input with UI gestures; mouse, keyboard, and close box. Now it appears that everything works. I also cleaned up and fixed a few remaining issues in the Cocoa backend.

Now my focus will shift to polishing the UI, writing documentation, and fixing bugs. Hopefully Doug will finish the Windows UI backend soon (he's making great progress), and I can release 0.81.

Tuesday, March 21, 2006

Objective C FFI now supports super message sends

While the Objective C FFI has had the ability to define subclasses for a while now, you were unable to call the superclass method from inside a subclass. Well now you can, for example consider the following definition of the FactorView class from the UI backend:

"NSOpenGLView" "FactorView" {
....
{ "initWithFrame:pixelFormat:" "id" { "id" "SEL" "NSRect" "id" }
[
rot drop
SUPER-> [initWithFrame:pixelFormat:]
dup "updateFactorGadgetSize:" add-resize-observer
]
}

{ "dealloc" "void" { "id" "SEL" }
[
drop
dup view close-world
dup views get remove-hash
dup remove-observer
SUPER-> [dealloc]
]
}
....
} { } define-objc-class


The addition of this capability makes the Cocoa interface feature-complete. I have been able to implement the missing parts from the UI backend, and modulo bugs, its pretty much done.

I'm very happy with the level of integration I've managed to achieve with the Cocoa binding. Factor can introspect Cocoa classes, define new Objective C classes, catch and throw Cocoa exceptions, and resend methods to the superclass. I'm not aware of any other concatenative language with such a comprehensive Cocoa binding.

So my main focus is now the X11 backend, and helping Doug implement the Win32 backend. The cool thing is, when this is all done, not only will Factor have a more powerful cross-platform UI, but also top-notch bindings for native graphics libraries which developers can call directly if they wish. I intend to document everything at all layers of the graphics subsystem.

Monday, March 20, 2006

Started X11 UI backend

The Cocoa backend is almost complete; it is missing a few features which depend on the ability to call methods on a superclass inside an Objective C method definition. Once I implement this feature, I can continue working on the Cocoa backend, but today, I decided to start the X11 backend instead. So far, I've moved the core of Eduardo's X11 bindings from contrib/x11/ to library/x11/, and cleaned up some of his utility words. I got it to the stage where a GLX window rendering Factor UI gadgets is displayed, however input does not work yet.

Here is my rough list of goals for Factor 0.81:
  • Finish Cocoa and X11 UI backends
  • Make the UI faster, write some new graphical tools
  • Wait for Doug Coleman to finish the Windows UI backend :-)

Basically 0.81 is all about callbacks in the FFI, and the new super-duper platform-tuned UI.

Developing Factor has been a great educational experience for me. I taught myself many new things:
  • The C language
  • x86, PowerPC and AMD64 assembly
  • OpenGL
  • Cocoa (although my first exposure to Cocoa was a commercial gig, I still learned a lot more about Cocoa internals while writing the Factor Cocoa binding)
  • X11 - learning it right now
  • Language design and implementation techniques
  • I even learned JVM bytecode so I could write the early JFactor compiler...

Saturday, March 18, 2006

Partial continuations in Factor

Chris Double has posted another update about his work to implement partial continuations and generators in Factor. Cool stuff!