Skip to content

Commit e09904a

Browse files
committed
Merge branch 'v0.2-beta' into 'main'
v.0.2.48-beta See merge request mech-lang/mech!123
2 parents c02a898 + 47834d4 commit e09904a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+4254
-1334
lines changed

Cargo.toml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mech"
3-
version = "0.2.47"
3+
version = "0.2.48"
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,11 +18,11 @@ gitlab = { repository = "mech-lang/mech", branch = "main" }
1818
maintenance = { status = "actively-developed" }
1919

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

25-
clap = {version = "4.5.32", features = ["cargo"]}
25+
clap = {version = "4.5.40", features = ["cargo"]}
2626
colored = "3.0.0"
2727
bincode = "2.0.1"
2828
serde = "1.0.219"
@@ -32,11 +32,11 @@ crossbeam-channel = "0.5.14"
3232
crossterm = "0.29.0"
3333
tabled = "0.18.0"
3434
nalgebra = "0.33.2"
35-
indexmap = {version = "2.9.0", features = ["serde"]}
35+
indexmap = {version = "2.10.0", features = ["serde"]}
3636
nom = "7.1.3"
3737
ctrlc = "3.4.5"
3838
csv = "1.3.1"
39-
reqwest = {version = "0.12.15", features = ["blocking"]}
39+
reqwest = {version = "0.12.20", features = ["blocking"]}
4040
chrono = "0.4.40"
4141
warp = {version = "0.3.7", features = ["compression"]}
4242
tokio = { version = "1.44.1", features = ["full"] }
@@ -53,7 +53,8 @@ members = [
5353
"src/syntax",
5454
"src/interpreter",
5555
"src/wasm",
56-
"notebook"]
56+
"notebook",
57+
"mech-app/src-tauri"]
5758

5859
[build-dependencies]
5960
winres = "0.1.12"
@@ -77,13 +78,13 @@ mech-interpreter = { path = 'src/interpreter'}
7778
#mech-logic = { path = '../machines/logic' }
7879

7980
[patch.'https://gitlab.com/mech-lang/core']
80-
mech-core = { path = 'src/core', version = '0.2.47' }
81+
mech-core = { path = 'src/core', version = '0.2.48' }
8182

8283
[patch.'https://gitlab.com/mech-lang/syntax']
83-
mech-syntax = { path = 'src/syntax', version = '0.2.47' }
84+
mech-syntax = { path = 'src/syntax', version = '0.2.48' }
8485

8586
[patch.'https://gitlab.com/mech-lang/interpreter']
86-
mech-interpreter = { path = 'src/interpreter', version = '0.2.47' }
87+
mech-interpreter = { path = 'src/interpreter', version = '0.2.48' }
8788

8889
#[patch.'https://gitlab.com/mech-lang/wasm']
8990
#mech-wasm = { path = 'src/wasm', version = '0.2.44' }

docs/I.getting-started/install.mec

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Download and Install Mech
66

77
The easiest way to install Mech is to use the installer provided for your platform. The installer includes the `mech` command-line tool, which is a standalone executable that includes everything you need to get started with Mech.
88

9-
- **Windows** - [x86-64](https://github.com/mech-lang/mech/releases/download/v0.2.47-beta/mech-installer-v0.2.47-beta-win-x86-64.exe)
9+
- **Windows** - [x86-64](https://github.com/mech-lang/mech/releases/download/v0.2.48-beta/mech-installer-v0.2.48-beta-win-x86-64.exe)
1010

1111
Right now, the installer is only available for Windows, but we are working on providing installers for other platforms in the future.
1212

@@ -19,10 +19,10 @@ Precompiled binaries are available for the following platforms:
1919

2020
| OS | Architecture |
2121
| ---------- | ------------------------------------------------------------------------------------------------------------ |
22-
| **Wndows** | [x86-64](https://github.com/mech-lang/mech/releases/download/v0.2.47-beta/mech-v0.2.47-beta-win-x86-64.7z) |
23-
| **Linux** | [x86-64](https://github.com/mech-lang/mech/releases/download/v0.2.47-beta/mech-v0.2.47-beta-win-x86-64.7z) |
24-
| **macOS** | [aarch64](https://github.com/mech-lang/mech/releases/download/v0.2.47-beta/mech-v0.2.47-beta-mac-aarch64.zip) |
25-
| **Web** | [wasm](https://github.com/mech-lang/mech/releases/download/v0.2.47-beta/mech_wasm_bg.wasm.br) |
22+
| **Wndows** | [x86-64](https://github.com/mech-lang/mech/releases/download/v0.2.48-beta/mech-v0.2.48-beta-win-x86-64.7z) |
23+
| **Linux** | [x86-64](https://github.com/mech-lang/mech/releases/download/v0.2.48-beta/mech-v0.2.48-beta-win-x86-64.7z) |
24+
| **macOS** | [aarch64](https://github.com/mech-lang/mech/releases/download/v0.2.48-beta/mech-v0.2.48-beta-mac-aarch64.zip) |
25+
| **Web** | [wasm](https://github.com/mech-lang/mech/releases/download/v0.2.48-beta/mech_wasm_bg.wasm.br) |
2626

2727
You can find previous releases and release notes at [/mech-lang/mech/releases](https://github.com/mech-lang/mech/releases).
2828

docs/IV.design/specification.mec

Lines changed: 53 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ punctuation := period
122122
| apostrophe ;
123123
```
124124

125-
**Examples:**
125+
(3.2.2.1) Examples
126126

127127
```
128128
. ! ? , : ; " '
@@ -148,7 +148,7 @@ symbol := ampersand
148148
| underscore ;
149149
```
150150

151-
**Examples:**
151+
(3.2.3.1) Examples
152152

153153
```
154154
& $ | % @ / # = \ ~ + - * ^ _
@@ -167,7 +167,7 @@ grouping-symbol := left-parenthesis
167167
| right-bracket ;
168168
```
169169

170-
**Examples:**
170+
(3.2.4.1) Examples
171171

172172
```
173173
( ) < > { } [ ]
@@ -207,32 +207,38 @@ Because Mech has a focus on literate programming, comment have less of an emphas
207207

208208
Therefore, comments are primarily used for writing notes inline with the code that cannot be broken out into a paragraph. For example, to make a note within a state machine definition.
209209

210-
**Examples:**
210+
(3.3.1) Examples
211211

212212
Here are some ways to write a comment in Mech:
213213

214214
```
215-
-- Single line comment.
216-
// Also a single line comment.
215+
-- Comment prefix with --
216+
// Comment prefixed with //
217+
-- Supports formatting like **bold**, __underline__, `inline code`, and [links](https://example.com).
217218
x := 1 -- Comment after an expression
218219
```
219220

220221
When parsed and rendered, these become:
221222

222-
```mech-comment
223+
```mech:disabled
223224
-- Comment prefix with --
224225
// Comment prefixed with //
226+
-- Supports formatting like **bold**, __underline__, `inline code`, and [links](https://example.com).
225227
x := 1 -- Comment after an expression
226228
```
227229

230+
One special ability comments have is they can be used to print out the evaluation of a Mech code statement.
231+
232+
qq := 10 * 20 -- The value of qq is {qq}
233+
228234
(3.4) Keywords
229235

230236
There are only two keywords in Mech: `true` and `false`. Because Mech is designed to be used by non-English speakers, the syntax allows for an alternative representation, which can be used in place of the English keywords.
231237

232-
| Keyword | Alternative |
233-
|---------|-------------|
234-
| true | |
235-
| false | |
238+
| Keyword | Alternative |
239+
|-----------|-------------|
240+
| `true` | `✓` |
241+
| `false` | `✗` |
236242

237243
This allows users to write code in their native language without the need to learn English keywords.
238244

@@ -281,12 +287,13 @@ Mech supports several types of literals, which are used to represent values in t
281287
- `f32` - 32-bit floating-point number
282288
- `f64` - 64-bit floating-point number
283289
- **Imaginary** - Represent imaginary components of complex numbers.
284-
- **String** - A sequence of UTF-8 characters representing text.
285-
- `string` - A sequence of characters enclosed in double quotes.
286-
- **Boolean** - Represents logical truth values.
290+
- **String**
291+
- `string` - A sequence of UTF-8 characters representing text.
292+
- **Boolean**
293+
- `bool` - Represents logical truth values.
287294
- **Atom** - A symbolic constant, often used for tags or enums.
288-
- **Empty** - Represents an empty value, placeholder, or the absence of a value.
289-
- **Kind** - A meta-type that categorizes types
295+
- **Empty**
296+
- `_` - Represents an empty value, placeholder, or the absence of a value.
290297

291298
(4.1) Kinds
292299

@@ -334,15 +341,12 @@ Kinds are used to specify the type of a literal or expression in Mech. Kinds are
334341

335342
**Examples:**
336343

337-
```
338344
<_> -- Empty
339345
<`A> -- Atom
340346
<{A:B}> -- Map
341-
<(A,B)=(C,D)> -- Function
342347
<{A}> -- Set
343348
<[A]> -- Matrix
344349
<(A,B,C)> -- Tuple
345-
```
346350

347351
(4.2) Numbers
348352

@@ -364,7 +368,7 @@ An integer literal is a sequence of digits representing a whole number. Mech sup
364368
- Octal: Prefixed with 0o, containing digits 0-7 (e.g., 0o755).
365369
- Binary: Prefixed with 0b, containing only 0 and 1 (e.g., 0b1010).
366370

367-
**Examples:**
371+
(4.2.1.1) Examples
368372

369373
42 -- decimal
370374
0d42 -- decimal
@@ -373,13 +377,15 @@ An integer literal is a sequence of digits representing a whole number. Mech sup
373377
0o12345670 -- octal
374378
0b100110101 -- binary
375379

380+
(4.2.1.2) Kind
381+
376382
By default, Mech can represent integers in the following data types:
377383

378384
- Signed: `i8`, `i16`, `i32`, `i64`, `i128`
379385
- Unsigned: `u8`, `u16`, `u32`, `u64`, `u128`
380386
- Float: `f32`, `f64`
381387

382-
Unless specified or inferred, the default data type for integer literals is `f64`. This is different from many systems languages but consist with other languages like Python, JavaScript, and Ruby.
388+
Unless specified or inferred, the default data type for integer literals is `f64`. This is different from many systems languages but consist with other languages like Matlab, Python, and Javascript.
383389

384390
(4.2.2) Fractional Numbers
385391

@@ -404,7 +410,7 @@ A floating-point literal represents a real number, potentially with a fractional
404410
- **Scientific notation**: A number followed by e or E, then an optional sign and exponent (e.g., `2.5e10`, `1e-3`)
405411
- **Rational literals**: A fraction of two integers separated by `/` (e.g., `3/4`, `22/7`) — these may be evaluated as exact values or approximated depending on context.
406412

407-
**Examples:**
413+
(4.2.2.1) Examples
408414

409415
3.14 -- decimal float
410416
0.001 -- decimal float
@@ -657,9 +663,14 @@ A Set is defined using curly braces `{}` and contains a comma-separated list of
657663

658664
(5.2.4) Kind
659665

660-
```
661-
<{u8}:3>
662-
```
666+
The kind of a set consists of:
667+
668+
- The kind of the elements
669+
- The number of elements, which can be dynamic or fixed
670+
671+
<{u8}> -- Generic set of unsigned 8-bit integers
672+
<{u8}:3> -- Set of 3 unsigned 8-bit integers
673+
<{{i8}}> -- Set of sets of signed 8-bit integers
663674

664675
(5.3) Map
665676

@@ -696,27 +707,30 @@ A Map is defined using curly braces `{}` and contains a set of key-value mapping
696707

697708
(5.3.3) Examples
698709

699-
```
700-
- Empty: {_:_}
701-
- Single element: {"a":1}
702-
- Multiple elements: {"a":10, "b":20, "c": 30}
703-
- Nested: {"a":{"a":10}}
704-
- Multiline:
705-
{ "a" : 10
706-
"b" : 20
707-
"c" : 30 }
708-
```
710+
{_:_} -- Empty map
711+
{"a": 1} -- Map with a single key-value pair
712+
{1: 0xA, 2: 0xB, 3: 0xC} -- Map with multiple key-value pairs
713+
{"a": {"b": 10}} -- Nested map
714+
{ "a" : 10
715+
"b" : 20
716+
"c" : 30 } -- Multiline map
709717

710718
**Edge Cases**
711719

712720
- `{_:_}` represents an empty map.
713-
- Duplicate keys result in an overwrite of the previous value, as long as the map is mutable.
714-
- `{1: "hello", 2: "world"}` is valid, but `{1: "hello", "one": "world"}` results in a type error if homogeneity is enforced.
721+
- If the map is mutable, inserting a duplicate key overwrites the previous value
722+
- `{1: "hello", 2: "world"}` is valid, but `{1: "hello", "one": "world"}` results in an error, as the keys are not homogenous.
715723

716724
(5.3.4) Kind
717725

718-
- A map of strings to u8s: `<{string:u8}>`
719-
- A map of strings to a map of strings to u8: `<{string:{string:u8}}>`
726+
The kind of a map consists of:
727+
728+
- The kind of the keys
729+
- The kind of the values
730+
- The number of key-value pairs, which can be dynamic or fixed
731+
732+
<{string:u8}> -- A map of strings to unsigned 8-bit integers
733+
<{string:{string:u8}}> -- A map of strings to a map of strings to unsigned 8-bit integers
720734

721735
(5.4) Tuple
722736

docs/index.mec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Mech Programming Language Documentation
6666

6767
docs/machine := {
6868
name: "docs"
69-
version: "v0.2.47"
69+
version: "v0.2.48"
7070
authors: ["Corey Montella"]
7171
machine-url: "https://gitlab.com/mech-lang/mech/docs"
7272
license: "Apache-2.0"}

0 commit comments

Comments
 (0)