# Haxe 4.2.0 is released!

**URL:** https://community.haxe.org/t/haxe-4-2-0-is-released/2888
**Category:** Announcements
**Tags:** release
**Created:** [February 9, 2021, 12:57pm UTC](https://community.haxe.org/t/haxe-4-2-0-is-released/2888 "2021-02-09T12:57:17Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![RealyUniqueName](https://community.haxe.org/user_avatar/community.haxe.org/realyuniquename/32/10_2.png) [@RealyUniqueName](https://community.haxe.org/u/RealyUniqueName)
#### Post date: [February 9, 2021, 12:57pm UTC](https://community.haxe.org/t/haxe-4-2-0-is-released/2888/1 "2021-02-09T12:57:17Z")

</div>

Dear Community,

On behalf of the Haxe Foundation, we are proud to announce the official release of Haxe 4.2.0!

It is available along with the changelog at [https://haxe.org/download/version/4.2.0/](https://haxe.org/download/version/4.2.0/)

Here are the most notable features made into this release:

- Module-level fields (see [blog post](https://haxe.org/blog/module-level-fields/))

- “Classic” abstract classes and functions (see [haxe-evolution proposal](https://github.com/HaxeFoundation/haxe-evolution/blob/master/proposals/0012-abstract-classes.md#abstract-classes))

- Rest arguments (variadic functions) for all targets (see the doc for [`haxe.Rest`](https://github.com/HaxeFoundation/haxe/blob/844cbe6e907418a950d4c685a06743546c01afb1/std/haxe/Rest.hx#L8))

- many other features (see changelog)

Haxe 4.2.0 also includes dozens of other additions, optimizations, improvements, and bugfixes.

Check out the changelog for more information.

If you have any suggestions or run into any problems, absolutely [open an issue on GitHub](https://github.com/HaxeFoundation/haxe/issues).

Thanks to everyone involved!

---

<div class="post-metadata">

### Author: ![RealyUniqueName](https://community.haxe.org/user_avatar/community.haxe.org/realyuniquename/32/10_2.png) [@RealyUniqueName](https://community.haxe.org/u/RealyUniqueName)
#### Post date: [February 9, 2021, 12:57pm UTC](https://community.haxe.org/t/haxe-4-2-0-is-released/2888/2 "2021-02-09T12:57:35Z")

</div>



---

<div class="post-metadata">

### Author: ![davidbruce](https://community.haxe.org/user_avatar/community.haxe.org/davidbruce/32/555_2.png) [@davidbruce](https://community.haxe.org/u/davidbruce)
#### Post date: [February 9, 2021, 6:41pm UTC](https://community.haxe.org/t/haxe-4-2-0-is-released/2888/3 "2021-02-09T18:41:59Z")

</div>

I absolutely love module-level fields, fantastic release everyone.

Could you shed some more light on the following:

> - jvm : added `-D jvm.dynamic-level` to control the amount of dynamic support code being generated. 0 = none, 1 = field read/write optimization (default), 2 = compile-time method closures

---

<div class="post-metadata">

### Author: ![Simn](https://community.haxe.org/user_avatar/community.haxe.org/simn/32/388_2.png) [@Simn](https://community.haxe.org/u/Simn)
#### Post date: [February 9, 2021, 7:44pm UTC](https://community.haxe.org/t/haxe-4-2-0-is-released/2888/4 "2021-02-09T19:44:02Z")

</div>

This is in the context of dynamic access to methods. Each class generates a `_hx_getField` method for read-access, which you can pretend looks something like this:

```haxe
return switch (fieldName) {
    #if (jvm.dynamic_level >= 1)
    case "someVariable": this.someVariable;
    #end
    #if (jvm.dynamic_level >= 2)
    case "someMethod": new CurrentClass_someMethod(this);
    #else
    case "someMethod": haxe.jvm.Jvm.readFieldClosure(this, "someMethod", [argumentTypes]);
    #end
    default: // Slow dynamic default routing
}

```

In other words, with a level \>= 2 you’ll get a compile-time closure instance for every method. This can make things faster in highly dynamic code, but it definitely makes the output much bigger.

---

<div class="post-metadata">

### Author: ![00.Archer](https://avatars.discourse-cdn.com/v2/letter/0/45deac/32.png) [@00.Archer](https://community.haxe.org/u/00.Archer)
#### Post date: [February 9, 2021, 9:45pm UTC](https://community.haxe.org/t/haxe-4-2-0-is-released/2888/5 "2021-02-09T21:45:10Z")

</div>

Congrats on the release. It’s very pleasant to write code in Haxe, and I think module-level functions is a good addition.

I hope the tooling and libraries get updated soon.

---

<div class="post-metadata">

### Author: ![postite](https://community.haxe.org/user_avatar/community.haxe.org/postite/32/320_2.png) [@postite](https://community.haxe.org/u/postite)
#### Post date: [February 9, 2021, 9:50pm UTC](https://community.haxe.org/t/haxe-4-2-0-is-released/2888/6 "2021-02-09T21:50:05Z")

</div>

thanks for all the good work !

---

<div class="post-metadata">

### Author: ![teotigraphix](https://community.haxe.org/user_avatar/community.haxe.org/teotigraphix/32/916_2.png) [@teotigraphix](https://community.haxe.org/u/teotigraphix)
#### Post date: [February 10, 2021, 6:49pm UTC](https://community.haxe.org/t/haxe-4-2-0-is-released/2888/7 "2021-02-10T18:49:27Z")

</div>

Those are some nice language features added, cool.

Haxe really has potential in the next couple years to show it’s mature and robust.

We all should show some love to the compiler devs, it’s plumbing. 🙂

Thanks @Simn !

---

<div class="post-metadata">

### Author: ![davidbruce](https://community.haxe.org/user_avatar/community.haxe.org/davidbruce/32/555_2.png) [@davidbruce](https://community.haxe.org/u/davidbruce)
#### Post date: [February 10, 2021, 8:13pm UTC](https://community.haxe.org/t/haxe-4-2-0-is-released/2888/8 "2021-02-10T20:13:41Z")

</div>

Thanks for breaking that down. 😀

---

<div class="post-metadata">

### Author: ![parallax](https://community.haxe.org/user_avatar/community.haxe.org/parallax/32/1726_2.png) [@parallax](https://community.haxe.org/u/parallax)
#### Post date: [February 11, 2021, 4:23pm UTC](https://community.haxe.org/t/haxe-4-2-0-is-released/2888/9 "2021-02-11T16:23:42Z")

</div>

Great update. 🥳 A great thanks to everybody. 😀
