Releases: hhvm/hsl
v4.15.2: support latest HHVM nightlies (4.21-dev)
preg_match
no longer takes a $matches
by-ref argument in the latest HHVM nightly builds
v4.15.1: support current nightlies (4.20-dev)
This release:
- supports current nightly builds (4.20-dev)
- requires HHVM 4.15 or above
4.15.0 was incorrectly taggeed.
4.10: future compatibility, feature enhancements
This release:
- extends
Vec\slice()
to support negative offsets - adds
Math\PI
andMath\E
constants - supports potential future changes to the Hack language
- supports HHVM 4.10 and above; note that the HHVM project no longer supports 4.11 or 4.12.
Add `HH\Lib\Ref<T>`
This class wraps a value inside an object - this can be useful to get byref-like semantics. For example:
$total = C\count($jobs);
$done = new Ref(0);
concurrent {
await Vec\map_async(
$jobs,
async $job ==> {
try {
return await handle_job_async($job);
} finally {
// As `$done` is an object, the changes persist outside of this scope;
// if `$done` were an integer, `$done++` would only modify a copy of
// the local within the lambda scope.
$done->value++;
}
},
);
await async {
while($done->value < $total) {
await \HH\Asio\usleep(1000 * 1000);
await IO\request_output()->writeAsync(
Str\format("Progress: %d/%d\n", $done->value, $total)
);
}
};
};
It is usually best to refactor to avoid this class; for example:
- use
inout
parameters - return values from lambdas instead of mutating values from inside lamdas
- use
C\reduce()
orC\reduce_with_key()
if a Ref is being used as an accumulator
There are cases like the above where Ref is the cleanest solution; you may also find Ref<vec<T>>
to be preferable to Vector<T>
, in order to use a consistent API and be more explicit about when a function is likely to mutate a container.
variadic Traversable -> Container, DivisionByZeroException changes
- replace
Traverable... $foo
withContainer... $foo
(and alsoKeyedTraversable
->KeyedContainer
) in functions such asDict\merge()
- replace
Math\DivisionByZeroException
with the new HHVM built-inDivisionByZeroException
- this release requires HHVM 4.3 or later
Release for 4.1.0
This release:
- improves the performance of
Math\from_base
andMath\to_base
- contrains the key parameter of
C\contains_key
to require anarraykey
parameter - supports and requires HHVM 4.1.0
Support nightly builds too
This release suppresses a typechecker error to allow usage in nightly builds of HHVM. v4.1 is likely to require that keys passed to C\contains_key
are an arraykey
.
Support 4.0, add Regex\,Str\replace_every_ci, Dict\map_with_key_async
This release:
- supports and requires HHVM 4
- adds the Regex\ namespace (previously in hsl-experimental)
- adds
Str\replace_every_ci
- adds
Dict\map_with_key_async
Target HHVM 3.30, add SecureRandom\ and PseudoRandom\, performance improvements
This release:
- targets HHVM 3.30
- adds
SecureRandom\int()
,float()
,string()
, and equivalents in thePseudoRandom\
namespace - improves performance of
C\first
,first_key
,last
, andlast_key
when operating onContainer
s
Support typed user attributes in HHVM/Hack 3.29
supported typed attributes in open source Summary: Pull Request resolved: https://github.com/hhvm/hsl/pull/63 Reviewed By: BobertForever Differential Revision: D10447615 Pulled By: BobertForever fbshipit-source-id: 5ed4b2d27b013dc71239d8a59051be1768cf11d6