Skip to content

Commit

Permalink
Merge pull request #6211 from roc-lang/zig-glue
Browse files Browse the repository at this point in the history
Initial template for Zig glue
  • Loading branch information
lukewilliamboswell authored Dec 7, 2023
2 parents 497187a + 61a55ad commit 5652d4e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions crates/glue/src/ZigGlue.roc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
app "zig-glue"
packages { pf: "../platform/main.roc" }
imports [
pf.Types.{ Types },
pf.File.{ File },
"../../compiler/builtins/bitcode/src/list.zig" as rocStdList : Str,
]
provides [makeGlue] to pf

makeGlue : List Types -> Result (List File) Str
makeGlue = \typesByArch ->
typesByArch
|> List.map convertTypesToFile
|> List.concat staticFiles
|> Ok

## These are always included, and don't depend on the specifics of the app.
staticFiles : List File
staticFiles = [
{ name: "list.zig", content: rocStdList },
]

convertTypesToFile : Types -> File
convertTypesToFile = \_ -> {
name: "glue.zig",
content: "// Nothing to see yet",
}

0 comments on commit 5652d4e

Please sign in to comment.