@devaloop/devalang 0.0.1-alpha.1 → 0.0.1-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.devalang +4 -0
- package/Cargo.toml +49 -45
- package/README.md +127 -46
- package/docs/CHANGELOG.md +172 -0
- package/docs/COMMANDS.md +60 -6
- package/docs/CONFIG.md +30 -0
- package/docs/ROADMAP.md +10 -7
- package/docs/SYNTAX.md +100 -18
- package/docs/TODO.md +31 -28
- package/examples/condition.deva +20 -0
- package/examples/group.deva +12 -0
- package/examples/index.deva +13 -4
- package/examples/loop.deva +16 -0
- package/examples/samples/hat-808.wav +0 -0
- package/examples/synth.deva +14 -0
- package/examples/variables.deva +9 -0
- package/out-tsc/bin/devalang.exe +0 -0
- package/out-tsc/scripts/version/fetch.js +1 -5
- package/package.json +5 -4
- package/project-version.json +3 -3
- package/rust/cli/build.rs +114 -28
- package/rust/cli/check.rs +96 -103
- package/rust/cli/init.rs +79 -0
- package/rust/cli/mod.rs +203 -1
- package/rust/cli/play.rs +193 -0
- package/rust/cli/template.rs +57 -0
- package/rust/config/loader.rs +13 -0
- package/rust/config/mod.rs +16 -0
- package/rust/core/audio/engine.rs +214 -0
- package/rust/core/audio/evaluator.rs +31 -0
- package/rust/core/audio/interpreter/arrow_call.rs +129 -0
- package/rust/core/audio/interpreter/call.rs +70 -0
- package/rust/core/audio/interpreter/condition.rs +69 -0
- package/rust/core/audio/interpreter/driver.rs +236 -0
- package/rust/core/audio/interpreter/let_.rs +19 -0
- package/rust/core/audio/interpreter/load.rs +18 -0
- package/rust/core/audio/interpreter/loop_.rs +67 -0
- package/rust/core/audio/interpreter/mod.rs +12 -0
- package/rust/core/audio/interpreter/sleep.rs +36 -0
- package/rust/core/audio/interpreter/spawn.rs +84 -0
- package/rust/core/audio/interpreter/tempo.rs +16 -0
- package/rust/core/audio/interpreter/trigger.rs +69 -0
- package/rust/core/audio/loader/mod.rs +1 -0
- package/rust/core/audio/loader/trigger.rs +52 -0
- package/rust/core/audio/mod.rs +6 -0
- package/rust/core/audio/player.rs +54 -0
- package/rust/core/audio/renderer.rs +54 -0
- package/rust/core/builder/mod.rs +70 -27
- package/rust/core/debugger/lexer.rs +27 -0
- package/rust/core/debugger/mod.rs +13 -49
- package/rust/core/debugger/preprocessor.rs +27 -0
- package/rust/core/debugger/store.rs +25 -0
- package/rust/core/error/mod.rs +60 -0
- package/rust/core/lexer/handler/arrow.rs +31 -0
- package/rust/core/lexer/handler/at.rs +21 -0
- package/rust/core/lexer/handler/brace.rs +41 -0
- package/rust/core/lexer/handler/colon.rs +21 -0
- package/rust/core/lexer/handler/comment.rs +30 -0
- package/rust/core/lexer/handler/dot.rs +21 -0
- package/rust/core/lexer/handler/driver.rs +230 -0
- package/rust/core/lexer/handler/identifier.rs +41 -0
- package/rust/core/lexer/handler/indent.rs +52 -0
- package/rust/core/lexer/handler/mod.rs +14 -0
- package/rust/core/lexer/handler/newline.rs +23 -0
- package/rust/core/lexer/handler/number.rs +31 -0
- package/rust/core/lexer/handler/operator.rs +44 -0
- package/rust/core/lexer/handler/string.rs +63 -0
- package/rust/core/lexer/mod.rs +37 -319
- package/rust/core/lexer/token.rs +86 -0
- package/rust/core/mod.rs +6 -2
- package/rust/core/parser/driver.rs +331 -0
- package/rust/core/parser/handler/arrow_call.rs +126 -0
- package/rust/core/parser/handler/at.rs +162 -0
- package/rust/core/parser/handler/bank.rs +41 -0
- package/rust/core/parser/handler/condition.rs +74 -0
- package/rust/core/parser/handler/dot.rs +112 -0
- package/rust/core/parser/handler/identifier/call.rs +41 -0
- package/rust/core/parser/handler/identifier/group.rs +75 -0
- package/rust/core/parser/handler/identifier/let_.rs +133 -0
- package/rust/core/parser/handler/identifier/mod.rs +51 -0
- package/rust/core/parser/handler/identifier/sleep.rs +33 -0
- package/rust/core/parser/handler/identifier/spawn.rs +41 -0
- package/rust/core/parser/handler/identifier/synth.rs +65 -0
- package/rust/core/parser/handler/loop_.rs +72 -0
- package/rust/core/parser/handler/mod.rs +8 -0
- package/rust/core/parser/handler/tempo.rs +47 -0
- package/rust/core/parser/mod.rs +3 -200
- package/rust/core/parser/statement.rs +96 -0
- package/rust/core/preprocessor/loader.rs +229 -0
- package/rust/core/preprocessor/mod.rs +2 -24
- package/rust/core/preprocessor/module.rs +42 -56
- package/rust/core/preprocessor/processor.rs +76 -0
- package/rust/core/preprocessor/resolver/bank.rs +41 -51
- package/rust/core/preprocessor/resolver/call.rs +123 -0
- package/rust/core/preprocessor/resolver/condition.rs +92 -0
- package/rust/core/preprocessor/resolver/driver.rs +227 -0
- package/rust/core/preprocessor/resolver/group.rs +61 -0
- package/rust/core/preprocessor/resolver/let_.rs +31 -0
- package/rust/core/preprocessor/resolver/loop_.rs +76 -67
- package/rust/core/preprocessor/resolver/mod.rs +12 -111
- package/rust/core/preprocessor/resolver/spawn.rs +58 -0
- package/rust/core/preprocessor/resolver/synth.rs +50 -0
- package/rust/core/preprocessor/resolver/tempo.rs +40 -61
- package/rust/core/preprocessor/resolver/trigger.rs +90 -154
- package/rust/core/preprocessor/resolver/value.rs +78 -0
- package/rust/core/shared/duration.rs +8 -0
- package/rust/core/shared/mod.rs +2 -0
- package/rust/core/shared/value.rs +28 -0
- package/rust/core/store/export.rs +28 -0
- package/rust/core/store/global.rs +39 -0
- package/rust/core/store/import.rs +28 -0
- package/rust/core/store/mod.rs +4 -0
- package/rust/core/store/variable.rs +28 -0
- package/rust/core/utils/mod.rs +2 -0
- package/rust/core/utils/path.rs +31 -0
- package/rust/core/utils/validation.rs +37 -0
- package/rust/lib.rs +161 -1
- package/rust/main.rs +46 -30
- package/rust/utils/file.rs +35 -0
- package/rust/utils/logger.rs +108 -34
- package/rust/utils/mod.rs +3 -2
- package/rust/utils/{loader.rs → spinner.rs} +2 -0
- package/rust/utils/watcher.rs +33 -0
- package/templates/minimal/.devalang +5 -0
- package/templates/minimal/README.md +202 -0
- package/templates/minimal/src/index.deva +2 -0
- package/templates/welcome/.devalang +5 -0
- package/templates/welcome/README.md +202 -0
- package/templates/welcome/samples/kick-808.wav +0 -0
- package/templates/welcome/src/index.deva +13 -0
- package/templates/welcome/src/variables.deva +5 -0
- package/typescript/scripts/version/fetch.ts +1 -6
- package/examples/exported.deva +0 -7
- package/rust/audio/mod.rs +0 -1
- package/rust/cli/new.rs +0 -1
- package/rust/core/parser/at.rs +0 -142
- package/rust/core/parser/bank.rs +0 -42
- package/rust/core/parser/dot.rs +0 -107
- package/rust/core/parser/identifer.rs +0 -91
- package/rust/core/parser/loop_.rs +0 -62
- package/rust/core/parser/tempo.rs +0 -42
- package/rust/core/parser/variable.rs +0 -129
- package/rust/core/preprocessor/dependencies.rs +0 -54
- package/rust/core/preprocessor/resolver/at.rs +0 -24
- package/rust/core/types/cli.rs +0 -160
- package/rust/core/types/mod.rs +0 -7
- package/rust/core/types/module.rs +0 -41
- package/rust/core/types/parser.rs +0 -73
- package/rust/core/types/statement.rs +0 -105
- package/rust/core/types/store.rs +0 -116
- package/rust/core/types/token.rs +0 -83
- package/rust/core/types/variable.rs +0 -32
- package/rust/runner/executer.rs +0 -44
- package/rust/runner/mod.rs +0 -1
- package/rust/utils/path.rs +0 -46
package/.devalang
ADDED
package/Cargo.toml
CHANGED
|
@@ -1,45 +1,49 @@
|
|
|
1
|
-
[package]
|
|
2
|
-
name = "devalang"
|
|
3
|
-
version = "0.0.1-alpha.
|
|
4
|
-
authors = ["Devaloop <contact@devaloop.com>"]
|
|
5
|
-
description = "Write music like code. Devalang is a domain-specific language (DSL) for sound designers and music hackers. Compose, automate, and control sound — in plain text."
|
|
6
|
-
license = "MIT"
|
|
7
|
-
repository = "https://github.com/devaloop-labs/devalang"
|
|
8
|
-
keywords = ["music", "dsl", "audio", "cli"]
|
|
9
|
-
categories = ["command-line-utilities", "
|
|
10
|
-
readme = "README.md"
|
|
11
|
-
homepage = "https://
|
|
12
|
-
documentation = "https://docs.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
[
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
[
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
[
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
1
|
+
[package]
|
|
2
|
+
name = "devalang"
|
|
3
|
+
version = "0.0.1-alpha.10"
|
|
4
|
+
authors = ["Devaloop <contact@devaloop.com>"]
|
|
5
|
+
description = "Write music like code. Devalang is a domain-specific language (DSL) for sound designers and music hackers. Compose, automate, and control sound — in plain text."
|
|
6
|
+
license = "MIT"
|
|
7
|
+
repository = "https://github.com/devaloop-labs/devalang"
|
|
8
|
+
keywords = ["music", "dsl", "audio", "cli"]
|
|
9
|
+
categories = ["command-line-utilities", "development-tools", "parser-implementations"]
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
homepage = "https://devalang.com"
|
|
12
|
+
documentation = "https://docs.devalang.com/"
|
|
13
|
+
license-file = "LICENSE"
|
|
14
|
+
edition = "2024"
|
|
15
|
+
|
|
16
|
+
[[bin]]
|
|
17
|
+
name = "devalang"
|
|
18
|
+
path = "rust/main.rs"
|
|
19
|
+
required-features = ["cli"]
|
|
20
|
+
|
|
21
|
+
[lib]
|
|
22
|
+
path = "rust/lib.rs"
|
|
23
|
+
crate-type = ["cdylib"]
|
|
24
|
+
|
|
25
|
+
[profile.release]
|
|
26
|
+
opt-level = "s"
|
|
27
|
+
|
|
28
|
+
[features]
|
|
29
|
+
default = ["cli"]
|
|
30
|
+
cli = ["crossterm", "indicatif", "inquire"]
|
|
31
|
+
|
|
32
|
+
[dependencies]
|
|
33
|
+
clap = { version = "4.5", features = ["derive"] }
|
|
34
|
+
serde = { version = "1.0", features = ["derive"] }
|
|
35
|
+
serde_json = "1.0"
|
|
36
|
+
rodio = "0.17"
|
|
37
|
+
hound = "3.4.0"
|
|
38
|
+
toml = "0.8"
|
|
39
|
+
notify = "6.1"
|
|
40
|
+
fs_extra = "1.3"
|
|
41
|
+
include_dir = "0.7"
|
|
42
|
+
wasm-bindgen = "0.2"
|
|
43
|
+
serde-wasm-bindgen = "0.4"
|
|
44
|
+
nom_locate = "4.0.0"
|
|
45
|
+
chrono = "0.4"
|
|
46
|
+
crossterm = { version = "0.27", optional = true }
|
|
47
|
+
indicatif = { version = "0.17", optional = true }
|
|
48
|
+
inquire = { version = "0.7.5", optional = true }
|
|
49
|
+
js-sys = "0.3"
|
package/README.md
CHANGED
|
@@ -11,97 +11,164 @@
|
|
|
11
11
|

|
|
12
12
|

|
|
13
13
|
|
|
14
|
-

|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
[](https://marketplace.visualstudio.com/items?itemName=devaloop.devalang-vscode)
|
|
15
18
|
|
|
16
19
|
## 🎼 Devalang, by **Devaloop Labs**
|
|
17
20
|
|
|
18
|
-
🎶 Compose music with code —
|
|
21
|
+
🎶 Compose music with code — structured, expressive, and fast.
|
|
19
22
|
|
|
20
23
|
Devalang is a tiny domain-specific language (DSL) for music makers, sound designers, and audio hackers.
|
|
21
|
-
Compose loops, control samples, and
|
|
24
|
+
Compose loops, control samples, render and play audio — all in clean, readable text.
|
|
22
25
|
|
|
23
26
|
🦊 Whether you're building a track, shaping textures, or performing live, Devalang helps you think in rhythms. It’s designed to be simple, expressive, and fast — because your ideas shouldn’t wait.
|
|
24
27
|
|
|
25
28
|
From studio sketches to live sets, Devalang gives you rhythmic control — with the elegance of code.
|
|
26
29
|
|
|
27
|
-
> 🚧 **v0.0.1-alpha.
|
|
30
|
+
> 🚧 **v0.0.1-alpha.10 Notice** 🚧
|
|
28
31
|
>
|
|
29
|
-
>
|
|
32
|
+
> NEW: Online documentation is now available at [docs.devalang.com](https://docs.devalang.com).
|
|
30
33
|
>
|
|
31
|
-
>
|
|
34
|
+
> NEW: Devalang VSCode extension is now available !
|
|
35
|
+
> [Get it here](https://marketplace.visualstudio.com/items?itemName=devaloop.devalang-vscode).
|
|
32
36
|
>
|
|
33
|
-
>
|
|
34
|
-
> Custom instruments can be defined with `@load`, allowing any sound sample to be triggered with the same syntax.
|
|
37
|
+
> Includes synthesis, playback, and rendering features, but is still in early development.
|
|
35
38
|
>
|
|
36
39
|
> Currently, Devalang CLI is only available for **Windows**.
|
|
37
40
|
> Linux and macOS binaries will be added in future releases via cross-platform builds.
|
|
38
41
|
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 📚 Quick Access
|
|
45
|
+
|
|
46
|
+
- [📖 Documentation](https://docs.devalang.com)
|
|
47
|
+
- [💡 Examples](./examples/)
|
|
48
|
+
- [🧩 VSCode Extension](https://marketplace.visualstudio.com/items?itemName=devaloop.devalang-vscode)
|
|
49
|
+
- [🎨 Prettier Plugin](https://www.npmjs.com/package/@devaloop/prettier-plugin-devalang)
|
|
50
|
+
- [🌐 Project Website](https://devalang.com)
|
|
51
|
+
|
|
52
|
+
## ❓ Why Devalang?
|
|
53
|
+
|
|
54
|
+
- 🎹 Prototype audio ideas without opening a DAW
|
|
55
|
+
- 💻 Integrate sound into code-based workflows
|
|
56
|
+
- 🎛️ Control audio parameters through readable syntax
|
|
57
|
+
- 🧪 Build musical logic with variables and conditions
|
|
58
|
+
|
|
59
|
+
> Producer, coder, or both — Devalang gives you musical structure, instantly.
|
|
60
|
+
|
|
39
61
|
## 🚀 Features
|
|
40
62
|
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
- 🔄 `@load` assignment to load a sample (.mp3, .wav) to use it as a value
|
|
50
|
-
- 🛠️ CLI tools for syntax checking (`check`), AST output (`build`)
|
|
63
|
+
- 🎵 **Audio Engine**: Integrated audio playback and rendering
|
|
64
|
+
- 🧩 **Module system** for importing and exporting variables between files
|
|
65
|
+
- 📜 **Structured AST** generation for debugging and future compilation
|
|
66
|
+
- 🔢 **Basic data types**: strings, numbers, booleans, maps, arrays
|
|
67
|
+
- 👁️ **Watch mode** for `build`, `check` and `play` commands
|
|
68
|
+
- 📂 **Project templates** for quick setup
|
|
69
|
+
- 🎛️ **Custom samples**: easily load and trigger your own audio files
|
|
70
|
+
- 🔄 **Looping and grouping**: create complex patterns with ease
|
|
51
71
|
|
|
52
72
|
## 📆 Installation
|
|
53
73
|
|
|
54
74
|
### For users
|
|
55
75
|
|
|
56
|
-
>
|
|
76
|
+
> ⚠️ Requires [Node.js 18+](https://nodejs.org/en/download)
|
|
57
77
|
|
|
58
|
-
|
|
78
|
+
For Node users (NPM)
|
|
59
79
|
|
|
60
80
|
```bash
|
|
61
|
-
npm install -g @devaloop/devalang
|
|
81
|
+
npm install -g @devaloop/devalang@latest
|
|
62
82
|
```
|
|
63
83
|
|
|
64
|
-
|
|
84
|
+
> ⚠️ Requires [Rust 1.70+](https://www.rust-lang.org/learn/get-started#installing-rust)
|
|
85
|
+
|
|
86
|
+
For Rust users (Cargo)
|
|
65
87
|
|
|
66
88
|
```bash
|
|
67
|
-
|
|
89
|
+
cargo install devalang
|
|
68
90
|
```
|
|
69
91
|
|
|
70
92
|
### For contributors
|
|
71
93
|
|
|
72
|
-
>
|
|
73
|
-
|
|
94
|
+
> ⚠️ Requires [Node.js 18+](https://nodejs.org/en/download)
|
|
95
|
+
|
|
96
|
+
> ⚠️ Requires [Rust 1.70+](https://www.rust-lang.org/learn/get-started#installing-rust)
|
|
74
97
|
|
|
75
98
|
```bash
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
99
|
+
git clone https://github.com/devaloop-labs/devalang.git
|
|
100
|
+
|
|
101
|
+
cd devalang
|
|
102
|
+
|
|
103
|
+
npm install
|
|
80
104
|
```
|
|
81
105
|
|
|
82
|
-
|
|
106
|
+
Development usage (you can customize arguments in package.json)
|
|
83
107
|
|
|
84
108
|
```bash
|
|
85
109
|
# For syntax checking test
|
|
86
|
-
npm run rust:dev
|
|
110
|
+
npm run rust:dev:check
|
|
111
|
+
|
|
112
|
+
# For building test
|
|
113
|
+
npm run rust:dev:build
|
|
87
114
|
```
|
|
88
115
|
|
|
89
116
|
## ❔ Usage
|
|
90
117
|
|
|
118
|
+
NOTE: Commands are available via `devalang` or `npx @devaloop/devalang`.
|
|
119
|
+
|
|
120
|
+
NOTE: Arguments can be passed to commands using `--<argument>` syntax. You can also use a configuration file to set default values for various settings, making it easier to manage your Devalang project.
|
|
121
|
+
|
|
122
|
+
NOTE: Some commands require a mandatory `--entry` argument to specify the input folder, and a `--output` argument to specify the output folder. If not specified, they default to `./src` and `./output` respectively.
|
|
123
|
+
|
|
91
124
|
For more examples, see [docs/COMMANDS.md](./docs/COMMANDS.md)
|
|
92
125
|
|
|
93
|
-
|
|
126
|
+
### Initialize a new project
|
|
127
|
+
|
|
128
|
+
In the current directory
|
|
94
129
|
|
|
95
130
|
```bash
|
|
96
|
-
devalang
|
|
131
|
+
devalang init
|
|
97
132
|
```
|
|
98
133
|
|
|
99
|
-
|
|
134
|
+
Or use optional arguments to specify a directory name and a template
|
|
100
135
|
|
|
101
136
|
```bash
|
|
102
|
-
devalang
|
|
137
|
+
devalang init --name <project-name> --template <template-name>
|
|
103
138
|
```
|
|
104
139
|
|
|
140
|
+
### Checking syntax only
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
devalang check --watch
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Building output files
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
devalang build --watch
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Playing audio files (once by file change)
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
devalang play --watch
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Playing audio files (continuous playback, even without file changes)
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
devalang play --repeat
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## ⚙️ Configuration
|
|
165
|
+
|
|
166
|
+
You can use a configuration file to set default values for various settings, making it easier to manage your Devalang project.
|
|
167
|
+
|
|
168
|
+
To do this, create a `.devalang` file in the root of your project directory.
|
|
169
|
+
|
|
170
|
+
See [docs/CONFIG.md](./docs/CONFIG.md) for more information.
|
|
171
|
+
|
|
105
172
|
## 📄 Syntax example
|
|
106
173
|
|
|
107
174
|
For more examples, see [docs/SYNTAX.md](./docs/SYNTAX.md)
|
|
@@ -111,6 +178,8 @@ For more examples, see [docs/SYNTAX.md](./docs/SYNTAX.md)
|
|
|
111
178
|
|
|
112
179
|
@import { globalBpm, globalBank, kickDuration } from "global.deva"
|
|
113
180
|
|
|
181
|
+
@load "./examples/samples/kick-808.wav" as customKick
|
|
182
|
+
|
|
114
183
|
bpm globalBpm
|
|
115
184
|
# Will declare the tempo at the globalBpm variable beats per minute
|
|
116
185
|
|
|
@@ -118,34 +187,46 @@ bank globalBank
|
|
|
118
187
|
# Will declare a custom instrument bank using the globalBank variable
|
|
119
188
|
|
|
120
189
|
loop 5:
|
|
121
|
-
.
|
|
122
|
-
# Will play 5 times a
|
|
190
|
+
.customKick kickDuration {reverb=50, drive=25}
|
|
191
|
+
# Will play 5 times a custom sample for 500ms with reverb and overdrive effects
|
|
192
|
+
|
|
193
|
+
group myGroup:
|
|
194
|
+
.customKick kickDuration {reverb=50, drive=25}
|
|
195
|
+
# Will play the same sample in a group, allowing for more complex patterns
|
|
196
|
+
|
|
197
|
+
call myGroup
|
|
198
|
+
# Will be executed line by line (sequentially)
|
|
199
|
+
|
|
200
|
+
# spawn myGroup
|
|
201
|
+
# Will be executed in parallel (concurrently)
|
|
202
|
+
# ⚠️ Note: `spawn` runs the entire group in parallel, but the group’s internal logic remains sequential unless it uses `spawn` internally.
|
|
123
203
|
```
|
|
124
204
|
|
|
205
|
+
> 🧠 Note: `call` and `spawn` only work with `group` blocks. They do not apply to individual samples or other statements.
|
|
206
|
+
|
|
125
207
|
```deva
|
|
126
|
-
#
|
|
208
|
+
# variables.deva
|
|
127
209
|
|
|
128
210
|
let globalBpm = 120
|
|
129
211
|
let globalBank = 808
|
|
130
|
-
let kickDuration = 500
|
|
212
|
+
let kickDuration = 500
|
|
131
213
|
|
|
132
214
|
@export { globalBpm, globalBank, kickDuration }
|
|
133
215
|
```
|
|
134
216
|
|
|
135
217
|
## 🧯 Known issues
|
|
136
218
|
|
|
137
|
-
- No
|
|
138
|
-
- No support yet for `
|
|
139
|
-
- No support yet for
|
|
140
|
-
- Nested loops and conditions may not be fully tested
|
|
219
|
+
- No smart modules yet, all groups, variables, and samples must be explicitly imported where used
|
|
220
|
+
- No support yet for `pattern`, `function`, ... statements
|
|
221
|
+
- No support yet for cross-platform builds (Linux, macOS)
|
|
141
222
|
|
|
142
223
|
## 🧪 Roadmap Highlights
|
|
143
224
|
|
|
144
225
|
For more info, see [docs/ROADMAP.md](./docs/ROADMAP.md)
|
|
145
226
|
|
|
146
|
-
- ⏳
|
|
147
|
-
- ⏳
|
|
148
|
-
- ⏳
|
|
227
|
+
- ⏳ Other statements (e.g `function`, `pattern`, ...)
|
|
228
|
+
- ⏳ Cross-platform support (Linux, macOS)
|
|
229
|
+
- ⏳ More built-in instruments (e.g. snare, hi-hat, etc.)
|
|
149
230
|
|
|
150
231
|
## 🛡️ License
|
|
151
232
|
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://firebasestorage.googleapis.com/v0/b/devaloop-labs.firebasestorage.app/o/devalang-teal-logo.svg?alt=media&token=d2a5705a-1eba-4b49-88e6-895a761fb7f7" alt="Devalang Logo">
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
# Changelog
|
|
6
|
+
|
|
7
|
+
## Version 0.0.1-alpha.10 (2025-07-19)
|
|
8
|
+
|
|
9
|
+
### 📖 Documentation
|
|
10
|
+
|
|
11
|
+
- Updated [new documentation website](https://docs.devalang.com) with new features and examples.
|
|
12
|
+
|
|
13
|
+
### 🧠 Core Engine
|
|
14
|
+
|
|
15
|
+
- Patched `call`, `spawn` to handle correct cursor time.
|
|
16
|
+
- Patched `advance_char` to handle correct indentation and dedentation.
|
|
17
|
+
- Patched `bank` resolver to handle numbers in bank names.
|
|
18
|
+
- Patched `spawn` calls that was not calling a variable.
|
|
19
|
+
|
|
20
|
+
### 🧩 Web Assembly
|
|
21
|
+
|
|
22
|
+
- Added `load_wasm_module` function to the WASM module to load Devalang modules dynamically.
|
|
23
|
+
- Added `render_audio` function to the WASM module to render audio files.
|
|
24
|
+
|
|
25
|
+
## Version 0.0.1-alpha.9 (2025-07-14)
|
|
26
|
+
|
|
27
|
+
### ✨ Syntax
|
|
28
|
+
|
|
29
|
+
- Added support for `synth` directives to define synthesizer sounds directly in code
|
|
30
|
+
→ Example:
|
|
31
|
+
|
|
32
|
+
```deva
|
|
33
|
+
let mySynth = synth sine
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 🧠 Core Engine
|
|
37
|
+
|
|
38
|
+
- ✅ **Major refactor** of the resolution layer:
|
|
39
|
+
|
|
40
|
+
- `condition`, `loop`, `group`, `trigger`, `call`, `spawn`, and `driver` were fully rewritten
|
|
41
|
+
- Ensures **correct variable scoping**, **cross-module references**, and **imported symbol resolution**
|
|
42
|
+
|
|
43
|
+
- ✅ Audio interpreter updated:
|
|
44
|
+
- `call` and `spawn` now execute correctly in parallel, preserving **temporal alignment** across groups
|
|
45
|
+
|
|
46
|
+
### 🧩 Language Features
|
|
47
|
+
|
|
48
|
+
- Improved `@import` behavior:
|
|
49
|
+
- Modules can now be imported using **relative paths only**
|
|
50
|
+
- No need for absolute or root-based imports
|
|
51
|
+
|
|
52
|
+
## Version 0.0.1-alpha.8 (2025-07-12)
|
|
53
|
+
|
|
54
|
+
### Syntax
|
|
55
|
+
|
|
56
|
+
- Implemented `if` directive to conditionally execute blocks of code.
|
|
57
|
+
- Implemented `else` directive to provide an alternative block of code when the `if` condition is not met.
|
|
58
|
+
- Implemented `else if` directive to provide additional conditions for the `if` directive.
|
|
59
|
+
|
|
60
|
+
### Core Components
|
|
61
|
+
|
|
62
|
+
- Implemented evaluator for audio statements, to execute conditional statements.
|
|
63
|
+
- Fixed `group` resolution and export issues.
|
|
64
|
+
- Implemented `Global Store` debugger to inspect variables by module for build command.
|
|
65
|
+
- Organized `TokenKind` and `StatementKind` enums for better clarity and maintainability.
|
|
66
|
+
- Refactored audio interpreter to handle the new syntax and directives.
|
|
67
|
+
- Refactored lexer to handle new directives and improve tokenization.
|
|
68
|
+
- Refactored parser to handle new directives and improve parsing logic.
|
|
69
|
+
- Added support for `call` and `spawn` execution of imported groups.
|
|
70
|
+
- Enforced scoped resolution of groups in `spawn` and `call` (must be imported in current module).
|
|
71
|
+
|
|
72
|
+
## Version 0.0.1-alpha.7 (2025-07-11)
|
|
73
|
+
|
|
74
|
+
## Examples
|
|
75
|
+
|
|
76
|
+
- Added examples in `examples` folder (group, loop, variables, index).
|
|
77
|
+
|
|
78
|
+
## Structure
|
|
79
|
+
|
|
80
|
+
- Moved `rust/audio` folder to `rust/core/audio` to better organize the project structure.
|
|
81
|
+
|
|
82
|
+
### Core Components
|
|
83
|
+
|
|
84
|
+
- Implemented `group` directive to define groups of sounds.
|
|
85
|
+
- Implemented `call` directive to call a group of sounds.
|
|
86
|
+
- Implemented `spawn` directive to spawn a group of sounds in parallel.
|
|
87
|
+
- Implemented `sleep` directive to pause execution for a specified duration.
|
|
88
|
+
- Patched line and column tracking in the lexer to ensure correct indentation handling.
|
|
89
|
+
- Patched string lexing advancing to handle first character correctly.
|
|
90
|
+
|
|
91
|
+
## Version 0.0.1-alpha.5 (2025-07-05)
|
|
92
|
+
|
|
93
|
+
### Syntax
|
|
94
|
+
|
|
95
|
+
- Fixed block parsing issues caused by missing or incorrect `Indent` / `Dedent` token detection.
|
|
96
|
+
- Indentation handling now triggers correctly at each newline.
|
|
97
|
+
- Improved reliability of nested blocks (e.g., inside `loop`) with consistent `Dedent` termination.
|
|
98
|
+
|
|
99
|
+
### Core Components
|
|
100
|
+
|
|
101
|
+
- Added full **WebAssembly (WASM)** support — Devalang can now be compiled for browser or Node.js environments.
|
|
102
|
+
- Prepared the ground for future IDE integrations (e.g., VSCode extension) by stabilizing core syntax parsing.
|
|
103
|
+
|
|
104
|
+
## Version 0.0.1-alpha.4 (2025-07-03)
|
|
105
|
+
|
|
106
|
+
### Audio Engine
|
|
107
|
+
|
|
108
|
+
- Integrated Audio Engine to handle audio playback and rendering.
|
|
109
|
+
- Implemented Audio Player to play audio files.
|
|
110
|
+
- Added support for audio playback with the `play` command.
|
|
111
|
+
|
|
112
|
+
### Commands
|
|
113
|
+
|
|
114
|
+
- Implemented `play` command to play Devalang files.
|
|
115
|
+
|
|
116
|
+
- Added `--watch` option to watch for changes in files and automatically rebuild and play them. (once)
|
|
117
|
+
- Added `--repeat` option to repeat the playback of the audio file. (infinite)
|
|
118
|
+
|
|
119
|
+
Note : You cannot use `--watch` and `--repeat` options together. Use `--repeat` instead.
|
|
120
|
+
|
|
121
|
+
## Version 0.0.1-alpha.3 (2025-07-01)
|
|
122
|
+
|
|
123
|
+
- /!\ Major refactor of the project structure and module system /!\
|
|
124
|
+
- Refactored module system to support multiple modules and submodules.
|
|
125
|
+
- Patched all directives to be compatible with the new project structure.
|
|
126
|
+
- Prepared for the upcoming audio engine integration and sound rendering capabilities.
|
|
127
|
+
- Updated documentation to reflect the new project structure and features.
|
|
128
|
+
|
|
129
|
+
## Version 0.0.1-alpha.2 (2025-06-26)
|
|
130
|
+
|
|
131
|
+
### Commands
|
|
132
|
+
|
|
133
|
+
- Implemented `init` command to initialize a new Devalang project.
|
|
134
|
+
- Implemented `template` command to manage templates.
|
|
135
|
+
- Added `list` subcommand to list available templates.
|
|
136
|
+
- Added `info` subcommand to show information about a specific template.
|
|
137
|
+
- Implemented `watch` subcommand for the `build` and `check` command to watch for changes in files and automatically rebuild or check them.
|
|
138
|
+
|
|
139
|
+
### Core Components
|
|
140
|
+
|
|
141
|
+
- Implemented Config manager to handle configuration files.
|
|
142
|
+
- Added support for `.devalang` configuration file as a TOML file.
|
|
143
|
+
- Implemented File System watcher to monitor file changes.
|
|
144
|
+
- Implemented Template manager to handle templates and their metadata.
|
|
145
|
+
|
|
146
|
+
### Syntax
|
|
147
|
+
|
|
148
|
+
- Added support for built-in triggers for `.snare`, `.hihat`, `.clap`, `.tom`, `.crash`, `.ride`, `.synth`, `.bass`, and `.pad`.
|
|
149
|
+
|
|
150
|
+
## Version 0.0.1-alpha.1 (2025-06-25)
|
|
151
|
+
|
|
152
|
+
### Syntax
|
|
153
|
+
|
|
154
|
+
- Added support for `@import` directive to import other Devalang files.
|
|
155
|
+
- Added support for `@export` directive to export variables and functions.
|
|
156
|
+
- Added support for `@load` directive to load external resources.
|
|
157
|
+
- Added support for `bpm` directive to set the beats per minute.
|
|
158
|
+
- Added support for `bank` directive to define a bank of sounds.
|
|
159
|
+
- Added support for `loop` directive to define loops in the code.
|
|
160
|
+
|
|
161
|
+
### Commands
|
|
162
|
+
|
|
163
|
+
- Implemented `check` command to check the syntax of Devalang files.
|
|
164
|
+
- Implemented `build` command to build the Abstract Syntax Tree (AST) of Devalang files.
|
|
165
|
+
|
|
166
|
+
### Core Components
|
|
167
|
+
|
|
168
|
+
- Implemented Lexer to tokenize Devalang source code.
|
|
169
|
+
- Implemented Parser to parse the tokens and build the AST.
|
|
170
|
+
- Implemented Preprocessor to handle directives and preprocess the source code.
|
|
171
|
+
- Implemented Debugger to debug Devalang code.
|
|
172
|
+
- Implemented Builder to build the final output from the AST.
|
package/docs/COMMANDS.md
CHANGED
|
@@ -4,28 +4,82 @@
|
|
|
4
4
|
|
|
5
5
|
# Devalang Commands Guide
|
|
6
6
|
|
|
7
|
+
## Initialization
|
|
8
|
+
|
|
9
|
+
Initialize a new Devalang project (current folder)
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
devalang init
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Initialize a new Devalang project (new folder)
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
devalang init --name <project-name> --template <template-name>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Available arguments:
|
|
22
|
+
|
|
23
|
+
- `--name`: The name of the project (cannot be empty)
|
|
24
|
+
- `--template`: The template to use for the project (default to `welcome`)
|
|
25
|
+
|
|
7
26
|
## Checking
|
|
8
27
|
|
|
9
28
|
Checking syntax of .deva file(s)
|
|
10
29
|
|
|
11
30
|
```bash
|
|
12
|
-
devalang check --entry ./examples --output ./output
|
|
31
|
+
devalang check --entry ./examples --output ./output --watch
|
|
13
32
|
```
|
|
14
33
|
|
|
15
34
|
Available arguments :
|
|
16
35
|
|
|
17
|
-
-
|
|
18
|
-
-
|
|
36
|
+
- `--no-config`: Whether to ignore the configuration file (default to `false`)
|
|
37
|
+
- `--entry`: The input folder (default to `./src`)
|
|
38
|
+
- `--output`: The output folder (default to `./output`)
|
|
39
|
+
- `--watch`: Whether to watch for changes and re-analyze (default to `false`)
|
|
19
40
|
|
|
20
41
|
## Building
|
|
21
42
|
|
|
22
43
|
Building AST of .deva file(s)
|
|
23
44
|
|
|
24
45
|
```bash
|
|
25
|
-
devalang build --entry ./examples --output ./output
|
|
46
|
+
devalang build --entry ./examples --output ./output --watch
|
|
26
47
|
```
|
|
27
48
|
|
|
28
49
|
Available arguments :
|
|
29
50
|
|
|
30
|
-
-
|
|
31
|
-
-
|
|
51
|
+
- `--no-config`: Whether to ignore the configuration file (default to `false`)
|
|
52
|
+
- `--entry`: The input folder (default to `./src`)
|
|
53
|
+
- `--output`: The output folder (default to `./output`)
|
|
54
|
+
- `--watch`: Whether to watch for changes and rebuild (default to `false`)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
## Playing
|
|
58
|
+
|
|
59
|
+
Playing .deva file(s) without audio playback (once)
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
devalang play --entry ./examples --output ./output
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Playing .deva file(s) with audio playback (once by file change)
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
devalang play --entry ./examples --output ./output --watch
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Playing .deva file(s) with audio playback (infinite loop)
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
devalang play --entry ./examples --output ./output --repeat
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Note : You cannot use `--watch` and `--repeat` options together. Use `--repeat` instead.
|
|
78
|
+
|
|
79
|
+
Available arguments :
|
|
80
|
+
|
|
81
|
+
- `--no-config`: Whether to ignore the configuration file (default to `false`)
|
|
82
|
+
- `--entry`: The input folder (default to `./src`)
|
|
83
|
+
- `--output`: The output folder (default to `./output`)
|
|
84
|
+
- `--watch`: Whether to watch for changes and rebuild + play (default to `false`)
|
|
85
|
+
- `--repeat`: Whether to repeat the playback of the audio file (default to `false`)
|
package/docs/CONFIG.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://firebasestorage.googleapis.com/v0/b/devaloop-labs.firebasestorage.app/o/devalang-teal-logo.svg?alt=media&token=d2a5705a-1eba-4b49-88e6-895a761fb7f7" alt="Devalang Logo">
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
# Devalang Configuration File
|
|
6
|
+
|
|
7
|
+
Use a configuration file if you don't want to pass command-line arguments every time you run a command. The configuration file allows you to set default values for various settings, making it easier to manage your Devalang project.
|
|
8
|
+
|
|
9
|
+
## Ignoring the Configuration File
|
|
10
|
+
|
|
11
|
+
If you prefer not to use a configuration file, you can ignore it by passing the `--no-config` flag when running Devalang commands. This will bypass any settings defined in the configuration file and use only the command-line arguments you provide.
|
|
12
|
+
|
|
13
|
+
## Structure of the Configuration File
|
|
14
|
+
|
|
15
|
+
The configuration file is a TOML (Tom's Obvious, Minimal Language) file that contains key-value pairs to define various settings for your Devalang project. Below is a sample configuration file:
|
|
16
|
+
|
|
17
|
+
```toml
|
|
18
|
+
[defaults]
|
|
19
|
+
entry = "./src"
|
|
20
|
+
output = "./output"
|
|
21
|
+
watch = false
|
|
22
|
+
repeat = true
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Available Settings
|
|
26
|
+
|
|
27
|
+
- `entry`: (String) The entry point for your Devalang project (default to `./src`)
|
|
28
|
+
- `output`: (String) The output directory for generated files (default to `./output`)
|
|
29
|
+
- `watch`: (Boolean) Whether to watch for changes in files and automatically rebuild or check them (default to `false`)
|
|
30
|
+
- `repeat`: (Boolean) Whether to repeat the playback of audio files (default to `false`)
|