Hacker Newsnew | past | comments | ask | show | jobs | submit | magnars's commentslogin

Want to watch two developers live code a small game with Clojure and ClojureScript? What does functional programming look like when wielded in anger? Will the tests be green or red or both?

Seven years ago I made a screencast where I coded a game in Clojure so very quickly. This time I'm joined by a friend to do something hopefully a bit more entertaining, useful and informative. The first two episodes are out. More to come every Friday. :)


It didn't feel right naming it `optimus.core` :)


I see that you're actually creating your own slime-js-minor-mode-map. I'm guessing that was necessary because you didn't require slime-js before requiring setup-slime-js.

Maybe it will resolve your issue of you put this at the top of the file?

     (require 'slime)
     (require 'slime-js)
The swank-js documentation says it depends on js2-mode too. Are you using that? At least I have no issues with entering arrays in the repl.


When I try requiring slime-js it complains about slime-face-inheritance-possible. And yeah I'm using js2-mode


That's defined in my slime.el (2010.04.04), which is why I require that first.


Yeah, that would be pretty cool. I'll be making something along those lines to aid me while I'm making that bouncy ball into an actual game. I wouldn't know how to start making it general purpose, but as a wrapper around canvas and requestAnimationFrame it is definitely doable.


Well, I doubt you could make it arbitrarily general-purpose.

I was thinking about maybe building on top of some existing framework. I think there are various existing libraries that help you create shapes and animate them; I imagine you could make something very useful by hooking onto the various methods in a library like that.


Ooh, very nice. I'll fix that straight away. Thanks!


I wrote a little bit about installing swank-js a couple of posts up. You can also check out all my emacs-settings on github https://github.com/magnars/.emacs.d/blob/master/setup-slime-...

The only thing missing there is the packages installed through package.el, which would be slime-js in this case.

And here's the code for the bouncing ball: https://github.com/magnars/blockout


Cool, but how about the rest of the code, for the "game"?


That last link there is all there is of the "game" for now. :-)


The biggest problem for me was conflicting versions of SLIME.

Installing swank-js is a breeze with npm, but the installation instructions tell you to get the newest version of SLIME from their svn. That didn't work so well, since my clojure-swank already relied on an older version.

Simply installing slime-js from marmalade instead made all the difference.

As for my settings, they are public on github. https://github.com/magnars/.emacs.d/blob/master/setup-slime-...


I have the same problem. So how does ELPA resolve conflicting SLIME versions?


From what I can understand, it doesn't. Backwards compatability is usually good. However, there was a breaking change in 2011 sometime. The slime-js in marmalade relies on the SLIME in marmalade, which is from 2010.04.04 - and works with that. Same for clojure-swank. So by removing the newest SLIME, it worked for me.


So I guess the "Use for good, not evil" clause will finally be removed from jsmin and jslint now.


He gave IBM a special license to do evil with it. IBM complained that, whilst they thought they were doing good things, they were not so sure there customers would.



What is fascinating about the description there is that IBM hasn't just asked once - they've asked many times.

I'd be willing to bet that the cause is that IBM's lawyers are aware that the most famous act of evil in the 20th century was committed by an IBM client, using IBM equipment. No joke, that was how the Nazis kept track of the Jews. And I'd be willing to bet that there are a lot of random dictators today who are using IBM software to keep tabs on their populations as well.

So while the IBM license exemption sounds silly and amusing, there is a very serious point behind it.

Incidentally this clause makes jsmin both not open source (discriminates against fields of endeavor) and also puts it in Debian non-free (same reason).


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: