all right it's time to get started again
time for the most exciting parts and the
lightning talks
this is where we get to actually get a
chance to see what people have been
doing that may have uh done something
actually maybe over the last 24 hours 48
hours
and go through some really cool things
that have been happening recently we
have i think four uh lightning socks for
this afternoon uh the first one up is
alex he uh works
with me at relevance has the most
excellent mohawk on the planet that i
think might uh
kill kind of thing
awesome dead animal then animal hawk so
uh alex all right i'm love machine
i like ideas i like ideas because
they're uh
they're something that we kind of share
a relationship with uh humans can use
ideas but ideas can also use humans
uh
one way the idea to be using a human is
that an idea can take up residence in
your mind it can burrow in and hang out
there for years and years
and another way that an idea can use a
human is that we can communicate them to
each other
and in that manner the ideas are using
us as replicators for themselves
i'd like to talk to you about one of my
ideas which is on cyclic time a long
time ago i had a problem where i had to
write a scheduling mechanism
i think that there's probably a lot of
people in the room who've had to do this
but sick like time is a problem it
solves a lot of problems or it's an idea
that solves a lot of problems right it
allows you to do scheduling this allows
you to do calendaring applications it
allows you to do building there's
applications for this idea of cyclic
time and it's
an idea if you can pull it out and treat
it abstractly you can start building
things for solving all these problems on
top of that idea
so i'd like to do a little bit of an
audience participation session um
real quick just by show of hands who
here has ever had to deal with a
scheduling problem
all right
great now who here looked at kron said
man i really don't want to use that
because it looks ugly
all right
of those who decided you know what i'm
going to do something different than
crown i'm going to do something better
than crime
who succeeded
okay good i'm right there with you
uh
about seven years ago i had the uh you
know i wanted to beat this problem and i
surrendered
what about a couple months ago a
gentleman named alan dippert who i work
with
was talking about this idea of cyclic
time with me
and
i
was re-revisiting my ideas about cyclic
time
when i first tried to solve this problem
i didn't have a good solution and i
think a lot of the reason i didn't come
to the right solution is i didn't have
the right tools
when we started thinking about it again
i've been educated in closure and i was
able to start using the tools the
closure provides to apply them to this
problem and i came home with something
that
it's an interesting idea i haven't been
putting it into production i haven't
been using it in anger but it's a
scratch that's looking for an inch
when i'm thinking about cyclic time i
like to think about it in these kinds of
terms time is a single dimension
it's uncountably infinite there are
apparently many infinitely many
instances in time
and that's not useful
uh we can't work with an accountably
infinite set of time
and the final quality of time that i
like to think about when i'm
working with this problem is that we
tend to break time into ranges ranges
between one instant and another instant
in time
this is useful
this is a useful way to abstract over uh
units of time such as you know seconds
minutes hours years millennia they're
all just points between one incident and
another time
so when i was wanting to work with time
and when i was discussing the idea of
alan there's really only two things that
i want to be concerned with when i'm
trying to conceive of cyclic time
periods it's a range between two
instances and if we
agree upon a convention for expressing a
period of time
uh in in my library i'm using a
convention of a vector that has a start
point and an end point and that's it
um
and the idea of cycles which are
repetitive periods uh you think of
cycles as being a generator that would
create multiple periods that are
self-similar
and the real problem is
time i think is in these cycles because
most cycles are pretty simple right
seconds are uniform no second is
different from another second in terms
of the actual span of time it's uh
it's tracing out this holds true all the
way up through weeks when we start
getting the months let's get really kind
of fuzzy they're a nasty special case if
we're talking about months the way that
humans talk about months because you
know february has 28 days
each month has a very slightly different
duration and that makes it a little bit
complex but
there's a nice little cheat that you can
do it's called using java util calendar
which handles all the live imports um
and that's basically what i did is i
built up uh
this idea of
cycles and periods on top of java util
calendar and i know that's not me
there's not a whole lot to it right now
i think the main points are
one function we call it i call it
periods and you hand it a keyword saying
what do you want the
uh
six cycle periods
and it will return you an infinite lazy
sequence of
periods just these vectors of two
instances uh such that they
dovetail nicely and it starts with the
instant you call the function by default
you can read the figure
but it generates this infinite sequence
and now you have a cyclic generator
and the other i think important tool
here is bounded cycles in uh in this
example
i would like you to indulge me and
pretend that november was bound to a
vector that included the first incident
of the month of november and the last
instant of the month of november and
what about the cycle does is it breaks
down that month of november into another
of another series of periods at the
resolution of days
we've now got a sequence of all the days
in november represented using periods
and we can start doing computation
based on
what days are important
the example i use in the readme for this
library is to try and generate all of
the tri-closure meetings
that relevance holds at relevance
headquarters
they occur on the third wednesday of
every single month at 6 00 pm uh and the
way that i basically go through this
process is decompose the months into
days i have some predicate functions so
that we can examine whether our a day is
wednesday so we filter all the days down
to only the wednesdays block the third
one out of there uh
find all the hours in that bag pluck out
6 p.m and now we've got the period for
when the tri-closure meeting is going to
be occurring
i think this is a useful way to think
about recurring cyclic time
but it's also an immature idea i haven't
spent a whole lot of time working on
but these are these are the kind of
tools i had to use to build up to this
point uh
one of them is retrieving our concepts
of what are natural boundaries you can
use there there are many many
milliseconds out there uh that are not
cleanly on the boundary of you know the
instant when we change from tuesday to
wednesday for example
it's useful to be able to find these
cut points and to specify periods
relative to any arbitrary millisecond
within that period
we have predicates for testing human
names for things like you know the
wednesday and some week or is this month
july
and sorry
okay uh and we can in the library
consume either dates or longs uh
interchangeably the convention being
that
we basically shove lungs into dates or
fold the mill seconds off dates
and that's basically my you know i just
want to introduce this concept to you
that you're thinking about it um i'd
like to invite you to play with me i
have it on github and
you can add it's also pushed out to
clojars so if you're interested you
could uh add it to your projects and
start playing with it
if you'd like to fork the work
submit pull requests or report issues on
the library i'd be very appreciative of
it uh but finally the last thing i'd
like to invite you to do is to go
digging through your old ideas in the
past
particularly you know if you've had a
problem in the past that's
defeated you you've surrendered to and
use what you've learned working with
closure to try playing with it again
think about what kind of new solutions
uh you can find
by using the toolbox the closure gives
you in my particular case
uh the idea of lazy sequences was
incredibly useful for tackling this
problem and i think that if you revisit
some of your old problems you might also
find some really good solutions in the
closure toolbox to help you solve those
problems
thank you
so next up we have a really interesting
treat uh there is a
a new thing that has entered the world
uh the name of a mutant and
i uh
don't know what that clicking is
okay
uh anyways um there has been some really
interesting work in uh recently done in
just tying together uh application
servers and and new ways of deploying uh
your closure code and actually allowing
you to interact with with other uh
non-closure code and i think there's uh
a whole bunch of really cool stuff that
can happen here and kind of marrying
closure uh and and
legacy code and things like that so i'm
gonna let jim take it further and talk
to you about it
all right
can you hear me
all right
so we're muting an application server
for closure i'm sure i'm sure that
frightens some of you possibly
so let's try to allay some of those
fears
because we are new to the community uh
let me introduce myself i'm jim crossley
toby crawley we work for red hat
we are core committers on torque box
which is if you hadn't heard torque box
torque box is an application server or
ruby
uh
both torque box and a mutant are enabled
by
the jboss as7
java application server
now
so application server basically means
middleware
middleware is
is the accidental complexity it's all
the software you build
or configure or use that doesn't have
anything to do with the problem domain
that the application you're trying to
build
is trying to solve
so an application server done well
is basically
a clean shaven yet
and that's what we're trying to do
it is very easy to do an application
server
poorly and we have failed if we do that
so
even though i just said that clean shape
and yak what does that mean
what is an application server it is
perfectly correct to think of jboss
at just as you would jetty or tomcat
so just as you would
use line again to bring up jetty to run
your ring based application you do the
exact same thing with jvos
but in addition to that you get other
services we uh it's an integrated all of
the 10 solution
we provide in addition to the web
messaging caching messaging through
hornet cube jms message queue uh caching
through infinite span which is a key
value store data grid
all kind of easily replicated
service
clustering again all the standard things
that you would expect to see in
the e-word
so
to get all the advantages of those
services
traditionally you've had to
assemble a big pile of annotated java
classes and xml so
torque box was written in response to
that to say
none of that we do all ruby where
you know we've talked about rapping as
an overloaded term but we are we are
wrapping with malice we are opinionated
wrapping we're not just exposing those
job services via jay ruby we are
adopting that policy uh or embracing
that notion of configuration
convention over configuration
um
and jruby basically enables us to be the
fastest platform for any kind of ruby
web app development that's out there in
google for torque box uh benchmarks
um
to see that for yourself
uh so basically we're just replacing
java xml with ruby and yaml and we're
very excited we've got numbers to come
out so none of that you're interested in
when we talk about job and ruby so far
let's get to the closure
torque box inspired the idea of a mutant
so
essentially it's a dsl to describe the
middleware that your application would
be
bsl
in its most loose definition
uh
so far we've only been doing this for a
couple of months and so far we had web
and core messaging stuff implemented
because we're an app server you
typically deploy multiple applications
to it so you want some isolation
we have that working
we're trying to make it all installable
runnable
deployable using uh a line again uh
plugins as well
so here's a quick example
uh you're just writing your
project as you normally would in line
again
but when you deploy it to a human youth
is looking for a top level in unc lj
file here's an example of how we might
uh
there's a messaging and web name space
here's how we're starting uh just
starting a cube and we are mapping uh
a handler to receive messages that are
posted thank you and i'm going to pause
for a moment while each of you say in
your mind
the name of that function the name of
that handler
all right so uh ring handle here's the
edge we support any kind of
ring-based web framework that there is
this is a similar handler where we're
just going to publish to our work queue
any composite data structure we'd like
um
it just has to be understandable
by whoever's going to receive it on the
other end if it's
another closure app great
we just print
that stuff there
and you associate that handle with a
particular web context just your typical
way you would uh
do that with uh jetty
um so that's what we have working now
but we also have a vision for the future
because we're kind of
jboss is embracing this notion of
polyglot
in other words
you use the best framework available
on the jvm regardless of what
application
it's written in so a lot of people have
expertise in using ruby on on the
website
we want to let them do that there are
great analytics packages you know in
closure we like to allow them to easily
exchange messages between both of those
producers and consumers
currently we do that using
json encoding but we'd love to
do the ruby side of those uh tag-based
serial nation stuff that brits talked
about yesterday um
to further that
so
inner language messaging you know
uniform point you always point the same
way you know
an integrated stack you're not building
up your stack every time
and we get a very simple horizontal
scaling just based on jboss's built-in
clustering capabilities to where you
automatically just by using a different
command line option you get automatic
load balancing across the cluster of the
mutants
of the consumers of those messages that
you might be putting on whatever
jms destinations there are so
we are new um uh we we love the help for
all open source
either by helping us build it or kind of
pull us in a direction that makes sense
for your organization
free note's the best place to uh
to contact us
with you
contact points.org
that's basically all i got
so the next set of uh presenters
i mean i guess people all know the term
hipster uh these guys are lispsters yeah
use that ten times fast and uh you know
make your brain explode
so these guys uh
uh thoughts that uh closure was cool but
they want to do something cooler
and so alan and john are gonna talk to
you about uber lisp
um
so quick show hands who's familiar with
something called the arduino
oh wow okay
so for the two people that haven't
seen it's a microcontroller
it's a microcontroller like many others
with capabilities similar to many other
microcontrollers like the pic or other
things
and microcontroller means a really small
computer effectively
the differentiator of this thing is that
they're cheap the cheapest one you can
get is about ten dollars for a kit
um
the other thing about them is they have
easily accessible i o so if you're
trying to do any kind of i o between
your computer and say
your toaster
there's not like a usb dude that's gonna
do that for you that's like you figuring
out the usb thingy and like going nuts
um the arduino has rows of pins plug
wires in and you can programmatically
turn those things on and off with
registers
so it's a great little platform for
doing uh prototyping devices that you
know do physical or electrical
interactions with things there's a huge
hobby community around these things
people are you know making their own
garage door openers and you know
alarm clocks and all kinds of other
really mission critically useful things
so
uh i got into this thing a couple years
ago and you know i bought all the gear
and then it was on a shelf for a couple
more years
and
pulled it out recently uh because i
wanted to make some cylon lights for my
pumpkins around halloween
so which is something you can totally do
and it's pretty straightforward but
here's the pickle
uh you can't do it in lisp
and i think we all know as you know
people who are just obsessed with lisp
and sort of can look at other things and
be like yeah
um
i really miss lisp
uh it's kind of cool you can do this
thing
but
it's not lisp so
um
i had this idea to write a list that
would run on the arduino so i could do
the same kind of interactive real-time
development on a microcontroller that
i'm used to a closure replica
um i wasn't sure if it was possible but
i started anyway
uh
and you know list from the bottom uh if
you haven't done it implemented it i
think this paul graham talks about like
the
there's like these two things that are
high ground see on one end and list on
the other
it's actually a really cool exercise to
kind of start at one end and then you
kind of wade through the morass and then
you kind of get closer to the lift side
and like you can start to see the sky
again and then you have a lisp
uh so if you haven't made your own list
i really recommend it um as far as the
rationale for doing it uh
conspicuously on the cloture.org website
on the rationale which says you know i
needed it for functional programming all
these things and then i needed a list
with like no further justification
so
if this truth is self-evident just go
nuts doesn't matter if there's a problem
uh the fact that you haven't written
your own list is the real problem
so without further ado uh john's gonna
do a little demo here
um
quick text specs and highlights so this
thing has 2k of ram
that's almost 15 tweets worth of
information
we've got lexical scope first cost
functions all these things that we know
and love and
thanks in john's health
it all kind of works i told him about
this idea
in the morning after i saw i got like 10
emails between the hours of midnight at
5am and then my birthday
he's done a lot with
figuring out how exactly these ideas map
the lower level things like reading
specs and data sheets and
uh he's kind of the wizard between how
it actually works my initial
my initial pass was
was garbage and was collected
you
microphone works
uh so this thing's written in c uh
i don't need to show you the source code
right now but
um
it's plugged in we wrote some make tasks
that uh
build and flash the arduino so we're
going to clean
see
i'm running this on a do a millino
because i like the
usb to serial thing better than the one
that you know you know actually is a
real pain to deal with
so here we go
that's flashing
it got really big yesterday when i
included the delay library i don't know
why i'll figure that out tomorrow
so here we go
or tonight
uh i got some device
we basically got a rebel now you can see
at the top we've defined all those
symbols to be themselves uh because
those are special
um
and
let's run your marks
you don't have to type anything
we're going to show you some exciting
things
no gc either yet uh so we can't type in
very much stuff
i noticed the memory
user important
rule of demons
are we doing it on
right
that works e-max is a problem
yeah all right so i gotta type this real
slow
um
okay so set register
fourth b
255
sleep 100
set
okay and then we have to set pdrp
to
look
it's not sleeping 100 milliseconds i
don't know why it's so slow but it
should be blinking list is slow
question do you have a trampoline
uh no
okay so that's gonna overflow eventually
though oh absolutely
way after we're done so
for symbols um which means if your
symbols are four characters or fewer
they're just the characters literally in
a row except that we set the high bit on
the fourth character to one so you know
you're looking at a four character
symbol for up to six characters you can
use any characters a z and any non a to
z character that automatically becomes
underscore
condensed down to five bits and sort of
crammed into the four bytes
and then decompressed at the other end
um so yeah only capital errors because
lowercase letters are too big
oh and uh
so uh i guess i had two small things to
add one is that the ibm 704 which is the
first thing john mccarthy's steve
russell did list bond had about 32k of
ram so
huh
the other thing is uh since this is a
very simple list implementation and we
are very humble guys uh we called it
uber list
and you can google for it it'll pop up
it's on the github um next big thing is
gc so you have the chops come on down
let's compute so thanks everybody
i'm looking for a chris ranger
oh there he is
so
our uh next lightning talk presenter is
i think a machine i'm not sure if he
actually sleeps or not but he has been
just uh just sending out libraries for
us all to
to use uh noir pino and now uh something
just recently uh for sql and i will let
chris tell you a little bit more about
all right yeah so
i'm chris granger like you said and i
recently uh
started working on a project that
required a lot of sql work and one of
the things that i had done previously
when i had written frameworks actually
in php was i wrote an orf
and as i did that i realized hey you
know rms are kind of cool they seem nice
but it turns out that orms in the long
run end up actually being kind of
problematic
uh you end up fighting against them you
end up needing to do more than their
abstraction allows you to do
and so what i wanted to do was work with
a really nice abstraction for sql on
closure
and so this is kind of what cormo looks
like you define a database can everyone
see that out of curiosity
uh you define a database you know i i
give a set of really simple helpers uh
to create sort of these maps that uh
represent your database connections
right
and under the covers here i wanted to
make sure that you don't have to think
about some things uh
that you would otherwise have to think
about if you were using just straight uh
java jdbc things like connection porn as
an example right you know one of the
things that i didn't realize when i
started using jdbc was that i was going
to have to manage that connection
explicitly so this uses a library called
c3po that does all that connection
pooling for you so you just start
writing queries
and what you can see here
is i have a thing called deaf entity
this is something just maps directly to
a table more or less but allows you to
specify you know some properties of
these things so you can do interesting
things with them later so for example i
have a query here where i want to select
you know all my users with their
addresses since i've defined a
relationship between my entities i can
do that and on the back end korma is
simply you know writing out joints it's
not doing anything particularly special
here
for the most part it's just writing out
the join so that you don't have to so
this isn't an orm in the large hibernate
sense where it's doing all this crazy
magic on the back end for the most part
it's just helping you write queries more
efficiently right at the end he's just
writing very simple sql
um i think the advantage or rather the
power of karma though
is not so much in just the abstraction
it's nice to be able to write it you
know succinctly and cleanly and clearly
but i think the real power of korma
comes in the fact that uh much like play
casco log it is entirely composable
right you can in this case instead of
using the select macro you select star
and then start building up a query and
then you add more to the query and then
you add more to the query all you're
doing here is actually manipulating a
map
and what corma really is if you want to
break it down into its constituent
pieces is actually a sql generation
engine right and then a nice way of
writing out the maps that go to it
that's all it is
now when you start thinking of libraries
in that way where you always have sort
of this one thing that can take
basically any arbitrary um map that you
create for it and then generate sql out
of it um this allows you to literally
completely replace my syntax that's
syntax my the the the
api i provided here you could you know
you don't like select write some other
thing that creates you know a map that
represents a select query you wouldn't
actually have to rewrite all that sql
generation stuff so this enables you to
actually add to korma in interesting
ways so i provide a relatively simple
set of um
of relationships but you can imagine
actually creating a property or a method
rather or function
for deaf entity that creates
all the relationships for just a chain
let's say you're constantly um using one
entity and you want you know something
that's like eight levels nested right
you don't want to constantly write those
joins out as a matter of fact you may do
that all the time so you don't want to
write you know like i've done here where
you're writing essentially functions to
add that each time you could actually
add it to korma itself you could go up
here right and in your deaf entity say
you know chained address to
state to whatever else you may have to
zip code to blah blah blah
and then cormac can then
uh
you know you could then use that in
widths and enable yourself to
essentially write out all those joints
for you so it's a really extensible way
of dealing with sql in general
um
another thing that i wanted to make sure
was that um it was flexible in a way
that wasn't annoying right so hibernate
has gotten a lot lot better over the
years but i remember the first few
versions it was like pages and pages and
pages of xml files where you had to
configure everything
while you do need to do that at some
times right you shouldn't always have to
do that there's value in the things that
that ruby on rails presented which is
you know this notion of convention over
over customization
but you need to be able to sort of get
out of it if you need to so for example
i used to work on a massive project that
had a wine database for
literally millions upon millions of
wines and everything you could ever want
to know about them but that database was
built up over many years by many
different companies and so we had a wine
table an underscore wine table an
underscore underscore one table right we
had all these weird
sort of names and none of the keys would
match and so another thing that i wanted
to make sure uh when i wrote corman that
was built for real world stuff
right i don't make assumptions and when
i do make assumptions you can override
them and that's that's i think an
important part of being really useful in
this space
um
so i mean there's lots of interesting
things here it's actually really small
so if you want to see how you might
write a sequel generating engine
that runs off of maps take a look at the
take a look at the source
um
yeah i don't want to take them any more
time so if you have any questions if i
have time
feel free
yeah you do your your joins all in one
swipe or if you
uh
like you know hibernate you could do a
cascading so like the first layer and
then do the second
level of indirection laserly or you know
on demand do you do that or no so by
default my has many relationship right
because that can be a multiplicative set
as you go down you don't want to do that
all really in one query most of the time
and you want to do it lazily like you
said my has many does exactly that and
you could write very very similar things
that do that there's a notion of a post
query essentially where you say oh do
this with the id you know the primary
key of this other thing and it makes it
easy actually to add if you don't like
what i've done even add more complex
ways of doing it yeah
about how much code is dedicated to the
differences between syntax and different
databases
well not a ton right now um and i'm i'm
sure there are bugs in this because i
only use a few databases i have not
tested against a lot of them so once
people start using it i'll start sussing
that out now to be to be um clear though
it does use jdbc on the backend right so
some of that is handled purely by jdbc
somebody who's done this for a lot
longer than i have and i don't have to
you know i know if they're correct
uh just like parameterized queries as an
example right all that is to make sure
it's safe i don't want to touch that as
much as i can
i should also mention you can actually
like get the sequel out of this and do
stuff with it if you want so you don't
actually have to use it to execute you
don't even like that you could if you're
working in another project you could
actually use closure to generate your
queries for that other project in a
different language and then you know
any other questions
all right