Skip to content

Releases: hhvm/hsl

v4.15.2: support latest HHVM nightlies (4.21-dev)

29 Aug 18:48
Compare
Choose a tag to compare

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)

23 Aug 20:57
Compare
Choose a tag to compare

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

07 Aug 20:49
Compare
Choose a tag to compare

This release:

  • extends Vec\slice() to support negative offsets
  • adds Math\PI and Math\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>`

31 May 17:19
Compare
Choose a tag to compare

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() or C\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

13 May 17:17
Compare
Choose a tag to compare
  • replace Traverable... $foo with Container... $foo (and also KeyedTraversable -> KeyedContainer) in functions such as Dict\merge()
  • replace Math\DivisionByZeroException with the new HHVM built-in DivisionByZeroException
  • this release requires HHVM 4.3 or later

Release for 4.1.0

09 Apr 19:14
Compare
Choose a tag to compare

This release:

  • improves the performance of Math\from_base and Math\to_base
  • contrains the key parameter of C\contains_key to require an arraykey parameter
  • supports and requires HHVM 4.1.0

Support nightly builds too

27 Feb 17:20
Compare
Choose a tag to compare

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

08 Feb 23:22
Compare
Choose a tag to compare

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

14 Dec 21:32
Compare
Choose a tag to compare

This release:

  • targets HHVM 3.30
  • adds SecureRandom\int(), float(), string(), and equivalents in the PseudoRandom\ namespace
  • improves performance of C\first, first_key, last, and last_key when operating on Containers

Support typed user attributes in HHVM/Hack 3.29

18 Oct 18:23
Compare
Choose a tag to compare
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