More about F3

This was going to be a comment to a posting about F3 on Lambda the Ultimate, but got a little too big so I'm posting it here.

But I am posting this in the spirit of LtU as expressed by Ehud Lamm (the originator of LtU)

Note that from the perspective of LtU the expressiveness of the language constructs is the main thing, implementing them as efficiently as possible comes second: efficient implementation should be possible, but might still not exist in the marketplace.

The above quote is also very close to my original approach when I started F3. I knew from using Tcl/Tk in the mid-90's that high performance from F3 wouldn't be required for the vast majority of graphical user interface use cases. With Tcl/Tk all of the Tk widgets as well as my back-end code was implemented in C and Tcl was used simply to glue them together. And at that time Tcl was probably one of the slowest interpreters ever written as it actually reparsed the source code on every evaluation. So efficiency of the programmer in expressing such programs was my focus.

Although I don't think there's anything particularly innovative in F3 from a programming language point of view, my experience has been that the combination of features it provides proves more effective in expressing graphical user interface programs than other systems I've encountered (your experience may be different than mine). The language itself is only part of that. The libraries which provide useful abstractions for Widgets and 2D graphics and which, in particular, closely match the concepts used by graphic artists and content designers are also equally important.

Unfortunately, not having a background in math or formal logic, F3 doesn't have a formal basis. Prior to programming my primary interest was linguistics, so a lot my of opinions about what makes programming languages "expressive" comes from my observations and opinions about what allows us effective expression in natural languages.

Although I'm concerned that F3 may have fundamental flaws that haven't been exposed yet, I don't feel too bad about lacking a formal basis for F3, since to be honest I really never intended to write a programming language in the first place.

The F3 project was originally called GBTDS which stood for "GUI Builder That Doesn't Suck". I just wanted an easy way of creating GUI's.

I thought I could just create some visual tools where I allowed the user to define an object-oriented model, and then have them lay out widgets on the screen and somehow bind them to the model using a "stylesheet". My implementation of the model would automatically generate events whenever it changed and automatically update the widgets. Anyway, I originally wrote a working prototype of something like this (but without the visual tools). Unfortunately, it was a still a GUI builder that sucked.

There was always an impedance mismatch between the application model and the widgets and no effective way to really connect them together. I always had to add lots of extra attributes to the model as placeholders for things needed for the views or "hard-code" the styling. For example, if I had a Person class with a firstName and lastName attribute and I wanted to show a person's full name in the view, I had to add a fullName attribute to the model (and then write event handling code in Java to update it whenever firstName or lastName changed) in order to have something to bind the view to. In addition, each widget had to have special event handling plumbing to hook up to the model and special styling plumbing to hook up to the stylesheet, all written in Java (and there are quite a few widgets in Swing...).

It was obvious I needed a query language to project the model into a form that was suitable to bind to the widgets. So that's what I implemented next. Early on I recognized I needed dependency based evaluation of the query language to handle changes to the model. In the early versions this wasn't incremental, but rather reevaluated the entire query whenever any of its dependencies changed. I could reference such queries in the stylesheet and it was now much easier to express the styling of widget attributes. However, I still didn't have any reasonable way of expressing the structure and layout of widgets, and all the updates to the model had to be done through Java API's to my model (which was similar to programming through reflection, i.e. extremely tedious).

So next I added a procedural language, which used Java-like control structures and borrowed the update syntax from XQuery. This made it very easy to update the model compared to what I had before. In addition, I added support for list comprehensions to the query language (foreach, select) which allowed me to also declaratively project multi-valued attributes. Having all that I realized my "stylesheet" was really just the interface to the Widgets. So I ditched it and my Java Widget library, and wrote a set of F3 classes that wrapped the Swing widgets. Having done that I could pretty much write any Swing program declaratively all in F3. At that point I also implemented incremental dependency-based evaluation.

Although I could write any Swing program pretty easily there was obviously a large class of GUI's that I couldn't produce (including most of the demos you see on my weblog). So it was obvious I needed a declarative interface to Java2D as well.

Fortunately, a very talented young man, Jesse Grosjean, had written an excellent 2d scene graph toolkit based on Java2D called Piccolo. The conceptual model of Piccolo was very close to SVG, and I realized I could fairly easily implement F3 versions of SVG's declarative 2D graphics interfaces using Piccolo.

Once I had that, I could pretty much create any GUI or visual effect you find in Flash, Java, DHTML, or elsewhere, declaratively in F3 and started writing the demos you see today.

Anyway, as I said my original thinking was that I wanted an easy way of creating Model/View GUI's. To that end I wanted a simple, object-oriented system. The informal conceptual basis for this I borrowed from Martin and Odell.

To summarize the important points (informally):

  • Classes correspond to the concepts we use to identify the common characteristics of the things around us and how they relate to each other.
  • Thus a class declares a set of potential relationships (links) between objects.
  • Once an object has been classified we can navigate those relationships to discover its properties, i.e. the other objects related to it.
  • In F3 these properties are called attributes.
  • In F3 functions are queries that navigate links or produce new objects in terms of existing ones, but do not modify the links of existing objects.
  • In F3 all change consists of adding new objects or of adding, removing, or replacing the links between existing objects.
  • In F3 Events are simply notifications of object instantiation or of "link addition", "link removal", or "link replacement"
  • In F3 operations in addition to performing queries can sequentially perform one or more such link modifications. Such modifications may be sequenced with conditional logic and by selection and iteration over query results.
  • The values of an object's attributes may be specified either through explicit assignment or by means of a bound query. In the latter case implicit modification of the attribute occurs whenever the inputs to the query expression change and produce a new result.
  • So when a change occurs one way to specify the "effect" is to define a bound query that expresses how other objects depend on it.
  • The other way to respond to change is by making further explicit modifications using triggers. A trigger is an operation that is performed whenever an insert, delete, or replace event which applies to it occurs.

As far as the syntax of F3, it's intended to be familiar to mainstream programmers whose primary language is derived from C (C++, Java, JavaScript, PHP, etc), but also includes features from query languages (OQL, XQuery, SQL).

F3 is still a work in progress.

When F3 is open-sourced the syntax of the language and API's will be open for discussion and change.

Comments:

I'm not a developer and I can't wait for this to be released. I would assume this could encompass enterprise scale strength. I wonder how long it would take to create a calendar app like 30 boxes?

Posted by james shamenski on January 22, 2007 at 11:30 AM PST #

Thanks for sharing little about history of F3 and your intentions. However reading it and comparing with most of demo applications on this page I'm confuse.
What will (should) be main area of using F3. The language is:
- competitor of Flash/AJAX web applications;
- simplest way of creating swing GUI for desktop applications;
- replacing swing for applications which need more complicated (graphically richer) GUI;

Posted by Arek Stryjski on January 22, 2007 at 06:51 PM PST #

Arek: The answer is all of the above.

Posted by Chris Oliver on January 23, 2007 at 01:45 AM PST #

Hi Chris: I'd like to know if there are any way to use a F3 widgets into a normal java application?

Posted by Rene Davila on January 23, 2007 at 04:22 AM PST #

Rene: Yes, F3 widgets are JComponents. Once you have a reference to one in your Java code you can use it like any other JComponent.

You'll find more information here.

Posted by Chris Oliver on January 24, 2007 at 01:54 AM PST #

It is hard for me to 'get' F3. I thought that it would allow me to build gui but when I look at the code it looks so much like Swing... As a matter of fact the tutoria is called "Declarative GUI Programming Tutorial (for Swing Programmers)". And what if you're not a Swing programmer? It seems that you need to be a swing programmer to be a good F3 programmer...?

Posted by James on January 24, 2007 at 11:40 PM PST #

Great post. I have just used your summary to show how this relates to the Semantic Web technologies in my post The F3 data model.

Posted by Henry Story on January 31, 2007 at 05:30 PM PST #

I visited the Piccolo home page a while ago and saw that is no longer in development. I searched for alternatives and saw your project. Now my question: Is F3 dependent on Piccolo or did you just get some inspiration an code from it?

Posted by Gabriel on February 21, 2007 at 04:59 PM PST #

Is there a way to use Swing components in F3. Can you point to a sample? Something similar to var button = new JButton("text"); Frame{ ... content: button } but working :)

Posted by Michael on March 06, 2007 at 09:03 PM PST #

"When F3 is open-sourced the syntax of the language and API's will be open for discussion and change." Any update on when that might be? I'm really looking forward to having a play with it.

Posted by Hugo Vincent on May 08, 2007 at 02:41 PM PDT #

Is there a way to use Swing components in F3. Can you point to a sample?

Posted by chat on September 01, 2008 at 06:29 AM PDT #

When F3 is open-sourced the syntax of the language and API's will be open for discussion and change." Any update on when that might be? I'm really looking forward to having a play with it.

Posted by key ödemeleri on September 01, 2008 at 06:29 AM PDT #

Thank you very much for this useful article. I like it.

Posted by evden eve nakliyat on September 11, 2008 at 08:02 PM PDT #

Is there a way to use Swing components in F3. Can you point to a sample?

Posted by saç ekimi on October 24, 2008 at 06:26 PM PDT #

Thank you very much for this useful article. I like it.

Posted by key ödemeleri on November 07, 2008 at 10:58 PM PST #

very good site :)

Posted by hürriyet insan kaynakları ilanı on January 02, 2009 at 10:30 PM PST #

Posta ilan

Posted by Posta Seri İlan on January 02, 2009 at 10:37 PM PST #

Thanks

Posted by key on February 03, 2009 at 12:02 AM PST #

Is there a way to use Swing components in F3. Can you point to a sample? Something similar to var button = new JButton("text"); Frame{ ... content: button } but working :)

Posted by toki on February 18, 2009 at 07:26 PM PST #

Hi Chris: I'd like to know if there are any way to use a F3 widgets into a normal java application?

Posted by araç sorgulama on February 18, 2009 at 07:27 PM PST #

Arek: The answer is all of the above.

Posted by kredi on February 18, 2009 at 07:27 PM PST #

Is there a way to use Swing components in F3. Can you point to a sample?

Posted by ssk sorgulama on February 18, 2009 at 07:28 PM PST #

I’ve been searching for a good bank pen for some time; this "subeler" one has earned a permanent place on my carabiner.
I’ve recently fallen for a new <a href="http://www.subeler.com/" title="Bankalar">bankalar</a> pen. It comes with a bank adress designed keychain case, turkey banking guide and with the case converts into a full-sized pen for writing above-and-beyond quick notes.

Posted by banka şubeleri on April 30, 2009 at 08:32 AM PDT #

I guess we can safely assume those are the production headlamps. Dang Ed, I thought the coupe was nice, but the convertible is sexy… even with the top up!

Posted by Dekorasyon on May 14, 2009 at 01:57 AM PDT #

http://www.smsmatbaa.com

Posted by matbaa on June 22, 2009 at 03:10 AM PDT #

It is hard for me to 'get' F3. I thought that it would allow me to build gui but when I look at the code it looks so much like Swing...

Posted by iyinet frmtr trkygnclr webmaster seo yarışması on September 26, 2010 at 04:50 AM PDT #

I guess we can safely assume those are the production headlamps. Dang Ed, I thought the coupe was nice, but the convertible is sexy… even with the top up!
http://www.batteriefrance.com/batterie-ordinateur-portable/hp/hp-pavilion-dv6000-batterie

Posted by Batterie Ordinateur Portable on October 01, 2010 at 12:49 PM PDT #

I thought the coupe was nice, but the convertible is sexy… even with the top up!

Posted by hp pavilion dv7 batterie on October 16, 2010 at 03:47 PM PDT #

Simple and Nice example !

Posted by دردشة مصرية on December 04, 2010 at 08:10 PM PST #

Simple and Nice example !

Posted by دردشة on December 04, 2010 at 08:11 PM PST #

Simple and Nice example !

Posted by شات on December 04, 2010 at 08:11 PM PST #

Simple and Nice example !

Posted by شات مصرى on December 04, 2010 at 08:12 PM PST #

I think I am going to put this up on my Facebook wall, so that my friends can also read it. Thank you so much for sharing.

Posted by Quran Teaching on January 16, 2011 at 08:10 PM PST #

Simple and Nice example !

Posted by عسلى on March 04, 2011 at 07:36 PM PST #

Simple and Nice example !

Posted by اشهار on March 04, 2011 at 07:37 PM PST #

I guess we can safely assume those are the production headlamps. Dang Ed, I thought the coupe was nice, but the convertible is sexy… even with the top up!

Posted by عروض الاشهار on March 04, 2011 at 07:44 PM PST #

I guess we can safely assume those are the production headlamps. Dang Ed, I thought the coupe was nice, but the convertible is sexy… even with the top up!

Posted by عروض الاشهار on March 04, 2011 at 07:44 PM PST #

I guess we can safely assume those are the production headlamps. Dang Ed, I thought the coupe was nice, but the convertible is sexy… even with the top up!

Posted by خطط الاشهار on March 04, 2011 at 07:45 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

user12610627

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today