Madeleine Sydney Ślaga c5f6ad4573
Some checks failed
build / build (push) Failing after 29s
wip: qq
2026-04-24 12:16:43 -06:00
2023-01-05 14:07:51 +01:00
nix
2026-04-24 12:16:43 -06:00
2022-07-03 17:18:37 +02:00
2026-04-24 12:16:43 -06:00
2022-07-03 18:22:26 +02:00
2026-04-24 08:54:34 -06:00
2026-04-24 08:54:34 -06:00
2022-07-10 22:29:01 +02:00
nix
2026-04-24 12:16:43 -06:00
nix
2026-04-24 12:16:43 -06:00
🌅
2022-07-01 15:21:26 +02:00
2026-04-24 12:16:43 -06:00
2026-04-24 12:16:43 -06:00

qbe-hs

fork of qbe-hs

Hackage builds.sr.ht status

Haskell types and prettyprinter for the IL of the QBE compiler backend

Example

helloWorld :: Program
helloWorld = Program [] [helloString] [helloMain]
  where
    helloString = DataDef [] "str" Nothing
      [ FieldExtTy Byte $ String "hello world" :| []
      , FieldExtTy Byte $ Const (CInt False 0) :| []
      ]
    helloMain = FuncDef [Export] (Just $ AbiBaseTy Word) "main"
      Nothing [] NoVariadic $
      Block "start"
        []
        [ Call (Just ("r", AbiBaseTy Word)) (ValGlobal "puts")
            Nothing
            [Arg (AbiBaseTy Long) $ ValGlobal "str"]
            []
        ]
        (Ret $ Just $ ValConst $ CInt False 0)
      :| []

Gets rendered to

data $str =
{b "hello world", b 0}
export
function w $main () {
@start
    %r =w call $puts (l $str)
    ret 0
}

Contributing

You can send patches to my public-inbox mailing list or to any of the contacts listed at fgaz.me/about. Or you can send a pull request to the GitHub mirror.

Issues are tracked at https://todo.sr.ht/~fgaz/qbe-hs

Description
No description provided
Readme BSD-3-Clause 116 KiB
Languages
Haskell 90.6%
Nix 9.4%