The Dark Balloon

A weblog by Hao Lian.
A terrible secret guarded by golems.
A note that thanks you for being born, all those years ago.

§
“Standards were falling everywhere. They usually do.”

Seriously, A List Apart? Two Ruby on Rails tutorials in this issue? (Oh, Web 2.0. Is nothing sacred to you?) There are, on my last count, approximately 42 infinities of Rails tutorials on the Internet. You can tell Ruby on Rails is easy to use because there are so many tutorials and because it generates code for you automatically—less typing! So ALA decided to publish two new tutorials. What happened to the good old days when it wasn’t involved in the hip new stuff? A couple of issues ago it was the brouhaha over IE 8’s rendering engine switching. Back in the old days, ALA single-hanedly launched CSS techniques. Sliding doors, sprites, and Suckerfish. Doing Ruby on Rails is like New York Times doing a nine-page investigation of Ruby on Rails.

[(2008 April 22) .]

§
2007 predictions, final updates

Let’s wrap up the 2007 predictions with as little crying as possible, OK?

[Mac OS X failing], with Vista, will leave a power vacuum in the OS market, one that is not filled by Linux, which will lack an OS to copy from which to copy any more features.

TRUE. 2007 was not a good year for operating systems. Unless, of course, you count the release of Emacs 22.1. What happened to version 22, you ask? It’s currently lost in the beard of Richard Stallman, and no amount of open source communism is enough to entice anybody to go and retrieve it.

Web 2.0 will stagnate.

TRUE. Web 2.0 is no longer cool. Lame Internet fads are cool again.

Language interpreters will become a bottleneck.

TRUE. Python is cool now. We all know Python is not interpreted; it’s, in fact fed through van Rossum’s head before he manually flips the diodes in your monitor. That’s right, I’m making this public: Python only runs on LCDs. Deal with it, bitches.

Perl 6.0 will not be released. Python 3000 will not be released.

DOUBLE TRUE. Perl now has Rakudo, Pugs, and about twenty other mini-languages. Apparently, “focus” in the Perl community is a weird way of spelling “vapor.” As in vaporware. MORPHEME BURN. Sizzle sizzle, bitches. (Seriously, when C++0x adds a whole bunch of unnecessary features, it’s lame. But when Perl 6 does it, it’s “Come on, we have nightly builds?”)

dotfloofy dotblog will reach its fourth anniversary.

FALSE. We had a continuity jump and we are, indeed, in our sixth anniversary by now. Scientists, with their sciencing, widely believe this is due to anomalies caused by the pesto sauce I spilled back around June of 2007.

[(2008 April 1) .]

§
How to install ParseTree and RubyInline on Windows and, gasp, get them to work

ParseTree converts Ruby code to a sex expression. RubyInline is magic.

First, gem install rubyinline and gem install parsetree.

Install Visual C++ Express and the newest Microsoft Platform SDK, which is Vista SDK currently. If you wait for 2008 edition, VC++ Express will automatically install Platform SDK for you. This takes a while to download, so kidnap and chloroform a friend with spare bandwidth.

Modify C:\Ruby\lib\ruby\1.8\i386-mswin32\rbconfig.rb, which will vary depending on where you installed Ruby. If your platform is not i386-mswin32, navigate to the correct directory. Change the CONFIG["CFLAGS"] line to CONFIG["CFLAGS"] = "-MD -Zi -O2b2x".

Open up a Windows 32-bit debugging console from Platform SDK’s many Start Menu subdirectories. In addition, drag the file Microsoft Visual Studio 8\VC\vcvarsall.bat in your Program File to the console, which will paste the full file path. Press Enter. Now you have the necessary bin, include, and lib variables.

Navigate to the highly redundant C:\Ruby\lib\ruby\gems\1.8\gems path. Go into RubyInline’s folder and edit lib\inline.rb. Around line 379 and 392, manually patch the file per my poorly generated diff using a text editor or SNOBOL, which will fix quotation marks, a method call, a compiler flag, and manifest molestation.

In Inline#generate, change the file, line = line per my poorly described bug.

Now, in your console, cd to ...\gems\RubyInline-version\demo and type ruby hello.rb. You should see Hello World. If not, search Google. Common problems include missing bin/include variables, in which case use set var=%var%;c:\new\directory for the path or include variables. If the C++ compiler screws up, Google and try modifying rbconfig.rb.

OK, you have RubyInline working now. ParseTree is much simpler now that the hard part is finished. Simply wrap every builder.add_compile_flag call around line 258 of ...gems\ParseTree-version\lib\parse_tree.rb with an if /win32/ !~ RUBY_PLATFORM ... end except the -Wall since that’s the only one that works with VC++. Now run ruby ...\demo\printer.rb to make sure it works.

Congratulations. You have conquered the dragon that is compiling on Windows.

[(2007 August 8, 4!) .]