Internship at Haxe
1
About me
Aurel [ow - el]
2
r
Internship
4-year MEng degree
Required industrial placement
3
4
📨
can I work remotely pls?
kind regards, Aurel
5
6
7
Intern work
noun (also internship)
1 work that does not affect the productivity of the core team.
2 (also wasted time)work “for the benefit of the community”.
ORIGIN early 16th cent. (as an adjective in the sense ‘internal’): from French interne (adjective), interner (verb), from Latin internus ‘inward, internal’. Current senses date from the 19th cent.
8
Manual
9
10
11
Stdlib and Compiler
Improvements
12
Map.clear()
var map = new Map<String, Int>();�// add keys...�map = []; // clear keys
final map = new Map<String, Int>();�// add keys...�map = []; // error!
13
→ Haxe 4.0
UTC-based Date methods
date.getUTCHours();�date.getUTCMinutes();�date.getUTCSeconds();�date.getUTCFullYear();�date.getUTCMonth();�date.getUTCDate();�date.getUTCDay();�date.getTimezoneOffset();
14
→ Haxe 4.0
15
16
17
18
hxb
Binary format for serialising modules, AST, and typed AST
Specification:
github.com/Aurel300/hxb
WIP compiler branch:
github.com/HaxeFoundation/haxe/tree/hxb
19
→ Haxe 4.1 ?
asys
asynchronous system APIs
20
Current system APIs
No asynchrony (have to create threads manually)
Lacking file system functionality (e.g. chmod)
Hard-to-use TCP/UDP sockets
Hard-to-use processes
No IPC sockets
21
Solutions?
How to design the API?
How to implement it consistently across many different sys targets?
How to represent asynchrony?
22
23
24
libuv
25
26
27
eval
28
29
30
31
And similarly on HL and Neko
32
demo
Asynchronous file reading
33
demo
Asynchronous DNS and IP address manipulation
34
demo
TCP echo server
35
demo
Process communication with ffmpeg
36
demo
UDP video stream
37
asys
File system operations
TCP/UDP/IPC sockets
DNS
Processes
Message passing (including open sockets) across Haxe processes
38
soon™
39
asys
Haxe API: feedback welcome! (PR #8832)
Targets mostly finished™:� HashLink (#306)� Eval (#8831)� Neko (#201)
40
→ Haxe 4.1 ?
*
* better name?
Side project
ammer
41
42
43
Eval
Neko
HashLink
44
Eval
Neko
HashLink
45
Eval
Neko
HashLink
ammer
46
ammer
Under the hood:� Types mapped to target-native analogues� Functions accessed via automatically generated FFI� A Makefile is generated that handles native compilation (hdll, ndll)
47
ammer
API features:� Functions� Header defines� Opaque types (abstract pointers)
More planned, of course, e.g.:� Callbacks� Structs
48
ammer
Targets supported:� Eval *� HashLink� Hxcpp
Targets planned:� All sys targets!
github.com/Aurel300/ammer
49
50
Haxe
HashLink
Hxcpp
Eval
Java
Lua
…
Haxe compiler
FFI
Externs
FFI
…
Native library
ammer
demo
ammer in action!
51
Lua!
SDL?
Libuv?
OpenAL?
Dear-imgui?
52
Future work
HashLink GC
53
Thank you.
54