ranjan

Archive for July, 2008

Can’t we have Java to PHP compiler !

In Geek Stuff on July 11, 2008 at 11:24 am

You would have already come across something called GWT ( Google Web Toolkit ). Basically it compiles your Java code to JavaScript and HTML. Very interesting as it takes care of all the nuisances of the browser incompatibility ( specially IE ) and hand coded HTML.

But what came across my mind is that why can’t we have a compiler that compiles Java to one the ugliest ( second to perl ) langauges. Yup I’m talking about PHP.

PHP has huge market share becuase it’s quick and dirty. All you want is set up is a simple page, obviously your preferred language of choice will PHP. No question about that and yes it’s very handy. But again don’t expect it to go beyond that quick and dirty job of yours. There are several pros and cons and this blog isn’t about that.

What I’m trying to say is for Java developers who love the language, platform and tools can we have something that basically alleviates them from writing PHP.

KIRA is one of the compiler that is trying to solve this problem. But little is known at this point of time.

It’s not a Java to PHP compiler, but it compiles a functional langauge to PHP. It’s built using ANTLR which is again a compilers compiler built in Java.

Wouldn’t it be fun to have a library together with GWT that compiles Java to JS, HTML and PHP in one go. Just deploy that anywhere on Apache ( running mod_php )and there you go…a fully functional application all written in Java that runs in PHP platform.

django – My First Impression

In Geek Stuff on July 2, 2008 at 4:03 am

I really love python. But I don’t really know why. I come mostly from Java background and I wanted to use something in python so that i could quickly prototype my application which then i would have ported to Java.

I came across several post saying nice things about django framework in python and i decided to give it a spin.

After doing some basic crud application, i felt disappointed. Don’t get me wrong, i’m not biased towards Java. It’s just that I wanted to build applications for the enterprise and clearly saw that django was too trivial for such kind of task.

django is really for the Publishing world. Ya , it can churn out database driven application pretty easily and I liked it’s templating engine, but there was no clear level of separation and productivity which I was looking for.

In django the urls.py file is basically the controller, in the sense it decides which url request will go to which views. The views will have all the business logic ( it’s bit confusing in django ). The views after doing some business logic can send the data back to the template along with context data with it, which is automatically populated in the template.

so the flow is kind of

url request -> urls.py -> views -> template

and ya the good feature is you can direclty use ORM in case of django.

After having worked in Spring and Struts framework, I don’t think django framework can be that maintainable as far as enterprise software is concerned.

If anybody of you know or are doing some enterprise stuff in django, apart from CMS, Blogs or wiki than please let me know.

As i said, I really do like python.