-
The official Haxe sources:
- https://haxe.org/manual/macro.html
- http://api.haxe.org/haxe/macro/
- http://code.haxe.org/category/macros/
Getting better all the time, this is the definitive guide though quite meaty and requires a good couple of passes before things make sense. Learn from simple examples and practicing, use the manual as a reference.
-
Macronauts: Macro workshop
https://github.com/macronauts/haxe-macro-workshop-2015
Learning Macros by just-doing-it playground examples -
Underscorediscovery: haxe: compile time macros
http://notes.underscorediscovery.com/haxe-compile-time-macros/
Complex code rejection is explained in simple words. With some concrete examples of macro expressions. -
Andi Li: Everything in Haxe is an expression:
http://blog.onthewings.net/2012/10/14/haxe-tips-everything-is-an-expression/
This guide is a really helpful understanding that everything is an expression in haxe. This makes macros make a lot more sense for me. -
Mark Knol: custom autocompletion with macros
http://blog.stroep.nl/2014/01/haxe-macros/
An example of using macros to populate code for the compiler so it can code complete things that it wouldn't be able to otherwise. -
Mark Knol: conditional compilation values using macro function.
http://blog.stroep.nl/2015/05/compiler-define-values-using-macro-functions/
This post is about grabbing conditional compilation values and print them in the output context using a macro function. Then we can use it at runtime. -
Mark Weber: lots of simple macro snippet examples
https://github.com/MarcWeber/haxe-macro-examples/blob/master/Macro.hx
A simple and useful reference for getting some ideas and introduction to the concepts behind the macro code, the different macro contexts and their uses. -
Dan Korostelev writes about macros for tolerant JSON code
http://nadako.tumblr.com/post/77106860013/using-haxe-macros-as-syntax-tolerant-position-aware
A look at "Using haxe macros as syntax-tolerant, position-aware json parser" with example code. -
Creating a Code Profiler in Haxe Using Macros
http://hamaluik.com/posts/creating-a-code-profiler-in-haxe-using-macros/
Bringing in the Macro to get handy code profilertool. Has nice insights about build macros, how to inject specific code blocks. -
Haxe forum: back2dos explains how it works
https://groups.google.com/d/msg/haxelang/jEEh1hd81_w/fEy8m42IRtUJ
A very clear explanation on how macros exactly work. From haxe code to the macro context to the output context in a easy to follow example. -
Haxe macro: copying expressions from another Type
http://www.kevinresol.com/2015-11-26/haxe-macro-copying-expressions-from-another-type/
A possibly interesting use-case is that Haxe doesn’t inline your function even you marked it as inline, if you try to store the function in a variable. With this macro it copies a function body into some place.
Last active
February 24, 2024 15:07
-
-
Save markknol/2776beb30a3acab93394 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment