{"id":13681820,"url":"https://github.com/harpocrates/inline-rust","last_synced_at":"2025-08-20T22:32:45.963Z","repository":{"id":51080772,"uuid":"105115264","full_name":"harpocrates/inline-rust","owner":"harpocrates","description":"Use snippets of Rust inline in your Haskell programs","archived":false,"fork":false,"pushed_at":"2021-05-24T19:54:03.000Z","size":140,"stargazers_count":223,"open_issues_count":14,"forks_count":9,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-12-10T01:32:59.303Z","etag":null,"topics":["ffi","haskell","quasiquotation","rust"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/harpocrates.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-28T07:19:06.000Z","updated_at":"2024-09-03T04:11:16.000Z","dependencies_parsed_at":"2022-09-09T16:41:26.828Z","dependency_job_id":null,"html_url":"https://github.com/harpocrates/inline-rust","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harpocrates%2Finline-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harpocrates%2Finline-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harpocrates%2Finline-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harpocrates%2Finline-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harpocrates","download_url":"https://codeload.github.com/harpocrates/inline-rust/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230462914,"owners_count":18229865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ffi","haskell","quasiquotation","rust"],"created_at":"2024-08-02T13:01:36.348Z","updated_at":"2024-12-19T16:13:16.137Z","avatar_url":"https://github.com/harpocrates.png","language":"Haskell","funding_links":[],"categories":["Haskell"],"sub_categories":[],"readme":"# inline-rust\n\n[![Build Status][5]][6]\n[![Windows build status][7]][8]\n\nThis package allows you to write Rust inline in your Haskell source using\nquasiquotes. Here is a short example. For more examples, check out the\n[examples](examples) folder.\n\n```haskell\n-- examples/Hello.hs\n{-# LANGUAGE TemplateHaskell, QuasiQuotes #-}\n\nmodule Main where\n\nimport Language.Rust.Inline\nimport Data.Int\n\nextendContext basic\nsetCrateRoot []\n\nmain = do\n  putStrLn \"Haskell: Hello. Enter a number:\"\n  x \u003c- readLn\n  y \u003c- [rustIO| i32 {\n    let x = $(x: i32);\n    println!(\"Rust: Your number is {}\", x);\n    x + 1\n  } |]\n  putStrLn $ \"Haskell: Rust says number plus 1 is \" ++ show y\n\n```\n\nIf you want to use this with GHCi, make sure to pass in `-fobject-code`.\n\n## Building\n\nThis currently depends on a GHC [feature][1] that will be available in GHC 8.6.\nUntil then, you'll have to [build GHC][0] yourself or get a binary. For the\nlatter, you can install one of GHC's nightly builds.\n\n    $ curl https://ghc-artifacts.s3.amazonaws.com/nightly/validate-x86_64-darwin/latest/bindist.tar.xz | tar xz\n    $ cd ghc-*\n    $ ./configure \u0026\u0026 make install\n\nWith that installed, something like the following should work\n\n    $ cabal new-build -w /usr/local/bin/ghc-8.5.20180423\n    $ cabal new-test  -w /usr/local/bin/ghc-8.5.20180423\n\nRunning the examples is only a matter of threading through the right package\ndatabases. With a new enough Cabal, `new-exec` does this for you.\n\n    $ cabal new-exec -w /usr/local/bin/ghc-8.5.20180423 ghc -- -threaded -package inline-rust examples/Hello.hs\n    [1 of 1] Compiling Main             ( examples/Hello.hs, examples/Hello.o )\n    Linking examples/Hello ...\n    $ ./examples/Hello\n    Haskell: Hello. Enter a number:\n    42\n    Rust: Your number is 42\n    Haskell: Rust says number plus 1 is 43\n\n## Bugs\n\nPlease report bugs to [the issue tracker][4]\n\n[0]: https://ghc.haskell.org/trac/ghc/wiki/Building\n[1]: https://phabricator.haskell.org/D4217\n[2]: https://github.com/harpocrates/inline-rust/tree/master/examples\n[3]: https://github.com/harpocrates/language-rust\n[4]: https://github.com/harpocrates/inline-rust/issues\n[5]: https://travis-ci.org/harpocrates/inline-rust.svg?branch=master \n[6]: https://travis-ci.org/harpocrates/inline-rust\n[7]: https://ci.appveyor.com/api/projects/status/xiwf8743n2f7n400?svg=true\n[8]: https://ci.appveyor.com/project/harpocrates/inline-rust\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharpocrates%2Finline-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharpocrates%2Finline-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharpocrates%2Finline-rust/lists"}