~boringcactus/rust-scripting-languages

30461ed2f72bbdb61074b4ca934012d716837c44 — Melody Horn 3 years ago cf0a49c
try to write gluon example
4 files changed, 988 insertions(+), 25 deletions(-)

M Cargo.lock
M Cargo.toml
A examples/gluon.rs
A scripts/gluon-sample.glu
M Cargo.lock => Cargo.lock +901 -25
@@ 22,6 22,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aab032c118518f4bd1bd8f9efd22a60a7d153a7eafd2ed9709fc224ce4186094"

[[package]]
name = "ahash"
version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217"

[[package]]
name = "aho-corasick"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 46,6 52,47 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6b602bfe940d21c130f3895acd65221e8a61270debe89d628b9cb4e3ccb8569b"

[[package]]
name = "archery"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d308d8fa3f687f7a7588fccc4812ed6914be09518232f00454693a7417273ad2"
dependencies = [
 "static_assertions",
]

[[package]]
name = "arrayref"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544"

[[package]]
name = "arrayvec"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8"

[[package]]
name = "ascii-canvas"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff8eb72df928aafb99fe5d37b383f2fe25bd2a765e3e5f7c365916b6f2463a29"
dependencies = [
 "term",
]

[[package]]
name = "async-trait"
version = "0.1.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "687c230d85c0a52504709705fc8a53e4a692b83a2184f03dae73e38e1e93a783"
dependencies = [
 "proc-macro2",
 "quote",
 "syn",
]

[[package]]
name = "attohttpc"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 60,6 107,17 @@ dependencies = [
]

[[package]]
name = "atty"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
dependencies = [
 "hermit-abi",
 "libc",
 "winapi 0.3.9",
]

[[package]]
name = "autocfg"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 101,12 159,59 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"

[[package]]
name = "bit-set"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de"
dependencies = [
 "bit-vec",
]

[[package]]
name = "bit-vec"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f0dc55f2d8a1a85650ac47858bb001b4c0dd73d79e3c455a842925e68d29cd3"

[[package]]
name = "bitflags"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"

[[package]]
name = "blake2b_simd"
version = "0.5.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a"
dependencies = [
 "arrayref",
 "arrayvec",
 "constant_time_eq",
]

[[package]]
name = "block-buffer"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b"
dependencies = [
 "block-padding",
 "byte-tools",
 "byteorder",
 "generic-array",
]

[[package]]
name = "block-padding"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5"
dependencies = [
 "byte-tools",
]

[[package]]
name = "bstr"
version = "0.2.13"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 122,6 227,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820"

[[package]]
name = "byte-tools"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7"

[[package]]
name = "byteorder"
version = "1.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 176,6 287,46 @@ dependencies = [
]

[[package]]
name = "cloudabi"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467"
dependencies = [
 "bitflags",
]

[[package]]
name = "codespan"
version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ebaf6bb6a863ad6aa3a18729e9710c53d75df03306714d9cc1f7357a00cd789"
dependencies = [
 "codespan-reporting",
]

[[package]]
name = "codespan-reporting"
version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e0762455306b1ed42bc651ef6a2197aabda5e1d4a43c34d5eab5c1a3634e81d"
dependencies = [
 "termcolor",
 "unicode-width",
]

[[package]]
name = "collect-mac"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f168712e49987bd2f51cb855c4585999e12b1a0abdff60fea4b81b41f2010264"

[[package]]
name = "constant_time_eq"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"

[[package]]
name = "cookie"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 277,6 428,50 @@ dependencies = [
]

[[package]]
name = "diff"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e25ea47919b1560c4e3b7fe0aaab9becf5b84a10325ddf7db0f0ba5e1026499"

[[package]]
name = "digest"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5"
dependencies = [
 "generic-array",
]

[[package]]
name = "dirs"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901"
dependencies = [
 "libc",
 "redox_users",
 "winapi 0.3.9",
]

[[package]]
name = "docopt"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f525a586d310c87df72ebcd98009e57f1cc030c8c268305287a476beb653969"
dependencies = [
 "lazy_static 1.4.0",
 "regex 1.3.9",
 "serde",
 "strsim 0.9.3",
]

[[package]]
name = "downcast-rs"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650"

[[package]]
name = "dtoa"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 342,6 537,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"

[[package]]
name = "ena"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7402b94a93c24e742487327a7cd839dc9d36fec9de9fb25b09f2dae459f36c3"
dependencies = [
 "log",
]

[[package]]
name = "encoding"
version = "0.2.33"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 446,6 650,18 @@ dependencies = [
]

[[package]]
name = "fake-simd"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"

[[package]]
name = "fixedbitset"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d"

[[package]]
name = "flate2"
version = "1.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 479,6 695,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"

[[package]]
name = "frunk_core"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e04cda45add94e71c2990de778ae13059897d77b773130a9bc225e2970c413e"

[[package]]
name = "fs_extra"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 534,16 756,121 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef"

[[package]]
name = "futures"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613"
dependencies = [
 "futures-channel",
 "futures-core",
 "futures-executor",
 "futures-io",
 "futures-sink",
 "futures-task",
 "futures-util",
]

[[package]]
name = "futures-channel"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5"
dependencies = [
 "futures-core",
 "futures-sink",
]

[[package]]
name = "futures-core"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399"

[[package]]
name = "futures-cpupool"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4"
dependencies = [
 "futures",
 "futures 0.1.29",
 "num_cpus",
]

[[package]]
name = "futures-executor"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314"
dependencies = [
 "futures-core",
 "futures-task",
 "futures-util",
]

[[package]]
name = "futures-io"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789"

[[package]]
name = "futures-macro"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0b5a30a4328ab5473878237c447333c093297bded83a4983d10f4deea240d39"
dependencies = [
 "proc-macro-hack",
 "proc-macro2",
 "quote",
 "syn",
]

[[package]]
name = "futures-sink"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc"

[[package]]
name = "futures-task"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626"
dependencies = [
 "once_cell",
]

[[package]]
name = "futures-util"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6"
dependencies = [
 "futures 0.1.29",
 "futures-channel",
 "futures-core",
 "futures-io",
 "futures-macro",
 "futures-sink",
 "futures-task",
 "memchr 2.3.3",
 "pin-project",
 "pin-utils",
 "proc-macro-hack",
 "proc-macro-nested",
 "slab",
]

[[package]]
name = "generic-array"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec"
dependencies = [
 "typenum",
]

[[package]]
name = "getrandom"
version = "0.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 567,6 894,183 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"

[[package]]
name = "gluon"
version = "0.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95284d1aa2a141815ea329ea09cd2ed85161653114e5a703350b01b9466bec6b"
dependencies = [
 "async-trait",
 "codespan",
 "codespan-reporting",
 "collect-mac",
 "either",
 "futures 0.3.5",
 "gluon-salsa",
 "gluon_base",
 "gluon_check",
 "gluon_codegen",
 "gluon_format",
 "gluon_parser",
 "gluon_vm",
 "itertools",
 "log",
 "quick-error",
 "rand 0.7.3",
 "rand_xorshift 0.2.0",
 "regex 1.3.9",
 "tokio 0.2.22",
 "walkdir",
]

[[package]]
name = "gluon-salsa"
version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4644d498c04e71e60947f837bf9729379bd922e5b745c36bea5a4ce03e551fe5"
dependencies = [
 "crossbeam-utils",
 "futures-channel",
 "futures-util",
 "gluon-salsa-macros",
 "indexmap",
 "lock_api 0.4.1",
 "log",
 "oorandom",
 "parking_lot 0.11.0",
 "rustc-hash",
 "smallvec 1.4.2",
]

[[package]]
name = "gluon-salsa-macros"
version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "807a2b17a92e21080379cf696063642c70caea95c04b547320d37fd6844b8e0f"
dependencies = [
 "heck",
 "proc-macro2",
 "quote",
 "syn",
]

[[package]]
name = "gluon_base"
version = "0.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a34328ad20295a4ff26a6110a38e28822a4409e7ccd4d5d688c18c49498c8e0"
dependencies = [
 "bitflags",
 "codespan",
 "codespan-reporting",
 "collect-mac",
 "either",
 "fnv",
 "gluon_codegen",
 "hashbrown 0.8.2",
 "itertools",
 "log",
 "ordered-float",
 "pretty",
 "quick-error",
 "smallvec 1.4.2",
 "typed-arena",
 "vec_map",
]

[[package]]
name = "gluon_check"
version = "0.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92b1d605ca702622cc7f58cd4d667fd235387b5babe6805f65cc281529fddb6f"
dependencies = [
 "codespan",
 "codespan-reporting",
 "collect-mac",
 "ena",
 "gluon_base",
 "gluon_codegen",
 "itertools",
 "log",
 "pretty",
 "quick-error",
 "rpds",
 "smallvec 1.4.2",
 "strsim 0.10.0",
]

[[package]]
name = "gluon_codegen"
version = "0.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c11dc4e79138a18df511fd44729a35c57af9d739ab0400de87e2fa30aaa37c1"
dependencies = [
 "proc-macro2",
 "quote",
 "syn",
]

[[package]]
name = "gluon_format"
version = "0.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6eb47f0eb6347499236e4c0972dd3a02e4b992744170077a0f76af2312caab3f"
dependencies = [
 "codespan",
 "gluon_base",
 "itertools",
 "log",
 "pretty",
]

[[package]]
name = "gluon_parser"
version = "0.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdb6d717f6f6ff51f36fd05f2b6cdf550c9f10250bfaeaf23a547fa23a04daae"
dependencies = [
 "codespan",
 "codespan-reporting",
 "collect-mac",
 "gluon_base",
 "itertools",
 "lalrpop",
 "lalrpop-util",
 "log",
 "ordered-float",
 "quick-error",
]

[[package]]
name = "gluon_vm"
version = "0.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f464334591c0714063d4610304f3af58b1a8133d22977c68e9bf6216d7e84712"
dependencies = [
 "async-trait",
 "bitflags",
 "codespan",
 "codespan-reporting",
 "collect-mac",
 "crossbeam-utils",
 "downcast-rs",
 "frunk_core",
 "futures 0.3.5",
 "gluon_base",
 "gluon_check",
 "gluon_codegen",
 "itertools",
 "log",
 "ordered-float",
 "parking_lot 0.11.0",
 "petgraph",
 "pretty",
 "quick-error",
 "slab",
 "smallvec 1.4.2",
 "typed-arena",
]

[[package]]
name = "h2"
version = "0.1.26"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 575,7 1079,7 @@ dependencies = [
 "byteorder",
 "bytes 0.4.12",
 "fnv",
 "futures",
 "futures 0.1.29",
 "http 0.1.21",
 "indexmap",
 "log",


@@ 586,11 1090,30 @@ dependencies = [

[[package]]
name = "hashbrown"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e91b62f79061a0bc2e046024cb7ba44b08419ed238ecbd9adbd787434b9e8c25"
dependencies = [
 "ahash",
 "autocfg 1.0.1",
]

[[package]]
name = "hashbrown"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00d63df3d41950fb462ed38308eea019113ad1508da725bbedcd0fa5a85ef5f7"

[[package]]
name = "heck"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205"
dependencies = [
 "unicode-segmentation",
]

[[package]]
name = "hermit-abi"
version = "0.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 637,7 1160,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d"
dependencies = [
 "bytes 0.4.12",
 "futures",
 "futures 0.1.29",
 "http 0.1.21",
 "tokio-buf",
]


@@ 655,7 1178,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6"
dependencies = [
 "bytes 0.4.12",
 "futures",
 "futures 0.1.29",
 "futures-cpupool",
 "h2",
 "http 0.1.21",


@@ 667,7 1190,7 @@ dependencies = [
 "net2",
 "rustc_version",
 "time",
 "tokio",
 "tokio 0.1.22",
 "tokio-buf",
 "tokio-executor",
 "tokio-io",


@@ 707,7 1230,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2"
dependencies = [
 "autocfg 1.0.1",
 "hashbrown",
 "hashbrown 0.9.0",
]

[[package]]


@@ 731,6 1254,15 @@ dependencies = [
]

[[package]]
name = "itertools"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"
dependencies = [
 "either",
]

[[package]]
name = "itoa"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 766,6 1298,37 @@ dependencies = [
]

[[package]]
name = "lalrpop"
version = "0.19.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60fb56191fb8ed5311597e5750debe6779c9fdb487dbaa5ff302592897d7a2c8"
dependencies = [
 "ascii-canvas",
 "atty",
 "bit-set",
 "diff",
 "docopt",
 "ena",
 "itertools",
 "lalrpop-util",
 "petgraph",
 "regex 1.3.9",
 "regex-syntax 0.6.18",
 "serde",
 "serde_derive",
 "sha2",
 "string_cache",
 "term",
 "unicode-xid",
]

[[package]]
name = "lalrpop-util"
version = "0.19.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6771161eff561647fad8bb7e745e002c304864fb8f436b52b30acda51fca4408"

[[package]]
name = "lazy_static"
version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 793,6 1356,15 @@ dependencies = [
]

[[package]]
name = "lock_api"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28247cc5a5be2f05fbcd76dd0cf2c7d3b5400cb978a28042abcd4fa0b3f8261c"
dependencies = [
 "scopeguard",
]

[[package]]
name = "log"
version = "0.4.11"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 934,6 1506,12 @@ dependencies = [
]

[[package]]
name = "new_debug_unreachable"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54"

[[package]]
name = "nom"
version = "1.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 997,6 1575,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5"

[[package]]
name = "once_cell"
version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad"

[[package]]
name = "oorandom"
version = "11.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a170cebd8021a008ea92e4db85a72f80b35df514ec664b296fdcbb654eac0b2c"

[[package]]
name = "opaque-debug"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c"

[[package]]
name = "openssl"
version = "0.10.30"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1030,24 1626,44 @@ dependencies = [
]

[[package]]
name = "ordered-float"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9fe9037165d7023b1228bc4ae9a2fa1a2b0095eca6c2998c624723dfd01314a5"
dependencies = [
 "num-traits",
]

[[package]]
name = "parking_lot"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252"
dependencies = [
 "lock_api",
 "parking_lot_core",
 "lock_api 0.3.4",
 "parking_lot_core 0.6.2",
 "rustc_version",
]

[[package]]
name = "parking_lot"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4893845fa2ca272e647da5d0e46660a314ead9c2fdd9a883aabc32e481a8733"
dependencies = [
 "instant",
 "lock_api 0.4.1",
 "parking_lot_core 0.8.0",
]

[[package]]
name = "parking_lot_core"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b"
dependencies = [
 "cfg-if",
 "cloudabi",
 "cloudabi 0.0.3",
 "libc",
 "redox_syscall",
 "rustc_version",


@@ 1056,6 1672,21 @@ dependencies = [
]

[[package]]
name = "parking_lot_core"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b"
dependencies = [
 "cfg-if",
 "cloudabi 0.1.0",
 "instant",
 "libc",
 "redox_syscall",
 "smallvec 1.4.2",
 "winapi 0.3.9",
]

[[package]]
name = "percent-encoding"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1068,6 1699,57 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"

[[package]]
name = "petgraph"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7"
dependencies = [
 "fixedbitset",
 "indexmap",
]

[[package]]
name = "phf_shared"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7"
dependencies = [
 "siphasher",
]

[[package]]
name = "pin-project"
version = "0.4.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca4433fff2ae79342e497d9f8ee990d174071408f28f726d6d83af93e58e48aa"
dependencies = [
 "pin-project-internal",
]

[[package]]
name = "pin-project-internal"
version = "0.4.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c0e815c3ee9a031fdf5af21c10aa17c573c9c6a566328d99e3936c34e36461f"
dependencies = [
 "proc-macro2",
 "quote",
 "syn",
]

[[package]]
name = "pin-project-lite"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715"

[[package]]
name = "pin-utils"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"

[[package]]
name = "piston-float"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1097,6 1779,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20"

[[package]]
name = "precomputed-hash"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"

[[package]]
name = "pretty"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad9940b913ee56ddd94aec2d3cd179dd47068236f42a1a6415ccf9d880ce2a61"
dependencies = [
 "arrayvec",
 "typed-arena",
]

[[package]]
name = "proc-macro-hack"
version = "0.5.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99c605b9a0adc77b7211c6b1f722dcb613d68d66859a44f3d485a6da332b0598"

[[package]]
name = "proc-macro-nested"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a"

[[package]]
name = "proc-macro2"
version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1119,6 1829,12 @@ dependencies = [
]

[[package]]
name = "quick-error"
version = "1.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"

[[package]]
name = "quote"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1142,7 1858,7 @@ dependencies = [
 "rand_jitter",
 "rand_os",
 "rand_pcg",
 "rand_xorshift",
 "rand_xorshift 0.1.1",
 "winapi 0.3.9",
]



@@ 1247,7 1963,7 @@ version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071"
dependencies = [
 "cloudabi",
 "cloudabi 0.0.3",
 "fuchsia-cprng",
 "libc",
 "rand_core 0.4.2",


@@ 1275,6 1991,15 @@ dependencies = [
]

[[package]]
name = "rand_xorshift"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77d416b86801d23dde1aa643023b775c3a462efc0ed96443add11546cdf1dca8"
dependencies = [
 "rand_core 0.5.1",
]

[[package]]
name = "range"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1311,6 2036,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"

[[package]]
name = "redox_users"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d"
dependencies = [
 "getrandom",
 "redox_syscall",
 "rust-argon2",
]

[[package]]
name = "regex"
version = "0.1.80"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1368,7 2104,7 @@ dependencies = [
 "cookie_store",
 "encoding_rs",
 "flate2",
 "futures",
 "futures 0.1.29",
 "http 0.1.21",
 "hyper",
 "log",


@@ 1378,7 2114,7 @@ dependencies = [
 "serde_json",
 "serde_urlencoded",
 "time",
 "tokio",
 "tokio 0.1.22",
 "tokio-executor",
 "tokio-io",
 "tokio-threadpool",


@@ 1413,6 2149,27 @@ dependencies = [
]

[[package]]
name = "rpds"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1196a0a2f52d343bd32179834273eaac7d8739f7e3f8b700227d2fa06b9a423b"
dependencies = [
 "archery",
]

[[package]]
name = "rust-argon2"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9dab61250775933275e84053ac235621dfb739556d5c54a2f2e9313b7cf43a19"
dependencies = [
 "base64 0.12.3",
 "blake2b_simd",
 "constant_time_eq",
 "crossbeam-utils",
]

[[package]]
name = "rust-scripting-languages"
version = "0.1.0"
dependencies = [


@@ 1420,6 2177,8 @@ dependencies = [
 "duckscript",
 "duckscriptsdk",
 "dyon",
 "gluon",
 "gluon_codegen",
 "rhai",
 "rlua",
]


@@ 1431,6 2190,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783"

[[package]]
name = "rustc-hash"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"

[[package]]
name = "rustc_version"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1561,6 2326,24 @@ dependencies = [
]

[[package]]
name = "sha2"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69"
dependencies = [
 "block-buffer",
 "digest",
 "fake-simd",
 "opaque-debug",
]

[[package]]
name = "siphasher"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa8f3741c7372e75519bd9346068370c9cdaabcc1f9599cbcf2a2719352286b7"

[[package]]
name = "slab"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1582,6 2365,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252"

[[package]]
name = "static_assertions"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f3eb36b47e512f8f1c9e3d10c2c1965bc992bd9cdb024fa581e2194501c83d3"

[[package]]
name = "string"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1591,6 2380,31 @@ dependencies = [
]

[[package]]
name = "string_cache"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2940c75beb4e3bf3a494cef919a747a2cb81e52571e212bfbd185074add7208a"
dependencies = [
 "lazy_static 1.4.0",
 "new_debug_unreachable",
 "phf_shared",
 "precomputed-hash",
 "serde",
]

[[package]]
name = "strsim"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c"

[[package]]
name = "strsim"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"

[[package]]
name = "syn"
version = "1.0.41"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1628,6 2442,26 @@ dependencies = [
]

[[package]]
name = "term"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edd106a334b7657c10b7c540a0106114feadeb4dc314513e97df481d5d966f42"
dependencies = [
 "byteorder",
 "dirs",
 "winapi 0.3.9",
]

[[package]]
name = "termcolor"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f"
dependencies = [
 "winapi-util",
]

[[package]]
name = "thiserror"
version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1699,7 2533,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6"
dependencies = [
 "bytes 0.4.12",
 "futures",
 "futures 0.1.29",
 "mio",
 "num_cpus",
 "tokio-current-thread",


@@ 1712,6 2546,18 @@ dependencies = [
]

[[package]]
name = "tokio"
version = "0.2.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd"
dependencies = [
 "bytes 0.5.6",
 "fnv",
 "futures-core",
 "pin-project-lite",
]

[[package]]
name = "tokio-buf"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1719,7 2565,7 @@ checksum = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46"
dependencies = [
 "bytes 0.4.12",
 "either",
 "futures",
 "futures 0.1.29",
]

[[package]]


@@ 1728,7 2574,7 @@ version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e"
dependencies = [
 "futures",
 "futures 0.1.29",
 "tokio-executor",
]



@@ 1739,7 2585,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671"
dependencies = [
 "crossbeam-utils",
 "futures",
 "futures 0.1.29",
]

[[package]]


@@ 1749,7 2595,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674"
dependencies = [
 "bytes 0.4.12",
 "futures",
 "futures 0.1.29",
 "log",
]



@@ 1760,12 2606,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351"
dependencies = [
 "crossbeam-utils",
 "futures",
 "futures 0.1.29",
 "lazy_static 1.4.0",
 "log",
 "mio",
 "num_cpus",
 "parking_lot",
 "parking_lot 0.9.0",
 "slab",
 "tokio-executor",
 "tokio-io",


@@ 1779,7 2625,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee"
dependencies = [
 "fnv",
 "futures",
 "futures 0.1.29",
]

[[package]]


@@ 1789,7 2635,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72"
dependencies = [
 "bytes 0.4.12",
 "futures",
 "futures 0.1.29",
 "iovec",
 "mio",
 "tokio-io",


@@ 1805,7 2651,7 @@ dependencies = [
 "crossbeam-deque",
 "crossbeam-queue",
 "crossbeam-utils",
 "futures",
 "futures 0.1.29",
 "lazy_static 1.4.0",
 "log",
 "num_cpus",


@@ 1820,7 2666,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296"
dependencies = [
 "crossbeam-utils",
 "futures",
 "futures 0.1.29",
 "slab",
 "tokio-executor",
]


@@ 1841,6 2687,18 @@ dependencies = [
]

[[package]]
name = "typed-arena"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0685c84d5d54d1c26f7d3eb96cd41550adb97baed141a761cf335d3d33bcd0ae"

[[package]]
name = "typenum"
version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33"

[[package]]
name = "uname"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1877,6 2735,18 @@ dependencies = [
]

[[package]]
name = "unicode-segmentation"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0"

[[package]]
name = "unicode-width"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"

[[package]]
name = "unicode-xid"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1936,6 2806,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c"

[[package]]
name = "vec_map"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"

[[package]]
name = "vecmath"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1967,7 2843,7 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230"
dependencies = [
 "futures",
 "futures 0.1.29",
 "log",
 "try-lock",
]

M Cargo.toml => Cargo.toml +12 -0
@@ 43,3 43,15 @@ optional = true
[[example]]
name = "dyon"
required-features = ["dyon"]

[dependencies.gluon]
version = "0.17.1"
optional = true

[dependencies.gluon_codegen]
version = "0.17.1"
optional = true

[[example]]
name = "gluon"
required-features = ["gluon", "gluon_codegen"]

A examples/gluon.rs => examples/gluon.rs +70 -0
@@ 0,0 1,70 @@
#[macro_use]
extern crate gluon_codegen;

use std::fs::read_to_string;

use gluon::{
    import::add_extern_module,
    new_vm,
    primitive,
    RootedThread,
    Thread,
    vm,
    ThreadExt
};

use rust_scripting_languages::*;

#[derive(Debug, PartialEq, VmType, Getable, Pushable)]
#[gluon(vm_type = "Event")]
enum EventForGluon {
    Number(i64),
    Text(String),
}

impl From<Event> for EventForGluon {
    fn from(e: Event) -> Self {
        match e {
            Event::Number(x) => EventForGluon::Number(x),
            Event::Text(x) => EventForGluon::Text(x),
        }
    }
}

struct GluonScriptHost;

impl ScriptHost for GluonScriptHost {
    type ScriptContext = RootedThread;

    fn new_context() -> anyhow::Result<Self::ScriptContext> {
        let vm = new_vm();

        fn load_print_fancy(vm: &Thread) -> vm::Result<vm::ExternModule> {
            vm::ExternModule::new(vm, primitive!(1, print_fancy))
        }

        vm.load_script("rust-scripting-languages.event", "type Event = Number Int | Text String")?;

        add_extern_module(&vm, "print_fancy", load_print_fancy);

        vm.run_io(true);

        let script = read_to_string("scripts/gluon-sample.glu")?;
        vm
            .run_expr::<vm::api::OpaqueValue<&Thread, vm::api::Hole>>("scripts/gluon-sample.glu", &script)?;

        Ok(vm)
    }

    fn handle_event(context: &mut Self::ScriptContext, event: Event) -> anyhow::Result<()> {
        let mut handle_event: vm::api::FunctionRef<fn (EventForGluon)> = context.get_global("handle_event")
            .unwrap();
        handle_event.call(event.into())?;

        Ok(())
    }
}

fn main() -> anyhow::Result<()> {
    run_main::<GluonScriptHost>()
}

A scripts/gluon-sample.glu => scripts/gluon-sample.glu +5 -0
@@ 0,0 1,5 @@
let print_fancy = import! print_fancy
let handle_event event =
    match event with
        | Number n -> print_fancy (show n)
        | Text t -> print_fancy t