Notícias do universo Haxe

Uma pequena conferência online HaxeIn 2020 ocorreu em 14 de outubro . Um dos palestrantes foi Alexander Kuzmenko , o desenvolvedor do compilador Haxe. A palestra de

Alexander é um relato do trabalho realizado desde fevereiro de 2020 (quando ocorreu o HaxeUp Hamburg, hospedado pela Inno Games). Chamo sua atenção para uma transcrição de seu discurso.







imagem







O que foi feito nesse tempo?



benchs.haxe.org



, Haxe. , AlexHaxe.

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

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







imagem







Haxe 4.1



Haxe 4.1 ( Haxe 4.0). 4.1 :







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


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







imagem







dts2hx



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

Haxe Foundation, dts2hx ( , ).







imagem







Haxe 4.1:

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







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


imagem







SSL eval- ( Haxe) https- .

API Mbed TLS SSL ( Haxe SSL).







imagem







haxe.Exception



.

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



( ) -.

, haxe.Exception



. , , haxe.Exception



(, ), "" , haxe.Exception



. , Dynamic



(.. ) Haxe 4.1.







imagem







: Haxe haxe.CallStack



, . (rethrow exception), . ( ).







imagem







, :







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



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


imagem







catch



— , haxe.Exception



.







imagem







Tail recursion elimination



(tail recursion elimination) .

, , , ( ).

, , .







imagem







( -D analyzer_optimize



).

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

-D no_tre



.







imagem







Haxe 4.1 :







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



    (deprecated), Std.isOfType



    . is



    ( Haxe 4.2).


imagem







Haxe Evolution 2020



- Haxe Evolution, Haxe ( , , ).

. issue , .







imagem







Void



" "
(unit type). , : Void



, , , - . , Void



(Promise



), . Haxe .

, .. , , Void



, , Void



.







imagem







. AST . .







imagem







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



, . , .. , — , . , .







imagem







. , , - , , . , .







imagem







( C# Java) . , Haxe . , .







imagem







- . : , ( ); , - , .







imagem







, . Haxe — , , . , .







imagem







Haxe, . , this



( ). , . , : Haxe as



, , .







imagem







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



). , typedef



, , , .

, , , , , , , ?







imagem







this



, , . , .. . , , .







imagem







(type parameter variance of enum).

, , enum



Int



, enum



Float



( ) — , . , , , . , .

, .. — enum



, (, ). , C#, in



out



-.







imagem







Haxe 4.2



, Haxe .

Haxe 4.2. , .. , ( , ).







:

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







imagem







, . "" Java:







  • ,


Shape



, API — Shape



vertices()



, . Square



.

, - , .







imagem







sys.thread.Thread



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







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


imagem







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)



.







imagem







(, Thread.create()



, API ) , sys.thread.NoEventLoopException



.







: secondary



, , ( secondary



).







imagem







— "", , , .







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



— .







imagem









( ):







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



    @:forwardStatics



    ), Haxe 4.2 @:forward.new



    .


— 40 -.







imagem







:

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









imagem







(variance forwarding) . :

Haxe 4.1 Array<Int>



Array<Money>



, Money



— , Int



. , @:forward.variance



, "" , , Int



, Money



.







Any



, . Dynamic



, -. Any



.







imagem







, :







  • Haxe 4.2 is



    . Haxe 4.1 — . is



    Std.isOfType()



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



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


imagem







WIP



Haxe 4.2, :

API. API , API.







API C API , , API .







API , .







imagem







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







OCaml- Luv.

, Libuv ( ).







imagem









:







  • Haxe
  • haverá implementações de plataforma cruzada de tipos inteiros, como inteiros de 8 e 16 bits, com e sem sinal, etc.
  • também haverá suporte para métodos com um número variável de argumentos (argumentos restantes). O trabalho neles já havia começado, porém foi adiado.


imagem







Obrigado pela atenção! Espero que você tenha achado este material interessante.








All Articles