Post has attachment
I've setup a Gitter for chat.

I'm talking about Flabbergast at Google on Nov 6 in Sunnyvale. Details available, if interested.

Flabbergast now supports embedding times in an SQL query.

Suppose you want to send a time, with a timezone to MySQL. You need the following:

sql_expr : "TIMESTAMPADD(SECOND, \(arg.epoch To Int) + TIME_TO_SEC(TIMEDIFF(TIMESTAMP '1970-01-01 00:00:00',CONVERT_TZ('1970-01-01 00:00:00',@@session.time_zone,'+00:00'))),TIMESTAMP '1970-01-01 00:00:00')"

Fun, right?

Post has attachment

I think I just figured out how to add a `typeof` operator to Flabbergast and not have it suck.

The problem with `typeof` in Javascript (ignoring that it returns `object` for `null`) is that it returns a string. This is not the Flabbergast way. Why a string? Why not a frame or an integer? The purpose is for the user to take this value and then either compare it or do a lookup in some other structure. Why should it be tied to a particular type? The answer, is, now so clearly, lookup.

If you do `TypeOf "x"`, it should do a lookup for `str` and return whatever that is. This creates a relatively small binding between the language and user's namespace: one name for each of the 7 types (bringing the total number of magic words to 9: args, value, bin, bool, int, float, frame, str, tmpl)

Unfortunately, this design is awkward since we have no namespace control on those new magic words, unlike `args` and `value`, where the structure of the program controls their scopes.

So, let's introduce a namespace prefix:
`Type foo Of "x" ` would resolve to `foo.str`
Now, the user can have namespace control. This means one could do:

type_id : { bin : 0 bool : 1 int : 2 float : 3 frame : 4 str : 5 tmpl : 6 }
value : Type type_id Of x == Type type_id Of y

has_sql_literal : { bin : True bool : True int : True float : True frame : False str : True tmpl : False }
value : Type has_sql_literal Of x

We can even be craftier:
create_shell_literal : {
bin : Template { value : ... }
bool : Template { value : If input Then "true" Else "false" }
int : Template { value : input }
float : Template { value : input }
frame : Template { value : Error "Cannot convert frame to shell." }
str : Template { value : ... }
tmpl : Template { value : Error "Cannot convert template to shell." }
}
value : (Type create_shell_literal Of x)(input : x)

That is, use `Type Of` to find a function and then call that function on the value.

Post has attachment
I've been thinking about adding visibility modifiers to Flabbergast. I'd like some thoughts.

Version 0.13 is released with bug fixes and a JSON importer.

The time on the meeting tomorrow was set to something strange. It's been reset to something sensible (when Dublin, Toronto, and SF are awake).

Post has attachment
Some frequently asked questions about the language design. At the very least, read the last one.

Version 0.9 is out with an SQL interface and automatic documentation generation.
Wait while more posts are being loaded