Wednesday, March 05, 2008

Scripting the future

Not until only some time back C, C++ and java pretty much ruled the realm of programming languages. Dynamic scripting languages like Perl, python raised their head at times, but were never so much of a buzz. My first tryst with a scripting language happened when I heard about Ruby and developed a web application on Rails. The ease and speed of development impressed me so much that I instantly fell in love with it. Ever since then, scripting languages have been on a rise. I used to always wonder Why. Why was the potential of dynamic languages nascent all this while? What has changed between then and now?
I found answers to these in these wonderful articles:
Why Scripting Languages Matter?
Scripting: Higher Level Programming for the 21st Century

The points look appealing. I had always been taught to do a low level design before getting on with writing code. I always found it disconcerting. I mean who has the patience to design to the lowest level! I was more comfortable with designing while coding and coding while designing. I ran into issues some times that required so much recoding that I used to momentarily regret not following the elders' advice! Scripting languages claim to be more dynamic and malleable. Am sure developers love them for what they have on offer, but do they match up with the static languages on performance and other fronts? Need to see...

-Ashish.

Monday, March 03, 2008

Who owns the Internet?

Bumped on this interesting blog on CIO. The author has created a color coded map of all the routers in North America. Curious to see if something similar exists for India/Asia or create one.

Who Owns the Internet? We have a Map that shows you.

-Ashish.

Wednesday, January 02, 2008

Merb - A new Ruby framework

Merb (Mongrel+ERB) seems to be a new addition to the Ruby based frameworks. Like Rails, it complies to the MVC architecture. But instead of having all the components as part of the core, it relies more on plugins. It therefore claims to have a lighter footprint which can be extended through plugins. This makes it ORM agnostic, template language agnostic. Plugins are available for ActiveRecord, DataMapper, Sequel ORMs.

In short Merb has all the good features of Rails and more and is lighter and faster.

Learn more about it here or on DevjaVu.

-Ashish.

Digg!

Thursday, April 12, 2007

Go OpenGrok

To me, browsing a codebase until now always required downloading it and setting it up in an IDE. But as good as they are as a development environment, they are quite cumbersome (some might prefer to say they are an overkill) when it comes to browsing code, especially one that you are not familiar with. Add to this the need to have them and the codebase everywhere and everytime you want to browse... and all I wanted was to browse a set of code!

The idea of a web based source browser instantly appealed to me. I heard about OpenGrok in one of the sessions at the Sun Techdays and tried it out right away. OpenGrok is a web based source browser with cross referencing and freetext search. All that I need to do is to configure the path of the codebase and run OpenGrok. OpenGrok generates a war that I dump into tomcat and that's all! I can now search the code, click on the variables and methods to check their definitions and do all that's in the scope of code browsing. Moreover, I can just set it up on one box and access it from anywhere on the network.

OpenGrok uses exuberant Ctags and lucene, the java based search and indexing library to get the job done. It's an easy-to-use code browsing tool... try it out!

-Ashish.


Digg!

Wednesday, March 21, 2007

Rails vs Struts

I had done a study on the size and effort metrics and performance of an application developed on Rails vs that on Struts. Here are the observations:


Please note that the performance figures are not an exact measure and need to be considered with these points in perspective. There might be scope for improving the performance of the application, as there was no performance tuning performed for the application. In addition, following points also need to be taken into account.
  1. Ruby VM: Ruby is right now an interpreted language. But a project (code name Rite) plans to make it byte compiled. This would improve the execution speed of Ruby based programs.
  2. Framework method tuning: The Rails framework has been around only for a little more than a year. Development is on profile various components especially Active Record and Helper methods. The tuning effort would further improve the performance of applications using Rails.
  3. Choice of web server: WebRick was used as the web server for this application. Apache and Lighttpd are the suggested web servers for better performance.
-Ashish.

Wednesday, February 28, 2007

Sun 'Tech'-aways

Last week saw techies from all around the country and outside flocking at the International Convention Center in Hyderabad. It was the Sun Tech Days symposium, a worldwide developer event organized by Sun Microsystems and touted as the mini Sun One conference! With 3000+ attendees, it almost seemed like all roads led to Novotel,Hitex. Although far from the heart of the city, the venue was aptly located very close to the Hi-Tech City thus gaining a lot of visibility from the various IT companies. Both the ICC and Sun representatives did a commendable job of managing the crowd, time, booths, technical sessions and the whole event as such. To top it all, there was good food and gifts galore! Event of this scale can of course not do without sponsors and the list included some of the big names from the industry like AMD, Oracle, VmWare, Accenture, SAS, and NIIT.

The technical sessions were divided into multiple tracks alligned with the technologies - J2SE, J2EE, J2ME and open solaris. While on the first two days the attendees were free to choose between any of the sessions going parallaly in these tracks, on the third day, they had to choose between one of - Netbeans, J2ME and Open solaris - tracks. The sessions on ‘Java scripting’ and ‘JRuby’ in the J2SE track were quite interesting and having worked on Ruby, were quite appealing. It was interesting to know that the Java platform was no longer restricted to the Java language alone but supported various scripting languages like JRuby, Javascript, Groovy and Jython. The session on ‘JMX and concurrency’ talked about the new concurrency API in JDK 5.0 and its rich features that address the issues with the old Thread support. The JMX API which was already a part of J2EE 1.4 has now been adopted into the core java platform.

Among the more interesting sessions (and among the ones that I attended!) in the J2EE track, was the one on J2EE 5 and Glassfish. Apart from the technical talk on the new EJB 3.0, persistence API, JAX-WS and JAXB, the speaker encouraged the attendees to be a part of the Glassfish community and contribute to the development of the reference implementation.

The booth on Java DB, an Apache Derby based project, introduced the java based database. It is best suited for small and medium scale applications and can be bundled along with the application! An ideal solution for sharing database backed applications. The session on SPOTs was very impressive. The Small Programmable Object Technology aims at using Java for programming devices having embedded chips… something that was in the domain of C all this while. The demo showing three robots trying to chase each other recieved a loud applause from the audience. VmWare gave a presentation on their virtualization technology, which apparently is receiving a lot of attention and popularity. The technology evolved trying to explore solutions to the under utilization of the hardware. The presentation introduced the idea of treating one physical system as multiple virtual machines and then focused on its impact on cost, n/w maintenance, and availability. Their VMotion technology that allows runtime movement of virtual machines (and therefore the appliations running on them) from one system to another without requiring the systems to be down indeed has a lot of potential.

On the third day, as part of the Open Solaris track, there was an interesting talk on Opengrok. Opengrok is a tool that indexes a given code allowing developers to browse and search the codebase. Although the intent behind its development was to enable quick and easy browsing of the proliferating open source code on the internet without having to set up a development environment, it can be used for any application codebase in our day to day projects. What more, it also has support for dropping the ‘opengrok’ed code into a web server and browsing the code over the network!

I must say that it was a good learning experience and a forum to meet other developers and exchange ideas with them. And did I mention about the discounts in technical books and journals! :)

The sessions can be downloaded from the Sun Tech Days page on the Sun website:
http://developers.sun.com/events/techdays/index.jsp

- Ashish

Tuesday, December 26, 2006

Closures in Java

I hit upon closures first (well at least I thought so until I knew what they were and realized that I had used them before) when coding in Ruby. Closures are blocks of code that can be passed as arguments to other methods. In this sense they are similar to function pointers in C. But closures are a tad more powerful in that they also extend the scope of variables in the lexical scope of where they are used. Refer http://www.eclipsezone.com/eclipse/forums/t86911.html for a precise definition.

I recently completed a project involving Ruby on Rails. Having worked with Java for the last three years, I could not help but compare it with Java. I was wondering if any of the language and framework features could be implemented in Java and the numerous frameworks based on it. Blocks and closures are impressive language constructs that allow customization and extension of other language constructs (like the looping constructs) and APIs.

Gafter, Gosling et al's proposal to add closures in Java seems to be a good bet. This would put an end to the addition of more new statements like 'for each' that was added in J2SE 5.0.

Am keeping an eye on the numerous forums and blogs abuzz with discussions on Java and Ruby. It's interesting how Ruby and more importantly the Rails framework is causing so much flutter.

Pointer:
http://www.javac.info/closures-v04.html

-Ashish.