Skip to content

irutil: add stdlib package for C standard library declarations #188

@mewmew

Description

@mewmew

As suggested in #187 (comment):

I would say the biggest difficulty was the C standard library - it would be super cool to have a stdlib package, with bindings to the standard library. In the compiler/builtins.go file I wrote out the function signatures for a bit of the stdlib, but it would be awesome to automatically have bindings to the whole C stdlib.

Add a new irutil/stdlib package containing function (and global variable) declarations for interacting with the C standard library.

We should consider automatically doing this, perhaps using the LLVM compiler to parse the C standard library headers and generating LLVM IR function (and global variable) declarations.

Then, we could parse the LLVM IR output using llir/llvm/asm to get the llir/llvm/ir representation to interact with.

Will require some experimentation to find what approach works well, and is easy to work with.

Edit: related issues #22, #178, #180.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions