News for hackers. Stuff that matters.
Re:Facebook makes HipHop for PHP open source by Quarrelsome on Tuesday February 02, 2010 @12:47PM (#1095475)
So it converts PHP into C++?!? Woaw.

Didn't people accuse Joel Spolsky of jumping the shark for doing that kind of thing (Wasabi script => php or vbscript).

.....wait this means that Wasabi can now technically convert into C++! :D

Re:Facebook makes HipHop for PHP open source by mseebach on Tuesday February 02, 2010 @01:01PM (#1095512)
I think where most people chokes on Wasabi is the perception of compiling from an "insane" language to a sane language. No matter how cool it is to work at Fog Creek, it's very 1965 to work in a proprietary language, especially for web development. If Joel wasn't famous, anyone leaving Fog Creek would have serious problems finding a new job.

Facebook compiles from a "sane" language (PHP) to a less sane, but twice as fast language (C++). The alternative was to get their devs to work in C++, which they decided was an unattractive solution -- this seems reasonable.

Re:Facebook makes HipHop for PHP open source by tghw on Tuesday February 02, 2010 @01:07PM (#1095532)
PHP is somehow a more sane language than classic ASP? They are contemporaries of each other, and both were pretty popular in their day. PHP has continued, while ASP has been replaced by something significantly better than either.

P.S. If the company you're applying to is upset by you having worked in a proprietary language, they're hiring for the wrong things.

Re:Facebook makes HipHop for PHP open source by mseebach on Tuesday February 02, 2010 @01:22PM (#1095581)
> If the company you're applying to is upset by you having worked in a proprietary language, they're hiring for the wrong things.

In a perfect world, sure. But in the real world, the guy with actual experience in the language/framework used gets an interview first. Then the guy with experience in any language/framework the interviewer immediately recognizes as relevant. Then the guy with experience in something so obscure it's not even on Wikipedia (which Wasabi wouldn't be had Joel and Fog Creek not been famous).

Re:Facebook makes HipHop for PHP open source by johns on Tuesday February 02, 2010 @03:01PM (#1095904)
I don't think you quite understand how Wasabi works. Wasabi compiles VBScript (written mostly like normal VBScript with some conventions to ease the work on the compiler) to PHP. At least, that's how it originally worked. Now it compiles the same code to .NET IL which runs on Windows and Mono. They're not writing code in some obscure language.

If there's some company out there that doesn't want to hire people capable of writing their own compilers to more easily add cross-platform support to their software the guys at Fog Creek aren't going to want to work there anyway.

Re:Facebook makes HipHop for PHP open source by mseebach on Wednesday February 03, 2010 @07:07AM (#1097566)
According to Spolsky, Wasabi is backwards compatible with VBScript, but "we like closures, active records, lambdas, embedded SQL a la LINQ, etc. etc. and so those are the kinds of features we put into Wasabi."

If they'd been working in vanilla VBScript in 2010, it'd be even more insane, and also, I think Joel would have some serious problems holding on to employees.

http://www.joelonsoftware.com/items/2006/09/01b.html

Re:Facebook makes HipHop for PHP open source by acangiano on Tuesday February 02, 2010 @02:57PM (#1095891)
> from a "sane" language (PHP) to a less sane, but twice as fast language (C++)

C++ is much faster than PHP, not just twice as fast.

Re:Facebook makes HipHop for PHP open source by angelbob on Tuesday February 02, 2010 @03:59PM (#1096092)
Hand-coded C++ is much more than twice as fast, but 2x is what you get from machine-converted HipHop at this point.
Re:Facebook makes HipHop for PHP open source by Todd on Tuesday February 02, 2010 @06:38PM (#1096552)
Agreed. Scripted/interpreted languages are, in general, one to two orders of magnitude slower than a compiled language such as C/C++. It's damn difficult to go much better than 10x slower due to the nature of an interpreter--even fast opcode-based interpreters. There are some extensions to the GNU C/C++ compilers that can help here, though.
Re:Facebook makes HipHop for PHP open source by jwr on Tuesday February 02, 2010 @05:00PM (#1096293)
Languages aren't "fast" or "slow", it's programs that can be fast or slow.

If a higher-level language lets you implement a smarter algorithm, your program will run faster.

Re:Facebook makes HipHop for PHP open source by acangiano on Tuesday February 02, 2010 @06:51PM (#1096596)
> Languages aren't "fast" or "slow", it's programs that can be fast or slow.

We can say that "C++ is faster than PHP", because most, if not all, programs using the same algorithms will run faster when written in C++ and compiled to native code.

> If a higher-level language lets you implement a smarter algorithm, your program will run faster.

PHP is generally easier to master than C++, but both are high level enough to provide adequate tools to write efficient algorithms with comparable amount of effort, provided one is competent with the language at hand.

Re:Facebook makes HipHop for PHP open source by sker on Tuesday February 02, 2010 @01:06PM (#1095530)
PHP is sane?
Re:Facebook makes HipHop for PHP open source by mncaudill on Tuesday February 02, 2010 @02:17PM (#1095753)
I'd say PHP is more sane from a business and coding standpoint. Need to find a PHP developer? No problem. Want a PHP IDE? No problem. A large community to handle bugs and any future development? Yes.

It's obvious that wasabi has been good to Fog Creek, but that doesn't make it a sane decision, regardless of the quality of the syntax and semantics of the language itself.

Re:Facebook makes HipHop for PHP open source by david on Tuesday February 02, 2010 @03:39PM (#1096013)
What does "sane" mean in this thread? I can't figure it out other than "something that makes sense to the poster".

>> Need to find a PHP developer? No problem.

Not being able to hire just anyone to code for you is a good thing just as much as it is bad. It means you're going to have some pretty bright people working for you, which apparently is something Fog Creek values and can afford to do.

> Want a PHP IDE? No problem.

Most hackers have their own preferred editors anyways, and Emacs/vi/etc work well with any language if that's the editor you're experienced with.

>> A large community to handle bugs and any future development? Yes.

Again, that's a hindrance just as much as it is a benefit. If you need to make a change or fix a bug in the language, you're going to have much better luck if you know a bunch of people who are intimately familiar with how that language works, especially if their right down the hall from you.

Re:Facebook makes HipHop for PHP open source by sanswork on Tuesday February 02, 2010 @05:44PM (#1096426)
In response to your first comment I think the idea that developers that don't use PHP are better or brighter is absurd.

Not that it matters anyhow for most roles you neither need nor can afford to hire the best and brightest away from their current role which they probably love a lot(being the best gives you the ability to choose great places to work). So unless you're looking for a tech lead you're going to be looking for great, much better than average but not specifically the best and for those conditions PHP will give you a much larger developer base to choose from every day of the week.

As for the last point I think you're really reaching here to find a negative. A large community to handle bugs a hindrance? Seriously? And your alternative ideal solution is some people down the hall in your office that know how to use the language well?

Re:Facebook makes HipHop for PHP open source by lincolnq on Tuesday February 02, 2010 @06:02PM (#1096472)
Uhm, if the guy down the hall WROTE the language, that's gonna be a hell of a lot more useful than posting to a mailing list. Especially if you can't post your secret source code, so instead you have to spend a lot of time coming up with a simple test case you can post which demonstrates the problem -- whereas with the guy down the hall, he's allowed to see the code.
Re:Facebook makes HipHop for PHP open source by sanswork on Tuesday February 02, 2010 @06:25PM (#1096523)
That's great if you work down the hall from the guy that wrote the language but unless you're talking about a niche in house language when it comes to web development you're talking about what half a dozen people that you can claim that against? And how many of those work at Google and the like?

The vast majority of people will never have the opportunity to be down the hall from that guy and for the vast majority of people a large helpful community will be infinitely more valuable.

Re:Facebook makes HipHop for PHP open source by david on Wednesday February 03, 2010 @06:49PM (#1099289)
>> The vast majority of people will never have the opportunity to be down the hall from that guy and for the vast majority of people a large helpful community will be infinitely more valuable.

Which means what to Fog Creek?

Re:Facebook makes HipHop for PHP open source by jganetsk on Tuesday February 02, 2010 @11:33PM (#1097074)
And what happens when the guy down the hall leaves the company?
Re:Facebook makes HipHop for PHP open source by lincolnq on Wednesday February 03, 2010 @04:32PM (#1098935)
Ah, well, then you're fucked. My point is not that you should consider it a good idea to make your own proprietary language, just that that situation can sometimes be a really good, productive one.

(I'm dealing with this in my work -- we use a proprietary internal scripting language, and the guy who wrote it is not around. I'm slowly becoming the local expert on the language -- very slowly, though, because opportunities to work on it don't come up too often.)

Re:Facebook makes HipHop for PHP open source by mseebach on Wednesday February 03, 2010 @07:16AM (#1097575)
I think I introduced the word. I used it to describe the perceived relative merit of PHP vs. Wasabi/C++, where, in the example at hand, the sanity of PHP exceeds that of the alternatives for the given situation.
Re:Facebook makes HipHop for PHP open source by mseebach on Tuesday February 02, 2010 @01:11PM (#1095541)
More sane than any proprietary language, yeah. And more accessible than C++.
Re:Facebook makes HipHop for PHP open source by tghw on Tuesday February 02, 2010 @01:28PM (#1095605)
You're comparing apples an oranges. PHP is no more sane than classic ASP. They're both pretty awful.
Re:Facebook makes HipHop for PHP open source by brehaut on Tuesday February 02, 2010 @01:47PM (#1095674)
I think thats unfair. PHP sucks some hairy donkey's balls, but VBScript is significantly worse. Dim, Redim Preserve, ByRef, Arrays that are basicly C arrays (see also Redim), Ridiculous Object/Value dichotomy (for those that arent aware you need to use the Set keyword to assign an object to a variable, but not for a value. The distinction bleeds all over your code and makes things hurt) and friends are evil sons of bitches that don't belong in a scripting language.
Re:Facebook makes HipHop for PHP open source by voidpointer on Tuesday February 02, 2010 @06:33PM (#1096546)
Hello pot. This is kettle. You're black.
Re:Facebook makes HipHop for PHP open source by brehaut on Tuesday February 02, 2010 @07:10PM (#1096645)
Would you like to expand on your claim? Be quite clear that i dislike both languages. VBS is the worst of the two though.
Re:Facebook makes HipHop for PHP open source by wvenable on Tuesday February 02, 2010 @10:51PM (#1097011)
Classic ASP is whole class of awful all to itself. PHP has far more in common with other scripting languages than it does with Classic ASP. The fact that they both support embedding code into HTML is their only similarity.
Re:Facebook makes HipHop for PHP open source by mseebach on Wednesday February 03, 2010 @07:09AM (#1097569)
Wasabi >> Classic ASP, if that's what you're referring to. But it's a whole lot more, and on top of that it's proprietary. PHP isn't, and that alone makes it more sane.
Re:Facebook makes HipHop for PHP open source by statictype on Tuesday February 02, 2010 @10:54PM (#1097015)
> No matter how cool it is to work at Fog Creek, it's very 1965 to work in a proprietary language, especially for web development

So you're basically against the use of Domain Specific Languages on the whole? Or only those whose syntax you don't like?

Re:Facebook makes HipHop for PHP open source by mseebach on Wednesday February 03, 2010 @07:12AM (#1097574)
When the domain is general web development, I'm against it. It's an instance of the "right tool for the job"-problem.
Re:Facebook makes HipHop for PHP open source by encoderer on Wednesday February 03, 2010 @07:48AM (#1097612)
If you're hiring developers based on experience with a specific language, you're probably doing it wrong anyway.

Hire based on experience with a specific paradigm. OO. Functional. Etc. Or experience with a specific domain problem. Compilers. DSLs. Operating Systems. Etc.

Re:Facebook makes HipHop for PHP open source by runT1ME on Tuesday February 02, 2010 @02:57PM (#1095889)
I wish someone would invent some sort of C-like language that wasn't as complicated.

Maybe it could even compile itself on the fly to machine code to continually optimize itself!

Re:Facebook makes HipHop for PHP open source by didroe on Tuesday February 02, 2010 @04:53PM (#1096271)
Javascript? :)
Re:Facebook makes HipHop for PHP open source by kamens on Tuesday February 02, 2010 @12:57PM (#1095497)
We Fog Creek developers were just mentioning this hilarious possibility.
Re:Facebook makes HipHop for PHP open source by pvg on Tuesday February 02, 2010 @06:11PM (#1096497)
There's a pretty big difference between converting a very widely used language to C++ for performance reasons and inventing an entirely new language (which converts to some other, very similar language) for the purposes of tackling the unique and fundamental problems that arise when writing a bug tracker. Difference being only one of these is tremendously silly.
Re:Facebook makes HipHop for PHP open source by andrewvc on Tuesday February 02, 2010 @12:57PM (#1095498)
Well, from what I've heard its more like FB had a mountain of PHP they couldn't ever rewrite, so they made PHP faster by turning it into C++.

Fog Creek rewrote everything in a brand new language they invented that compiles down into multiple other languages.

So, in actuality, the projects are the exact opposite of each other.

Re:Facebook makes HipHop for PHP open source by gecko on Tuesday February 02, 2010 @01:06PM (#1095531)
Cute, but completely wrong.

Wasabi started out as a VBScript -> PHP compiler, allowing us to keep the existing FogBugz source, but run it on Unix and Linux, where ASP wasn't available. Once we had that, it hit us that it'd be pretty easy to add a VBScript -> VBScript compiler, at which point we could add language extensions. So we did. This allowed new code to take advantage of things like macros, better declaration syntax, lambdas and so on, without rewriting any existing code. Finally, because it was clear that ASP was dead, and specifically because we didn't want to rewrite FogBugz from scratch, we modified Wasabi to target .NET.

The whole point of Wasabi was to avoid rewriting FogBugz to support other platforms and technologies. I have no idea where you got the idea we rewrote the entire program; if we'd done that, we'd have just done it in C#.

Re:Facebook makes HipHop for PHP open source by _pius on Tuesday February 02, 2010 @01:27PM (#1095598)
I have no idea where you got the idea we rewrote the entire program ...

I think the mythology of Wasabi has become larger than life and pretty heavily distorted.

Re:Facebook makes HipHop for PHP open source by snom370 on Tuesday February 02, 2010 @07:00PM (#1096618)
Yep. Mainly because people like to think that Joel is a completely incompetent idiot that quite naturally would do something like inventing a new language for no absolutely no reason whatsoever, never mind the fact that he's running a successful company making a successful product.
Re:Facebook makes HipHop for PHP open source by tghw on Tuesday February 02, 2010 @01:02PM (#1095516)
Fog Creek didn't really rewrite anything. In fact, that was the whole point of Wasabi, to not rewrite anything.

Wasabi did extend VBScript to add objects and other language features, which were gradually incorporated into the code base, but just on changes going forward.

So, really, it is almost exactly the same thing.

Re:Facebook makes HipHop for PHP open source by idlewords on Tuesday February 02, 2010 @02:09PM (#1095727)
Except for the part where Facebook runs this in a production environment to serve hundreds of millions of requests and Wasabi is a toy.
Re:Facebook makes HipHop for PHP open source by snom370 on Tuesday February 02, 2010 @06:54PM (#1096604)
Except for the part where Wasabi powers FogBugz, the main product of Fog Creek Software, and enough people pay for this software to keep that company running very profitably for 10+ years.
Re:Facebook makes HipHop for PHP open source by gridspy on Tuesday February 02, 2010 @02:41PM (#1095839)
Hmmm, getting nasty there

Both companies had huge investments in a code base and found a geeky way to keep their code base while reaping modern benefits.

Most things are toys compared to face book, Google or Twitter. That doesn't make them pointless.

Re:Facebook makes HipHop for PHP open source by idlewords on Tuesday February 02, 2010 @03:02PM (#1095905)
What is nasty about pointing out this difference in scope?

Wasabi is an app-specific dialect of VBScript used by one company to deploy a bug tracker to small teams. HipHop is a general-purpose PHP compiler whose output is used at scale by the world's largest social networking site.

I can write a file system that will work fine on my computer, with my workload, and maybe even write an essay about how productive that makes me. But I don't think you'd want to install it.

These two projects are not in the same league - they're not even in the same sport - and so I am baffled to see Wasabi come up in this thread at all.

Re:Facebook makes HipHop for PHP open source by babakian on Tuesday February 02, 2010 @04:14PM (#1096137)
You've introduced a new idea here by comparing FogBugz to Facebook.

Those earlier comments are comparing the strategy that Fog Creek took versus the one that Facebook has taken. The strategies are similar, and so the comparison makes sense.

It should be noted that Wasabi is a general purpose programming language. It is Turing complete (up to relatively trivial finite-memory issues, just like any other general purpose programming language). Like C, for example. It should also be noted that Wasabi is a .NET language. It has full access to the .NET Framework and all of its classes.

One could use Wasabi to write a C compiler.

[NB: I am a Fog Creek developer, working on the FogBugz team.]

Re:Facebook makes HipHop for PHP open source by angelbob on Tuesday February 02, 2010 @04:01PM (#1096102)
What is nasty about pointing out this difference in scope?

In this case, your tone.

Re:Facebook makes HipHop for PHP open source by jerf on Tuesday February 02, 2010 @02:59PM (#1095894)
[citation needed]

What evidence do you have that Wasabi is a toy? I seriously doubt you have any knowledge on the topic either way.

Re:Facebook makes HipHop for PHP open source by tedunangst on Tuesday February 02, 2010 @01:01PM (#1095511)
Actually, the point of Wasabi was to avoid rewriting anything.
Re:Facebook makes HipHop for PHP open source by hypermatt on Tuesday February 02, 2010 @01:45PM (#1095670)
Whats even worse is fog creek uses .net now, so it even makes less sense to have your own proprietary language.
Re:Facebook makes HipHop for PHP open source by bitwize on Tuesday February 02, 2010 @02:02PM (#1095709)
So it converts PHP into C++?!? Woaw.

Joey Lawrence?!