Thursday, November 11, 2010

Land of Lisp book review

Land of Lisp is an intermediate-level book that teaches Lisp by way of game programming. Interspersed with light-hearted illustrations, LoL is a real page-turner and is one of the most interesting programming books I've read. Important Lisp concepts such as macros, higher order functions and generic programming are clearly explained. One whole chapter is devoted to Lisp being applied to Domain Specific Languages, which is highly applicable and relevant to modern web programming. Along the way, the author also teaches fundamental concepts such as recursion (although not as much emphasis on this as compared to Scheme, for example), code reuse (the "Don't Repeat Yourself" principle), functional programming, closures, basic algorithms like MiniMax, depth-first search and a whole lot more.

Because the author assumes the reader has a basic grasp of his operating environment, setting up a Common Lisp implementation (editor/compiler) is not covered in detail. If that idea is too daunting for you, then you may wish to refer to the beginning chapters of Peter Seibel's Practical Common Lisp or David Lamkin's Successful Lisp as a starting point and come back to LoL when you're more comfortable with how things work.

All in all, I would say, "buy this book!". Highly recommended.

Thursday, October 14, 2010

Back to the Mac

On 20 October, Apple is going to let the world know what they have planned for OS X 10.7


My wild-ass guess is that Apple is going to let the apps from iOS run in a sandbox environment on OS X 10.7, which really shouldn't be that hard to do since development code runs on emulated iOS devices. This would broaden the reach of the iOS ecosystem and would effectively give Apple direct insight into how people are actually using their Macs, via analytics. It would then be able to serve relevant ads.

Wednesday, October 13, 2010

As seen on HN

1993: if
1998: "if" too slow; use "case".
2002: "case" too slow; use Boolean algebra.
2006: Boolean algebra too slow, use arrays & pointers.
2010: Who wrote this shit and what does it do? Rewritten to use "if".

By edw519.

Friday, October 08, 2010

Reasons for continued existence of 3GS

asymco's Horace Dediu has an interesting take on the continued existence of the iPhone 3GS; essentially it is still being kept around so as to "steer adoption of the iPhone 4".

The iPhone 4 is clearly better from a hardware angle, the only downside is price (natch). But I think the 3GS is still around to serve 2 main purposes:

1) Reduce supply pressure of the iPhone 4. Even as iPhone 4 production ramps up and months after its launch, there is still widespread shortage worldwide. Whereas a potential customer might be sitting on the fence with regards to a purchase decision, the existence of a 3GS provides a low-cost "gateway drug" to get into the iOS ecosystem of App Store, excellent web browsing experience etc.

2) Preserve value of the iPhone brand. Many new iPhone 4 owners have upgraded from n-1 (3G or 3GS) and the continued sale of n-1 by Apple itself means the depreciation cost of n-1 phones is minimized. Owners with carrier contracts can upgrade to the next n+1 device at minimal outlay of cash with the proviso of extended carrier contracts (24 months in this part of the world), which is not necessarily onerous outside of the US. This strategy allows the iOS apps inertia to snowball.

Wednesday, October 06, 2010

Speed Download and GameTrailers

If you ever wanted to download the QuickTime HD movies on GameTrailers, and if you have Speed Download, you're in luck. Just copy the following file, name it "gt.sh" or something, give it execute permissions (chmod 755 or whatever), then just run it in the shell with each raw GameTrailer URL HD link as the arguments.

If you don't have Speed Download, you can still use curl to download the files, albeit at a much slower speed; just change the last command to pipe back into /usr/bin/curl instead of sdcli.

Enjoy.