HaxeFoundation / HaxeFoundation/haxe
Possibility to run some expression level filters
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
I've been working on some tAST -> WASM generation recently: https://github.com/back2dos/wasmix
There are some filters that I would love to run a bit earlier. Most notably, when I use classes with inline constructors, the code I have still contains the constructor invocations. I was wondering if it would be possible to run *some* filters on a given `TypedExpr`? I've noticed that there seem to be ["safe filters"](https://github.com/HaxeFoundation/haxe/blob/bf4652f0234bd61a18a7ad2bddbe83ee45fbb6fc/src/filters/filters.ml#L423C5-L423C22) which appear to include inline constructors. Does "safe" mean they would be safe to run "at any time"? Or even if not, could we have some API that allows to run those which are safe from a macro by hand?
Contributor guide
Research direction
Start with src/filters/filters.ml, especially the referenced “safe filters” section, and review how filters operate on TypedExpr values. Compare that behavior with the macro and tAST-to-WASM use case described in the issue. Done would mean a decided, documented way for macros to run the appropriate expression-level filters, including inline constructors.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100