quebex

A software analysis framework built around the QBE intermediate language

git clone https://git.8pit.net/quebex.git

 1<!--
 2SPDX-FileCopyrightText: 2025 Sören Tempel <soeren+git@soeren-tempel.net>
 3
 4SPDX-License-Identifier: GPL-3.0-only
 5-->
 6
 7## README
 8
 9A work-in-progress software analysis framework built around the [QBE] intermediate language.
10
11### Motivation
12
13Existing analysis frameworks are predominantly built around [LLVM].
14Unfortunately, LLVM is a fast moving target with constant changes and updates to its intermediate language.
15Therefore, tooling built around LLVM (e.g., [KLEE]) often requires dated LLVM versions.
16Obtaining these LLVM versions can be cumbersome and often hinders employment of these tools.
17To overcome these issues, maintainers of analysis tooling need to constantly invest time to catch-up with LLVM releases, instead of focusing on improving their analysis framework.
18
19In order to reduce maintenance burden, this project attempts to investigate utilization of another intermediate language for software analysis: [QBE].
20QBE is a much [smaller scale project][QBE vs LLVM] than LLVM and thereby offers a higher degree of stability.
21Further, QBE is much simpler than LLVM (e.g., providing fewer operations) and thereby also eases the implementation of certain analysis techniques.
22Nonetheless, there are sophisticated compiler frontends that can emit a representation in the QBE intermediate language (which can then be analyzed using quebex!).
23For example, [SCC], [cproc], or the [Hare compiler][Hare].
24
25### Status
26
27Proof of concept, not much to see here yet.
28Come back later!
29
30### Design Goals
31
32This project is intentionally written in a simple subset of the [Haskell] programming language.
33It should be usable by anyone with a basic Haskell background (e.g., as obtained by reading [Learn You a Haskell for Great Good!][learnyouahaskell]).
34Further, the project should require minimal long-term maintenance and should also support older GHC versions.
35Therefore, it uses the [GHC2021] language standard and avoids usage of additional language extensions.
36Further, whenever possible, dependencies on external libraries that are [not bundled by GHC][GHC libraries] must be avoided.
37
38### Development
39
40Code should be formatted using [ormolu][ormolu github].
41Git hooks performing several sanity checks, including ensuring the proper code formatting, are available.
42These hooks can be enabled using:
43
44	$ git config --local core.hooksPath .githooks
45
46Further, a [Guix] environment for development purposes can be obtained using:
47
48	$ guix shell -L .guix/modules/ -m .guix/manifest.scm
49
50### License
51
52This project uses the [REUSE Specification] to indicated used software license.
53
54[QBE]: https://c9x.me/compile/
55[QBE vs LLVM]: https://c9x.me/compile/doc/llvm.html
56[LLVM]: https://llvm.org/
57[KLEE]: https://klee-se.org
58[SCC]: https://www.simple-cc.org/
59[cproc]: https://sr.ht/~mcf/cproc/
60[Hare]: https://harelang.org/
61[Haskell]: https://haskell.org/
62[GHC2021]: https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/control.html#extension-GHC2021
63[GHC libraries]: https://ghc.gitlab.haskell.org/ghc/doc/libraries/index.html
64[learnyouahaskell]: https://learnyouahaskell.github.io/chapters.html
65[libriscv]: https://github.com/agra-uni-bremen/libriscv
66[ormolu github]: https://github.com/tweag/ormolu
67[REUSE Specification]: https://reuse.software/spec-3.3/
68[Guix]: https://guix.gnu.org