Una pequeña conferencia en línea HaxeIn 2020 tuvo lugar el 14 de octubre . Uno de los oradores fue Alexander Kuzmenko , el desarrollador del compilador Haxe. La charla de
Alexander es un relato del trabajo realizado desde febrero de 2020 (cuando tuvo lugar HaxeUp Hamburg organizado por Inno Games). Traigo a su atención una transcripción de su discurso.
¿Qué se ha hecho en el tiempo transcurrido?
benchs.haxe.org
, Haxe. , AlexHaxe.
https://benchs.haxe.org/, — github.
, . Haxe — , JVM - ( , ). , , .
Haxe 4.1
Haxe 4.1 ( Haxe 4.0). 4.1 :
- JVM ( JVM ). , .
- SSL Haxe (eval-)
- . , . .
- , , .
, Haxe 4.1 , , . ( ), Haxe 4.1 IDE.
dts2hx
2 Haxe 4.1 dts2hx — TypeScript Haxe-, JavaScript. , JavaScript-.
Haxe Foundation, dts2hx ( , ).
Haxe 4.1:
JVM-. — - ( pull request ), .. - — Java-. ( ), , , , , Haxe- JVM - Java. JVM- — Haxe, :
- Java, ,
- Haxe - JVM, JavaScript-
- . — jar-
- JVM — , Haxe. , , Java — ( ). , formatter ( formatter ) JVM- .
SSL eval- ( Haxe) https- .
API Mbed TLS SSL ( Haxe SSL).
haxe.Exception
.
(, , , ). Haxe 4.1 (.. ), haxe.Exception
( ) -.
, haxe.Exception
. , , haxe.Exception
(, ), "" , haxe.Exception
. , Dynamic
(.. ) Haxe 4.1.
: Haxe haxe.CallStack
, . (rethrow exception), . ( ).
, :
- . , - ( ), ,
-
haxe.Exception
. , Haxe - . , Haxe jar jar Java, , Haxe-, Java- - .
catch
— , haxe.Exception
.
Tail recursion elimination
(tail recursion elimination) .
, , , ( ).
, , .
( -D analyzer_optimize
).
, (inline), (final) . , ( ).
-D no_tre
.
Haxe 4.1 :
- ,
- Null- (Null Safety) — StrictThreaded, , . Strict- , .
- , ( JavaScript Source Maps) — .
-
Std.is
(deprecated),Std.isOfType
.is
( Haxe 4.2).
Haxe Evolution 2020
- Haxe Evolution, Haxe ( , , ).
. issue , .
— Void
" " (unit type). , : Void
, , , - . , Void
(Promise
), . Haxe .
, .. , , Void
, , Void
.
, Haxe , — . . , : , @.haxe.meta.MetadataType
, . , .. , — , . , .
- . : , ( ); , - , .
Haxe, . , this
( ). , . , : Haxe as
, , .
- (generic types) . , (, ) - (, String
). , typedef
, , , .
, , , , , , , ?
this
, , . , .. . , , .
(type parameter variance of enum).
, , enum
Int
, enum
Float
( ) — , . , , , . , .
, .. — enum
, (, ). , C#, in
out
-.
Haxe 4.2
, Haxe .
Haxe 4.2. , .. , ( , ).
:
(Module-level static fields), , - . , , . , .
, . "" Java:
- ,
Shape
, API — Shape
vertices()
, . Square
.
, - , .
sys.thread.Thread
Haxe 4.2 ( , ) — (event loops) ( NodeJS libuv):
- ,
- . , - (callback)
- , .. Haxe 4.2, , , . Haxe 4.2 , .
API sys.thread.Thread
— Thread.createWithEventLoop()
, , . , , , , :
, :
secondary.events.run(() -> { trace(‘This is printed from the secondary thread’); });
, secondary
.
, , , secondary
, , :
mainThread.events.run(() -> { trace(‘This is printed from the main thread’); });
( ).
, .. Haxe , secondary
, , , secondary
. Sys.sleep(2)
.
(, Thread.create()
, API ) , sys.thread.NoEventLoopException
.
: secondary
, , ( secondary
).
— "", , , .
: "" , , ( , ) . , , , , , Sys.sleep(2)
— .
( ):
- ( )
- (variance forwarding), "" (underlying type)
- (constructor forwarding). Haxe 4.1 (
@:forward
@:forwardStatics
), Haxe 4.2@:forward.new
.
:
, (transitive casting), @:transitive
. .
("" ). Haxe 4.1 (Array<Int>
) , Collection
. , Collection
Array<Int>
( Items
). Haxe 4.2 ( ) — @:transitive
Collection
, Items
, , Collection
Array<Int>
(.. Items
Array<Int>
):
var collection:Collection = [123];
, Array<Int>
Collection
:
var array:Array<Int> = collection;
(variance forwarding) . :
Haxe 4.1 Array<Int>
Array<Money>
, Money
— , Int
. , @:forward.variance
, "" , , Int
, Money
.
Any
, . Dynamic
, -. Any
.
, :
- Haxe 4.2
is
. Haxe 4.1 — .is
Std.isOfType()
( ), . - Python API —
sys.thread.Thread
. - (object inlining). . , , , .
- . , , 2- Haxe ( 1 2). , , , , .
WIP
Haxe 4.2, :
API. API , API.
API C API , , API .
API , .
API Libuv, Haxe (eval-), API Libuv , .
OCaml- Luv.
, Libuv ( ).
:
- Haxe
- Habrá implementaciones multiplataforma de tipos enteros como enteros de 8 y 16 bits, firmados y sin firmar, etc.
- también habrá soporte para métodos con un número variable de argumentos (resto de argumentos). El trabajo en ellos ya había comenzado, sin embargo, se pospuso.
¡Gracias por la atención! Espero que este material le haya resultado interesante.