Hi,

Please find attached a new port of hashlink. HashLink as a format is a bytecode
target for Haxe. The HashLink virtual machine (this port) provides a runtime
for the bytecode, along with a set of libraries in the haxe .hdll format to
allow use of OpenAL, SDL2, MySQL, SSL, libui, libuv, and libfmt.

Basic functionality can be tested by building the bytecode target of the Haxe
helloworld example [1], hosted for convenience at [2].

Create the HashLink bytecode target:
$ haxe -hl helloworld.hl -main Main

Run in the virtual machine:
$ hl helloworld.hl

There are a few games that are distributed in HashLink bytecode format. The
most prominent example is the indie game Dead Cells. Here instructions on how
to run the GOG.com version [3] (Linux files) with this HashLink port:

Download the game files from GOG.com and unzip(1) the dead_cells_*.sh file.
$ cd data/noarch/game
$ rm *.so{,.*} # move any linux shared object files out of the way
$ rm *.hdll # move any .hdll binaries out of the way
$ hl

This can show that SDL/OpenAL also work. Another game distributed as HashLink
is Northgard, however it doesn't launch so far without a client for Steam.

I thought this would depend on Haxe being present somewhere, but it turns out
the HashLink virtual machine is perfectly happy to run without Haxe installed.

make port-lib-depends-check and portcheck are both happy, and the Hello World
example, as well as Dead Cells run on my testing.

A few notes about the port:

- needs USE_WXNEEDED
- port adds SO versioning to hl.so. The .hdll files also behave like shared
  object files, but I've stayed away from versioning them to avoid breaking
  compatibility.
- string.c needs a workaround to not error when a nullptr is passed to
  hl_ucs2length().

pkg/DESCR:

HashLink is a virtual machine for Haxe.

HashLink runtime includes the following features:
* Fully compatible with Haxe specification
* Support file I/O, regular expressions, network, etc.
* Unicode strings by default
* Mark-and-not-sweep Garbage Collector
* x86 and x86-64 HL/C compilation
* x86 and x86-64 HL/JIT compilation

ok?

[1] https://haxe.org/manual/introduction-hello-world.html
[2] https://thfr.info/pub/Main.hx
[3] https://www.gog.com/game/dead_cells

Attachment: hashlink.tgz
Description: Binary data

Reply via email to