Skip to content

Commit d3e053b

Browse files
committed
Update a few things, put some more basics into place
1 parent 515d936 commit d3e053b

File tree

4 files changed

+127
-37
lines changed

4 files changed

+127
-37
lines changed

Cargo.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "puke"
2+
name = "seaslug"
33
version = "0.0.0"
44
authors = ["Tyler Neely <[email protected]>"]
55
edition = "2018"
@@ -9,3 +9,10 @@ homepage = "https://github.com/spacejam/puke"
99
repository = "https://github.com/spacejam/puke"
1010

1111
[dependencies]
12+
lalrpop-util = "0.19.5"
13+
regex = "1.4.4"
14+
libc = "0.2.88"
15+
num_cpus = "1.13.0"
16+
17+
[build-dependencies]
18+
lalrpop = "0.19.5"

README.md

Lines changed: 23 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,45 @@
1-
# puke
1+
# seaslug
22

3-
a language that is happy and eager to suck at many things in pursuit of
4-
low-boilerplate, low-noise, highly reliable, high performance state machines
5-
with enforced strict error handling and built-in fault injection.
3+
small, beautiful, knowable, DOESN'T EXIST YET LOL
64

7-
puke may become a language that encourages users to write
8-
code that is usable by others and respectful to themselves
9-
by providing superior scheduling and concurrency facilities
10-
compared to what is generally available in current industrial
11-
languages.
5+
* non-turing complete, verified terminating code placed into well-defined interfaces similar to Erlang behaviors
6+
* strongly typed, powerful inference to minimize type noise
7+
* a runtime built from the beginning to take advantage of io_uring, immutable messaging, optimistic STM, and generally paying attention to modern scheduling research
8+
* the runtime tracks overall utilization and saturation
9+
* aims to maximize utilization while minimizing saturation (writes before reads before accepts for sockets)
10+
* infers contention causality encountered in the optimistic state layer and learns to step in as
11+
a traffic director, letting users avoid thinking about contention
12+
* leans into linear logic to enforce error handling in well-specified hierarchies, similar to Erlang supervisors
13+
* interpreter-first, but the interpreter itself aims to compile quickly so you can produce static optimized native binaries
14+
* built-in first-class fault injection, fuzzing, network simulation, model-based testing, and concurrent interleaving exploration
15+
* rich built-in data structures, first-class json support, first-class binary parsing support
1216

13-
##### puke should be an ideal language for building
17+
##### seaslug should be an ideal language for building
1418

1519
* databases
1620
* distributed systems
21+
* servers
22+
* scalable concurrent systems
1723
* multitenant infrastructure
1824

19-
##### puke does not aim to excel at
25+
##### seaslug does not aim to excel at
2026

2127
* building your own data structures
2228
* intensive numerical processing
2329
* short-lived CLI applications
2430
* embedded programming
2531

26-
##### ideas that may or may not lead to puke
32+
##### ideas that may or may not lead to seaslug
2733

28-
* erlang's terseness, focus on immutable message passing, explicit supervisor hierarchies, pattern matching
29-
* celf's nondeterminism and linear logic
34+
* erlang's terseness, behaviors, focus on immutable message passing, explicit supervisor hierarchies, pattern matching, binary parsing capabilities
35+
* celf's nondeterminism and linear logic
36+
* constraint handling rules's verification opportunities
3037
* prolog's declarative debugging, tables, provability of pure code
31-
* total functional programming
32-
* unison's effect systems
33-
* rust's restricted linear typing
34-
35-
##### puke should excel at
36-
37-
* testability
38-
* built-in network simulation, fail-points, concurrent interleaving exploration, model-based testing support
39-
* optimistic concurrency
40-
* shared mutable state regulated by optimistic software transactional memory, letting users avoid
41-
thinking about data races
42-
* scheduling
43-
* the runtime tracks overall utilization and saturation
44-
* aims to maximize utilization while minimizing saturation (writes before reads before accepts for sockets)
45-
* infers contention causality encountered in the optimistic state layer and learns to step in as
46-
a traffic director, letting users avoid thinking about contention
47-
* rich built-in data structures, first-class json support, first-class binary parsing support
38+
* total functional programming's restrictions on recursion and looping
4839

49-
##### puke is written in rust and takes advantage of things like
40+
##### seaslug is written in rust and takes advantage of things like
5041

5142
* io_uring
5243
* simdjson
5344
* sled
5445
* software transactional memory
55-
56-
57-
##### puke will have a gross name until it becomes something that is not actually gross

src/bin/puke.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
use puke::{Args, Interpreter};
2+
13
fn main() {
2-
println!("Hello, world!");
4+
let args = Args::parse();
5+
Interpreter::run(args);
36
}

src/lib.rs

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,95 @@
66
//! * first-class fault injection, simulation and model-based testing capabilities
77
//! * built-in data structures
88
//! * high quality scheduling built from the beginning to play well with io_uring and iocp
9+
10+
mod args;
11+
mod ast;
12+
mod cache_padded;
13+
mod ebr;
14+
mod histogram;
15+
mod io;
16+
mod lazy;
17+
mod machine_table;
18+
mod stack;
19+
20+
use lalrpop_util::lalrpop_mod;
21+
22+
pub use self::args::Args;
23+
24+
use self::{
25+
cache_padded::CachePadded, ebr::pin, histogram::Histogram, lazy::Lazy,
26+
machine_table::MachineTable, stack::Stack,
27+
};
28+
29+
#[cfg(any(test, feature = "lock_free_delays"))]
30+
mod debug_delay;
31+
32+
#[cfg(any(test, feature = "lock_free_delays"))]
33+
use debug_delay::debug_delay;
34+
35+
lalrpop_mod!(pub syntax);
36+
37+
/// This function is useful for inducing random jitter into our atomic
38+
/// operations, shaking out more possible interleavings quickly. It gets
39+
/// fully eliminated by the compiler in non-test code.
40+
#[cfg(not(any(test, feature = "lock_free_delays")))]
41+
const fn debug_delay() {}
42+
43+
/// The puke interpreter.
44+
pub struct Interpreter {
45+
ast: Ast,
46+
scheduler: Scheduler,
47+
}
48+
49+
impl Interpreter {
50+
pub fn run(args: Args) {
51+
println!(
52+
"
53+
+-------------------------------+
54+
w e l c o m e 2 p u k e :]
55+
+-------------------------------+"
56+
);
57+
println!();
58+
println!("{:?}", args);
59+
println!();
60+
61+
let mut interpreter = Interpreter {
62+
ast: args.module.as_ref().map(|m| Ast::load(&m)).unwrap_or(Ast),
63+
scheduler: Scheduler::start(&args),
64+
};
65+
66+
interpreter.repl();
67+
}
68+
69+
fn repl(&mut self) {}
70+
}
71+
72+
/// The puke AST.
73+
struct Ast;
74+
75+
impl Ast {
76+
fn load(path: &str) -> Ast {
77+
todo!()
78+
}
79+
}
80+
81+
/// The puke scheduler.
82+
struct Scheduler {
83+
work: MachineTable,
84+
}
85+
86+
impl Scheduler {
87+
fn start(args: &Args) -> Scheduler {
88+
Scheduler {
89+
work: MachineTable::default(),
90+
}
91+
}
92+
}
93+
94+
struct MessageBus;
95+
96+
struct Stm;
97+
98+
struct Machine {
99+
ast: Ast,
100+
}

0 commit comments

Comments
 (0)