Live data from Hacker News

Hack: a new programming language for HHVM

code.facebook.com

391–400 of 422 posts

Re: Hack: a new programming language for HHVM

#391
post #334
post #87

Earlier quoted context omitted.

The HN crowd seems to dislike (or despise perhaps?) PHP, but it's really not that bad. Yes it has a lot of warts, but it has a lot of things that make it nice for web development. a) try your new code by saving in your editor, and hitting reload in your web browser. b) it's very approachable. People who only know HTML and CSS can be expected to do a little bit of PHP work to integrate their changes. If you setup the…

If you want to know: just checked the one project where I did a long running PHP-process. It is a job scheduler which takes jobs from a Redis queue and executes it. It does fork a new process for 1 type of task (image resizing in this case) to make sure it doesn't leak memory. It also reuses these forked processes so it doesn't need to fork for every task. It was last started on Jan. 2013 (because of maintenance) and…

Duly noted, will not be so negative on long running processes. :)

Re: Hack: a new programming language for HHVM

#392

Earlier quoted context omitted.

That's coming in PHP 5.7 anyhow. It's been implemented and works, but Nikita Popov hasn't had the time to change the function definitions of the standard library to work with it, hence PHP 5.6 won't have it, sadly.

Wow, I haven't kept up with things, but gosh that sounds pretty great. Type checking + named params is a fairly difficult combination of great language features to find in the same language.

I think both C# and Scala have both features.

Re: Hack: a new programming language for HHVM

#393
post #329
post #184

Earlier quoted context omitted.

In the sense that any software written in C is built on C.

True, but a lot of PHP's ... design also reflects C, only that they warped it.

A few of the complaints about PHP (the inconsistent function library, for example) exist because PHP was originally a very thin scripting language layer for using existing C libraries.

Re: Hack: a new programming language for HHVM

#394
post #87

I am baffled as to why you'd build your castle atop a crumbling foundation. I have wondered why FB didn't use a proper language with proper typing to begin with. I mean, I "understand" logistically: they already had a giant codebase in PHP, migrating a codebase is expensive, and it's difficult to hire and train 1000s of hackers in e.g., OCaml. (They do have some OCaml people, but they are outliers. OCaml was my favor…

The HN crowd seems to dislike (or despise perhaps?) PHP, but it's really not that bad. Yes it has a lot of warts, but it has a lot of things that make it nice for web development. a) try your new code by saving in your editor, and hitting reload in your web browser. b) it's very approachable. People who only know HTML and CSS can be expected to do a little bit of PHP work to integrate their changes. If you setup the…

> a) try your new code by saving in your editor, and hitting reload in your web browser.

The only language for which that works is client-side Javascript. For PHP, you forgot the part in which you have to install and run a web server, then point your browser to localhost. Plus, to get anything useful done, you'll also need some sort of database to go along with it. I remember the first time I did that and it was pretty intimidating.

> c) it's not super high overhead at runtime ... it's not too hard to get your page out with about 10 ms of overhead beyond data fetching

To me much more interesting is the total time it took for the client to receive the response, possibly when multiple concurrent requests are happening. The comparison here should be versus a static page served by Nginx of course.

The best throughput possible that I got for an otherwise complex business logic happened on the JVM. I basically rewrote a web-service built on top of Django/Python, with a redesign with emphasis towards in-memory caching, parallelism and async I/O and the result was a server that was able to process more than 10,000 requests per second with an average of about 5ms per request (actually in production the instances ended up processing about 2000 reqs/sec of real traffic, since c1.medium EC2 instances don't have enough CPU power).

Of course, people that just need to slap something together, don't need this level of throughput. If a request takes 400ms for a dumb web form on a low traffic website, that's of no consequence to most people. The problem happens of course when such a piece of software evolves to something much bigger, like Wordpress. I'm always amazed at the gimmicks that people do just to keep their Wordpress powered blog alive.

Re: Hack: a new programming language for HHVM

#395

Earlier quoted context omitted.

> Because "build atop a crumbling foundation" has demonstrated time and again to be, by far, the most successful way to accomplish anything in computing? That's only because the currency for building things on top of crumbing foundations has been sweat and man-power . We aren't that far off from the Egyptians that were using hundreds of thousands of slaves per pyramid. It's a good thing that we've transcended the nec…

> We aren't that far off from the Egyptians that were using hundreds of thousands of slaves per pyramid. It's a good thing that we've transcended the necessity for hundreds of thousands of slaves when raising buildings, don't you think? False, they were skilled, paid laborers: http://en.wikipedia.org/wiki/Egyptian_pyramid_construction_t... Apologies for being irrelevant to the main point, but this is a tired myth.

Interesting. Thanks for the link. Is Wikipedia great or what? :-)

Re: Hack: a new programming language for HHVM

#396

Earlier quoted context omitted.

If you define "crumbling foundations" as "a dependency that is unreliable in the long term", then your conclusion is circular. Not at all. I'm arguing that in computing, worthwhile results often take time to achieve, and therefore that foundations that are likely to be around for longer will improve the chances of achieving such results. Alternatively, from the opposite point of view, the odds of achieving something…

hm interestingly, PHP still powers about 70% of the web! the web should have certainly crumbled by now ...

I'd disagree if you say PHP powers about 70% of the web. Web servers (and all other kinds of servers) are not written in PHP neither are protocols that drive the web. Operating systems are not written in it either. These (and many more) are what power the web, not web applications. Your definition of what "powers the web" is remarkablly wrong.

Re: Hack: a new programming language for HHVM

#397

Earlier quoted context omitted.

Because "build atop a crumbling foundation" has demonstrated time and again to be, by far, the most successful way to accomplish anything in computing? I can't imagine where that sort of conclusion comes from. Building on a crumbling foundation seems to be just about the most proven, reliable way to ensure your software project won't survive more than a short time without needing serious effort just to maintain it an…

> What major accomplishments in computing that have been built atop crumbling foundations can claim anything even close to the scale of success of these examples? Wikipedia and Facebook?

A fair question is if they successful thanks to PHP or inspite of PHP.

Re: Hack: a new programming language for HHVM

#398
post #228

Earlier quoted context omitted.

Perl was a possibility, but CGI is/was a pain to use. To get started you had to understand things like headers. You frequently had scripts refusing to run for whitespace issues relating to CRLF vs LF. You'd need to come up with your own templating language... It was just much more difficult. Also Perl libraries typically require superuser rights to install. That's a big deal if you're a poor student using shared host…

> To get started you had to understand things like headers since when is this a problem? really.

To make something accessible you need to let people learn it one small chunk at a time.

PHP lets you ease in, starting at html with some inserted php code and working your way up to more complex code.

CGI, at least as I recall, required you to return valid HTTP responses with correct headers. That's a big jump from simple HTML.

Re: Hack: a new programming language for HHVM

#399
post #170

Earlier quoted context omitted.

I'm appalled and little bit insulted that you group PHP in the same group with COBOL, C and C++ in terms of their foundation. COBOL and C were designed by some of the greatest pioneers of the field, and indeed PHP is built on C.

Why would you feel insulted? Did you personally create any of those languages? In fact, did you personally create any language? If not, maybe you should't be quite so dismissive of the accomplishment it was to create PHP. Sure, it's not the best language out there, and valid criticisms can be levelled at it, but as they say: It's better to have tried and failed...

What you just said is plain stupid. So our language designers can be critical of other languages? Bullshit! Since programmers can vote with their feet and gravitate towards better languages (is it miraculous that almost all programmers have a distaste for PHP?) we should give reasons why we use C and not PHP. If they were equally crappy what would have been the cause of choice of one over the other? I can call PHP the worse language ever, and I don't need to have created a language already.

Re: Hack: a new programming language for HHVM

#400
post #338
post #175

Earlier quoted context omitted.

> Much of the world still runs on C But these days, most interesting applications run on C++, which started from the arguably crumbling foundation (from C++'s point of view, not per se) of C, and grew organically over several major revisions into something hideously complex. This trait of C++ is not a good thing, but the amount of successful software written in it seems to prove that it's not fatal either. > You can…

C++ belongs to my list of languages that I enjoy using, sadly it was build in quicksand foundations due to C compatibility as a way to make it mainstream.

Add JavaScript. Super crappy but its ubiquity for web scripting is really saving it some real bashing. When we finally have options, we'd relish in our freedom and say what it was like to work with badly written programming languages.
Post reply on HN