Posted by Scott Hughes
Mon, 28 Nov 2005 19:50:00 GMT
My old friend P.O. Boykin recently took a look at Ruby (and other scripting languages) and came up with a very interesting post: Performance of Programming Languages
After spending time with so called “scripting languages” (a term that I feel is not a terribly well defined or useful), I have found that I enjoy programming in languages like Ruby, Python, and Boo more than languages like C, C++, Java, or C# (though C# is getting better and better as they improve the language). My question is: how much performance do I loose by adopting one these laguages. To answer this question I took a look at the Language Shootout site.
I hadn’t heard of the Language Shootout site; that’s a very interesting link. They compare the implementations of your favorite programming languages (and are very careful not to say they compare the actual language, just the implementation) and produce a whole lot of “at-a-glance” graphs.
I’m a very recent fan(atic) of Ruby. I still don’t “think” in Ruby, just because I don’t have enough trench time with it. But I subscribe to the Google group RSS feed for comp.lang.ruby, and it’s very common to find code snippets (usually in response to a question) that just make me smile. Since more than half of the work I do at my job is using a PC to communicate with a significantly slower device (parallel FPGA, usb or serial Micro, or a 1-Wire device), I try to sneak scripting solutions in wherever I can. If the PC takes 100x more cpu time to compute a message that is going to be put on a slow bus (several orders of magnitude slower than the cpu) noone is going to notice the loss of a few extra nanoseconds. That said, I usually need to hand code off to other people (those so-called “paying customers”) and using a more popular programming language (C or Java) makes that hand-off much easier.
But for some of my tasks, Ruby’s elegance outweighs any of the performance penalties. Ruby is still fairly young, so I’m hoping that in the near future it will reach a good level of general acceptance and gain some significant performance improvements (thanks to all the eyes it now has on it). Also, I think it’d be interesting to run the same benchmarks the Language Shootout guys did, but using either YARV [1] or RB2C [2]. Seems that if those projects don’t do better than vanilla Python, they should re-think their solution. It’d be nice to see if they are able to tighten the large margins between the Java or .NET runtime.
[1] YARV: Yet Another Ruby VM - http://www.atdot.net/yarv/
[2] RB2C : a Ruby to C converter http://www-lab09.kuee.kyoto-u.ac.jp/~hiwada/ruby/rb2c/
Posted in Code | Tags benchmark, Code, ruby | 4 comments
Posted by Scott Hughes
Wed, 23 Nov 2005 23:10:00 GMT
Am I the only one who finds these lip-synching Asian kids hilarious? I first discoverd that video a few years ago and found it quite laugh-out-loud funny. Now I’ve discovered some slightly more mature knock-offs singing a couple of Backstreet Boy’s songs : As Long As You Love Me and I Want It That Way. On Google Video it seems that this is inspiring a few other Asian kids to try their luck at becoming video-casting stars. Some of them aren’t very talented and have crappy web cams, but they are all hilarious.
Posted in Humor | Tags asians, humor, lipsynch | no comments
Posted by Scott Hughes
Tue, 15 Nov 2005 15:08:00 GMT
I read over on Penny Arcade that they’ve converted their site to Rails. This is pretty big news for Rails advocates. Penny Arcade has over 4 million readers… And after browsing their new site, I find it pretty damn fast. There is a large speed improvement over their php implementation. So they definitely took advantage of Rail’s caching feature. Of course, the biggest difference will be transparent to their readers, but it should be a hell of a lot easier to maintain and add new features.
Posted in Technology | Tags pennyarcade, Rails, ruby, RubyOnRails | no comments
Posted by Scott Hughes
Tue, 08 Nov 2005 14:34:00 GMT
Last night, I updated this Typo install to the latest svn trunk (rev 725). I had been running at rev 586 for a while now, but I was hesitant to upgrade as I noticed there were a few database changes. Turns out that, thanks to Rails Migrations, the database changes were simple (for me anyways, maybe not for the author of the migrations). While I was at it, I went ahead and updated Typo to run the latest Edge Rails also. Here’s the procedure I used on Dreamhost to install these:
# Get Latest Typo
$ svn co svn://leetsoft.com/typo/trunk typo-edge
# Get Latest Rails
$ cd typo-edge/vendor
$ svn co http://dev.rubyonrails.org/svn/rails/trunk rails
$ cd ..
$ rake update_javascripts
$ rake add_new_scripts
# Copy My Typo Configuration
$ cp ../{old-typo}/config/database.yml config/database.yml
$ cp -r ../{old-typo}/themes/globalreset themes/globalreset
$ vi config/environment.rb #forced RAILS_ENV='production'
# Update link I use to point to a version of Typo
# My setup expects web root at this link/public
$ rm typo
$ ln -s typo-edge typo
Then I opened my browser and navigated to /admin and was immediately prompted with a list of necessary Database Migrations, which must be performed on my existing database to be compatible with this version of Typo. I clicked affirmatively, and after a few seconds I was running the latest and greatest Rails and Typo.
Make sure you backup your database before attempting this. The web-based phpMyAdmin that Dreamhost provides is suitable for this. I’ve seen a couple of users report on the Typo-ML that they had some migration issues. I don’t know if those issues ended up in a wedged database or not, but better safe than sorry.
Posted in Code | Tags Rails, ruby, RubyOnRails, Typo | 4 comments
Posted by Scott Hughes
Sun, 06 Nov 2005 06:06:00 GMT
I’ve finally gotten around to creating a source tarball for the work I did to get the Public Domain Kit support files for libUSB running under the 1-Wire API for Java. 80% of the work here was figuring out what to do, so you’ll find there isn’t a lot of code to glue them together. It would be pretty easy, for example, to swap out the PDK files for libUSB with the DS1410E link-level files for Linux. Then you could have parallel port support using the 1-Wire API for Java under Linux as well as the USB port.
The Makefile is geared towards Mac OSX. Everything else, including the C source in the ‘native’ folder, is platform independent and should compile everywhere libUSB does. Using Sun’s reference on how to build JNI libraries for the various platforms, you should be able to modify the Makefile to support your platform. If you have any suggestions for improving the build process, especially if you can help make it a cross-platform Makefile, then please let me know.
PDKAdapterUSB.tar.gz (444kb)
Posted in Code, 1-Wire | Tags 1-Wire, Code, DS2490, Java, usb | 1 comment
Posted by Scott Hughes
Fri, 04 Nov 2005 14:28:00 GMT
I had my first frightening Mac crash last night. I was using CocoaMySQL to set up the latest Typo and Rails on a test server, when the app locked up by taking up 100% of the cpu. This is something CocoaMySQL does for me frequently, but I tolerate it because it is a nice interface and I can usually just restart it (and I haven’t found a better GUI alternative).
Read more...
Posted in OSX | Tags crash, mac, MacOSX, mini, osx | 6 comments
Posted by Scott Hughes
Fri, 04 Nov 2005 00:15:00 GMT
Although I don’t watch the show Trading Spouses, the promo for this week’s show caught my eye. It’s one of those rare commercials that make me back up with my TiVo to see what the hell is going on. Marguerite, the spouse du jour, is completely apeshit. She is screaming at the top of her lungs, like a raving lunatic, about gargoyles and God. It is frightening to see… At one point, you can hear a man (whom I assume is her husband) tell her in a calm voice that it is good to have her home. She continues to scream over him at the camera.
This is an excellent example of how religious folk scare me, even more so than the most immoral criminal mind. At least the thief/murderer/looter, who must necessarily ignore the consequences of his actions, maintains a narrow grasp of reality and what it takes to achieve their ill-gotten gains. This woman appears to be completely lost from reality; she uses the name of Christ to compel the camera man from her home!? She seems worse off (in terms of mental health) than a religious woman you may remember who recently drowned her babies. Hopefully they get some help for Marguerite before she has an opportunity to outdo Mommy Yates.
There is a resource available for people who have serious questions about God. I don’t know if it’ll help the PsychoChristians, but the Official God FAQ does a pretty good job of clearing up confusion. It’s a sparse FAQ, but it covers the most important point very succintly.
Posted in Philosophy, Television | Tags ethics, psycho, religion | no comments