Settings

Theme

Ask HN: What web language for server side scripting?

5 points by luct 18 years ago · 21 comments · 1 min read


I know this gets asked a lot, but some input on our specific situation would be appreciated, considering we don't have: a) experience with one of the languages already or b) bit of an app already coded.

For a dynamic web-based solution, what language would you recommend?

Some Criteria: 1) The languages we are thinking about are php, python, perl, ruby we are open to other suggestions, don't have enough experience in any of them to make a difference. 2) We value speed of execution most. 3) We are going to use postgres for a database. 4) Webhost compatibility is not an issue.

icey 18 years ago

You're going to have to define what sort of speed you need for #2. If you're talking about basic CRUD, then all of the languages you've specified will work just fine. If you're doing a lot of scientific work, then you might want to look at Python, along with NumPy / SciPy. If it's a small core of calculations that you know you'll have to execute over and over again, then all of the above are fine if you're happy to interop with C.

So... whatcha building?

  • dangoldin 18 years ago

    If you do stick with Perl, they have a NumPy/SciPy equivalent called PDL.

  • OneSeventeen 18 years ago

    I, personally, prefer Ruby because it thinks the same way I do (if that makes sense). So that's what I'd pick. But Python would do you just as well, if you like the way it reads, etc. better. They key, I think, is to not be too worried about speed up front. Get your thing working in Python, say, and then do testing (another comment mentioned this) and rewrite what's slowest in C. I guess I'm warning against premature optimization.

    • xenoterracide 18 years ago

      (Co-founder) well we are/aren't trying to prematurely optimize. It's more like 4 great languages to choose (depending on option) and we don't really know enough to pick and learn one. So we're polling to find out if there is really something that we should with a few requirements. Like we care more about how fast the code runs than the speed of coding.But generally not to the excess of writing in C (etc).

      • icey 18 years ago

        In my opinion, Python, Ruby or Perl are all good choices. You can get things done quickly in PHP, but I would recommend staying away from it as a first language.

        Honestly, if you care about speed as much as you say you do, you should be looking into Java. (Or Lisp, if you're not worried about hiring any time soon).

tachibana 18 years ago

I myself am a strong proponent of Java. There are enough tools out there that take much of the tediousness of all the common functionality (basic CRUD, form handling, workflow, etc).

The real strength of Java presents itself after you've moved to production; I almost always am able to hand somebody an .ear or .war file and completely offload deployment/operations to somebody else.

As a plug for EJBs (a lot of the negativity around EJBs are carryoversr from EJB 2.1 and earlier), EJB-based application can be easily scaled by putting a request into operations for an additional app server and administratively changing the number of "processors" (session beans). App server failover and recovery is also fairly transparent as well.

Just my $0.02..

ii 18 years ago

Python, of course.

#2. Python usually wins: http://www.alrond.com/en/2007/jan/25/performance-test-of-6-l...

#3. Django was written with Postgres in mind.

sadiq 18 years ago

If speed of execution is a key requirement, beyond C++ and some good programmers, your main options are Java and C#.

I use Java with Struts on Tomcat for a couple of projects and it's served me well.

  • davidw 18 years ago

    I was thinking that too, but perhaps he means 'execution' in the more generic sense of creating a product quickly?

    In any case, even with a slow scripting language like Ruby, if the speed of the language is a concern, perhaps that part of the application should just be farmed out to a library in C (or a separate process in whatever language). Need more info, though.

  • xenoterracide 18 years ago

    I'm the Ops Co-founder. True C like languages are faster, but we don't need quite that much speed. nothing Scientific, or really mission critical. I mostly want the code to run faster vs ease of coding. So if the app was going to take longer running in php than python, but faster to code, I would still want python.

  • ssanders82 18 years ago

    Agree. Speed of execution != scripting language.

chuchurocka 18 years ago

If speed really is key i'd say Perl, otherwise I would just stick to PHP. Ruby and Python are nice for writing code really fast in but Perl / PHP execute much faster.

  • ctbk 18 years ago

    Are you sure about PHP being faster than python?

    Unscientific as it could be, this test shows speeds comparable or better for python:

    http://shootout.alioth.debian.org/gp4/benchmark.php?test=all...

    [lines going right are better for python, the ones going left are better for php]

    I don't mean to bring this as proof of any sort, but also according to my own experience python scripts outperform php ones.

lr 18 years ago

We use Ruby on Rails for the web app, and our sys admin scripts are written in Ruby as well, as they can easily integrate with our DB via our Rails setup.

anonym 18 years ago

If you want speed, why not Common Lisp? Nice, high-level, a pleasure to work in, fast and compiled out of the box, with the ability to optimize the hell out of specific critical parts of your code (using, e.g., optional type declarations, speed and safety settings, inlining declarations, etc.). Hunchentoot is a nice web server, Postmodern is a nice library for working with Postgres.

yourabi 18 years ago

Python, reasons follow:

1) Django 2) App Engine 3) Highly expressive

  • kashif 18 years ago

    Or Pylons @ pylonshq.com is a better alternative to Django for most projects.

davidw 18 years ago

Ruby on Rails or Django.

pystar 18 years ago

python

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection