I think this should be a demo of the basic use of Refs and STM. The
tough part is keeping this simple enough to explain and demo in 4
minutes. The bank example at
http://java.ociweb.com/mark/clojure/article.html#ReferenceTypes is too
long. Maybe a simplified version of that can be created.
> What community contribution(s) should we showcase?
I think this should be a simple demo of Compojure. I have one at
http://java.ociweb.com/mark/clojure/article.html#WebApps that you are
welcomed to use.
--
R. Mark Volkmann
Object Computing, Inc.
They may be important, but is 4 minutes enough to show that are better
than just using threads and locking directly?
--
Michael Wood <esio...@gmail.com>
Yeah, 4 minutes is quite a restriction. It's just hard for me to
imagine having the task of trying to convince people of the goodness
of Clojure and not talking about STM.
> I'd appreciate some suggestions *and help* preparing demos for the
> Script Bowl. What (that could be demonstrated in 4 minutes) would make
> you think - 'Clojure looks cool, I need to look into it'? What
> community contribution(s) should we showcase?
For the first round, I'd try to prepare a modified version of the
ants demo:
1) simplify as much as possible
2) introduce a couple of macros, to show the power of syntax
abstractions (without going into any details, of course)
3) modify some parameter interactively
That should demonstrate
- concurrency without locks (again, no details in four minutes)
- the power of macros
- Java integration (the GUI)
- interactivity
The last point is the least important because the others have it as
well, but it's still good to see interactivity in practice.
The big missing points would be functional programming and immutable
data structures.
Konrad.
Perhaps using one of the clojure-processing wrappers to do some
outrageously-slick data visualization, and then showing how little
code is required to do it and how much leverage the language provides
when addressing changes in requirements? Maybe the slick visual
impact part can be merged with the "business application" mindset by
generating a report that includes the data visualization (I think PDF
generation is built into processing).
- Chas
I agree that the uniform data structures are one of the really cool
things about Clojure, but it seems like a fairly subtle point to try
to get across in such a short amount of time; also, showing people a
language with loads of parentheses *and* saying it's not OO may just
scare people off ;-) Although to be fair, I haven't been to J1 so I'm
not sure what the audience is going to be like.
For me, 2 of the biggest things are:
* using macros to add new control structures and eliminating
boilerplate; and
* changing code at runtime.
However, given the time constraint I think that changing code at runtime
will have more of a 'wow' factor to it, and will also be easier to
demonstrate as you can, for example, have a app set up and running with
a known defect, that you could fix as a demo. For enterprise users who
value uptime this is going to be pretty cool (it's not that big a deal
for the folks who run web sites as you can basically roll out changes
across a server cluster by bouncing nodes already
One other tip: if you're going to show source code then set the editor
to highlight brackets in a very light colour so they don't stand out as
much, I've often been surprised at how big a deal people make about them
when coming from Algol family languages.
Cheers,
Ian.
#ifndef __COMMON_SENSE__ | Ian Phillips
#include <std_disclaimer> | ia...@ianp.org
#endif | http://ianp.org/
Show how you can run a demo with a bug in it, trigger the bug, to
cause a break, fix the bug while in the break, and resume the demo
with the corrected code.
Quite an old example which I think demonstrates this well:
http://clojure.googlegroups.com/web/2c-calculator.clj
On Thu 21/05/09 17:43 , "Rich Hickey" richh...@gmail.com sent:
>
> I'd like to do something modest but distinguishing. I have a vague
> notion of showing some Clojure data originating in some XML off the
> web, being passed to some filtering/walking code, getting displayed,
> stored in a DB, all without specific DOM/model/recordset APIs, a
> couple of lines for each task. This demonstrating the difference of
> not being OO - using generic abstract data types like maps everywhere.
I think something like this is a good idea. It is very practical.
I can't share the code, but I am doing something similar - using clojure to build a pipeline that takes
different shaped queries as resultset-seqs, clusters related records into groups, and pushes the groups
through the pipeline using lazy-seq. I can also swap in literal datastructures in order to test the code
without depending on the database.
I guess there are lots of datasources that you could do something similar to resultset-seq with. Atom feeds
(particularly ones with history rel=next links), OpenSearch query results, queries to non-relational data-
stores, XMPP events...
I'm dabbling with a quick and dirty IRC logger + HTTP server, maybe too
long (60 lines)
http://gist.github.com/116323
--
Professional: http://cgrand.net/ (fr)
On Clojure: http://clj-me.blogspot.com/ (en)