-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
277 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,5 @@ members = [ | |
] | ||
exclude = [ | ||
"codegen/quirky_binder_codegen_wasm", | ||
"recipes", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/target | ||
/Cargo.lock | ||
qb_monitor.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[workspace] | ||
resolver = "2" | ||
members = [ | ||
"hello_world", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[package] | ||
name = "hello_world" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
anyhow = "1" | ||
fallible-iterator = "0.3" | ||
quirky_binder_support = { path = "../../quirky_binder_support" } | ||
serde = "1" | ||
static_assertions = "1" | ||
truc_runtime = { git = "https://github.com/arnodb/truc.git" } | ||
|
||
# quirky_binder_monitor | ||
chrono = { version = "0.4", optional = true } | ||
self-meter = { version = "0.6", optional = true } | ||
tracking-allocator = { version = "0.4", optional = true } | ||
|
||
[features] | ||
default = [] | ||
quirky_binder_monitor = ["chrono", "self-meter", "tracking-allocator"] | ||
|
||
[build-dependencies] | ||
handlebars = "4" | ||
quirky_binder = { path = "../../quirky_binder" } | ||
quirky_binder_lang = { path = "../../quirky_binder_lang" } | ||
serde = { version = "1", features = ["derive"] } | ||
truc = { git = "https://github.com/arnodb/truc.git" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use std::path::Path; | ||
|
||
use quirky_binder::{prelude::*, quirky_binder}; | ||
use truc::record::type_resolver::{StaticTypeResolver, TypeResolver}; | ||
|
||
fn main() { | ||
quirky_binder!(include("main.qb")); | ||
|
||
let type_resolver = { | ||
let mut resolver = StaticTypeResolver::new(); | ||
resolver.add_std_types(); | ||
resolver | ||
}; | ||
|
||
let graph = quirky_binder_main(GraphBuilder::new( | ||
&type_resolver, | ||
ChainCustomizer::default(), | ||
)) | ||
.unwrap_or_else(|err| { | ||
panic!("{}", err); | ||
}); | ||
|
||
let out_dir = std::env::var("OUT_DIR").unwrap(); | ||
graph.generate(Path::new(&out_dir)).unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use quirky_binder::{ | ||
filter::{ | ||
function::{ | ||
produce::function_produce, | ||
terminate::function_terminate, | ||
}, | ||
}, | ||
}; | ||
|
||
{ | ||
( | ||
function_produce( | ||
fields: [("hello", "String")], | ||
body: r#"{ | ||
let record = new_record("world".to_string()); | ||
output.send(Some(record))?; | ||
output.send(None)?; | ||
Ok(()) | ||
}"#, | ||
) | ||
- function_terminate( | ||
body: r#" | ||
let record = input.next()?.unwrap(); | ||
println!("Hello {}!", record.hello()); | ||
assert!(input.next()?.is_none()); | ||
Ok(()) | ||
"#, | ||
) | ||
) | ||
} | ||
|
||
#( | ||
name: "quirky_binder_monitor", | ||
feature: "quirky_binder_monitor", | ||
) | ||
{ ( quirky_binder::filter::monitor::monitor() ) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
use quirky_binder_support::chain::configuration::ChainConfiguration; | ||
|
||
#[macro_use] | ||
extern crate static_assertions; | ||
|
||
#[allow(dead_code)] | ||
#[allow(clippy::borrowed_box)] | ||
#[allow(clippy::module_inception)] | ||
mod chain { | ||
include!(concat!(env!("OUT_DIR"), "/chain.rs")); | ||
} | ||
|
||
quirky_binder_support::tracking_allocator_static!(); | ||
|
||
#[quirky_binder_support::tracking_allocator_main] | ||
fn main() { | ||
chain::main(ChainConfiguration::default()).unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
|
||
SHORT_NAME="$1" | ||
|
||
mkdir "$SHORT_NAME" | ||
cd "$SHORT_NAME" | ||
cargo generate --init --name "${SHORT_NAME}" --path ../template | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[package] | ||
name = "{{project-name}}" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
anyhow = "1" | ||
fallible-iterator = "0.3" | ||
quirky_binder_support = { path = "../../quirky_binder_support" } | ||
serde = "1" | ||
static_assertions = "1" | ||
truc_runtime = { git = "https://github.com/arnodb/truc.git" } | ||
|
||
# quirky_binder_monitor | ||
chrono = { version = "0.4", optional = true } | ||
self-meter = { version = "0.6", optional = true } | ||
tracking-allocator = { version = "0.4", optional = true } | ||
|
||
[features] | ||
default = [] | ||
quirky_binder_monitor = ["chrono", "self-meter", "tracking-allocator"] | ||
|
||
[build-dependencies] | ||
handlebars = "4" | ||
quirky_binder = { path = "../../quirky_binder" } | ||
quirky_binder_lang = { path = "../../quirky_binder_lang" } | ||
serde = { version = "1", features = ["derive"] } | ||
truc = { git = "https://github.com/arnodb/truc.git" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use std::path::Path; | ||
|
||
use quirky_binder::{prelude::*, quirky_binder}; | ||
use truc::record::type_resolver::{StaticTypeResolver, TypeResolver}; | ||
|
||
fn main() { | ||
quirky_binder!(include("main.qb")); | ||
|
||
let type_resolver = { | ||
let mut resolver = StaticTypeResolver::new(); | ||
resolver.add_std_types(); | ||
resolver | ||
}; | ||
|
||
let graph = quirky_binder_main(GraphBuilder::new( | ||
&type_resolver, | ||
ChainCustomizer::default(), | ||
)) | ||
.unwrap_or_else(|err| { | ||
panic!("{}", err); | ||
}); | ||
|
||
let out_dir = std::env::var("OUT_DIR").unwrap(); | ||
graph.generate(Path::new(&out_dir)).unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use quirky_binder::{ | ||
filter::{ | ||
function::{ | ||
produce::function_produce, | ||
terminate::function_terminate, | ||
}, | ||
}, | ||
}; | ||
|
||
{ | ||
( | ||
function_produce( | ||
fields: [("hello", "String")], | ||
body: r#"{ | ||
let record = new_record("world".to_string()); | ||
output.send(Some(record))?; | ||
output.send(None)?; | ||
Ok(()) | ||
}"#, | ||
) | ||
- function_terminate( | ||
body: r#" | ||
let record = input.next()?.unwrap(); | ||
println!("Hello {}!", record.hello()); | ||
assert!(input.next()?.is_none()); | ||
Ok(()) | ||
"#, | ||
) | ||
) | ||
} | ||
|
||
#( | ||
name: "quirky_binder_monitor", | ||
feature: "quirky_binder_monitor", | ||
) | ||
{ ( quirky_binder::filter::monitor::monitor() ) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
use quirky_binder_support::chain::configuration::ChainConfiguration; | ||
|
||
#[macro_use] | ||
extern crate static_assertions; | ||
|
||
#[allow(dead_code)] | ||
#[allow(clippy::borrowed_box)] | ||
#[allow(clippy::module_inception)] | ||
mod chain { | ||
include!(concat!(env!("OUT_DIR"), "/chain.rs")); | ||
} | ||
|
||
quirky_binder_support::tracking_allocator_static!(); | ||
|
||
#[quirky_binder_support::tracking_allocator_main] | ||
fn main() { | ||
chain::main(ChainConfiguration::default()).unwrap(); | ||
} |