20100711

Fun with PostgreSQL and Smalltalk

On any windows system, this would be trivial. NOT SO ON LINUX. Why did I use Linux? Because I love it, and it doesn't need a GIG OF F*CKING RAM to run a web server. That being said, I'm not sure I'd "happily" choose it again if the web server was one based on Seaside, but I'm going to do it again. But Seaside is the second half of the fun. The first half was getting PostgreSQL/ODBC and the given Smalltalk environment (OpenCobalt) to be friends.

You'll have to pardon my opinions. I am not a zealot, nor an evangelist. As such, I may well be burned at the stake as an absolute heretic. But I know my sh*t, I put in my hours, I bust my ass, and I have very little patience for those who cling to and fight fervently for lofty ideals while not achieving harmonious utility and productivity from their efforts. Such people are, AFAIC, a sinful waste of time.

Server: Ubuntu Server 10.04 LTS x64
WHAT I DID:

apt-get install odbc-postgresql
odbcinst -i -d -f /usr/share/psqlodbc/odbcinst.ini.template


* Configured DSN using ODBCConfig tool in X (superuser to do this; apt-get it before trying to use it)

Handy Documentation:
FFI info - http://wiki.squeak.org/squeak/1414

"I find myself saving every few minutes; it reminds me of when I was a kid, playing those old Sierra adventure games. Every few steps or screens I'd hit SAVE. The motto was 'Save Early, Save Often' because you never knew when or how you were gonna die! So it is with Squeak..."




FFI Loading Snafu...
The Foreign Function Interface was totally missing, or partially broken, depending on which distro you use. To recover it, you have to do the following voodoo dance:

Get the sources:

MCHttpRepository
location: 'http://source.squeak.org/FFI'
user: ''
password: ''.


Load the sources, in THIS ORDER:
  1. FFI-Pools
  2. FFI-Kernel
  3. FFI-Win32 (or FFI-Unix, or FFI-MacOS, or all three)
  4. FFI-Tests
  5. FFI-Examples

"The more I use the end-products of Smalltalk coders, I suspect their work to be steaming piles of crap. Disorganized, disjointed, lacking in all notion of communal productivity and standardization - it's the ultimate narcisists' environment. Now, the language may have some fault in that, but the environment devised around language is where the true evil seems to lurk."


DEALING WITH ODBC LIBRARY FROM SQUEAKMAP
OpenCobalt does NOT understand the _ operator. Seems they've moved on to bigger and better keyboards. Find/replace all " _ " with " := " when trying to filein the ODBC changeset that is available from SqueakMap.

By the way, the ODBC lib I found in Sqeakmap was terribly outdated. Had zero support for non-Windows systems. Got updated copy from coworker - have NO IDEA where he got it. And that's kind of crap that just pisses me off.

Of course, once you have the right lib, it still won't Just Work (tm). To get ODBC library to work correctly, do:
    ODBCLibrary default initialze. 

No comments:

Post a Comment