annealer annealer

gabriel gironda will have his revenge on seattle

  1. Zero to Compojure in a few easy steps

    Written on Monday, November 23, 2009

    Step One

    Ensure you’re running the latest RubyGems

        gabriel@pinion:~/Code/GitHub$ sudo gem update --system
        Password:
        Updating RubyGems
        Nothing to update
        gabriel@pinion:~/Code/GitHub$ 
    

    Step Two

    Install JavaGems

        gabriel@pinion:~/Code/GitHub$ gem install javagems
        WARNING:  Installing to ~/.gem since /opt/ruby-enterprise-edition/lib/ruby/gems/1.8 and
            /opt/ruby-enterprise-edition/bin aren't both writable.
        Choosy clojurers choose Thumblemonks
    
        Remember to add ~/.javagem/java/bin to your PATH environment
        variable for maximum-JavaGems-fun-times.
        Successfully installed javagems-0.4.10
        1 gem installed
        Installing ri documentation for javagems-0.4.10...
        Installing RDoc documentation for javagems-0.4.10...
        gabriel@pinion:~/Code/GitHub$ 
    

    Step Three

    Install Compojure via JavaGems

        gabriel@pinion:~/Code/GitHub$ javagem install compojure
        Successfully installed clojure-1.0.0
        Successfully installed clojure-contrib-1.0.0
        Successfully installed jetty-util-6.1.22
        Successfully installed servlet-api-2.5
        Successfully installed jetty-6.1.22
        Successfully installed commons-fileupload-1.2.1
        Successfully installed commons-codec-1.4
        Successfully installed commons-io-1.4
        Successfully installed compojure-0.3.1
        9 gems installed
        Installing ri documentation for clojure-1.0.0...
        Installing ri documentation for clojure-contrib-1.0.0...
        Installing ri documentation for jetty-util-6.1.22...
        Installing ri documentation for servlet-api-2.5...
        Installing ri documentation for jetty-6.1.22...
        Installing ri documentation for commons-fileupload-1.2.1...
        Installing ri documentation for commons-codec-1.4...
        Installing ri documentation for commons-io-1.4...
        Installing ri documentation for compojure-0.3.1...
        Installing RDoc documentation for clojure-1.0.0...
        Installing RDoc documentation for clojure-contrib-1.0.0...
        Installing RDoc documentation for jetty-util-6.1.22...
        Installing RDoc documentation for servlet-api-2.5...
        Installing RDoc documentation for jetty-6.1.22...
        Installing RDoc documentation for commons-fileupload-1.2.1...
        Installing RDoc documentation for commons-codec-1.4...
        Installing RDoc documentation for commons-io-1.4...
        Installing RDoc documentation for compojure-0.3.1...
        gabriel@pinion:~/Code/GitHub$ 
    

    Step Four

    Create a new project with Compojure specified in the Gemfile

        gabriel@pinion:~/Code/GitHub$ mkdir compojure-example
        gabriel@pinion:~/Code/GitHub$ cd compojure-example/
        gabriel@pinion:~/Code/GitHub/compojure-example$ echo 'gem "compojure"' > Gemfile
        gabriel@pinion:~/Code/GitHub/compojure-example$ 
    

    Step Five

    Run your sample app

        gabriel@pinion:~/Code/GitHub/compojure-example$ cat hello.clj 
        (use 'compojure)
    
        (defroutes my-app
          (GET "/"
            (html [:h1 "Hello World"]))
          (ANY "*"
            (page-not-found)))
    
        (run-server {:port 8080}
          "/*" (servlet my-app))
    
        gabriel@pinion:~/Code/GitHub/compojure-example$ jam clojure.main hello.clj
        2009-11-23 20:31:35.397:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
        clojure.proxy.javax.servlet.http.HttpServlet
        2009-11-23 20:31:35.493:INFO::jetty-6.1.x
        2009-11-23 20:31:35.996:INFO::Started SocketConnector@0.0.0.0:8080
    

    All done!

  2. FFFUUU OPENSSL

    Written on Friday, November 13, 2009

    god fucking damn it

    Worst. Fucking. Part. Of dealing with OpenSSL. Seriously.

  3. open robots

    Written on Thursday, November 12, 2009

    open robots
  4. I do not think it means what you think it means.

    Written on Wednesday, November 11, 2009

    An enlightening article by Andrew Wooden is making the rounds today, featuring some choice quotes from a certain Simon Aldous, who seems to be some kind of Microsoft marketing hotshot in the UK. I love when someone gives a soundbite that can be refuted by four seconds with Google and eight seconds of stepping back from the monitor, straightening your jacket, and beginning to perceive correctly.

    Is Windows 7 really a much more agile operating system, in terms of the specific uses it can be moulded to?

    The interesting thing is, it’s basically the next version of Vista. Vista was a totally redesigned operating system from XP.

    Let’s take a trip down dictionary lane.

    Oxford American Writer's Thesaurus

    totally

    adverb

    the decor is totally pink: completely, entirely, wholly, thoroughly, fully, utterly, absolutely, perfectly, unreservedly, unconditionally, quite, altogether, downright; in every way, in every respect, one hundred percent, every inch, to the hilt; informal flat out, to the max. ANTONYMS partly.


    New Oxford American Dictionary

    totally |ˈtōtl-ē|

    adverb

    completely; absolutely : the building was totally destroyed by the fire | [as submodifier ] they came from totally different backgrounds.


    redesign |ˌrēdiˈzīn|

    verb [ trans. ]

    design (something) again in a different way : the front seats have been redesigned.

    noun

    the action or process of redesigning something.


    Now I don’t know about you, but I wouldn’t consider building an OS on top of a kernel that has its roots from circa 1989 a “total redesign”. I mean, if you’re going to be English, speak English. There’s nothing at all wrong with the fact it’s built on the NT kernel, by the way. Just don’t call it something it isn’t.

    We’ve improved upon Vista in that way. We’ve stripped out a lot of the code, we’ve made a lot of it much more efficient, it sits on a smaller footprint, it operates far more quickly, it’s far more agile and effective in terms of the calls it makes. I saw an article recently that described it as ‘Vista on steroids’, and in some ways you can absolutely relate to that.

    Agile is my favourite new buzzword. I sure hope they agilely developed agile software that makes agile calls in their Department of Agility over at Agile Microsoft (the software company formerly known as Microsoft). What does he even mean? Did they hire an entire team to hand unroll loops and make function calls tail recursive? Dear Simon, if you’re reading this, please quantify said statement. Otherwise I’m adding it to the list of “things I’ve heard that make no sense” right underneath the statement from a kid in grade school who told me he made a jetpack and car out of sticks.

    One of the things that people say an awful lot about the Apple Mac is that the OS is fantastic, that it’s very graphical and easy to use. What we’ve tried to do with Windows 7 – whether it’s traditional format or in a touch format – is create a Mac look and feel in terms of graphics. We’ve significantly improved the graphical user interface, but it’s built on that very stable core Vista technology, which is far more stable than the current Mac platform, for instance.

    Because in the arena of popular operating systems, the one that’s known for immense amounts of stability is Windows. Right. Mac OS X isn’t perfect by far (hey thanks Snow Leopard bug that forces all my keyboard input to one application until I reboot the machine), but I don’t recall the press around Vista being “man this thing sure is ugly, but at least it’s stable”. Your FUD is embarrassing, and I see right through you.

    So you’ve taken the style of the Mac platform and built it on the more solid foundations of Vista?

    What the fuck, Andrew? I’m not exactly a journalist, but I really don’t think taking a contentious statement from the guy you’re interviewing and then reinforcing it by reusing it in your own question is exactly a shining star of journalistic integrity. Up your game.

    We’ve taken everything that’s good about Vista, along with the core infrastructure of the operating system, and we’ve made it faster and slimmed down the code to make it more effective.

    You just said the good thing about Vista was the core infrastructure of the operating system. Essentially the same statement was made twice. Also, please quantify the usage of the term “effective”, in five hundred words or less. I don’t know what you mean by “effective”. You’re throwing words out there like a malfunctioning Speak and Spell. Forming coherent sentences doesn’t work like that, unfortunately. I’m sorry.

    We’ve also tried to listen to what customers want in terms of a much slicker user interface and the ability to engage with it far more intuitively. That’s the product that we’re delivering.

    I wish they’d fire this dude and deliver a new marketing guy an interviewer can engage with far more intuitively (and “effectively”). Is this seriously the best you can come up with, Microsoft? I don’t even mean Windows 7, I’m talking about the total stooge you sent out to shill it.

  5. Thumbs Down for Your Shitty Ivory Tower

    Written on Tuesday, November 10, 2009

    I recently stumbled into the land of Clojure and was subsequently shown a delightful demonstration of looking down your nose in its peak form. I haven’t seen pointless elitism on this grand a scale since… well… the last time I started poking around a language badly in need of one of those giant needles from Pulp Fiction to the chest because hardly anyone was using it for anything useful ever.

    I quote, from this paragon of snobbery:

    I find Clojure revolting.

    It is the most explicit to date abandonment of the age-old Lispers’ Dream, “Lisp All The Way Down.” Clojure is the antithesis of the Lisp Machine. Instead of a crystalline pyramid of comprehensible mutually-interlocking concepts, behind every Clojure primitive there lurks Black Magic.

    That’s great. I’m happy you find it to be the antithesis of a hardware/software platform that has been dead since the 1980s. Please write another post once you find the antithesis of the following platforms: IRIX on SGI MIPS hardware, Smalltalk on Xerox Alto hardware, NeXTSTEP on a NeXTcube. If you could also take into account the subsequent death (Mac OS X notwithstanding) of each of these platforms despite their respective amounts of technical superiority over whatever else existed at the time, that would be great too. In a follow-up post, please also explain the black magic behind generating C, JVM, or .NET bytecode in Bigloo Scheme and the contents of eval.c in MzScheme. That would be aces. Being in line with your “pure-Lisp” worldview, as they’re implementations of Scheme, resolving this apparent cognitive dissonance should be easy enough.

    Continuing down this path of pompous self righteousness…

    The Clojure user who is missing some routine or other will run crying to Java for help, rather than implementing the feature himself correctly - that is, as a natural part of the entire language, built on the same concepts. Clojure pisses on everything I’ve ever loved about Lisp. It rejects even what little consistency and intellectual rigor there is to be found in an abomination like Common Lisp.

    Heavens no. How dare someone implement a feature in another lanGGGGGGGGG-oh-god-code-snippets

        /* network.c from MzScheme */
        # include <netinet/in.h>
        # include <netdb.h>
        # include <sys/socket.h>
        # include <fcntl.h>
    

    isweartogodihadapointheeeeeeeee@#@@@#%%^^!

        /* strftime.c from GNU Guile */
        /* Copyright (C) 1991-1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2009 Free Software
           Foundation, Inc.
    
           NOTE: The canonical source of this file is maintained with the GNU C Library. <-- HEY LOOK AT THAT
           Bugs can be reported to bug-glibc@prep.ai.mit.edu. */
        /* SNIP */
    

    reallyabouttogetbackontrackiprZZZZZZZZZZZZZCARRIERLOST

        /* re.c from the regexp implementation for TinyScheme */
        /* re.c */
        /* Henry Spencer's implementation of Regular Expressions,
           used for TinyScheme */
        /* Refurbished by Stephen Gildea */
        #include "regex.h"
        #include "scheme.h"
    

    Holy shit. My mind has been blown. Three separate Scheme implementations, re-using C code and even implementing parts of the language in C? Heavens no! Please Lord, reach down from the heavens and pinch my bottom so I KNOW THAT I’M DREAMING. Hey guy, when you’re done reinventing the wheel, I have this mousetrap that needs fixing. Copious amounts of sarcasm aside, using another language for help isn’t called “running crying”, in most places it’s called “pragmatism” and, it lets you do things like “write software to solve the task at hand” rather than “write three socket implementations and a regexp library because you just LOVE shaving yaks”. If you could let the maintainers of every single Scheme implementation know they’re doing it wrong every time they drop down to C, that would be great, thanks.

    Carrying on with indestructible resolve and I stiff upper lip, I bring you…

    Clojure is the False Lisp, which Reeketh of the Cube Farm. A Lisp unworthy of the name; one which encourages users to pepper their code with calls to opaque routines having no underlying Lispiness. A Lisp which barfs Java stack traces. It promotes - no, mandates - the use of undigestable foreign matter in Lisp code: primitives on which you cannot pop the hood to reveal intelligible innards.

    I Love The Capitalisation Here. Heh. You Peon. In Your Cube Farm. Come Back To Me When You Code In A Real Language, Newbie. Heh. I Bet You Don’t Even Know APL. Dumbass. If only Clojure were some kind of open source project with large amounts of the language implemented in Clojure itself. If only the parts that weren’t in Clojure were implemented in some kind of higher level language than C so that they were easily comprehensible by most humans (note: this is in no shape, way, or form an endorsement of Java in general). Oh shit, those all hold true? My mistake.

    I don’t care if everybody really is more productive in Clojure than in Common Lisp. The latter is not my standard of comparison (Symbolics Genera, the state of the art, is. Or, if you want something that is distinctly inferior but is currently available on the market: Mathematica.) Clojure is the gutted and zombie-reanimated corpse of a dream.

    The cult of Good Enough which seems to pervade all of modern computing has finally chewed its way through to the Lisp community, with Clojure as the result. I am tired of this abomination being hailed as the future of Lisp. Aficionados of real Lisps, such as myself, will keep hoping, dreaming, and working on systems which do not betray the original virtues of the language.

    Symbolics Genera remains the gold standard of programming systems. Though largely forgotten, it can never be un-created. My standard of comparison for any technology will always be everything previously achieved by mankind, rather than what is available on the market today.

    Ok. I think I’ve spotted the core of our mutual disconnect here. I’d like to be productive in Lisp and be able to write usable and deployable software in it, whereas you want a fucking DeLorean so we can flux-capacitor our way back to 1985 and kill Bill Joy then sell a bunch of expensive Symbolics hardware. I see. I think you should start a club with some of the more hardcore (disclaimer: I fucking love Smalltalk) Smalltalk guys and you can have a collective circlejerk about how great your closed ecosystem of writing custom version control systems and deployment solutions is. In the meantime, I’ll be busy with Clojure and GNU Smalltalk and getting things done. Thanks! Send me a postcard from the ivory tower some time, I hear the view is spectacular, but the company leaves something to be desired.

    My point here is this: Clojure is a young language. The last thing it needs is the Lisp-elitists stomping all over it because it doesn’t meet their standards of purity (which can only be met by running on dead hardware). Hopefully, the fact that it’s actually usable for writing every-day software will let it overcome the naysayers. You aren’t really helping further the cause of Lisp in general by scaring away newcomers with a lot of chest-thumping and quoting of the nerd version of the Reinheitsgebot. If Clojure were my first exposure to Lisp, and I read that blog post, I’d probably stay the fuck away. Not based on any technical pros/cons, but more because I’d think the Lisp community is a bunch of dicks (which it isn’t, for the most part).

Older Posts

  1. 2009/01/08 - GitHub fork of Vlad the Deployer with better Git support...
  2. 2009/01/02 - Fast and easy method protocols in Ruby...
  3. 2008/12/29 - Interesting Rails commits, Volume #1...
  4. 2008/12/28 - Jekyll tip for rendering individual posts...
  5. 2008/12/26 - Ghetto contexts in Rails tests...
  6. 2008/12/23 - Merb+Rails? Meals? What the fuck is Ruby on Meals?...
  7. 2008/12/22 - Callbacks got refactored to ActiveSupport in Rails 2.1...
  8. 2008/12/22 - Back to the blarghosphere....

Annealer, a Jekyll powered blog by Gabriel Gironda.