Live data from Hacker News

Web Applications Should Be Compiled

ediblepet.net

101–110 of 177 posts

Re: Web Applications Should Be Compiled

#101
post #98

Sweet merciful lord. Is this guy channelling Zed Shaw or what? Apart from all the hand-waving and generalizations, this guy doesn't sound like he's ever really a webapp under serious load. I'm not a Ruby guy, so I don't know how things fly with that, but I've never once had a problem with a webapp being slow because of the language it was written in. Bad database queries, unnecessary assets being loaded, definitely.…

I've worked on a webapp under serious load, and I think he's right. You're correct that database queries and resource bottlenecks are the usual problems for web application scaling, but even taking that into account, I've had more than one problem that was caused by the simple fact that Ruby is a dog of a language. Python is better, but only just so. Perl is faster than both, but still nowhere near as fast as a C++ p…

> I think I'd still consider using a compiled language, because the type-safety and compile-time guarantees of a statically typed language would go a long way toward eliminating a huge class of silly bugs that we deal with on a daily basis.

Not all compiled languages are statically typed.

> That's developer time in the bank.

And the time spent in the edit, compile, test, run, cycle? I'd think there's more developer time in the bank if I can edit, test, run.

Re: Web Applications Should Be Compiled

#102
post #76

Viaweb used C on the backend.

Not really. The shopping basket (this was before everyone settled on "cart") was written in C, but the shopping basket wasn't the back end of the rest of the system, just one of several components that ran in parallel.

Re: Web Applications Should Be Compiled

#103
post #101
post #98

Earlier quoted context omitted.

I've worked on a webapp under serious load, and I think he's right. You're correct that database queries and resource bottlenecks are the usual problems for web application scaling, but even taking that into account, I've had more than one problem that was caused by the simple fact that Ruby is a dog of a language. Python is better, but only just so. Perl is faster than both, but still nowhere near as fast as a C++ p…

> I think I'd still consider using a compiled language, because the type-safety and compile-time guarantees of a statically typed language would go a long way toward eliminating a huge class of silly bugs that we deal with on a daily basis. Not all compiled languages are statically typed. > That's developer time in the bank. And the time spent in the edit, compile, test, run, cycle? I'd think there's more developer t…

No, not all compiled languages are statically typed. I wouldn't use those languages.

The time spent compiling is a red herring. I know that I've spent dozens of hours chasing down weird runtime bugs in Ruby that a C++ compiler would have caught for me during static analysis. That time more than makes up for the 15 minutes a day I might spend waiting on a compiler (I waste more than 15 minutes a day on coffee breaks!)

Re: Web Applications Should Be Compiled

#104
I find it ironic that he mocks "the losers who don’t know how to code and instead just pontificate endlessly about the hippest new blog post that totally changed their way of thinking"

Isn't that exactly who is writing to? Doesn't he WANT people to pontificate about his post and change our thinking?

So why is he mocking his intended audience?

Re: Web Applications Should Be Compiled

#105
post #102
post #76

Viaweb used C on the backend.

Not really. The shopping basket (this was before everyone settled on "cart") was written in C, but the shopping basket wasn't the back end of the rest of the system, just one of several components that ran in parallel.

I stand corrected. I just remember reading about Viaweb using C on your website. But I was right in that the cart used it.

Re: Web Applications Should Be Compiled

#106

Earlier quoted context omitted.

You can always throw hardware at the performance problem. No, you can't. That's what scalability means . If you don't have scalability, then additional hardware will only take you so far before you begin wasting it.

Many dynamic-languages frameworks (notably PHP) are more scalable than writing a custom webapp in C. This is because C encourages you to store state in memory on the server, because it's really easy when everything is a single long-lived process. Good for performance, terrible for scalability. PHP (and Rails/Django, if you ignore their ORMs) encourage you to store state on some collection of backend servers and commu…

Absolutely! Just for the record -- since people seem to assume otherwise -- I'm not agreeing with the article. I'm just disagreeing with the idea of ignoring "scalability and performance" and then expecting to solve performance problems by "throwing hardware" at them.

Re: Web Applications Should Be Compiled

#107

I chose C because C is the dominant language right now Good bit of satire. I wouldn't call it a troll because it's funny and just unbelievable enough, rather than inflammatory and merely misguided.

Indeed, I would have to say that Javascript is the dominant language right now.

Re: Web Applications Should Be Compiled

#108
post #2

Not a bad troll. Not the best I've ever read, but not bad, either.

I don't think it's a troll, but just someone who is really in to performance, like I do, and I agree with him on some points. But what I don't agree is using just C. C is too low level and is a horrific unfit task for web development. Instead C++ would be a good fit (and writing in C mixed in). The STL/Boost provide a wonderful abstraction layer that does pretty much anything you throw at it with ease, plus there are…

How about a web-centric programming environment that compiles web page code to DLLs, and changes pages "dynamically" by unloading the DLL, recompiling, and reloading? Base the language on a modified Ngnix as an execution environment and generate C as intermediate code. Use TCC to compile web pages very quickly. The modified Ngnix would have a big hashtable of dynamic methods, which would be pointers to functions in the DLLs. Make it concurrency-friendly like Erlang by using isolation and green threads.

Re: Web Applications Should Be Compiled

#109

Earlier quoted context omitted.

At least he's planning on putting his money where his mouth is. If he creates this framework, more power to him!

The VisualWorks Smalltalk Server Pages framework already does this. SSP results in web pages as compiled machine language. The HTML file is translated into a new Smalltalk method, the tags become Smalltalk message sends, and the HTML between the dynamic tags just become accesses into an Array. Because Array access is optimized and JITed as machine code, the only message sends are due to the dynamic tags. When the web…

I believe the framework discussion is of a compiled C "Rails" type MVC framework, I'm not familiar with Smalltalk Server Pages but from an initial google search it doesn't seem to be on par with what rails provides?

Re: Web Applications Should Be Compiled

#110
post #16

It's a valid point. I wrote the Mibbit backend from scratch in Java for these reasons. I can only start to imagine the horror I would be enduring if I'd chosen a scripting language. Having said that, choose the right tool for the job. edit: Downmod me all you like. A scripted language wouldn't handle 2k req/sec on a couple of VPSs.

I think Mibbit, much like twitter, is one of those apps that is a non-traditional webapp. While its a web based frontend the traffic and distribution of chat messages is a much different beast then what most webapps do. Java is very likely a much better choice for these reasons.
Post reply on HN