Debian Codegraph @

subprojects/meson-docs/docs/markdown/Use-of-Python.md

raw
1 # Use of Python
2
3 Meson is implemented in Python. This has both positive and negative
4 sides. The main thing people seem to be mindful about is the
5 dependency on Python to build source code. This page discusses various
6 aspects of this problem.
7
8 # Dependency hell
9
10 There have been many Python programs that are difficult to maintain on
11 multiple platforms. The reasons come mostly from dependencies. The
12 program may use dependencies that are hard to compile on certain
13 platforms, are outdated, conflict with other dependencies, not
14 available on a given Python version and so on.
15
16 Meson avoids dependency problems with one simple rule: Meson is not
17 allowed to have any dependencies outside the Python basic library. The
18 only thing you need is Python 3 (and possibly Ninja).
19
20 ## Reimplementability
21
22 Meson has been designed in such a way that the implementation language
23 is never exposed in the build definitions. This makes it possible (and
24 maybe even easy) to reimplement Meson in any other programming
25 language. There are currently no plans to reimplement Meson, but we
26 will make sure that Python is not exposed inside the build
27 definitions.
28
29 ## Cross platform tooling
30
31 There is no one technical solution or programming language that works
32 natively on all operating systems currently in use. When Autotools was
33 designed in the late 80s, Unix shell was available pretty much
34 anywhere. This is no longer the case.
35
36 It is also the case that as any project gets larger, sooner or later
37 it requires code generation, scripting or other tooling. This seems to
38 be inevitable. Because there is no scripting language that would be
39 available everywhere, these tools either need to be rewritten for each
40 platform (which is a lot of work and is prone to errors) or the
41 project needs to take a dependency on _something_.
42
43 Any project that uses Meson (at least the current version) can rely on
44 the fact that Python 3 will always be available, because you can't
45 compile the project without it. All tooling can then be done in Python
46 3 with the knowledge that it will run on any platform without any
47 extra dependencies (modulo the usual porting work). This reduces
48 maintenance effort on multiplatform projects by a fair margin.