Skip to content

Commit 618ac40

Browse files
committed
Merge branch 'v0.2-beta' into 'main'
V0.2.36 beta See merge request mech-lang/mech!106
2 parents 6acc3bc + be6a155 commit 618ac40

File tree

21 files changed

+1183
-372
lines changed

21 files changed

+1183
-372
lines changed

Cargo.toml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mech"
3-
version = "0.2.35"
3+
version = "0.2.36"
44
authors = ["Corey Montella <[email protected]>"]
55
description = "Mech is a reactive programming language for building robots, games, and animations."
66
documentation = "https://mech-lang.org/docs"
@@ -18,29 +18,29 @@ gitlab = { repository = "mech-lang/mech", branch = "main" }
1818
maintenance = { status = "actively-developed" }
1919

2020
[dependencies]
21-
mech-core = "0.2.35"
22-
mech-syntax = "0.2.35"
23-
mech-interpreter = "0.2.35"
21+
mech-core = "0.2.36"
22+
mech-syntax = "0.2.36"
23+
mech-interpreter = "0.2.36"
2424

25-
clap = {version = "4.5.30", features = ["cargo"]}
25+
clap = {version = "4.5.32", features = ["cargo"]}
2626
colored = "3.0.0"
27-
bincode = "2.0.0"
28-
serde = "1.0.218"
29-
serde_derive = "1.0.218"
27+
bincode = "2.0.1"
28+
serde = "1.0.219"
29+
serde_derive = "1.0.219"
3030
serde_json = "1.0.140"
3131
crossbeam-channel = "0.5.14"
3232
crossterm = "0.28.1"
3333
lazy_static = "1.5.0"
3434
tabled = "0.18.0"
3535
nalgebra = "0.33.2"
36-
indexmap = {version = "2.7.1", features = ["serde"]}
36+
indexmap = {version = "2.8.0", features = ["serde"]}
3737
nom = "7.1.3"
3838
ctrlc = "3.4.5"
3939
csv = "1.3.1"
40-
reqwest = {version = "0.12.12", features = ["blocking"]}
40+
reqwest = {version = "0.12.15", features = ["blocking"]}
4141
chrono = "0.4.40"
4242
warp = {version = "0.3.7", features = ["compression"]}
43-
tokio = { version = "1.43.0", features = ["full"] }
43+
tokio = { version = "1.44.1", features = ["full"] }
4444
base64 = "0.22.1"
4545
rand = "0.8.5"
4646
notify = "8.0.0"

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ cd mech
2424
cargo build --bin mech --release
2525
```
2626

27+
Alternatively, you can install Mech directly via Rust's [Cargo](https://crates.io/crates/mech) utility:
28+
29+
```bash
30+
cargo install mech
31+
```
32+
2733
## 📚 Documentation
2834

2935
New to Mech? Start with [Learn Mech in Fifteen Minutes](https://gitlab.com/mech-lang/docs/-/raw/v0.2-beta/III.guides/MechFifteen.mec).

examples

Lines changed: 0 additions & 1 deletion
This file was deleted.

include/style.css

Lines changed: 156 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,20 @@ body {
4444
}
4545

4646
.mech-toc::-webkit-scrollbar {
47-
width: 8px; /* Adjust width as needed */
47+
width: 8px;
4848
}
4949

5050
.mech-toc::-webkit-scrollbar-track {
51-
background: transparent; /* Makes the track invisible */
51+
background: transparent;
5252
}
5353

5454
.mech-toc::-webkit-scrollbar-thumb {
55-
background: rgba(128, 128, 128, 0.7); /* Grey with some transparency */
56-
border-radius: 10px; /* Rounds the scrollbar */
55+
background: rgba(128, 128, 128, 0.7);
56+
border-radius: 10px;
5757
}
5858

5959
.mech-toc::-webkit-scrollbar-thumb:hover {
60-
background: rgba(128, 128, 128, 0.9); /* Slightly darker on hover */
60+
background: rgba(128, 128, 128, 0.9);
6161
}
6262

6363
/* For Firefox */
@@ -218,6 +218,20 @@ h4:before{
218218
margin-top: 5px;
219219
}
220220

221+
.mech-program h3 a {
222+
color: #f2ead9;
223+
text-decoration: none;
224+
}
225+
226+
.mech-program h3 {
227+
font-family: 'FiraCodeRegular', monospace;
228+
color: #f2ead9;
229+
font-size: 14pt;
230+
font-weight: bold;
231+
margin-bottom: 10px;
232+
letter-spacing: 1px;
233+
}
234+
221235
.mech-program h4 a {
222236
color: #f2ead9;
223237
text-decoration: none;
@@ -280,6 +294,73 @@ h4:before{
280294
scrollbar-width: thin;
281295
}
282296

297+
.mech-grammar {
298+
background-color: #171D21;
299+
color: #ada594;
300+
font-family: 'FiraCodeLight', monospace;
301+
font-size: 12pt;
302+
line-height: 18px;
303+
border-radius: 0px;
304+
padding: 30px;
305+
border-radius: 10px;
306+
overflow-x: auto;
307+
}
308+
309+
.mech-grammar::-webkit-scrollbar {
310+
height: 8px; /* Horizontal scrollbar height */
311+
}
312+
313+
.mech-grammar::-webkit-scrollbar-track {
314+
background: transparent;
315+
}
316+
317+
.mech-grammar::-webkit-scrollbar-thumb {
318+
background: rgba(128, 128, 128, 0.7);
319+
border-radius: 10px;
320+
}
321+
322+
.mech-grammar::-webkit-scrollbar-thumb:hover {
323+
background: rgba(128, 128, 128, 0.9);
324+
}
325+
326+
/* Firefox */
327+
.mech-grammar {
328+
scrollbar-color: rgba(128, 128, 128, 0.7) transparent;
329+
scrollbar-width: thin;
330+
}
331+
332+
.mech-grammar-identifier {
333+
color: #ccbbc2;
334+
}
335+
336+
.mech-grammar-definition {
337+
color: #ccbbc2;
338+
}
339+
340+
.mech-grammar-definition a {
341+
color: #ccbbc2;
342+
text-decoration: none;
343+
}
344+
345+
.mech-grammar-definition a:hover {
346+
color: #ccbbc2;
347+
text-decoration: underline;
348+
}
349+
350+
.mech-grammar-choice {
351+
margin-left: 20px;
352+
}
353+
354+
.mech-grammar-sequence {
355+
margin-left: 20px;
356+
}
357+
358+
359+
.mech-grammar-terminal {
360+
color: #ef5f90;
361+
}
362+
363+
283364
.mech-code {
284365
}
285366

@@ -618,4 +699,74 @@ li p {
618699
}
619700

620701
.mech-table-row {
702+
}
703+
704+
.mech-table {
705+
width: 100%;
706+
border-collapse: collapse;
707+
background-color: #2F353B;
708+
color: #f2ead9;
709+
}
710+
711+
.mech-table thead {
712+
background-color: #171D21;
713+
}
714+
715+
.mech-table .mech-table-header-cell {
716+
color: #f2ead9;
717+
padding: 10px;
718+
text-align: left;
719+
font-weight: bold;
720+
border-bottom: 2px solid #333;
721+
}
722+
723+
.mech-table .mech-table-row-even {
724+
background-color: #232A30;
725+
}
726+
727+
.mech-table .mech-table-row-odd {
728+
background-color: #171D21;
729+
}
730+
731+
.mech-table .mech-table-cell {
732+
padding: 10px;
733+
border-bottom: 1px solid #333;
734+
text-align: left;
735+
}
736+
737+
.mech-table tbody tr:hover {
738+
background-color: #3A4148;
739+
}
740+
741+
.mech-table a {
742+
color: #ee6262;
743+
text-decoration: none;
744+
}
745+
746+
.mech-table a:hover {
747+
color: #f2ead9;
748+
}
749+
750+
.mech-block-quote {
751+
background-color: #232A30;
752+
border-left: 5px solid #ee6262;
753+
padding: 15px 20px;
754+
color: #f2ead9;
755+
font-style: italic;
756+
margin: 20px 0;
757+
border-radius: 5px;
758+
}
759+
760+
.mech-block-quote blockquote {
761+
margin: 0;
762+
padding: 0;
763+
font-size: 1.2em;
764+
}
765+
766+
.mech-thematic-break {
767+
border: 0;
768+
border-top: 2px solid #7e8892;
769+
margin: 30px 0;
770+
width: 100%;
771+
opacity: 0.7;
621772
}

src/bin/mech.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,9 @@ async fn main() -> Result<(), MechError> {
130130

131131
let mut intrp = Interpreter::new();
132132

133+
// --------------------------------------------------------------------------
133134
// Serve
134-
// ----------------------------------------------------------------
135+
// --------------------------------------------------------------------------
135136
if let Some(matches) = matches.subcommand_matches("serve") {
136137

137138
let port: String = matches.get_one::<String>("port").cloned().unwrap_or("8081".to_string());
@@ -146,16 +147,17 @@ async fn main() -> Result<(), MechError> {
146147
server.serve().await?;
147148

148149
}
150+
// --------------------------------------------------------------------------
149151
// Format
150-
// ----------------------------------------------------------------
152+
// --------------------------------------------------------------------------
151153
if let Some(matches) = matches.subcommand_matches("format") {
152154
let html_flag = matches.get_flag("html");
153155
let stylesheet_url = matches.get_one::<String>("stylesheet").cloned().unwrap_or("https://gitlab.com/mech-lang/mech/-/raw/v0.2-beta/include/style.css?ref_type=heads".to_string());
154156
let output_path = PathBuf::from(matches.get_one::<String>("output_path").cloned().unwrap_or(".".to_string()));
155157

156158
let mech_paths: Vec<String> = matches.get_many::<String>("mech_format_file_paths").map_or(vec![], |files| files.map(|file| file.to_string()).collect());
157159
let mut mechfs = MechFileSystem::new();
158-
160+
159161
// open file or url. If it's a local file load it from disk, if it's a url fetch it from internet
160162
let stylesheet = if stylesheet_url.starts_with("http") {
161163
match reqwest::get(&stylesheet_url).await {
@@ -245,8 +247,9 @@ async fn main() -> Result<(), MechError> {
245247
return Ok(());
246248
}
247249

250+
// --------------------------------------------------------------------------
248251
// Run
249-
// ----------------------------------------------------------------
252+
// --------------------------------------------------------------------------
250253
let mut paths = if let Some(m) = matches.get_many::<String>("mech_paths") {
251254
m.map(|s| s.to_string()).collect()
252255
} else { repl_flag = true; vec![] };
@@ -309,8 +312,9 @@ async fn main() -> Result<(), MechError> {
309312
print_prompt();
310313
}).expect("Error setting Ctrl-C handler");
311314

315+
// --------------------------------------------------------------------------
312316
// REPL
313-
// ----------------------------------------------------------------
317+
// --------------------------------------------------------------------------
314318
'REPL: loop {
315319
{
316320
let mut ci = caught_inturrupts.lock().unwrap();

src/core/Cargo.toml

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mech-core"
3-
version = "0.2.35"
3+
version = "0.2.36"
44
authors = ["Corey Montella <[email protected]>"]
55
description = "The Mech language runtime."
66
documentation = "http://docs.mech-lang.org"
@@ -60,32 +60,31 @@ VectorD = []
6060
MatrixD = []
6161

6262
[dependencies]
63+
base64 = "0.22.1"
64+
bincode = {version = "2.0.1", features = ["serde"]}
65+
brotli = "7.0.0"
6366
hashbrown = "0.15.2"
64-
serde = {version = "1.0.218", default-features = false, features = ["alloc", "derive"] }
65-
serde_derive = "1.0.218"
66-
rlibc = { version = "=1.0", optional = true }
67+
indexmap = {version = "2.8.0", features = ["serde"]}
6768
lazy_static = "1.5.0"
69+
libm = "0.2.11"
70+
nalgebra = "0.33.2"
71+
paste = "1.0.15"
72+
rayon = {version = "1.10.0", optional = true}
73+
rlibc = { version = "=1.0", optional = true }
6874
seahash = "4.1.0"
75+
serde = {version = "1.0.219", default-features = false, features = ["alloc", "derive"] }
76+
serde_derive = "1.0.219"
6977
serde_json = "1.0.140"
70-
indexmap = {version = "2.7.0", features = ["serde"]}
71-
rayon = {version = "1.10.0", optional = true}
72-
time = {version = "0.3.37", optional = true}
73-
ed25519-dalek = {version = "2.1.1", default-features = false, features = ["rand_core"]}
74-
getrandom = { version = "0.2.15", features = ["js"]}
75-
rand = "0.8.5"
76-
tinyrand = "0.5.0"
77-
rand_core = {version = "0.6.4"}
78-
wasm-bindgen = {version = "0.2.100", optional = true}
79-
nalgebra = "0.33.2"
80-
simba = "0.9.0"
81-
libm = "0.2.11"
8278
tabled = "0.18.0"
83-
paste = "1.0.15"
84-
rkyv = "0.8.10"
85-
bytemuck = "1.21.0"
86-
bincode = {version = "2.0.0", features = ["serde"]}
87-
base64 = "0.22.1"
88-
brotli = "7.0.0"
79+
wasm-bindgen = {version = "0.2.100", optional = true}
80+
#time = {version = "0.3.40", optional = true}
81+
#ed25519-dalek = {version = "2.1.1", default-features = false, features = ["rand_core"]}
82+
#rand = "0.9.0"
83+
#tinyrand = "0.5.0"
84+
#rand_core = {version = "0.9.3"}
85+
#simba = "0.9.0"
86+
#rkyv = "0.8.10"
87+
#bytemuck = "1.22.0"
8988

9089
[dependencies.web-sys]
9190
version = "0.3.77"
File renamed without changes.

src/core/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ extern crate hashbrown;
2424
extern crate serde_derive;
2525
extern crate serde;
2626
extern crate num_traits;
27-
extern crate ed25519_dalek;
28-
extern crate rand;
29-
extern crate getrandom;
27+
//extern crate ed25519_dalek;
28+
//extern crate rand;
3029

3130
extern crate seahash;
3231
extern crate indexmap;

0 commit comments

Comments
 (0)