Is F-Script too much to expect a designer to learn?

Discussion in 'Mac Programming' started by Cromulent, Aug 23, 2010.

  1. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #1
    I've been trying to think about an HTML templating language I can incorporate into a little project of mine. Initially I decided on XSLT to do the XML transformation but that would either require a separate XML file to be written as well as the XSLT file or it would require all data coming from the database to be built into an XML tree in memory so that the transformation can be applied to that, neither of which is ideal. Plus I think designers would find XSLT concepts somewhat foreign if they are only used to things like JavaScript.

    So I thought about writing my own little simple templating language and quickly ruled it out as a bug prone endeavour and one which is likely to result in a crippled solution. Then I ran into F-Script.

    It looks good. The website says it was inspired by Smalltalk, Self and APL (sounds interesting if nothing else) and the syntax is fairly clear and straightforward. Plus its BSD licensed.

    Do you think F-Script is suitable for my target audience, I just want to use it so that people can do simple for loops and conditional branching to display certain data on a webpage. But at the same time I don't want to scare them off because of arcane syntax.

    Any thoughts?

    http://www.fscript.org/
     
  2. jpyc7 macrumors 6502

    Joined:
    Mar 8, 2009
    Location:
    Denver, CO
    #2
    I think you might consider a template system that is not as Mac-centric.

    I have used 2 styles of dynamic web page creation.

    I used ClearSilver, a web template system, that is not directly tied to any programming language but has bindings to a Perl, Python, and Ruby. It has the looping and conditionals, as well as its own syntax to define data object values. The HTML includes the ClearSilver elements with some sort of escaping that I think is very similar to PHP. (I'm not a PHP programmer, so I could be wrong about this.)

    The other style I used involved server-side code to create JSON objects. Then Javascript included in the webpage could be used to read those (using AJAX-type request) and after retrieval, the javascript code could manipulate the DOM of the webpage. So the code for conditionals and looping is all done through Javascript. I was using the Spry javascript framework from Adobe plus custom stuff for the AJAX.

    The wikipedia entry for Web template system, shows a large number of potential choices. F-script is not among them, but if you're tightly integrating with Mac OS, it might work better for you.
     
  3. Cromulent thread starter macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #3
    Thanks for the reply.

    ClearSilver is not really a preferable way to go although it does meet my requirements of being a C or Objective-C based templating engine. I've had a good look at that Wikipedia page and none of the options really look realistic.

    Being Mac centric is not really a problem as the whole project will be deeply entwined with Apple APIs so there is no real chance of turning it into a cross platform solution.

    Javascript would be the best option, but I don't want to require clients to have Javascript enabled in order for the sites to work correctly.
     

Share This Page