Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 454 Bytes

README.md

File metadata and controls

24 lines (18 loc) · 454 Bytes

HaSM

A simple assembly EDSL (Embedded Domain Specific Language) for Haskell, generating native code for fast runtime. It aims at being quite cross-platform.

Code example

{-# LANGUAGE QuasiQuotes #-}

import Language.HaSM

main :: IO Int
main = do
    hello_world <- asciz "Hello, world!"
    printf      <- extern "printf"

    run X86 [hasm|
        push ${hello_world}
        call ${printf}
        xor %eax, %eax
        ret
    |]