Metacircular thoughts

December 25, 2007

Working through Concepts, Techniques, and Models of Computer Programming

Filed under: Language pissing matches, Language snobbery, Politics — metacircular @ 12:05 am

I am working through the famous CTM book, which looks like it could be like SICP for grownups.

CTM uses a language and platform called Mozart/Oz, which is freely downloadable and easy to get started with.

The development environment includes an Emacs-based REPL. It’s very easy to get started.

15 minutes after installing the program, I was able to code up the classic tail-recursive factorial:


declare
fun {Fact N}
   fun {FactIter N Acc}
      if N == 0 then
	 Acc
      else
	 {FactIter N-1 Acc*N}
      end
   end in {FactIter N 1}
end

{Browse {Fact 23}}

The first part defines our factorial function, and the second evaluates 23! and displays the result in the browser, which will be familiar to anyone who use has used Common Lisp.

(Yes, Oz has arbitary-precision integer arithmetic built in, like any sane modern programming language. Yes, Oz is apparently lexically scoped.)

All in all, it looks like the CTM book should be quite enjoyable. I’ve heard it’s readable and its coverage of different programming paradigms — object-oriented, concurrent, logic, functional, imperative, constraint-based, declarative — is nearly comprehensive.

Let the holiday language snobbery commence!

November 28, 2007

Holy shit Akismet sucks

Filed under: Politics, Pop culture — metacircular @ 10:12 pm

I was just looking through the comments on this blog after neglecting it for a while and I had no idea Akismet let through so much spam. What a piece of shit.

July 9, 2007

How to ace a tech interview

Filed under: Politics, Pop culture, The Dark Side — metacircular @ 6:32 pm

In this article, I’m going to help you whiz through those dastardly technical interview questions. Ever wonder why manholes are round? Read on.

Let’s start with an easy one. This one is called “The Rope Bridge“.

Four people need to cross a rickety rope bridge to get back to their camp at night. Unfortunately, they only have one flashlight and it only has enough light left for seventeen minutes. The bridge is too dangerous to cross without a flashlight, and it’s only strong enough to support two people at any given time.

Each of the campers walks at a different speed. One can cross the bridge in 1 minute, another in 2 minutes, the third in 5 minutes, and the slow poke takes 10 minutes to cross. How do the campers make it across in 17 minutes?

Solution: Who gives a shit? Who asks retarded questions like this?

This one is called “Wanna Play?” (hint: No!):

i offer to play a card game with you using a normal deck of 52 cards. the rules of the game are some fucking arbitrary bullshit that make this bullshit mental masturbation way harder than it needs to be. if you can’t figure it out in 45 seconds, i’ll assume you can’t produce code and work on a team, regardless of any free software projects you may have participated in (in fact i couldn’t look at open source code you’ve written if i wanted to, i’d get fired), regardless of any nice code samples you have to show me, regardless of how quickly you can pick up new things, and so on.

Solution: Are you getting the point? Jesus christ, no fucking wonder companies who use these kind of questions can’t ship anything.

July 2, 2007

Functional programming is easier than imperative programming

Filed under: Politics — metacircular @ 6:26 pm

Or maybe I should instead say that functional programming scales down better than imperative languages.

Java and C# are not interactive at all. I can’t fire up an interpreter and test out inputting values. Even if I could, it’s a pain in the ass, because you can’t declare literal hashes/lists, and you can forget about one-line iteration statements the way Scala or Ruby lets you do something along the lines of Array(1,3,9,16,25) foreach {n => ...}.

Unfortunately, this carries over to non-trivial applications. If I’m working on an interpreter, I can start out by framing the grammar as a series of algebraic data types, and then I can make a simple interpreter with pure pattern matching. Algebraic data types are ideal for representing abstract syntax trees, and so I can directly type in code fragments at the REPL within a subwindow of my editor while I’m coding up my interpreter that will be efficiently compiled to run roughly on parity with Java or C#.

And don’t tell me about the value of sophisticated IDEs if you’ve never used SLIME or Squeak.

June 26, 2007

Someone please make the bubble die

Filed under: Life, Politics, RIAs, The Dark Side, Web development — metacircular @ 11:38 pm

OK, we’re now deep in 1998-1999 territory with respect to Web 2.0 bullshit. Like the real estate crash, if you don’t see what’s going to happen in about 8-24 months coming a mile away you’re living under a rock.

Look at what’s on the top blogs, mang. Remember all those experimental psychology papers you’ve seen which make a pretty convincing, fairly scientific argument that people aren’t effective at multitasking? Disregard that and embrace meaningless phrases like connected mode: do stupid shit faster! That’s right. All the old facts (who has time for facts anymore?) are irrelevant. It’s different this time. Smug dipshits who can’t produce code wearing ironic t-shirts gather at parties and rub each other’s balls in a circlejerk of self-congratulatory praise. We are so awesome. We’re wiseguys. Everyone outside our incestual Valley echo chamber is a sucker.

Somehow, human nature has changed in the last three years: cool office + caffeine + slave labor = startup success! Or, alternatively: MacBook Pro + Rails + Ajax todo-list app = startup success!

Another forgettable blog proclaims non-chalantly: “…as businesses … get more productive to remain competitive…” The same message is everywhere: no one (an absolute) has time to do anything: (another absolute) read books (except masturbatory productivity ones), write coherent essays, or learn new things that don’t involve Javascript. The same people using motherfucking PHP talk about increasing productivity without a hint of irony in their high-pitched voices! Unfuckingbelievable!

OK, so proprietary vendor Z wants to lock users in to new platform C, which garners significant mindshare from developers busy locking people in to platforms A and B from proprietary vendors X and Y, and I’m supposed to be impressed? Ignore the fact that you can’t link to a single fucking thing in this RIA widget shit Z is pushing, and you can’t increase the size of the text, or use Firefox extensions on it, or do most of the things a web browser is currently useful for. Nevertheless: game-changing!

TechCrunch is a sea of forgettable names: PopSugar, Meebo, Cellfish, Jobster, Topix, Kiptronic, PicLens, Pixoh, Snipshot, Cumshot, Gazeebo, Dildo, whatever. That sinking feeling in your stomach and glaze in your eyes as you read those names is the knowledge that this has all happened before (and that it doesn’t have to be like this). Yes, it’s not as insane as it was during the first bubble. But there are still millions of dollars going after companies that can’t possibly actually have, you know, customers, revenue, the stuff that actually sustains business. This Valley-blog-startup-TechCrunch-iPhone-Digg bullshit is not indefinitely sustainable. Like Sarah Connor stuck in her Armageddon nightmare, you can pound against the fence and scream all you want, but the mushroom cloud is coming, man.

Look, you little Bay Area-dwelling, public transportation-using, podcatching, bespectacled too-cool-for-cool circlejerk pricks: calm the fuck down. Chill the fuck out and read a computer science textbook. Learn a functional/concurrent/logic programming language. Read Steve Yegge. Face the fact that your startup, rather than being “game-changing,” is boring and banal, just like most businesses; what matters is whether revenue - expenses > 0 or not. Learn how code generation in a modern compiler works. Make a toy operating system. Learn how the CLR in .NET works by reading books, documentation, and examining IL bytecode. Tinker with OpenBSD and write a solid technical article about what Mac OS X/Linux users could learn from it (crypto? firewalls? there has to be something). Do something real for once, for fucks’ sake! Do something a bright teenager could grasp the outcome of but when asked how he’d do it would scratch his head and say, “uh… hm.” REAL! And I’m not talking about robotic toys that don’t do anything interesting from a science/engineering perspective! And no data center/sysadmin shit that only applies to web hosting companies who are hosting 50 terabytes of data, nor something a smart 15 year old kid could do in a weekend in between Bangbus marathons. You’re driving me nuts. Less TechCrunch, more Fog Creek. OK?

(Am I just jealous I’m not on the gravy train? Uh, obviously.)

June 17, 2007

If Ruby is so great

Filed under: Politics — metacircular @ 9:40 pm

Why do I always see Ruby programmers using hash parameters as a substitute for keyword/optional arguments? Why don’t they cook up a DSL that adds that to Ruby, huh? Why do they destroy the readability of their code by making 80% of their functions take one or two parameters and then a completely uninformative one called “options?” Why do they, in spite of this wannabe Common Lisp phenomenon, then insist that Ruby is an acceptable Lisp?

Why doesn’t Ruby have a decent VM?

Why do I have to drop down to C if I want to do anything that requires performance and there’s not a major bottleneck like a database? Like, say, large unit test suites?

Why do available Ruby development tools imitate IDEs for Java/C/C++ rather than imitating Squeak and VisualWorks? In fact, why does Ruby ignore so much of the valuable prior art the Smalltalk community has accumulated?

May 20, 2007

Fair, balanced Metacircular Thoughts: What you must believe to be a Democrat, 2007 edition

Filed under: Politics — metacircular @ 1:59 pm
  • Governments elected on a death cult platform are friends to be courted.
  • If only we took firearms out of the hands of law-abiding citizens, tragedies like the Columbine school shootings (which was carried with illegally purchased weapons) wouldn’t have occurred.
  • If only we disarmed rural populations in developing countries, genocides like Rwanda (which was carried out to a significant degree with machetes) wouldn’t occur.
  • If only we had more gun-free zones, tragedies like the Virginia Tech (a gun-free zone) shootings would never occur.
  • Women, homosexuals, and others who feel they are in danger of being assaulted or mugged should battle it out in dark alleyways with 250-lb rapists/muggers/gaybashers rather than having an equalizer in the form of a concealed weapon. Moral righteousness is far more important than physical safety.
  • The 1st Amendment is sacred and more relevant than ever. The 2nd Amendment is evil, outdated, and irrelevant.
  • It’s possible to envision a future free of firearms. The weapon that has been a key element in all wars for the last 500 years can be uninvented, especially when in the past it was independently rediscovered by the Arabs, the Chinese, the Indians, and the Europeans.
  • Open borders will enhance our quality of life. What would we do without ethnic restaurants?
  • Open borders will enhance our quality of life. The racist Hispanic lynch mobs that cruise around Los Angeles looking for black children to kill are a blessing.
  • Open borders will enhance our quality of life. Millions of anti-Semitic foreigners who don’t speak English and have a fourth-grade education will help America stay competitive in a future where knowledge and information are the key sources of value.

What you must believe to be a Republican, 2007 edition

Filed under: Politics — metacircular @ 10:23 am
  • Believing in retarded 9/11 conspiracies makes you a persona non grata, but believing that 9/11 was a punishment from God for tolerating any belief system that isn’t fundamentalist Christian makes you a pious, respectable individual.
  • Deviating from the party line even by a little, no matter how ridiculous the party line is, emboldens terrorists and endangers America. However, reckless, trillion-dollar wars that indirectly result in the death of tens of thousands of innocent people and destroy alliances with other countries make America stronger.
  • America is a wonderful, free nation, which is why all decent people should have the good sense to keep their mouths shut if they disagree with military policy. Don’t they know that the troops died for their right to shut the fuck up?
  • Muslims in the Middle East are too backward and uncivilized to appreciate noble Western notions of democracy, the sanctity of life, and the like. But that doesn’t mean we shouldn’t have a war so that the can experience the joys of democracy and civil liberties. What, you don’t think they can handle it?
  • Because there are quite a few good things you can say about Israel, all the bad things its military does are irrelevant and untrue.

And finally, the most damning of them all:

Torturing people works and torture is a good way to fight terrorism.

See also What you must believe to be a Democrat, 2007 edition.

May 14, 2007

What do you get in a commercial Common Lisp implementation?

Filed under: Lisp, Politics, Prolog, The Dark Side, Web development — metacircular @ 8:44 pm

Commercial Common Lisp implementations like LispWorks and Allegro Common Lisp cost thousands of dollars. What do you get in them which isn’t included in SBCL or something, which costs $0?

  • ACL has AllegroCache, a true object database which has ACID transactions and scales to billions of objects. It is used transparently and integrates seamlessly with CLOS, Common Lisp’s ridiculously powerful object system. Depending on the project, this alone could be worth thousands of dollars.
  • LW and ACL have fast embedded Prolog compilers which seamlessly integrates with everything else in the distribution, including AllegroCache. LW actually gives you a full-blown expert system IDE (which is LW’s distinguishing feature as it doesn’t have an object database). In the ’80s, the kind of expert system functionality LW provides costed thousands of 1980s dollars.
  • Good cross-platform support so that you don’t run into the kind of problems the reddits had when working between Mac OS X and FreeBSD.
  • Libraries for web programming: XML/SOAP/WSDL/yadda yadda parsers, HTML parsers, a Lispish web application server and HTTP server, and easy libraries for all major networking protocols bundled in.
  • Cross-platform GUI libraries which are good enough for prototyping “programmer interfaces”.
  • Database libraries: ODBC, MySQL, Postgresql, Oracle.
  • Excellent foreign function interfaces for C libraries.
  • ACL provides OLE/COM linkage and examples of things like creating a simple CLOS layer for working with Excel.
  • Linkage to Java and/or .NET (e.g., jLinker and full support for RDNZL), which, together with the C FFI, means you can easily use code written in all the most popular languages.
  • Native threading (I guess you don’t get this), Unicode, and other oft-neglected but essential stuff.
  • Abundant working examples and comprehensive, helpful documentation for all of this.
  • All these libraries are bundled in, they work, they’re efficient, and they are supported.

All Common Lisp distributions give you efficient implementations of CLOS, a metacircular multiple-dispatch multiple-inheritance object system with an amazing metaobject protocol, as well as mini-languages for pretty-printing and iteration. SBCL, LispWorks, and ACL all have optimizing native-code compilers that give you performance somewhere between C and Java. SLIME, LW, and ACL provide IDEs matched only by Squeak in power.

Clearly if you pay $3,000 or however much, you’re getting a helluva lot more than just an implementation of a spec from 1984.

March 14, 2007

Email is serious business

Filed under: Politics — metacircular @ 12:05 am

Based on a revelatory email from a staff member of Attorney General Gonzales, Chuck Schumer and Dianne Feinstein are suggesting the drastic step of rolling back the heinous PATRIOT Act to a prior version.

When are Democrats going to grow a pair?

Next Page »

Blog at WordPress.com.