This week includes crash fixes, more compatibility with PHP, more killing of IDL (one file to go!) and a speed boost for HHVM running in interp mode.
Not as many commits to HHVM this time. Only doing one week’s worth instead of 4 would certainly explain that ;)
There’s a couple of fixes for Reflection and some work on the fancy register-allocation part of the JIT.
It’s been a while since my last commit summary. Something about holidays and stuff. Quite a bit has happened with HHVM during the last 28 days, with the most exciting user-facing change being the introduction of the
|> operator in Hack code.
The commits for HHVM this week contain things from small improvements to the docs site to common-case optimisations to underlying engine improvements. There was more activity this week, though it’s likely to drop for the next couple of weeks as people go on holiday.
There’s been further work this week on general PHP and PHP7 compatibility, some more docs work and the continuing death of IDL. Outside of commits directly to HHVM, the new docs site has been launched!
I’ve decided to start summarising some of the commits made to HHVM each week. I won’t post all of them (you can view those on github if you want), just the ones I either find interesting or think would be of interest to others.
I’m not part of the HHVM team, nor do I work for Facebook. These are just the ramblings of a community member that likes to follow all the exciting new things being added (which does lead to some interesting commits ?)
One of the most frustrating parts of using Hack is accessing user-provided data through the request based
$_POST super-globals. The problem being two-fold:
- In partial mode, these aren’t typed. This means Hack assumes you know what you’re doing with the values, which can be bad.
- In strict mode, the super globals aren’t available and result in undefined variable errors in the type checker.
That’s where my new package comes in.
Since this series of posts if all about me learning things, I figured I should at least mention some of the things I’m hoping to learn this year. This list is by no means complete.
Dragoon is a simple Markov-chain based post generator for App.net. At a high level, it loads recent posts by the current user from App.net until there’s at least 201 posts loaded, or no more to load. It then builds up a chain and generates a string from it that’s no more than 247 characters if ‘Include #Dragoon in the posts?’ is selected or 256 characters otherwise.
Depending on how the process was instigated, it is then either displayed to the user or directly posted to App.net. Then hilarity happens.
There are two main parts to the post generation: creating the markov chain and creating the actual post. I’m going to provide code and details on most of those parts. The glue code is left as an exercise for the reader.