Skip to content

Commit

Permalink
Update the crates README, clean up dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
rdaum committed Dec 6, 2024
1 parent fed66f6 commit ac876f0
Show file tree
Hide file tree
Showing 13 changed files with 124 additions and 277 deletions.
330 changes: 111 additions & 219 deletions Cargo.lock

Large diffs are not rendered by default.

12 changes: 1 addition & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,15 @@ clap_derive = "4.5"

## HTTP/websockets front-end
axum = { version = "0.7", features = ["ws"] }
axum-extra = "0.9"
serde = { version = "1.0", features = ["derive"] }
serde_derive = "1.0"
serde_json = "1.0"
tower-http = { version = "0.5.2", features = ["add-extension", "auth", "compression-full", "trace"] }

## Asynchronous transaction processing & networking, used in web-host and telnet-host.
## the daemon itself uses its own threading
futures = "0.3"
futures-util = { version = "0.3", features = ["sink", "std"] }
tokio = { version = "1.37", features = ["full"] }
tokio-test = "0.4"
tokio-util = { version = "0.7", features = ["full"] }

# Used for RPC daemon/client
Expand All @@ -82,29 +79,22 @@ zmq = "0.10"
## Logging & tracing
tracing = "0.1"
tracing-subscriber = "0.3"
tracing-test = "0.2"

# General usefulness
binary-layout = "4.0"
bincode = "2.0.0-rc.3"
bindgen = "0.70"
bytes = "1.7"
chrono = "0.4"
cmake = "0.1"
criterion = { version = "0.5", features = ["async_tokio"] }
crossbeam-channel = "0.5"
daumtils = { git = "https://github.com/rdaum/daumtils.git", version = "0.2.0" }
decorum = "0.3" # For ordering & comparing our floats
encoding_rs = "0.8.34"
enum-primitive-derive = "0.3"
im = "15.1"
inventory = "0.3"
itertools = "0.13"
lazy_static = "1.5"
num-traits = "0.2"
oneshot = { version = "0.1", default-features = false, features = ["std"] }
owo-colors = "3.5"
rustyline = "14.0"
strum = { version = "0.26", features = ["derive"] }
text-diff = "0.4"
ustr = "1.0"
Expand All @@ -131,7 +121,7 @@ thiserror = "2.0"
paste = "1.0"

# For the DB & values layer.
fjall = { version = "2.3.2", default-features = false, features = ["ssi_tx", "bytes"] }
fjall = { version = "2.4", default-features = false, features = ["ssi_tx", "bytes"] }
libc = "0.2"
text_io = "0.1" # Used for reading text dumps.

Expand Down
9 changes: 6 additions & 3 deletions crates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ Binaries:
network `host`s
- `web-host` - like the above, but hosts an HTTP server which provides a websocket interface to the system.
as well as various web APIs.
- `console-host` - console host which connects as a user to the `daemon` and provides a readline-type interface to the
system.
- `model-checker` - a tool for using the `elle` tool from Jepsen for verifying transactional properties of the\
database
- `moot` - a comprensive test suite for verifying the correctness of the MOO implementation, including a battery of
tests ported from ToastStunt.

Libraries:

- `values` - crate that implements the core MOO discriminated union (`Var`) value type,
plus all associated types and traits.
- `rdb` - implementation of a custom in-memory quasi-relational MVCC database system
- `db` - implementation of the `WorldState` object database overtop of `rdb`
- `compiler` - the MOO language grammar, parser, AST, and codegen, as well as the decompiler & unparser
- `kernel` - the kernel of the MOO driver: virtual machine, task scheduler, implementations of all builtin\
functions
- `rpc-common` - provides types & functions used by both `daemon` and each host binary, for the RPC interface
- `rpc-async-client` - provides an async RPC client for the `daemon`'s RPC interface
- `rpc-sync-client` - provides a synchronous RPC client for the `daemon`'s RPC interface
3 changes: 0 additions & 3 deletions crates/compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ description = "Functions and structures for compilation and decompilation of MOO
[dev-dependencies]
pretty_assertions.workspace = true
test-case.workspace = true
tracing-test.workspace = true
unindent.workspace = true

[dependencies]
Expand All @@ -24,8 +23,6 @@ moor-values = { path = "../values" }
## General usefulness
bincode.workspace = true
bytes.workspace = true
daumtils.workspace = true
itertools.workspace = true
lazy_static.workspace = true
strum.workspace = true

Expand Down
2 changes: 0 additions & 2 deletions crates/daemon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ rpc-common = { path = "../rpc-common" }
## Command line arguments parsing.
clap.workspace = true
clap_derive.workspace = true
strum.workspace = true

# General.
bincode.workspace = true
bytes.workspace = true
color-eyre.workspace = true
daumtils.workspace = true
eyre.workspace = true
fjall.workspace = true
oneshot.workspace = true
Expand Down
4 changes: 0 additions & 4 deletions crates/db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ description = "Interfaces for describing the worldstate of a moor database"

[dev-dependencies]
tempfile.workspace = true
tracing-test.workspace = true

[dependencies]
## Own
Expand All @@ -22,12 +21,9 @@ moor-values = { path = "../values" }
## Error declaration/ handling
bytes.workspace = true
crossbeam-channel.workspace = true
daumtils.workspace = true
fjall.workspace = true
im.workspace = true
lazy_static.workspace = true
oneshot.workspace = true
strum.workspace = true
tempfile.workspace = true
thiserror.workspace = true
tracing.workspace = true
Expand Down
6 changes: 0 additions & 6 deletions crates/kernel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,11 @@ moor-db = { path = "../db" }

criterion.workspace = true
eyre.workspace = true
inventory.workspace = true
pretty_assertions.workspace = true
tempfile.workspace = true
test-case.workspace = true
test_each_file.workspace = true
text-diff.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
tracing-test.workspace = true
unindent.workspace = true

[[test]]
name = "regression-suite"
Expand All @@ -52,7 +47,6 @@ bytes.workspace = true
chrono.workspace = true
crossbeam-channel.workspace = true
daumtils.workspace = true
decorum.workspace = true
encoding_rs.workspace = true
lazy_static.workspace = true
libc.workspace = true
Expand Down
9 changes: 4 additions & 5 deletions crates/kernel/src/builtins/bf_num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// this program. If not, see <https://www.gnu.org/licenses/>.
//

use decorum::R64;
use rand::Rng;

use moor_compiler::offset_for_builtin;
Expand Down Expand Up @@ -45,8 +44,8 @@ fn bf_min(bf_args: &mut BfCallState<'_>) -> Result<BfRet, BfErr> {
match (&bf_args.args[0].variant(), &bf_args.args[1].variant()) {
(Variant::Int(a), Variant::Int(b)) => Ok(Ret(v_int(*a.min(b)))),
(Variant::Float(a), Variant::Float(b)) => {
let m = R64::from(*a).min(R64::from(*b));
Ok(Ret(v_float(m.into())))
let m = a.min(*b);
Ok(Ret(v_float(m)))
}
_ => Err(BfErr::Code(E_TYPE)),
}
Expand All @@ -61,8 +60,8 @@ fn bf_max(bf_args: &mut BfCallState<'_>) -> Result<BfRet, BfErr> {
match (&bf_args.args[0].variant(), &bf_args.args[1].variant()) {
(Variant::Int(a), Variant::Int(b)) => Ok(Ret(v_int(*a.max(b)))),
(Variant::Float(a), Variant::Float(b)) => {
let m = R64::from(*a).max(R64::from(*b));
Ok(Ret(v_float(m.into())))
let m = a.max(*b);
Ok(Ret(v_float(m)))
}
_ => Err(BfErr::Code(E_TYPE)),
}
Expand Down
7 changes: 0 additions & 7 deletions crates/model-checker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,16 @@ clap.workspace = true
clap_derive.workspace = true
color-eyre.workspace = true
eyre.workspace = true
pretty_assertions.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true

# Auth/Auth
ed25519-dalek.workspace = true
pem.workspace = true
rusty_paseto.workspace = true

## ZMQ / RPC
tmq.workspace = true
uuid.workspace = true

## Asynchronous transaction processing & networking
futures.workspace = true
tokio.workspace = true
tokio-util.workspace = true

edn-format.workspace = true
rand.workspace = true
1 change: 0 additions & 1 deletion crates/rpc-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ bincode.workspace = true
thiserror.workspace = true

# Auth/Auth
ed25519-dalek.workspace = true
pem.workspace = true
rusty_paseto.workspace = true
5 changes: 0 additions & 5 deletions crates/telnet-host/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ uuid.workspace = true
## Rich content
termimad.workspace = true

# Auth/Auth
ed25519-dalek.workspace = true
pem.workspace = true
rusty_paseto.workspace = true

# Testing
[dev-dependencies]
escargot.workspace = true
Expand Down
2 changes: 0 additions & 2 deletions crates/values/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ description = "The set of values, and model/entities used across the system"
binary-layout.workspace = true
bincode.workspace = true
bytes.workspace = true
daumtils.workspace = true
decorum.workspace = true
enum-primitive-derive.workspace = true
im.workspace = true
itertools.workspace = true
Expand Down
11 changes: 2 additions & 9 deletions crates/values/src/var/variant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ use crate::var::Associative;
use crate::var::{map, string, Sequence};
use crate::var::{Error, Obj};
use bincode::{Decode, Encode};
use decorum::R64;
use num_traits::ToPrimitive;
use std::cmp::Ordering;
use std::fmt::{Debug, Formatter};
use std::hash::{Hash, Hasher};
Expand All @@ -42,7 +40,7 @@ impl Hash for Variant {
Variant::None => 0.hash(state),
Variant::Obj(o) => o.hash(state),
Variant::Int(i) => i.hash(state),
Variant::Float(f) => f.to_f64().unwrap().to_bits().hash(state),
Variant::Float(f) => f.to_bits().hash(state),
Variant::List(l) => l.hash(state),
Variant::Str(s) => s.hash(state),
Variant::Map(m) => m.hash(state),
Expand All @@ -57,12 +55,7 @@ impl Ord for Variant {
(Variant::None, Variant::None) => Ordering::Equal,
(Variant::Obj(l), Variant::Obj(r)) => l.cmp(r),
(Variant::Int(l), Variant::Int(r)) => l.cmp(r),
(Variant::Float(l), Variant::Float(r)) => {
// For floats, we wrap in decorum first.
let l = R64::from(l.to_f64().unwrap());
let r = R64::from(r.to_f64().unwrap());
l.cmp(&r)
}
(Variant::Float(l), Variant::Float(r)) => l.total_cmp(r),
(Variant::List(l), Variant::List(r)) => l.cmp(r),
(Variant::Str(l), Variant::Str(r)) => l.cmp(r),
(Variant::Map(l), Variant::Map(r)) => l.cmp(r),
Expand Down

0 comments on commit ac876f0

Please sign in to comment.