| 1 |
# Rationale |
| 2 |
|
| 3 |
[Meson doesn't support user defined |
| 4 |
functions](https://mesonbuild.com/FAQ.html#why-doesnt-meson-have-user-defined-functionsmacros) |
| 5 |
as one of its core principles. Why would muon relax this limitation? Partially |
| 6 |
because I believe that careful implementation of user defined functionality |
| 7 |
would not be harmful. We have seen meson scripts can get |
| 8 |
[plenty](https://github.com/xorvoid/meson-brainfuck) |
| 9 |
[complex](https://github.com/annacrombie/meson-raytracer) anyways. The main |
| 10 |
reason however, is that requiring every last bit of functionality to be |
| 11 |
implemented in the build system itself is fundamentally untenable, especially |
| 12 |
if the build system will support multiple implementations. |
| 13 |
|
| 14 |
- Many meson modules are effectively reusable chunks of meson code (calls to |
| 15 |
dependency, custom\_target, etc.), so it is not necessary to access things |
| 16 |
that a native module has access to like the interpreter state. |
| 17 |
- Lowering the bar for module contributions (this is important because they |
| 18 |
often involve specific tools I have no experience with/interest in). |
| 19 |
- Potential to some day share module code with other meson implementations. |
| 20 |
|
| 21 |
That last point is a bit pie in the sky, but at least this makes it technically |
| 22 |
possible from muon's point of view and proves that it has value. |