So Nine Inch Nails has released a new album. So what? I don’t usually keep track of, let alone care, of such things, but this one caught my attention. They’re releasing it from their site, with options from a $5 download (for all 36 songs) in a variety of DRM-free formats (including Flac) to a $300 limited edition boxed set, including vinyl, signed by Trent Reznor (which considering the traffic load is likely sold out by now). And yet more interestingly, one of the options is all of Ghost I, DRM-free, in mp3, for free. Not only that, but there’s even an official torrent for it at The Pirate Bay. You can guess what I’m going to be Scrobbling for a while now.
About the albums, from the site:
Nine Inch Nails presents Ghosts I – IV, a brand new 36 track instrumental collection available right now. Almost two hours of new music composed and recorded over an intense ten week period last fall, Ghosts I – IV sprawls Nine Inch Nails across a variety of new terrain.
Trent Reznor explains, “I’ve been considering and wanting to make this kind of record for years, but by its very nature it wouldn’t have made sense until this point. This collection of music is the result of working from a very visual perspective – dressing imagined locations and scenarios with sound and texture; a soundtrack for daydreams. I’m very pleased with the result and the ability to present it directly to you without interference. I hope you enjoy the first four volumes of Ghosts.”
See also the discussion at Slashdot.
March 3, 2008
Posted by prael |
Last.FM, Music, web |
Leave a Comment
So I’ve noticed that I have 23 posts for January (I need a life), and only 4 for February. What have I been up to?
Mostly delving more into Scheme(see footnote), nearly to the exclusion of Common Lisp, other than the occasional tweaking of my StumpWM config.
A few years ago when I was still doing security (of the rent-a-cop sort) I was reading some Scheme book or another (I don’t remember which) in PDF format on my old Palm T3 running LispME. I miss my T3, I thought the format was just about perfect, and it was well built. I wouldn’t have given it away if I knew it would finally be figured out how to get Linux on it. Oh well, I have a laptop now. Anyway, I don’t really know why I never got more into it… I loved it, but I probably got distracted by other things after I moved (like trying to find a fucking job -_-). I don’t really know how it caught my interest again either (along with Common Lisp this time), but I figure it was inevitable with nothing else really going on.
So now I spend large portions of my time coding Scheme, and I’ll talk about a couple of the things I’ve been working on, the things I plan to work on, and some things I might eventually work on.
I wrote an IRC bot in Common Lisp as I always do when learning a new language. It was mostly a matter of the quote given in my earlier post on Scheme vs. Common Lisp, “Most newcomers eventually (and independently) decide the same thing: Scheme is a better language, but Common Lisp is the right choice for production work. CL has more libraries, and the implementations are somewhat more compatible than Scheme implementations, particularly with respect to macros.“.
But I decided, fuck that, it is the better language, and reimplemented it in Scheme. But I wasn’t happy, there wasn’t enough separation of layers, and the code to make the network interface bits portable across different Scheme implementations was a gigantic cond expression requiring the user (I always (try to) code with the assumption that other people will have to use/read it) to set a variable to the name of their implementation. All that complexity just to open a socket is bullshit, and doesn’t belong in the bot’s code.
I knew I must have been reinventing wheels, so I started looking around, and I found what I needed, Snow. It’s not perfect, but it’s still a fairly new project and pretty much does the job. And more importantly, it already has things like a portable TCP/IP package, among many others I’ve also found useful, and works on pretty much all of the major implementations. Documentation for specific packages can be sparse at times, but they *do* always at least tell you the procedures they make available and what args they expect. And one of the nice things about Lisp in general is that it’s not generally a bitch to figure out someone else’s code, should you need to.
With that, I set about writing an IRC library for Scheme using the Snow framework, to eventually use to rewrite my bot. And I dare say it’s nearing completion. The only thing currently lacking is DCC support, which will come at some later time. The IRC client protocol itself and CTCP support are pretty much there however. It was originally inspired by cl-irc but so much of it wound up being based around the ideas of the IRC “egg” for Chicken that I consider it a derivitive thereof (and is happily BSD licensed anyway). While it does have its issues (such as not checking whether a nick change actually worked…), its general design, which I thought was quite simply fucking brilliant, is obviously far superior to that of cl-irc’s (especially in how hooks/handlers and CTCP are handled). It seems I learned about as much Scheme from reading that code as I have reading any books. I only hope that my IRC code may be useful to Chicken’s, as mine likely wouldn’t exist as it does without it, so I’m going to wind up trying to write a couple patches for the parts of the egg I found lacking. Open source is grand, isn’t it?
Once that’s all done, I’ll be using it to (re-re-)implement my IRC bot in Scheme. And I think, for once, I’ll finally have the bot I always really wanted instead of a hack job that has to get around the limitations of the language it’s written in.
One of the things the bot does is retrieve information from Last.FM, so I’ll need to write an implementation of the API for Scheme too (obviously, based on the excellently written cl-audioscrobbler).
And then, I’ll get back to work on my MUD based on the ideas in Mooix NG. I’ve got a basic framework done making heavy use of Common Lisp’s CLOS, as an object system seemed the obvious tool for the job, and CLOS is simply sexy to work with. But working with Common Lisp just didn’t feel quite right, and I wound up looking more into Scheme(see other footnote).
I’m also vaguely entertaining the thought of writing Snow packages for the 9P and Freenet protocols. But what I’d really like to see is a widely supported SRFI for Foreign Function Interfaces(FFI). That would make the others (and other cool shit like POSIX) nearly trivial to do portably across implementations. Although threading at least has a couple of its own SRFI’s anyway. But in the mean time, a lot of Scheme implementations do support FFI to one extent of another… maybe someday when I’ve got more experience I’ll see about writing a Snow package to smooth over their differences, as CFFI does for Common Lisp.
So yeah. Do I need to get laid, or what?
(footnote) As it breaks compatibility both literally and ideologically to previous Scheme standards, I do not refer to R6RS as Scheme. When I say Scheme, assume R5RS.
(other footnote) Separate namespaces making me care whether it’s a variable or if I need to use #’, having to remember to use gensym in macros, should it be defvar or defparameter, … I don’t want to give a shit about the language, I just want to write what I’m trying to write, and when trying to write a MUD it was getting pretty old. Sure, I could abstract all that away. Lisp is GREAT for that sort of thing, and I started to do just that. But then I thought, why should I make Common Lisp be Scheme-like, when there’s already Scheme? If the language I really want is already there… use it.
February 25, 2008
Posted by prael |
cl-audioscrobbler, Common Lisp, IRC, Last.FM, Meta, Programming, Scheme, StumpWM |
Leave a Comment
So as I’m learning Common Lisp, as I usually do in a new language, I decide to write an IRC bot. It has been quite an interesting experience. Having had the general framework figured out I started to make it actually do some things, google searches, quotes, etc…
I also recently set up a last.fm account and had nothing better to do on New Year’s Eve, so I thought it would be nifty if I had my bot interact with last.fm in some way, and I found a handy library to do just that, cl-audioscrobbler.
But it always set the time the song played to 6 hours before I actually played it. It was easy to figure out what was going wrong, given I’m in CST, or UTC-6. Last.fm’s API specifies: “UTC date/time in YYYY-MM-DD hh:mm:ss format”. cl-audioscrobbler was sending my *local* time.
So I found the bit of code that figures out what time it is in src/tools.lisp, and naively tried to simply add 6 hours to whatever it produced. Naturally, that didn’t work out so well, and I wound up with something that kinda sorta worked but was hugely complicated and ugly. Then I found the un-braindead way to do it.
Change (get-decoded-time) to (decode-universal-time (get-universal-time) 0)
It’s not much, and chances are cl-audioscrobbler’s author has already found and fixed this (it was obvious looking at the sources that 1.2 support was already well underway), but I sent him a quick note about it anyway.
But it was the first bug in Lisp I’ve ever fixed that wasn’t in my own code, so I’m still pretty happy about it.
—–
Update: As of 2008/01/08 this is fixed with the 0.3.1 release. Thanks to Nicolas Lamirault for accepting my first ever Lisp patch =)
January 3, 2008
Posted by prael |
cl-audioscrobbler, Common Lisp, Last.FM |
Leave a Comment