9:59:59.000,9:59:59.000 I'm Steve. 9:59:59.000,9:59:59.000 That's me. That's my twitter handle. 9:59:59.000,9:59:59.000 I sometimes wear cowboy shirts, 9:59:59.000,9:59:59.000 I'm blonde, I'm from Canada. 9:59:59.000,9:59:59.000 I'm from a tiny little village in the middle of seriously nowhere. 9:59:59.000,9:59:59.000 That's a picture of-- actually, it's right beside the pond I used to play in as a kid. 9:59:59.000,9:59:59.000 I'm looking back at my town, so there's nothing there [laughter]. 9:59:59.000,9:59:59.000 [coughs] There are cowboys. 9:59:59.000,9:59:59.000 So this is a website that some friends in Canada sent me this week, which I think is amazing - 9:59:59.000,9:59:59.000 farmersonly.com - this is actually the town that I went to university. 9:59:59.000,9:59:59.000 These are people looking to marry farmers, or farmers looking to marry farm girls [laughter]. 9:59:59.000,9:59:59.000 It's pretty sweet. Uh, I'm not a cowboy - I'm a Smug Lisp Weenie. 9:59:59.000,9:59:59.000 I'm not a particularly good Smug Lisp Weenie, so uh... 9:59:59.000,9:59:59.000 I don't really know what this is. 9:59:59.000,9:59:59.000 I did a Google image search for 'Smug Lisp Weenie' and it gave me a cute bunny, 9:59:59.000,9:59:59.000 [laughter] and I know you're supposed to include one cute animal slide, so there it is. 9:59:59.000,9:59:59.000 I've worked these places. 9:59:59.000,9:59:59.000 So I worked at ADX Studio, ThoughtWorks, and DRW Trading - which is in Chicago. 9:59:59.000,9:59:59.000 DRW is where I've done all my Clojure so far. 9:59:59.000,9:59:59.000 Introducing Clojure into an environment is kind of difficult. 9:59:59.000,9:59:59.000 We started with just a t-logger. 9:59:59.000,9:59:59.000 It was listening to a really terrible messaging framework called LBM - 9:59:59.000,9:59:59.000 which is some UDP, drop all your packets, head loss piece of junk. 9:59:59.000,9:59:59.000 So we just had an old application that was written in JRuby 9:59:59.000,9:59:59.000 which would connect to this thing, and dump all the messages out to a file. 9:59:59.000,9:59:59.000 So we figured, that thing is like 50 lines of Ruby, we'll rewrite it in Clojure. 9:59:59.000,9:59:59.000 So we got then 12 lines of Clojure. That was a start. 9:59:59.000,9:59:59.000 Then we moved on to market data republisher, which is also boring. 9:59:59.000,9:59:59.000 So it basically gets a data-stream from an exchange, 9:59:59.000,9:59:59.000 and broadcasts it out to the rest of the companies, 9:59:59.000,9:59:59.000 so that not everyone needs to connect to the exchange all at once. 9:59:59.000,9:59:59.000 It was a little bit more interesting, because we had to deal with Java Interop and things like that. 9:59:59.000,9:59:59.000 It was 300 lines of Clojure. 9:59:59.000,9:59:59.000 And then the last thing that I wrote before I left was a web application and service, 9:59:59.000,9:59:59.000 so it was basically your standard RESTful web service, 9:59:59.000,9:59:59.000 in behind what would normally be kind of a Rails app. 9:59:59.000,9:59:59.000 So we were using Compojure and stuff for that. 9:59:59.000,9:59:59.000 That was about 2000 lines of Clojure. 9:59:59.000,9:59:59.000 It was actually kind of cumbersome, because it was also speaking LBM in addition to HTTP. 9:59:59.000,9:59:59.000 Okay, people are tweeting at me, so I'm just going to... 9:59:59.000,9:59:59.000 Nokia phones - they're amazing. 9:59:59.000,9:59:59.000 So the last thing that was written just as I was leaving, 9:59:59.000,9:59:59.000 was our trade capture and positions management system. 9:59:59.000,9:59:59.000 So this was an application that we'd taken from 9:59:59.000,9:59:59.000 60,000 lines of C#, down to about 5,000 lines of Ruby. 9:59:59.000,9:59:59.000 The code samples that people were sending me after I left and joined C42 9:59:59.000,9:59:59.000 made it look like it would probably go down to about 3,000 lines of Clojure, which is pretty cool. 9:59:59.000,9:59:59.000 So now I work at C42. 9:59:59.000,9:59:59.000 I'm their token white guy. 9:59:59.000,9:59:59.000 They can only have one until they hire 100 more employees, 9:59:59.000,9:59:59.000 according to Indian 'import white people from Canada' laws. 9:59:59.000,9:59:59.000 I work on RubyMonk, so I've inherited 9:59:59.000,9:59:59.000 a pretty sweet code-base from 9:59:59.000,9:59:59.000 from Josum and kitty and clojuremonk is definately coming. Its not there yet but i will build it, i promise. So this what we are going to do. So, we basically got this broken up into 2 chunks. 1 through 4 is going to go really fast so I can kind of do the Zedshaw thing and maybe ask everybody not to be that guy, we can leave questions for the end but this is a pretty tight talk so we might not have time for questions. I am totally happy to stop by like the coding room and hack with you on clojure if you actually want to try something out after the talk this afternoon or tomorrow. [br]So we are just going to do the baseline stuff, give you a quick introduction to Clojure, talk about lisp history. [br]I think the curiousity is joy, thats the whole reason i am a programmer. Quick introduction to functional programming as it pertains to Ruby, atleast one of the colonels, I think, for me and feeling good because that also why i am a programmer, for writing codes makes me feel good. Little bit of metaprogramming and then little bit of concurrency just finishing stuff.[br][br]So Baseline..[br]Really Quickly![br]How many people have read about Clojure? Anything at all?[br]Okay. So, a lot of people.[br]How many people have tried Clojure? Dowload, lining in, get it rapid running?[br]Okay, So, about like 20% or something.[br]Allright![br]How many of you have read some lisp literature? sicp, lisp in small pieces, anything?[br]That's about half..[br]Alltight!![br]Do you beleive this? Clojures equals Objects?[br]Hands up..[br]This is a serious one..[br]Wow!! Nobody!![br]Allright, I am screwed!! [br]Okayyy. So, we will do a quick introduction to Clojure but maybe i need more material than this. [br]What is this?[br]Just shout it out.[br]Okay, what sort of expression is it? [br]S expression. Okay, thats technically a correct answer. Thats function call, assuming the stretch is in the macro or a built in special form.[br]What is this, for anybody who has actually played with Clojure, you should know this one?[br]Sorry??[br]Conditional special form. Special form is a good guess. Its actually a macro call which is totally awesome. Check it out. [br]This is the mactro that defines "when not" which is basically Ruby's on list. So you have a language element defined as a macro in one freaking line. RAD..[br]Okay, so this is bastardisation of a Rich Hickie code. Basically he says, if you want a new for loop, you can should be able to ready it yourself. You shouldn't have to wait for the compiler or the interpretor/implementer to come up with Java 1.8 to do something fancy for each.[br]What's this?[br]Ya, okay, a string.[br]What's this? [br]Keyword..[br]Right on.. some people..[br]What's this?[br]Symbol. Right on..[br]So, basically, in Clojure, like one of the things that's gonna screw you up is keyword and symbol are more or less reverse, not exactly but it helps to think of them that way. 6.21