Skip to content

baioc/gyred

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

27 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

GyreD

pipeline status latest version

This is a reference implementation of Gyre, a compiler IR designed as a practical "linguistic switchbox", or UNCOL.

As such, the IR should be able to efficiently accommodate many high-level languages and target architectures. In order to test this, this repository contains will contain multiple compilers using the same middle-end infrastructure.

Work In Progress

This is an early-stage prototype of an IR designed as part of my Bachelor thesis, which provides an extensive survey on compilers, portable IRs and the UNCOL solution to "the problem of programming communication with changing machines", also known as "the compiler construction problem".

If you are looking for a ready-to-use optimization framework, a full compiler, or benchmark results for any of these, come back later. In that case, I suggest using GitHub to watch this repository's releases, and/or star it so I know there are people interested. In any case, here is an example of the current IR builder API.

Still, here are some figures from my thesis, to spark your curiosity. Check out the docs for more information.

Logical structure of an optimizing compiler UNCOL as a linguistic switchbox
compiler-structure uncol-solution
Gyre subgraph with explicit concurrency Mapping of classic SSACFG constructs
gyre-fork-join gyre-vs-ssa-cfg
Memory operations in Gyre IR types and macros
gyre-state gyre-typed

Development

These are the configuration files which I use to build, test and debug this project in VSCode.

The only tool needed is DUB, but I also recommend the awesome VSCode extensions by WebFreak.

tasks.json

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "dub: Run unit tests",
            "group": {
                "kind": "test",
                "isDefault": true
            },
            "type": "shell",
            "command": "dub test --coverage",
            "problemMatcher": {
                "owner": "d",
                "fileLocation": ["relative", "${workspaceFolder}"],
                "pattern": {
                    "regexp": "^(.*)@(.*)\\((\\d+)\\):\\s+(.*)$",
                    "code": 1,
                    "file": 2,
                    "location": 3,
                    "message": 4,
                }
            },
            "presentation": {
                "echo": false,
                "clear": true,
            },
        },
        {
            "label": "dub: Build project docs",
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "type": "shell",
            "command": "dub run adrdox@2.5.2 -- . -i -o docs",
            "problemMatcher": {
                "owner": "d",
                "fileLocation": ["relative", "${workspaceFolder}"],
                "pattern": {
                    "regexp": "^(.*)\\((\\d+,\\d+)\\):\\s+(Error|Warning):\\s+(.*)$",
                    "file": 1,
                    "location": 2,
                    "severity": 3,
                    "message": 4,
                }
            },
            "presentation": {
                "echo": false,
                "clear": true,
                "reveal": "silent",
            },
        }
    ],
}

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug application",
            "type": "gdb",
            "request": "launch",
            "cwd": "${workspaceRoot}",
            "target": "gyred",
        },
        {
            "name": "Debug unittest",
            "type": "gdb",
            "request": "launch",
            "cwd": "${workspaceRoot}",
            "target": "gyred-test-unittest",
        },
    ]
}