Noticias del universo Haxe

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.







imagen







¿Qué se ha hecho en el tiempo transcurrido?



benchs.haxe.org



, Haxe. , AlexHaxe.

https://benchs.haxe.org/, — github.

, . Haxe — , JVM - ( , ). , , .







imagen







Haxe 4.1



Haxe 4.1 ( Haxe 4.0). 4.1 :







  • JVM ( JVM ). , .
  • SSL Haxe (eval-)
  • . , . .
  • , , .


, Haxe 4.1 , , . ( ), Haxe 4.1 IDE.







imagen







dts2hx



2 Haxe 4.1 dts2hx — TypeScript Haxe-, JavaScript. , JavaScript-.

Haxe Foundation, dts2hx ( , ).







imagen







Haxe 4.1:

JVM-. — - ( pull request ), .. - — Java-. ( ), , , , , Haxe- JVM - Java. JVM- — Haxe, :







  • Java, ,
  • Haxe - JVM, JavaScript-
  • . — jar-
  • JVM — , Haxe. , , Java — ( ). , formatter ( formatter ) JVM- .


imagen







SSL eval- ( Haxe) https- .

API Mbed TLS SSL ( Haxe SSL).







imagen







haxe.Exception



.

(, , , ). Haxe 4.1 (.. ), haxe.Exception



( ) -.

, haxe.Exception



. , , haxe.Exception



(, ), "" , haxe.Exception



. , Dynamic



(.. ) Haxe 4.1.







imagen







: Haxe haxe.CallStack



, . (rethrow exception), . ( ).







imagen







, :







  • . , - ( ), ,
  • haxe.Exception



    . , Haxe
  • . , Haxe jar jar Java, , Haxe-, Java- - .


imagen







catch



— , haxe.Exception



.







imagen







Tail recursion elimination



(tail recursion elimination) .

, , , ( ).

, , .







imagen







( -D analyzer_optimize



).

, (inline), (final) . , ( ).

-D no_tre



.







imagen







Haxe 4.1 :







  • ,
  • Null- (Null Safety) — StrictThreaded, , . Strict- , .
  • , ( JavaScript Source Maps) — .
  • Std.is



    (deprecated), Std.isOfType



    . is



    ( Haxe 4.2).


imagen







Haxe Evolution 2020



- Haxe Evolution, Haxe ( , , ).

. issue , .







imagen







Void



" "
(unit type). , : Void



, , , - . , Void



(Promise



), . Haxe .

, .. , , Void



, , Void



.







imagen







. AST . .







imagen







, Haxe , — . . , : , @.haxe.meta.MetadataType



, . , .. , — , . , .







imagen







. , , - , , . , .







imagen







( C# Java) . , Haxe . , .







imagen







- . : , ( ); , - , .







imagen







, . Haxe — , , . , .







imagen







Haxe, . , this



( ). , . , : Haxe as



, , .







imagen







- (generic types) . , (, ) - (, String



). , typedef



, , , .

, , , , , , , ?







imagen







this



, , . , .. . , , .







imagen







(type parameter variance of enum).

, , enum



Int



, enum



Float



( ) — , . , , , . , .

, .. — enum



, (, ). , C#, in



out



-.







imagen







Haxe 4.2



, Haxe .

Haxe 4.2. , .. , ( , ).







:

(Module-level static fields), , - . , , . , .







imagen







, . "" Java:







  • ,


Shape



, API — Shape



vertices()



, . Square



.

, - , .







imagen







sys.thread.Thread



Haxe 4.2 ( , ) — (event loops) ( NodeJS libuv):







  • ,
  • . , - (callback)
  • , .. Haxe 4.2, , , . Haxe 4.2 , .


imagen







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)



.







imagen







(, Thread.create()



, API ) , sys.thread.NoEventLoopException



.







: secondary



, , ( secondary



).







imagen







— "", , , .







: "" , , ( , ) . , , , , , Sys.sleep(2)



— .







imagen









( ):







  • ( )
  • (variance forwarding), "" (underlying type)
  • (constructor forwarding). Haxe 4.1 (@:forward



    @:forwardStatics



    ), Haxe 4.2 @:forward.new



    .


— 40 -.







imagen







:

, (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;









imagen







(variance forwarding) . :

Haxe 4.1 Array<Int>



Array<Money>



, Money



— , Int



. , @:forward.variance



, "" , , Int



, Money



.







Any



, . Dynamic



, -. Any



.







imagen







, :







  • Haxe 4.2 is



    . Haxe 4.1 — . is



    Std.isOfType()



    ( ), .
  • Python API — sys.thread.Thread



    .
  • (object inlining). . , , , .
  • . , , 2- Haxe ( 1 2). , , , , .


imagen







WIP



Haxe 4.2, :

API. API , API.







API C API , , API .







API , .







imagen







API Libuv, Haxe (eval-), API Libuv , .







OCaml- Luv.

, Libuv ( ).







imagen









:







  • 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.


imagen







¡Gracias por la atención! Espero que este material le haya resultado interesante.








All Articles