HNHacker News
TopNewBestAskShowJobs

bos

1,351 karma · joined July 16, 2009

submissionscomments
bos··on Hack: a new programming language for HHVM
As you note, the team developed the typechecker in OCaml, as that's what the founding engineers were familiar with. Many of ML's cousin languages happen to be well suited to this kind of work.
bos··on Hack: a new programming language for HHVM
Because this is tremendously important to the usability of the language.

One of the reasons that PHP has been such a success is that you can simply save a source file and reload a web page to see what's going on.

The server-based typechecker that runs instantaneously is what makes it possible for Hack to replicate this experience: you save a file and reload a web page, but you have the safety net of a typechecker that told you about your type errors as soon as you saved the file.

I can't overstate how important this instant feedback is: it's really the thing that distinguishes Hack from working in a more traditional compile-based static language.

bos··on Hack: a new programming language for HHVM
Oops! Thanks - we're fixing it now.
bos··on Hack: a new programming language for HHVM
Yes, "<?hh // strict" at the top of a file will do the trick.
bos··on Hack: a new programming language for HHVM
Yep, we're happy to be inspired by good ideas when they're obviously the right path to walk.
bos··on Hack: a new programming language for HHVM
Yes, definitely.
bos··on Hack: a new programming language for HHVM
100% of our web front end developers use Hack now. This has been an organic process of growth over the past year, by which I mean our engineers are using it because they like it and see value in it, not because there's someone standing over them with a big stick :-)

The biggest learning step for our engineering teams was to treat type errors from Hack as actual logic errors. We have a collection of "linters" that provide advice on code style and other nice-to-have factors. Some people (quite reasonably) initially thought of Hack errors as lint-like stuff that it was safe to ignore, when in fact they indicate real logical inconsistencies in code.

bos··on Hack: a new programming language for HHVM
On Linux, we use the inotify subsystem to be informed every time you save a source file or switch branches. The hh_server process can then update its data structures immediately, without being explicitly asked.
bos··on Hack: a new programming language for HHVM
It was very important to us to have a gradual and smooth upgrade path, such that you can start using Hack by just tweaking the "<?php" header at the top of a source file.

Obviously switching to a syntactically incompatible programming language would be at odds with that goal.

bos··on Hack: a new programming language for HHVM
We are just beginning to use the static type information that Hack provides to yield performance optimizations, and that's definitely on the cards as something we'd like to push further.
bos··on Hack: a new programming language for HHVM
Stay tuned. You'll hear more in due course.

In the mean time, the open source release of Hack includes integration with both Emacs and Vim.

bos··on Hack: a new programming language for HHVM
We wanted to preserve our investment in PHP, while introducing new capabilities and safety that make rapid development at scale less daunting.
bos··on Hack: a new programming language for HHVM
I'm the manager of the team that developed Hack, and I'm sitting here with some of the language designers. Happy to answer your questions.
bos··on Bitbucket passes one million users
"hg histedit" is almost exactly the same as "git rebase -i", right down to the UI.
bos··on What was your "ah ha" moment with Haskell?
In my experience, Haskell is not yet a great language for numerically intensive computing.

I'll explain in a bit, but before I do, let me first address your question about "can I bang on bits?". Yes, you can allocate memory and do all the low-level hacking you please in Haskell. It's not really any harder than in C, although the notation is different and that throws people. But because this is a very imperative way of programming, it's also not going to be any faster than C (typically it'll be a bit slower).

There are even MPI bindings for Haskell, and they look pretty much the same as for other languages (i.e. very low level).

If you're just foontling around imperatively in big homogeneous arrays and sending messages, then the type system really won't do you any good, and you'll rightly find yourself wishing for the notational convenience and speed of Fortran 95.

You could use immutable arrays (the Vector type is your friend) and higher order functions instead, and thereby benefit from Haskell's rather nice parallel evaluation support with only a little effort. This is quite practical, and can lead to pretty code that runs quickly.

Where all the fancy type-related machinery comes into play for numeric code is still largely a matter of research. There are interesting projects underway for parallel programming (both on CPUs and GPUs) that rely heavily on the type system. They're not obviously useful for real work yet, and since they rely on advanced type system features, neither are they something you just pick up and use as a newbie. Nevertheless, I think they're pretty cool projects, and I have been watching them for a few years.

So while there's a lot of interesting stuff going on, the current state of affairs is somewhat mixed. You might enjoy learning your way through it, though; there are many rewards to the path.

bos··on Haskell School of Music by Paul Hudak
Its author, Paul Hudak, is undergoing a lung biopsy today. Send your best wishes his way.
bos··on Facebook hit git performance issue on large repository
Facebook engineer here, working on this problem with Joshua.

What this comes down to is that git uses a lot of essentially O(n) data structures, and when n gets big, that can be painful.

A few examples:

* There's no secondary index from file or path name to commit hash. This is what slows down operations like "git blame": they have to search every commit to see if it touched a file.

* Since git uses lstat to see if files have been changed, the sheer number of system calls on a large filesystem becomes an issue. If the dentry and inode caches aren't warm, you spend a ton of time waiting on disk I/O.

An inotify daemon could help, but it's not perfect: it needs a long time to warm up in the case of a reboot or crash. Also, inotify is an incredibly tricky interface to use efficiently and reliably. (I wrote the inotify support in Mercurial, FWIW.)

* The index is also a performance problem. On a big repo, it's 100MB+ in size (hence expensive to read), and the whole thing is rewritten from scratch any time it needs to be touched (e.g. a single file's stat entry goes stale).

None of these problems is insurmountable, but neither is any of them amenable to an easy solution. (And no, "split up the tree" is not an easy solution.)

bos··on Running a Startup on Haskell
Our app consists of two parts: there's a client component that integrates into Outlook, and a server part that does all the actual heavy lifting.

The client-side code is written in C# because the .net APIs for Office are the easiest to deal with.

bos··on Running a startup on Haskell
> It's worth noting that QuickCheck is used with functional code only.

That's actually not true. You can use QuickCheck with "normal" code that has side effects, too, and it's every bit as useful there.

← PreviousPage 2 of 2