Archive for February, 2009

Help, I’m failing to install Squeak Smalltalk on 64 bit AMD FreeBSD box

February 18, 2009

I’m web developer and I have my own server (amd64 running FreeBSD, 2GB of RAM) co-located at local ISP. All web sites that I host are running Rails. The problem is, however, server is running out of RAM. Every Rails process eats up roughly 50-60 megabytes of RAM and I have near 20 sites running. This leaves me with maybe up to ten new sites to run on this setup.

Looking for a way to get out of this situation, I’ve looked at few alternatives. Being fond of Smalltalk lately and it’s relatively small memory footprint, I decided I’ll try putting Squeak on this server and develop sites with Aida/Web. Janko is a good friend of mine and he lives in the same city as I do, so his web framework would be natural choice. He once stated he got more than 50 sites running smoothly in one Smalltalk image burning roughly 400MB of RAM. Nice numbers. I learned something little about Aida and found it quite nice to work with. Of course, having it’s creator nearby helps a bit. :-)  

There is just one little problem. I can’t get Squeak to run on my server. I’ve tried the 64 bit version but no luck. It does not compile. I’ve tried installing it from ports collection but it’s for 32 bit only. After almost a week of trying and failing, I’m slowly giving up. I even looked at other Smalltalk distributions and found none that would run on my setup. If you have any suggestions, please, I’d really need some.

One other solution would be to add another Linux server and put Squeak there, leaving current server untouched. This should be doable without much hassle and I’d prefer not to play too much with my production server. But doubling hosting expenses isn’t what I want… :-) Maybe I could move all Rails web sites onto this new Linux server and replace FreeBSD one with it. Doable but lot’s of work.

What to do? Linux route seems the safest one. Ok, more work for me, but this would get me out of current situation. If you don’t mind sharing, what is your Smalltalk web setup? How do you deploy web sites into production Smalltalk image? What are the problems I can expect with my setup (Linux with Squeak)?

Smalltalk – not just for big players

February 14, 2009

Remember your early days when you were a kid and how you loved playing with your toys. Imagine programming so joyful you’d want to do it a little bit longer even if your dinner is getting cold and somebody is not too happy about it. Imagine having fun while refactoring code. Where can you get this nowadays? And you can get it for free.

I admit it. I’m newish here and I’ve been playing with Smalltalk for only about few months. This explains the excitement and I’ve never been so excited about programming. In the last two to three weeks I’ve had lots of those “a-ha” moments where suddenly all make sense. And just after I thought I understand some parts of it quite thoroughly, I get introduced to even leaner and simpler way of doing it.

Coding and code refactoring is actually fun with Smalltalk. It’s like having this big new toy where all the things I’ve learned so far get turned upside down. No more SQL, no more server and application restarts, no more multi-tier setups. Built-in persistence, instant state reflection, hot code deployment and unified language and tools are just some of advantages Smalltalk has to offer.

I’m sold.

Smalltalk image persistence – definitive developer advantage

February 9, 2009

Difference between good and bad application model design can make or brake the application. Having bulletproof app spec can help, but let’s not kid ourselves. There’s no such thing as rock solid application model. Models are prone to change every so often and you can easily paint yourself in the corner.

Any SQL based software suffers from this issue and there’s little you can do. ORM helps to offload this burden, but all it actually does is mask under laying SQL statements. With every update to SQL schema, you need to restart the database server, update application code, restart the application itself and hope you didn’t introduce another bug or two. If all goes well, users probably won’t notice few seconds of downtime.

The story is different with Smalltalk. For small to medium sized projects you can use Smalltalk image as data persistence. This offers quite some advantages, both while developing and when in production:

  • no need for third-party software (SQL servers)
  • no server and application restarts upon model change
  • you edit live code while application is being used
  • faster data access – data is stored in RAM, not on remote TCP accessed server
  • some serious tools to help you craft, debug and maintain your code like a pro :-)

With real-time object reflection you can play with the application model all you want and still be on top of it. As there are no restarts and with changes visible the moment you make them, modeling becomes almost trivial compared to code-fu you need to do with SQL based models. It’s not all honey and milk, but the difference is big enough it should make you interested.

However, there is a down side too. You have to get used to Smalltalk. It’s so different you have to make the effort to really grasp it. Newcomers, including me, tend to leave too soon and not really take enough time to understand the power Smalltalk gives you. Don’t make this same mistake I did a year ago. If you’re interested in Smalltalk, invest the time to really understand it.

Floppy hack: RAID5 with 1.44″ floppies

February 9, 2009
The 3½-inch floppy disk drive automatically en...
Image via Wikipedia

Years ago, out of sheer boredom, we attached 6 1.44 inch floppy drives on 3 floppy controllers (ISA) which we installed into old pentium box. It took us few reboots to configure all three floppy controllers properly (mainly setting the jumpers right to avoid interrupt clashing) and we were ready to go.

With 6 floppies in the floppy drives we configured software RAID5 (maybe we did RAID1, I don’t remember) and put CVS on it. Sure, floppy lights were flashing as we issued commits. I can’t describe the sounds and sights of drooling and cheering we did as beer cans were being opened.

I don’t remember all technical details (beer might be to blame) but the lights were blinking and we actually used that CVS for few days. Also I don’t know what happened with that box, but I’ll always remember that moment when lights began to flash. It was one of those moments I’ll always remember – few guys hacked the floppy RAID.

Reblog this post [with Zemanta]

Smalltalk is primarily used by blue chip professionals

February 7, 2009

Few days ago I’ve posted a question on Stack Overflow and it went ballistic. Few thousands views and two dozen answers later I’ve got my answer: Smalltalk is still in heavy use today, primarily by professionals in various businesses. Ranging from transport logistic (OOCL’s IRIS-2) and financial services (JPMorgan’s Kapital) to web professionals using either Aida/Web or Seaside web frameworks for developing complex web applications.

While some answers exposed difficulties when using Smalltalk, most of them were void after some explanations. Smalltalk was presented as right choice for demanding and complex environments where high flexibility, robustness and speed of development are main requirements.

I encourage you to read all answers and consider Smalltalk as a possible solution for your next projects. 

Thanks to all who answered my question.

Erlang in practice screencasts

February 5, 2009

Few months ago I ordered Erlang in practice screencasts from Pragmatic by Kevin Smith. Watched all six of them (now there’s 8 of them) for at least 3 times. They are absolutely awsome.

It starts slowly explaining how to build message dispatcher, then goes on with adding users so you can send messages to users mailbox instead of id’s. It continues with some code refactoring and unit testing and ends with implementing RESTful messaging trough Mochiweb, connecting Erlang with web.

All in all very educational and easy way to learn Erlang. Hands on and practical. If you’re interested in learning Erlang this screencasts are good investments. Thumbs up Kevin, please keep on recording.

Reblog this post [with Zemanta]

Audi S8

February 5, 2009

For some time now I’ve been admiring Audi S8. I like the way it looks, the way it sounds and that feeling of being robust and compact really appeals to me. It radiates quality.

This post is filed in ToDo ToHave category on purpose.

Theory of corporate structures

February 3, 2009

On the bus drive to work this morning, I was standing near a student who was reading about “theory of corporate structures”. I glanced at a few paragraphs and sighted in disbelief. Lots of graphs and text of how corporate structure should be done. Scary stuff, half inch thick.

I don’t know what his major is, but this stuff is so theoretic and abstract he was just memorizing it so he could pass the test. Clearly he was not interested in digging deeper to understand core principles. No wonder, judging by how interesting the text was.

Wherever this whole process should lead him, I hope he’ll dig deeper and understand his stuff before getting elected as certified specialist in his field, earning juicy salary and steering some company. But then again, I was no better.