Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dylib compilation and runtime loading #127

Merged
merged 19 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hvm-core"
version = "0.2.25"
version = "0.2.26"
edition = "2021"
description = "HVM-Core is a massively parallel Interaction Combinator evaluator."
license = "MIT"
Expand All @@ -27,6 +27,7 @@ debug = "full"
TSPL = "0.0.9"
arrayvec = "0.7.4"
clap = { version = "4.5.1", features = ["derive"], optional = true }
libloading = "0.8.3"
nohash-hasher = { version = "0.2.0" }
ordered-float = "4.2.0"
parking_lot = "0.12.1"
Expand Down
8 changes: 8 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
use std::{env, process::Command};

fn main() {
let rustc_version = Command::new(env::var("RUSTC").unwrap()).arg("--version").output().unwrap().stdout;
let rustc_version = String::from_utf8(rustc_version).unwrap();

println!("cargo::rustc-env=RUSTC_VERSION={rustc_version}");
}
5 changes: 5 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"dereferencable",
"dref",
"dups",
"dylib",
"dylibs",
"effectful",
"fmts",
"fuzzer",
Expand All @@ -24,6 +26,8 @@
"ilog",
"inlinees",
"insta",
"libhvmc",
"libloading",
"lldb",
"lnet",
"lnum",
Expand All @@ -48,6 +52,7 @@
"rnet",
"rnum",
"rsplit",
"rustc",
"rwts",
"sigabrt",
"skippable",
Expand Down
6 changes: 5 additions & 1 deletion src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ fn _compile_host(host: &Host) -> Result<String, fmt::Error> {
continue;
}

let fields = refs.iter().map(|r| format!("def_{}", sanitize_name(r))).collect::<Vec<_>>().join(", ");
let fields = refs
.iter()
.map(|r| format!("def_{rust_name}: def_{rust_name}.clone()", rust_name = sanitize_name(r)))
.collect::<Vec<_>>()
.join(", ");

writeln!(
code,
Expand Down
Loading
Loading