# \#macro

**URL:** https://community.haxe.org/tag/macro/1.md

[Latest](https://community.haxe.org/latest.md) · [Categories](https://community.haxe.org/categories.md) · [Tags](https://community.haxe.org/tags.md)

---

## [Should \`:storedTypedExpr\` be turning up in macro functions?](https://community.haxe.org/t/should-storedtypedexpr-be-turning-up-in-macro-functions/4784)

<div class="topic-metadata">

**Author:** [@0b1kn00b](https://community.haxe.org/u/0b1kn00b)\
**Replies:** 6\
**Last updated:** [March 18, 2026, 11:15am UTC](https://community.haxe.org/t/should-storedtypedexpr-be-turning-up-in-macro-functions/4784 "2026-03-18T11:15:00Z")

</div>

I’m porting a null checking macro to 5 and I’m getting metadata with a const attached rather than an expression.

---

## [Go2hx Work in Progress](https://community.haxe.org/t/go2hx-work-in-progress/2821)

<div class="topic-metadata">

**Author:** [@PXshadow](https://community.haxe.org/u/PXshadow)\
**Replies:** 26\
**Last updated:** [January 2, 2026, 1:35pm UTC](https://community.haxe.org/t/go2hx-work-in-progress/2821 "2026-01-02T13:35:29Z")

</div>

go2hx A Go to Haxe transpiler and spiritual sucessor to the Tardisgo project with notable design improvements. Improvements: AST instead of SSA types that allows much nicer looking final generated code, and less overh…

---

## [Haxe is sooo](https://community.haxe.org/t/haxe-is-sooo/4736)

<div class="topic-metadata">

**Author:** [@semmi](https://community.haxe.org/u/semmi)\
**Replies:** 0\
**Last updated:** [December 28, 2025, 3:05am UTC](https://community.haxe.org/t/haxe-is-sooo/4736 "2025-12-28T03:05:48Z")

</div>

amazing … → creating little new macro today to \`switch\` between existing typed(files) changing type and type-\\params/ Totally AWESOME \\o/^^ → https://github.com/maitag/viktor/blob/main/src/Viktor.hx#L5 (haxe my LO…

---

## [How to prevent macro from running when using vshaxe and only run when actually compiling code?](https://community.haxe.org/t/how-to-prevent-macro-from-running-when-using-vshaxe-and-only-run-when-actually-compiling-code/4723)

<div class="topic-metadata">

**Author:** [@Davvex87](https://community.haxe.org/u/Davvex87)\
**Replies:** 10\
**Last updated:** [December 23, 2025, 9:08am UTC](https://community.haxe.org/t/how-to-prevent-macro-from-running-when-using-vshaxe-and-only-run-when-actually-compiling-code/4723 "2025-12-23T09:08:53Z")

</div>

How can i prevent my macro from being called because of the haxe LSP when coding my project in vscode with vshaxe and only run the function when we actually run haxe build.hxml?

---

## [\[Solved\] Field index not found on prototype, due to macro?](https://community.haxe.org/t/solved-field-index-not-found-on-prototype-due-to-macro/4695)

<div class="topic-metadata">

**Author:** [@lithiumfluorine](https://community.haxe.org/u/lithiumfluorine)\
**Replies:** 2\
**Last updated:** [October 29, 2025, 9:05pm UTC](https://community.haxe.org/t/solved-field-index-not-found-on-prototype-due-to-macro/4695 "2025-10-29T21:05:40Z")

</div>

When I compile my project, I get this very strange compiler error: \[ERROR\] (unknown position) | Field index for SetNextWindowSize not found on prototype helios.imgui.ImGui This only happens if I compile a new file…

---

## [XML Schema Definitions handling](https://community.haxe.org/t/xml-schema-definitions-handling/4675)

<div class="topic-metadata">

**Author:** [@jankapunkt](https://community.haxe.org/u/jankapunkt)\
**Replies:** 3\
**Last updated:** [September 13, 2025, 9:49am UTC](https://community.haxe.org/t/xml-schema-definitions-handling/4675 "2025-09-13T09:49:59Z")

</div>

Hey there :waving\_hand: I am about to design my first multi-language library using hx. For that I am trying to figure out the builtin capabilities for processing XSD (XML Schema Definitions) using the standard lib. I ha…

---

## [@:native doesn't work on the Lua target](https://community.haxe.org/t/native-doesnt-work-on-the-lua-target/4640)

<div class="topic-metadata">

**Author:** [@Davvex87](https://community.haxe.org/u/Davvex87)\
**Replies:** 2\
**Last updated:** [July 20, 2025, 7:08pm UTC](https://community.haxe.org/t/native-doesnt-work-on-the-lua-target/4640 "2025-07-20T19:08:06Z")

</div>

I am writing Haxe bindings for Roblox’s Luau API for my roblox-hx library, which heavily depends on objects to run your Roblox games’ logic. While in Lua it’s generally acceptable to write fields in UpperCamelCase, this …

---

## [Help macro for safe navigate dynamics using runtime string](https://community.haxe.org/t/help-macro-for-safe-navigate-dynamics-using-runtime-string/4609)

<div class="topic-metadata">

**Author:** [@neimanpinchas](https://community.haxe.org/u/neimanpinchas)\
**Replies:** 1\
**Last updated:** [May 30, 2025, 9:56am UTC](https://community.haxe.org/t/help-macro-for-safe-navigate-dynamics-using-runtime-string/4609 "2025-05-30T09:56:18Z")

</div>

I am try to make possible and safe to navigate dynamics using runtime strings, The first is working, second not. var a:Dynamic = { b: { c: 123 } }; var aaa=safeget(a.b.c); trace(aaa); aaa…

---

## [Twinspire Web: A New Macro-oriented, HTML-first web framework](https://community.haxe.org/t/twinspire-web-a-new-macro-oriented-html-first-web-framework/4558)

<div class="topic-metadata">

**Author:** [@tienery](https://community.haxe.org/u/tienery)\
**Replies:** 4\
**Last updated:** [March 8, 2025, 12:07pm UTC](https://community.haxe.org/t/twinspire-web-a-new-macro-oriented-html-first-web-framework/4558 "2025-03-08T12:07:18Z")

</div>

Say goodbye to traditional web frameworks and say hello to compile-time HTML, React-like Component’s and more, with Twinspire Web. Twinspire Web and what it’s for Twinspire Web is a macro-based Haxe web development fram…

---

## [How to access and modify function expression from field?](https://community.haxe.org/t/how-to-access-and-modify-function-expression-from-field/4434)

<div class="topic-metadata">

**Author:** [@Davvex87](https://community.haxe.org/u/Davvex87)\
**Replies:** 5\
**Last updated:** [January 14, 2025, 9:41am UTC](https://community.haxe.org/t/how-to-access-and-modify-function-expression-from-field/4434 "2025-01-14T09:41:51Z")

</div>

I’m trying to write a macro which modifies all functions/methods from all compiled classes to inject custom code into them, but I am unable to find a way to even access the Function expression via the field.kind property…

---

## [Do @:build macros run in parallel?](https://community.haxe.org/t/do-build-macros-run-in-parallel/4491)

<div class="topic-metadata">

**Author:** [@joshtynjala](https://community.haxe.org/u/joshtynjala)\
**Replies:** 6\
**Last updated:** [December 22, 2024, 4:57pm UTC](https://community.haxe.org/t/do-build-macros-run-in-parallel/4491 "2024-12-22T16:57:03Z")

</div>

I have a couple of classes with the same @:build macro defined. Inside the macro’s code, a static variable is used to cache some data, so that it doesn’t need to be calculated over and over again. I discovered that the c…

---

## [Issue compiling with macro](https://community.haxe.org/t/issue-compiling-with-macro/4152)

<div class="topic-metadata">

**Author:** [@MemeHovy](https://community.haxe.org/u/MemeHovy)\
**Replies:** 1\
**Last updated:** [February 1, 2024, 12:35pm UTC](https://community.haxe.org/t/issue-compiling-with-macro/4152 "2024-02-01T12:35:17Z")

</div>

I made an macro to get the parameters from an function, but this error keeps showing up Uncaught exception Unexpected value VEnumValue(TDynamic(null)), expected object I don’t really understand what this is, since I do…

---

## [Issue with Haxe Macro Library - Type Name Error in Expr.hx](https://community.haxe.org/t/issue-with-haxe-macro-library-type-name-error-in-expr-hx/4089)

<div class="topic-metadata">

**Author:** [@dragsbruh](https://community.haxe.org/u/dragsbruh)\
**Replies:** 4\
**Last updated:** [November 22, 2023, 3:54pm UTC](https://community.haxe.org/t/issue-with-haxe-macro-library-type-name-error-in-expr-hx/4089 "2023-11-22T15:54:43Z")

</div>

THIS IS A MISTAKE ISSUE RESOLVED PLEASE GO BACK I’m currently an issue which is apparently with the Haxe macro library, in Expr.hx (C:\\HaxeToolkit\\haxe\\std/haxe/macro/Expr.hx:720). The error message is indicating that “…

---

## [Compile time module discovery and import in haxe](https://community.haxe.org/t/compile-time-module-discovery-and-import-in-haxe/4087)

<div class="topic-metadata">

**Author:** [@dragsbruh](https://community.haxe.org/u/dragsbruh)\
**Replies:** 2\
**Last updated:** [November 21, 2023, 5:33pm UTC](https://community.haxe.org/t/compile-time-module-discovery-and-import-in-haxe/4087 "2023-11-21T17:33:13Z")

</div>

I am trying to make a command line tool like powershell except its too limited to commands. I plan to store each command related file in a separate module because the commands are going to be niche and long. The file str…

---

## [Pecan coroutines](https://community.haxe.org/t/pecan-coroutines/2885)

<div class="topic-metadata">

**Author:** [@Aurel300](https://community.haxe.org/u/Aurel300)\
**Replies:** 7\
**Last updated:** [April 26, 2023, 3:41pm UTC](https://community.haxe.org/t/pecan-coroutines/2885 "2023-04-26T15:41:21Z")

</div>

Hey all, pecan is a macro-based library for Haxe that lets you write coroutines, which are functions that can suspend their execution at any point: var co = pecan.Co.co({ while (true) trace('Hello, ${accept()}!')…

---

## [Help creating a macro to forward operator overloads \[SOLVED I GUESS?\]](https://community.haxe.org/t/help-creating-a-macro-to-forward-operator-overloads-solved-i-guess/3925)

<div class="topic-metadata">

**Author:** [@kvbc](https://community.haxe.org/u/kvbc)\
**Replies:** 4\
**Last updated:** [April 23, 2023, 6:03pm UTC](https://community.haxe.org/t/help-creating-a-macro-to-forward-operator-overloads-solved-i-guess/3925 "2023-04-23T18:03:25Z")

</div>

Consider the following code package; @:transitive abstract A(Int) from Int to Int { @:op(A + B) private function add (other: A): A { return (this: Int) + (other: Int); } } // here something like @:…

---

## [Haxe Delegates 1.0.0 Release: Faster Type-Safe Function Types](https://community.haxe.org/t/haxe-delegates-1-0-0-release-faster-type-safe-function-types/3908)

<div class="topic-metadata">

**Author:** [@thispolo](https://community.haxe.org/u/thispolo)\
**Replies:** 0\
**Last updated:** [March 22, 2023, 9:30am UTC](https://community.haxe.org/t/haxe-delegates-1-0-0-release-faster-type-safe-function-types/3908 "2023-03-22T09:30:13Z")

</div>

Hi All, Following on from this topic I created several months ago (thanks life), I am happy to announce a first major release with a majority of the original problems fixed. You can find it here: Please feel free to …

---

## [Finalization macro](https://community.haxe.org/t/finalization-macro/3853)

<div class="topic-metadata">

**Author:** [@acarioni](https://community.haxe.org/u/acarioni)\
**Replies:** 2\
**Last updated:** [February 14, 2023, 1:46pm UTC](https://community.haxe.org/t/finalization-macro/3853 "2023-02-14T13:46:31Z")

</div>

I have an expression macro that collects some data and save them in a global variable. When the compilation is done, I want to write the variable’s contents to a file. Is there something like an “onCompilationDone” hook…

---

## [Macro to generate nested Lua tables from typedef](https://community.haxe.org/t/macro-to-generate-nested-lua-tables-from-typedef/3795)

<div class="topic-metadata">

**Author:** [@danielo515](https://community.haxe.org/u/danielo515)\
**Replies:** 0\
**Last updated:** [December 10, 2022, 9:21am UTC](https://community.haxe.org/t/macro-to-generate-nested-lua-tables-from-typedef/3795 "2022-12-10T09:21:51Z")

</div>

Hello. I think I will start this post with a clear code example of what I want to achieve. I want to have this code as input: typedef Job\_opts = { final command:String; final cwd:Null\<String\>; final argume…

---

## [Haxe Injection 3.0.0 released -- A dependency container for Haxe](https://community.haxe.org/t/haxe-injection-3-0-0-released-a-dependency-container-for-haxe/3728)

<div class="topic-metadata">

**Author:** [@thispolo](https://community.haxe.org/u/thispolo)\
**Replies:** 0\
**Last updated:** [October 23, 2022, 1:05pm UTC](https://community.haxe.org/t/haxe-injection-3-0-0-released-a-dependency-container-for-haxe/3728 "2022-10-23T13:05:19Z")

</div>

Hi all, Just published the latest version of my dependency container for Haxe similar to the .NET container or Google’s Wire, creatively named Haxe-Injection: I have been using and developing this container as part of…

---

## [Macro that expands to a block expression](https://community.haxe.org/t/macro-that-expands-to-a-block-expression/3701)

<div class="topic-metadata">

**Author:** [@neimanpinchas](https://community.haxe.org/u/neimanpinchas)\
**Replies:** 3\
**Last updated:** [September 30, 2022, 5:49pm UTC](https://community.haxe.org/t/macro-that-expands-to-a-block-expression/3701 "2022-09-30T17:49:05Z")

</div>

Hi I am trying to make eaiser to use optional arguments with default values non constant, I am trying my luck with macros however i couldnt find in the documentation how to generate a block expr from a string code this …

---

## [\[Echo\] Am I using the macro correctly?](https://community.haxe.org/t/echo-am-i-using-the-macro-correctly/3643)

<div class="topic-metadata">

**Author:** [@Tekkunsan](https://community.haxe.org/u/Tekkunsan)\
**Replies:** 0\
**Last updated:** [August 22, 2022, 2:32am UTC](https://community.haxe.org/t/echo-am-i-using-the-macro-correctly/3643 "2022-08-22T02:32:17Z")

</div>

So I want to add an isOnFloor data to the body using the example --macro echo.Macros.add\_data("isOnFloor", "Bool") but when I try to access it I get an error: This is the hxml file if it will help -cp src -lib hea…

---

## [Haxe Macro book](https://community.haxe.org/t/haxe-macro-book/1978)

<div class="topic-metadata">

**Author:** [@filt3rek](https://community.haxe.org/u/filt3rek)\
**Replies:** 9\
**Last updated:** [July 23, 2022, 1:40am UTC](https://community.haxe.org/t/haxe-macro-book/1978 "2022-07-23T01:40:19Z")

</div>

Hej all ! I try to improve my understanding of macros in Haxe. I write macros since 2011, I’m not a specialist but I success to do almost all I want and have a quite good understanding of the basis but I still need to u…

---

## [Macro basics: Add a function by \`@:build\`](https://community.haxe.org/t/macro-basics-add-a-function-by-build/3550)

<div class="topic-metadata">

**Author:** [@AlienBuchner](https://community.haxe.org/u/AlienBuchner)\
**Replies:** 2\
**Last updated:** [May 30, 2022, 1:42pm UTC](https://community.haxe.org/t/macro-basics-add-a-function-by-build/3550 "2022-05-30T13:42:39Z")

</div>

I would like to generate functions via macros. So it’s almost like here in the manual, but I can’t seem to get the syntax right. (Actually what I’m trying to do with this in the end is I need to know whenever there has b…

---

## [Best method for evaluating Expr/TypedExpr during Initialization Macro?](https://community.haxe.org/t/best-method-for-evaluating-expr-typedexpr-during-initialization-macro/3540)

<div class="topic-metadata">

**Author:** [@RoBBoR](https://community.haxe.org/u/RoBBoR)\
**Replies:** 2\
**Last updated:** [May 13, 2022, 9:22am UTC](https://community.haxe.org/t/best-method-for-evaluating-expr-typedexpr-during-initialization-macro/3540 "2022-05-13T09:22:32Z")

</div>

I’m looking to evaluate an expression generated at compile-time (specifically during an initialization macro call). Something like: var e = macro { final a = "test"; a; }; eval(e); // test While I could use the exp…

---

## [Haxe to OCaml](https://community.haxe.org/t/haxe-to-ocaml/3529)

<div class="topic-metadata">

**Author:** [@rainy](https://community.haxe.org/u/rainy)\
**Replies:** 6\
**Last updated:** [May 1, 2022, 7:16am UTC](https://community.haxe.org/t/haxe-to-ocaml/3529 "2022-05-01T07:16:13Z")

</div>

I’m trying to use haxe to compile to Ocaml, and then from Ocaml to native code. At present, I have implemented some compilation contents. Github:GitHub - rainyt/ocaml-haxe: 使用Haxe编写OCaml代码

---

## [Python-ext Extended support for Python targets](https://community.haxe.org/t/python-ext-extended-support-for-python-targets/3519)

<div class="topic-metadata">

**Author:** [@rainy](https://community.haxe.org/u/rainy)\
**Replies:** 2\
**Last updated:** [April 20, 2022, 7:08am UTC](https://community.haxe.org/t/python-ext-extended-support-for-python-targets/3519 "2022-04-20T07:08:37Z")

</div>

Extended support for Python targets. :slightly\_smiling\_face:

---

## [Macro: How to count the number of callback function parameters?](https://community.haxe.org/t/macro-how-to-count-the-number-of-callback-function-parameters/3513)

<div class="topic-metadata">

**Author:** [@cambiata](https://community.haxe.org/u/cambiata)\
**Replies:** 3\
**Last updated:** [April 7, 2022, 1:55pm UTC](https://community.haxe.org/t/macro-how-to-count-the-number-of-callback-function-parameters/3513 "2022-04-07T13:55:50Z")

</div>

I need to check the number of parameters for callback functions, and doing it when using an inline arrow function works fine. Try Haxe ! However, I don’t know how to do the same thing when passing a standard function re…

---

## [Building Functions using private types in a macro](https://community.haxe.org/t/building-functions-using-private-types-in-a-macro/3473)

<div class="topic-metadata">

**Author:** [@EliteMasterEric](https://community.haxe.org/u/EliteMasterEric)\
**Replies:** 2\
**Last updated:** [February 19, 2022, 6:18pm UTC](https://community.haxe.org/t/building-functions-using-private-types-in-a-macro/3473 "2022-02-19T18:18:29Z")

</div>

I am working on a macro which builds overrides to the functions of the target’s superclasses by recursively creating adding new functions with the AOverride access for each function in the parent classes. This works for …

---

## [Difficulties Getting Haxe to Compile to a Blender Plugin](https://community.haxe.org/t/difficulties-getting-haxe-to-compile-to-a-blender-plugin/1380)

<div class="topic-metadata">

**Author:** [@zicklag](https://community.haxe.org/u/zicklag)\
**Replies:** 6\
**Last updated:** [December 30, 2021, 3:00am UTC](https://community.haxe.org/t/difficulties-getting-haxe-to-compile-to-a-blender-plugin/1380 "2021-12-30T03:00:18Z")

</div>

I’m trying to get Haxe to work for writing Blender plugins, specifically so that we can write the Armory Blender plugin in Haxe ( and if I ever write my own Blender plugin, I’d want to write it in Haxe, obviously …

[Next page](https://community.haxe.org/tag/macro/1.md?match_all_tags=true&page=1&tags%5B%5D=macro)
