
Better performance in App Engine with new Lisp language Clojure - mattyb
http://googlecode.blogspot.com/2010/05/better-performance-in-app-engine-with.html
======
wynand
Posts like this really make me want to move to Clojure.

Python is now my go-to language, especially because of Scipy, NetworkX and
bridges like RPy.

I would definitely put in the time if someone with mathematical modelling
experience can support the idea that I'll be more productive in Clojure.
Anyone?

I really would love to see a list of testimonials and anti-testimonials of
people from various fields that switched to Clojure and either got much more
done or got burned.

Sorry, I realise that this is a wee bit off the main topic.

~~~
icey
You should spend a little time playing with Clojure. I don't know if you'll be
more productive in it or not; people seem to either prefer lisps strongly or
dislike them strongly. If you like lisp then you'll have no problems being
tremendously productive, especially with libraries like Incanter available.

~~~
jacquesm
I very much like the elegance of lisp code, but I'm still a 'reader', not a
'writer'. I hope to change that one of these days, but as long as that magic
'click' hasn't happened I'm not confident enough to jump in and start some
major project.

Maybe that's what I should lose, the paralysis of starting out down the wrong
track and simply do stuff wrong until I find a better way.

~~~
icey
One of the charms of lisp is that it makes it easy to change your mind. It is
really well suited to iterative development; even if part of your iteration
process consists of getting things wrong.

------
zach
So I was in an App Engine workshop at PyCon and asked an engineer about
running Clojure on App Engine, which resulted in a confusing exchange. Then I
realized they thought I was talking about Google's Closure Library. Argh! I
guess this wasn't on the radar.

This shows a lot of promise, and it would be great if App Engine could become
(in a way) Clojure's Heroku.

------
psranga
I've looked off and on into using App Engine's Java interface. But even the
"hello world" app looked much more bureaucratic than the Python equivalent
(it's due to Google trying to do things the Java way).

Do you still have to deal with Java's baggage even if you run Clojure on App
Engine? How much can you abstract away? Any libs?

~~~
francoisdevlin
Occasional you do have to deal with Java's baggage in Clojure. The best
example I can think of right now is the build process. The consensus is to use
Maven or the Clojure tool Leiningen.

The good news is that you also get Java's "Deployment for Dummies" solutions
(just copy the JAR/WAR and you're good to go), though.

~~~
jwr
Leiningen is actually pretty cool. It uses Maven under the hood (but you don't
have to know that).

The nice thing is that if you suddenly decide you need to use a Java library
(say, one of the Apache Commons libs), you just add one line to your
project.clj file, do "lein deps" and boom, you can use the library in your
project.

Having written quite a bit of software in Common Lisp, this is a welcome
change.

~~~
aerique
Huh?, how's this easier than adding a package entry to the depends-on form in
an asdf-file in CL?

~~~
LaPingvino
You can add jars from any JVM language and use it directly with the great
Clojure Java-interop.

------
defdac
This is a very readworthy slide from the CTO of freiheit and the project:
[http://www.slideshare.net/smartrevolution/how-a-clojure-
pet-...](http://www.slideshare.net/smartrevolution/how-a-clojure-pet-project-
turned-into-a-fullblown-cloudcomputing-webapp)

I'm curious about the "how to get rid of Eclipse"-part. How do you "Go to
implementation" and "Find usages" in Clojure without a 7 key-combination in
Emacs? I would love to take a Clojure-IDE for a spin.

~~~
evgen
NetBeans with Enclojure is probably the best option for those who do not
already know Emacs (or Counterclockwise if you are already in the Eclipse
ecosystem.) I use Emacs for Erlang and Python coding, but for some reason the
swank-clojure setup never really clicked for me. I keep at it and I am sure at
some point I will not think that my Clojure dev environment is not more of a
hinderance than a help, but if you are not already using Emacs I would
probably suggest you start off by looking at the list here:
[http://www.bestinclass.dk/index.php/2010/03/clojure-ides-
the...](http://www.bestinclass.dk/index.php/2010/03/clojure-ides-the-grand-
tour-getting-started/)

------
mcav
A question I've been meaning to ask but didn't want to make a completely new
post about it:

If you could write a server (not a plain HTTP webapp necessarily) in Clojure,
Python, or Node.JS, provided you know all three, which would you choose and
why?

~~~
francoisdevlin
I'd go with Clojure if you need any of the following:

1\. Concurrency 2\. The most (largest qty of) available FOSS libs anywhere 3\.
Speed 4\. The ability to extend the language 5\. WORA 6\. Text/string
processing

Python will win in scripting/*NIX integration, though.

Don't really know enough about Node.JS

~~~
rglullis
I really have a hard time seeing Python losing to Clojure on (2), (5) and (6).
What kind of software/library would you find on Clojure but not Python? How is
Python not WORA? Where does Python lack in text processing?

~~~
KirinDave
> What kind of software/library would you find on Clojure but not Python?

Java has a lot of great libraries for which there are not terrific examples in
Python. Clojure gets all of them.

> Where does Python lack in text processing?

Clojure handles large strings better than Python (unless you start using
substrings, in which case an underlying java bug hits you).

(oh, and Clojure is not a deliberately and comically crippled language).

~~~
rufugee
How is Python deliberately and comically crippled? I'm honestly curious.

~~~
hugoc
I think he may be refering to the GIL.

~~~
technomancy
Don't forget one-line lambdas.

~~~
KirinDave
It is true. I really, really, really do not like those. I dislike them to the
point of irrationality.

------
va_coder
JVM apps on appengine start up slow. I encourage anyone looking into using a
JVM app on appengine to put together a simple app, wait 10 minutes after
deployment, and then hit the url and see how long it takes to load.

It bothers me that people don't mention this.

~~~
Quiark
It's called "loading request" and Google mentions it in the docs. They claim
that with the number of users rising, relatively few people will actually
experience it. But the ~10 seconds it takes to load my clojure app surely is
not pleasant.

------
caffeine
It doesn't really say much about performance...

~~~
jbellis
It doesn't say _anything_ about performance. I checked find-in-page in case I
somehow missed it. :)

------
mace
The blog referenced in this post has more details on their use of Clojure:
<http://www.hackers-with-attitude.com/search/label/Clojure>

------
waratuman
Where do the 30% and 50% numbers come from?

~~~
staunch
I took it to be an educated guess, not a statement based on hard data.

------
mark_l_watson
I am using Clojure a lot right now on a customer's project, a cool language
for sure.

That said, I have doubts about Clojure + AppEngine because of the loading
request times. I can get a Java + AppEngine app to do about a 1 to 2 second
loading request time by not using JDO and minimizing dependencies.

Unfortunately, loading the Clojure JARs (or the JRuby JARs) increase the
loading request time.

Sometimes when I go to TheDeadline, I see almost a 10 second delay on the
first page load. Does not happen often, but it does happen.

------
andreyf
_On Google App Engine, Google's cloud computing platform, developers can
officially choose between two languages -- Python and Java -- and both run on
the Java Virtual Machine (JVM)._

If they've got Python running on the JVM, why aren't they contributing back to
Jython (or releasing their own Python->JVM bytecode compiler)?

~~~
sgk284
Where are you getting that quote from? They don't run Python on the JVM.

~~~
csytan
I think the article has been changed after andreyf quoted it.

------
jheriko
Interesting, but I cringed when I read this:

"Writing less code requires less time."

Seriously? Then again, it /is/ a "to-do" app...

~~~
btilly
Seriously. Studies from a wide variety of languages over several decades have
found that average lines of code/developer is reasonably close to constant
independent of what language the developer is using. Therefore languages and
libraries that result in less code to get your work done generally result in
higher productivity.

~~~
ShardPhoenix
I'd be interested in seeing similar studies with relatively modern languages,
though. The only ones I've seen have been comparing things like C, Pascal, and
Cobol.

