Archive for the ‘Fantom’ Category

Fantom wrapper for Mailgun

Wednesday, April 17th, 2013

Posted a Fantom wrapper for Mailgun. Has first-class support for basics (send, unsub, spam, bounces, logs, stats). But really simple to work with raw REST API too.

The Fantom Linode Guide

Wednesday, February 27th, 2013

I’ve stubbed out a basic guide for getting Fantom up and running on Linode. Its a bit of a work in progress – but mostly gets you from start to finish:

  • Installing Fantom on Debian
  • Setting up init scripts
  • Configuring ngnix as proxy server
  • Setting up automated deployments

Its hosted on BitBucket – so feel free to send me pull requests if you have corrections or improvements (I’m by no means a linux guru…):

init.d example for Fantom

Wednesday, August 15th, 2012

Update 27 Feb 2013 – While this should still be valid advice – it’s been superseded by a more comprehensive guide covering the whole process of getting Fantom up and running on Debian:


Been meaning to post this for awhile. Below is the init.d script I use to run Fantom on my personal sites. I’m running Debian 6 – but should be straightforward to tweak for other distros. Might need to apt-get a few things like pgrep – can’t remember what came out of the box.

A few caveats:

  1. I always install and run each “app” using a dedicated user with its own Fantom runtime. I find this really simplifies security, process management, and versioning. This example uses the fan user.
  2. This script should properly block until process cleanly exits. But don’t have a good way to know when start is complete – so just waits a few seconds. You can tweak depending on your app.
  3. This script redirects stdout and stderr to the same log file. You can tweak as necessary.
  4. I’m using a script ( to launch my site. But you can launch Wisp or another main directly from bash string.

Example server layout:

    ~/               User home directory
      fantom/        Fantom runtime
      dist/          App path env
        fan.props    Empty fan.props to force PathEnv
        lib/         PathEnv lib for App

Example init.d script for Fantom:

    #! /bin/bash
    # /etc/init.d/example

    FIND_PID="pgrep -u fan java"

    case "$1" in
        PID=$( $FIND_PID )
        if [ -f $PID ]; then
          echo "Starting"
          sudo -u fan bash -c  'cd ~/dist; ~/fantom/bin/fan &' &> $STDOUT
          sleep 3
          echo " is already running"
        echo "Stopping"
        PID=$( $FIND_PID )
        if [ -f $PID ]; then
          echo " is not running"
          kill $PID
          while kill -0 $PID 2> /dev/null; do
            sleep 0.5
          echo "stopped"
        PID=$( $FIND_PID )
        if [ -f $PID ]; then
          echo " is not running"
          echo " is running"
        $0 stop
        $0 start
        echo "Usage: /etc/init.d/example {start|stop|restart|status}"
        exit 1

    exit 0

Markdown for Fantom

Sunday, February 5th, 2012

Sunday Funday project for today – Markdown for Fantom:

Markdown is a great little plain-text format created by John Gruber that converts nicely to HTML. Fantom’s own Fandoc was heavily inspired by Markdown. We just simplified a few things and added some Fantom conventions in a few places. But I’ve wanted the full Markdown syntax at my disposal for some time now.

Luckily it was a pretty simple project – I was able to essentially take the great Markdownj work as-is and wrap with a native Fantom API. Code is available over at BitBucket and is licensed under the BSD license.

LESS for Fantom

Sunday, January 22nd, 2012

I worked up a Fantom wrapper around LESS this week. Code and docs over on BitBucket:

LESS is a great little “extension” to CSS that adds lots of convenient features like variables, mixins, and nested rules that make developing and managing complex CSS much easier.

The Fantom wrapper adds:

  • An API interface to compile LESS files from a Str input or a File reference
  • A simple command line interface for compiling LESS files to CSS files
  • A BuildTask for integrating LESS into your Fantom build pipeline

Draft Mini Web Framework

Sunday, July 24th, 2011

I’ve posted a project I’ve been working on in my spare time recently:

Draft Mini Web Framework

Draft is a small web framework designed to notch in above WebMod, provide some useful features, while trying to leave as much freedom as possible for your app. Details over on the project site.

Its still a work in progress, but decided it was far enough along to start being useful to anyone who doesn’t mind getting their hands dirty. Hopefully I’ll have it wrapped up here in the next few months, and can be more generally useful to developers looking for a simple and lightweight solution for developing web apps in Fantom.

Sketching Logos

Wednesday, January 5th, 2011

Was flipping thru an old moleskin and found two sketches I made back in Fall 2009.

Fantom logo sketch

First was a little sketch of a potential logo for the Fantom language. For whatever reason, when we changed the name to Fantom, I got this 1920s/Art Deco motif concept in my head (hence the typeface). I’m pretty sure its because of the movie The Shadow, but I keep trying to tell myself thats not the case… Never really had time to come up with a real logo — but this is one I sorta liked.

Axon logo sketch

Second was a logo for the Axon scripting language we designed for our day job at SkyFoundry. Would love to give these both some good Photoshop treatment if I ever find the time.

Blue Collar Languages

Monday, September 27th, 2010

Cay Horstmann wrote an interesting response to Stephen Colebourne’s NBJL post:

Creating a “blue collar” language isn’t something that happens every day.

When done by “blue collar” people who have sketchy knowledge of programming language theory, the result is often problematic. Look at PHP–I trust that I won’t have to elaborate… Or Groovy, many of whose properties (particularly in the MOP) are under-specified and constantly shifting.

Few “white collar” people have an interest in designing a blue-collar language. They give us languages that dazzle us with their brilliance and innovation. After all, that’s what a researcher is rewarded for.

Interestingly he made no mention of Fantom in this context, which means I assume he hasn’t looked at it any detail. That was one of the explicit design goals.

Which makes me wonder – do people pass over Fantom because of the exact same reasons they search for new languages? You want a simpler, more expressive language, with great APIs, that make your life easier 9-5. But you take a look at Fantom, and move right along, since you don’t see buzzwords like monads, or some ground breaking new syntax?

Fantom’s History and Future with JavaScript

Wednesday, June 2nd, 2010

One of Fantom’s primary design goals from day one was portability between the JVM and CLR. Naturally we got to thinking, if we can run on both of the popular VM’s, why not on JavaScript too? That would enable enormous opportunities for code reuse and greatly simplify the huge impedance mismatch of developing backend server code and user interfaces in the browser.

Read the full post at


Monday, April 12th, 2010

The product we have been crafting at SkyFoundry for the past year and a half has officially been christened as SkySpark.


SkySpark is turning out to be an awesome platform for visualizing, analyzing, and managing mountains of data. We’ve updated the website to include some high level technical documentation on the software stack. Its built 100% in Fantom – including all the client-side browser code using the Fantom JavaScript compiler.

This software has really validated the years of effort we’ve put into making Fantom a first-class language. I don’t think we’d have been able to build anything even close without it. I’m excited to show off more as we move towards the official release.