@devaloop/devalang 0.0.1-alpha.1 → 0.0.1-alpha.11

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.
Files changed (168) hide show
  1. package/.devalang +9 -0
  2. package/Cargo.toml +15 -6
  3. package/README.md +79 -81
  4. package/docs/CHANGELOG.md +213 -0
  5. package/docs/ROADMAP.md +11 -8
  6. package/docs/TODO.md +32 -29
  7. package/examples/bank.deva +9 -0
  8. package/examples/condition.deva +20 -0
  9. package/examples/duration.deva +9 -0
  10. package/examples/group.deva +12 -0
  11. package/examples/index.deva +12 -5
  12. package/examples/loop.deva +16 -0
  13. package/examples/samples/hat-808.wav +0 -0
  14. package/examples/synth.deva +14 -0
  15. package/examples/variables.deva +9 -0
  16. package/out-tsc/bin/devalang.exe +0 -0
  17. package/out-tsc/scripts/version/fetch.js +1 -5
  18. package/package.json +5 -4
  19. package/project-version.json +3 -3
  20. package/rust/cli/bank.rs +455 -0
  21. package/rust/cli/build.rs +114 -28
  22. package/rust/cli/check.rs +96 -103
  23. package/rust/cli/driver.rs +280 -0
  24. package/rust/cli/init.rs +79 -0
  25. package/rust/cli/install.rs +17 -0
  26. package/rust/cli/mod.rs +8 -1
  27. package/rust/cli/play.rs +193 -0
  28. package/rust/cli/template.rs +57 -0
  29. package/rust/cli/update.rs +4 -0
  30. package/rust/common/cdn.rs +11 -0
  31. package/rust/common/mod.rs +1 -0
  32. package/rust/config/driver.rs +76 -0
  33. package/rust/config/loader.rs +110 -0
  34. package/rust/config/mod.rs +2 -0
  35. package/rust/core/audio/engine.rs +242 -0
  36. package/rust/core/audio/evaluator.rs +31 -0
  37. package/rust/core/audio/interpreter/arrow_call.rs +142 -0
  38. package/rust/core/audio/interpreter/call.rs +70 -0
  39. package/rust/core/audio/interpreter/condition.rs +69 -0
  40. package/rust/core/audio/interpreter/driver.rs +236 -0
  41. package/rust/core/audio/interpreter/let_.rs +19 -0
  42. package/rust/core/audio/interpreter/load.rs +18 -0
  43. package/rust/core/audio/interpreter/loop_.rs +67 -0
  44. package/rust/core/audio/interpreter/mod.rs +12 -0
  45. package/rust/core/audio/interpreter/sleep.rs +36 -0
  46. package/rust/core/audio/interpreter/spawn.rs +84 -0
  47. package/rust/core/audio/interpreter/tempo.rs +16 -0
  48. package/rust/core/audio/interpreter/trigger.rs +102 -0
  49. package/rust/core/audio/loader/mod.rs +1 -0
  50. package/rust/core/audio/loader/trigger.rs +64 -0
  51. package/rust/core/audio/mod.rs +6 -0
  52. package/rust/core/audio/player.rs +54 -0
  53. package/rust/core/audio/renderer.rs +54 -0
  54. package/rust/core/builder/mod.rs +70 -27
  55. package/rust/core/debugger/lexer.rs +27 -0
  56. package/rust/core/debugger/mod.rs +13 -49
  57. package/rust/core/debugger/preprocessor.rs +27 -0
  58. package/rust/core/debugger/store.rs +25 -0
  59. package/rust/core/error/mod.rs +60 -0
  60. package/rust/core/lexer/handler/arrow.rs +31 -0
  61. package/rust/core/lexer/handler/at.rs +21 -0
  62. package/rust/core/lexer/handler/brace.rs +41 -0
  63. package/rust/core/lexer/handler/colon.rs +21 -0
  64. package/rust/core/lexer/handler/comment.rs +30 -0
  65. package/rust/core/lexer/handler/dot.rs +21 -0
  66. package/rust/core/lexer/handler/driver.rs +241 -0
  67. package/rust/core/lexer/handler/identifier.rs +41 -0
  68. package/rust/core/lexer/handler/indent.rs +52 -0
  69. package/rust/core/lexer/handler/mod.rs +15 -0
  70. package/rust/core/lexer/handler/newline.rs +23 -0
  71. package/rust/core/lexer/handler/number.rs +31 -0
  72. package/rust/core/lexer/handler/operator.rs +44 -0
  73. package/rust/core/lexer/handler/slash.rs +21 -0
  74. package/rust/core/lexer/handler/string.rs +63 -0
  75. package/rust/core/lexer/mod.rs +37 -319
  76. package/rust/core/lexer/token.rs +87 -0
  77. package/rust/core/mod.rs +6 -2
  78. package/rust/core/parser/driver.rs +339 -0
  79. package/rust/core/parser/handler/arrow_call.rs +151 -0
  80. package/rust/core/parser/handler/at.rs +162 -0
  81. package/rust/core/parser/handler/bank.rs +41 -0
  82. package/rust/core/parser/handler/condition.rs +74 -0
  83. package/rust/core/parser/handler/dot.rs +178 -0
  84. package/rust/core/parser/handler/identifier/call.rs +41 -0
  85. package/rust/core/parser/handler/identifier/group.rs +75 -0
  86. package/rust/core/parser/handler/identifier/let_.rs +133 -0
  87. package/rust/core/parser/handler/identifier/mod.rs +51 -0
  88. package/rust/core/parser/handler/identifier/sleep.rs +33 -0
  89. package/rust/core/parser/handler/identifier/spawn.rs +41 -0
  90. package/rust/core/parser/handler/identifier/synth.rs +65 -0
  91. package/rust/core/parser/handler/loop_.rs +72 -0
  92. package/rust/core/parser/handler/mod.rs +8 -0
  93. package/rust/core/parser/handler/tempo.rs +47 -0
  94. package/rust/core/parser/mod.rs +3 -200
  95. package/rust/core/parser/statement.rs +96 -0
  96. package/rust/core/preprocessor/loader.rs +308 -0
  97. package/rust/core/preprocessor/mod.rs +2 -24
  98. package/rust/core/preprocessor/module.rs +42 -56
  99. package/rust/core/preprocessor/processor.rs +76 -0
  100. package/rust/core/preprocessor/resolver/bank.rs +41 -51
  101. package/rust/core/preprocessor/resolver/call.rs +123 -0
  102. package/rust/core/preprocessor/resolver/condition.rs +92 -0
  103. package/rust/core/preprocessor/resolver/driver.rs +232 -0
  104. package/rust/core/preprocessor/resolver/group.rs +61 -0
  105. package/rust/core/preprocessor/resolver/let_.rs +31 -0
  106. package/rust/core/preprocessor/resolver/loop_.rs +76 -67
  107. package/rust/core/preprocessor/resolver/mod.rs +12 -111
  108. package/rust/core/preprocessor/resolver/spawn.rs +58 -0
  109. package/rust/core/preprocessor/resolver/synth.rs +50 -0
  110. package/rust/core/preprocessor/resolver/tempo.rs +40 -61
  111. package/rust/core/preprocessor/resolver/trigger.rs +90 -154
  112. package/rust/core/preprocessor/resolver/value.rs +78 -0
  113. package/rust/core/shared/bank.rs +21 -0
  114. package/rust/core/shared/duration.rs +9 -0
  115. package/rust/core/shared/mod.rs +3 -0
  116. package/rust/core/shared/value.rs +29 -0
  117. package/rust/core/store/export.rs +28 -0
  118. package/rust/core/store/global.rs +39 -0
  119. package/rust/core/store/import.rs +28 -0
  120. package/rust/core/store/mod.rs +4 -0
  121. package/rust/core/store/variable.rs +28 -0
  122. package/rust/core/utils/mod.rs +2 -0
  123. package/rust/core/utils/path.rs +31 -0
  124. package/rust/core/utils/validation.rs +37 -0
  125. package/rust/installer/bank.rs +55 -0
  126. package/rust/installer/mod.rs +1 -0
  127. package/rust/lib.rs +162 -1
  128. package/rust/main.rs +104 -31
  129. package/rust/utils/file.rs +35 -0
  130. package/rust/utils/installer.rs +56 -0
  131. package/rust/utils/logger.rs +108 -34
  132. package/rust/utils/mod.rs +5 -3
  133. package/rust/utils/{loader.rs → spinner.rs} +2 -0
  134. package/rust/utils/watcher.rs +33 -0
  135. package/templates/minimal/.devalang +5 -0
  136. package/templates/minimal/README.md +202 -0
  137. package/templates/minimal/src/index.deva +2 -0
  138. package/templates/welcome/.devalang +5 -0
  139. package/templates/welcome/README.md +202 -0
  140. package/templates/welcome/samples/kick-808.wav +0 -0
  141. package/templates/welcome/src/index.deva +13 -0
  142. package/templates/welcome/src/variables.deva +5 -0
  143. package/typescript/scripts/version/fetch.ts +1 -6
  144. package/docs/COMMANDS.md +0 -31
  145. package/docs/SYNTAX.md +0 -148
  146. package/examples/exported.deva +0 -7
  147. package/rust/audio/mod.rs +0 -1
  148. package/rust/cli/new.rs +0 -1
  149. package/rust/core/parser/at.rs +0 -142
  150. package/rust/core/parser/bank.rs +0 -42
  151. package/rust/core/parser/dot.rs +0 -107
  152. package/rust/core/parser/identifer.rs +0 -91
  153. package/rust/core/parser/loop_.rs +0 -62
  154. package/rust/core/parser/tempo.rs +0 -42
  155. package/rust/core/parser/variable.rs +0 -129
  156. package/rust/core/preprocessor/dependencies.rs +0 -54
  157. package/rust/core/preprocessor/resolver/at.rs +0 -24
  158. package/rust/core/types/cli.rs +0 -160
  159. package/rust/core/types/mod.rs +0 -7
  160. package/rust/core/types/module.rs +0 -41
  161. package/rust/core/types/parser.rs +0 -73
  162. package/rust/core/types/statement.rs +0 -105
  163. package/rust/core/types/store.rs +0 -116
  164. package/rust/core/types/token.rs +0 -83
  165. package/rust/core/types/variable.rs +0 -32
  166. package/rust/runner/executer.rs +0 -44
  167. package/rust/runner/mod.rs +0 -1
  168. package/rust/utils/path.rs +0 -46
package/.devalang ADDED
@@ -0,0 +1,9 @@
1
+ [defaults]
2
+ entry = "./examples"
3
+ output = "./output"
4
+ watch = false
5
+
6
+ [[banks]]
7
+ path = "devalang://bank/808"
8
+ version = "0.0.1"
9
+ author = "devaloop"
package/Cargo.toml CHANGED
@@ -1,20 +1,22 @@
1
1
  [package]
2
2
  name = "devalang"
3
- version = "0.0.1-alpha.1"
3
+ version = "0.0.1-alpha.11"
4
4
  authors = ["Devaloop <contact@devaloop.com>"]
5
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
6
  license = "MIT"
7
7
  repository = "https://github.com/devaloop-labs/devalang"
8
8
  keywords = ["music", "dsl", "audio", "cli"]
9
- categories = ["command-line-utilities", "audio", "development-tools"]
9
+ categories = ["command-line-utilities", "development-tools", "parser-implementations"]
10
10
  readme = "README.md"
11
- homepage = "https://devaloop.com"
12
- documentation = "https://docs.rs/devalang"
11
+ homepage = "https://devalang.com"
12
+ documentation = "https://docs.devalang.com/"
13
+ license-file = "LICENSE"
13
14
  edition = "2024"
14
15
 
15
16
  [[bin]]
16
17
  name = "devalang"
17
18
  path = "rust/main.rs"
19
+ required-features = ["cli"]
18
20
 
19
21
  [lib]
20
22
  path = "rust/lib.rs"
@@ -25,7 +27,7 @@ opt-level = "s"
25
27
 
26
28
  [features]
27
29
  default = ["cli"]
28
- cli = ["crossterm"]
30
+ cli = ["crossterm", "indicatif", "inquire"]
29
31
 
30
32
  [dependencies]
31
33
  clap = { version = "4.5", features = ["derive"] }
@@ -42,4 +44,11 @@ serde-wasm-bindgen = "0.4"
42
44
  nom_locate = "4.0.0"
43
45
  chrono = "0.4"
44
46
  crossterm = { version = "0.27", optional = true }
45
- indicatif = "0.17"
47
+ indicatif = { version = "0.17", optional = true }
48
+ inquire = { version = "0.7.5", optional = true }
49
+ js-sys = "0.3"
50
+ reqwest = { version = "0.12.22", features = ["json"] }
51
+ flate2 = "1.0"
52
+ tar = "0.4"
53
+ tokio = { version = "1", features = ["full"] }
54
+ zip = "4.3.0"
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
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">
2
+ <img src="https://devalang.com/images/devalang-logo-cyan.svg" alt="Devalang Logo" width="300" />
3
3
  </div>
4
4
 
5
5
  ![Rust](https://img.shields.io/badge/Made%20with-Rust-orange?logo=rust)
@@ -11,141 +11,139 @@
11
11
  ![License: MIT](https://img.shields.io/badge/license-MIT-green)
12
12
  ![Platform](https://img.shields.io/badge/platform-Windows-blue)
13
13
 
14
- ![npm](https://img.shields.io/npm/dm/@devaloop/devalang)
14
+ ![npm](https://img.shields.io/npm/dt/@devaloop/devalang)
15
+ ![crates](https://img.shields.io/crates/d/devalang)
15
16
 
16
- ## 🎼 Devalang, by **Devaloop Labs**
17
+ [![VSCode Extension](https://img.shields.io/visual-studio-marketplace/v/devaloop.devalang-vscode?label=VSCode%20Extension)](https://marketplace.visualstudio.com/items?itemName=devaloop.devalang-vscode)
17
18
 
18
- 🎶 Compose music with code — simple, structured, sonic.
19
+ # 🎶 Devalang
20
+
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 automate parameters — all in clean, readable text.
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.1 Notice** 🚧
30
+ > 🚧 **v0.0.1-alpha.11 Notice** 🚧
28
31
  >
29
- > Devalang is still in early development. This version does not yet include **sound rendering**.
32
+ > NEW: Devalang is available in your browser at [playground.devalang.com](https://playground.devalang.com) !
30
33
  >
31
- > You can parse code, generate the AST, and validate syntax — all essential building blocks for the upcoming audio engine.
34
+ > NEW: Online documentation is now available at [docs.devalang.com](https://docs.devalang.com)
32
35
  >
33
- > Currently, only `.kick` is included as a built-in trigger.
34
- > Custom instruments can be defined with `@load`, allowing any sound sample to be triggered with the same syntax.
36
+ > Includes synthesis, playback, and rendering features, but is still in early development.
35
37
  >
36
38
  > Currently, Devalang CLI is only available for **Windows**.
37
39
  > Linux and macOS binaries will be added in future releases via cross-platform builds.
38
40
 
39
- ## 🚀 Features
40
-
41
- - 🧩 Module system for importing and exporting variables between files (`@import`, `@export`)
42
- - 📜 Structured AST generation for debugging and future compilation
43
- - 🔢 Basic data types: strings, numbers, booleans, maps, arrays
44
- - ⏱️ `bpm` assignment for setting tempo
45
- - 🧱 `bank` declaration to define the instrument set
46
- - 🔁 Looping system with fixed repetitions (`loop 4:`)
47
- - 🧪 Instruction calls with parameters (e.g. `.kick auto {reverb:10, decay:20}`) for testing pattern syntax
48
- - 📄 `let` assignments for storing reusable values
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`)
41
+ ## 📚 Quick Access
51
42
 
52
- ## 📆 Installation
43
+ - [▶️ Playground](https://playground.devalang.com)
44
+ - [📖 Documentation](https://docs.devalang.com)
45
+ - [🧩 VSCode Extension](https://marketplace.visualstudio.com/items?itemName=devaloop.devalang-vscode)
46
+ - [🎨 Prettier Plugin](https://www.npmjs.com/package/@devaloop/prettier-plugin-devalang)
47
+ - [📜 Changelog](./docs/CHANGELOG.md)
48
+ - [💡 Examples](./examples/)
49
+ - [🌐 Project Website](https://devalang.com)
50
+ - [📦 Devalang CLI on npm](https://www.npmjs.com/package/@devaloop/devalang)
53
51
 
54
- ### For users
52
+ ## ⏱️ Try it now !
55
53
 
56
- > - ⚠️ Requires [Node.js 18+](https://nodejs.org/en/download)
57
-
58
- Install the package globally (NPM)
54
+ ### You can also have a look at the [Playground](https://playground.devalang.com) to try Devalang directly in your browser
59
55
 
60
56
  ```bash
57
+ # Install Devalang CLI globally
61
58
  npm install -g @devaloop/devalang
62
- ```
63
-
64
- Usage without install (NPX)
65
59
 
66
- ```bash
67
- npx @devaloop/devalang <command>
60
+ # Create a new Devalang project
61
+ devalang init --name my-project --template minimal
62
+ cd my-project
68
63
  ```
69
64
 
70
- ### For contributors
65
+ Create a new Devalang file `src/index.deva` in the project directory:
71
66
 
72
- > - ⚠️ Requires [Node.js 18+](https://nodejs.org/en/download)
73
- > - ⚠️ Requires [Rust 1.70+](https://www.rust-lang.org/learn/get-started#installing-rust)
67
+ ```deva
68
+ # src/index.deva
74
69
 
75
- ```bash
76
- > git clone https://github.com/devaloop-labs/devalang.git
77
- > cd devalang
78
- > npm install
79
- > cargo install --path .
80
- ```
70
+ group myLead:
71
+ let mySynth = synth sine
81
72
 
82
- Usage for development (feel free to change arguments in package.json)
73
+ mySynth -> note(C4, { duration: 400 })
74
+ mySynth -> note(G4, { duration: 600 })
83
75
 
84
- ```bash
85
- # For syntax checking test
86
- npm run rust:dev <command>
76
+ # Play the lead
77
+
78
+ call myLead
87
79
  ```
88
80
 
89
- ## Usage
81
+ And the best part ? You can play it directly from the command line:
90
82
 
91
- For more examples, see [docs/COMMANDS.md](./docs/COMMANDS.md)
83
+ ```bash
84
+ # Play the Devalang file
85
+ devalang play
92
86
 
93
- Checking syntax only and output debug files
87
+ # Play the Devalang file with watch mode
88
+ devalang play --watch
94
89
 
95
- ```bash
96
- devalang check --entry <entry-directory> --output <output-directory>
90
+ # LIVE mode (repeat the playback + watch mode)
91
+ devalang play --repeat
97
92
  ```
98
93
 
99
- Building output file(s) (AST generation for the moment)
94
+ ### 🎉 You can now hear your Devalang code in action!
100
95
 
101
- ```bash
102
- devalang build --entry <entry-directory> --output <output-directory>
103
- ```
96
+ > For more examples, check out the [examples directory](./examples/).
104
97
 
105
- ## 📄 Syntax example
98
+ ## Why Devalang?
106
99
 
107
- For more examples, see [docs/SYNTAX.md](./docs/SYNTAX.md)
100
+ - 🎹 Prototype audio ideas without opening a DAW
101
+ - 💻 Integrate sound into code-based workflows
102
+ - 🎛️ Control audio parameters through readable syntax
103
+ - 🧪 Build musical logic with variables and conditions
108
104
 
109
- ```deva
110
- # index.deva
105
+ > Producer, coder, or both — Devalang gives you musical structure, instantly.
111
106
 
112
- @import { globalBpm, globalBank, kickDuration } from "global.deva"
107
+ ## 🚀 Features
113
108
 
114
- bpm globalBpm
115
- # Will declare the tempo at the globalBpm variable beats per minute
109
+ - 🎵 **Audio Engine**: Integrated audio playback and rendering
110
+ - 🧩 **Module system** for importing and exporting variables between files
111
+ - 📜 **Structured AST** generation for debugging and future compilation
112
+ - 🔢 **Basic data types**: strings, numbers, booleans, maps, arrays
113
+ - 👁️ **Watch mode** for `build`, `check` and `play` commands
114
+ - 📂 **Project templates** for quick setup
115
+ - 🎛️ **Custom samples**: easily load and trigger your own audio files
116
+ - 🔄 **Looping and grouping**: create complex patterns with ease
116
117
 
117
- bank globalBank
118
- # Will declare a custom instrument bank using the globalBank variable
118
+ ## 📄 Documentation
119
119
 
120
- loop 5:
121
- .kick kickDuration {reverb=50, drive=25}
122
- # Will play 5 times a kick for the duration of the kickDuration variable with reverb and drive effects
123
- ```
120
+ ### Please refer to the [online documentation](https://docs.devalang.com) for detailed information on syntax, features, and usage examples.
124
121
 
125
- ```deva
126
- # global.deva
122
+ ## 📜 Changelog Highlights
127
123
 
128
- let globalBpm = 120
129
- let globalBank = 808
130
- let kickDuration = 500
124
+ For a complete list of changes, see [docs/CHANGELOG.md](./docs/CHANGELOG.md)
131
125
 
132
- @export { globalBpm, globalBank, kickDuration }
133
- ```
126
+ - Implemented beat durations in `triggers` and `arrow_calls` statements
127
+ - Implemented `bank` resolver to resolve banks of sounds in the code
128
+ - Support for namespaced banks of sounds (e.g. `.808.myTrigger`)
129
+ - Implemented multiple commands for `bank` management
130
+ - `bank list`, `bank available`, `bank info <bank_name>`, `bank remove <bank_name>`, `bank update`, `bank update <bank_name>`
131
+ - Implemented `install` command to install banks of sounds
132
+ - `install bank <bank_name>`
134
133
 
135
134
  ## 🧯 Known issues
136
135
 
137
- - No support yet for Audio Engine
138
- - No support yet for `if`, `else`, `else if` statements
139
- - No support yet for `@group`, `@pattern`, `@function` statements
140
- - Nested loops and conditions may not be fully tested
136
+ - No smart modules yet, all groups, variables, and samples must be explicitly imported where used
137
+ - No support yet for `pattern`, `function`, ... statements
138
+ - No support yet for cross-platform builds (Linux, macOS)
141
139
 
142
140
  ## 🧪 Roadmap Highlights
143
141
 
144
142
  For more info, see [docs/ROADMAP.md](./docs/ROADMAP.md)
145
143
 
146
- - ⏳ Audio engine integration
147
- - ⏳ Other statements (e.g `if`, `@group`, ...)
148
- - ⏳ Watch mode for automatic rebuilds
144
+ - ⏳ Other statements (e.g `function`, `pattern`, ...)
145
+ - ⏳ Cross-platform support (Linux, macOS)
146
+ - ⏳ More built-in instruments (e.g. snare, hi-hat, etc.)
149
147
 
150
148
  ## 🛡️ License
151
149
 
@@ -0,0 +1,213 @@
1
+ <div align="center">
2
+ <img src="https://devalang.com/images/devalang-logo-cyan.svg" alt="Devalang Logo" width="300" />
3
+ </div>
4
+
5
+ # Changelog
6
+
7
+ ## Version 0.0.1-alpha.11 (2025-07-20)
8
+
9
+ ### 📖 Documentation
10
+
11
+ - Removed old documentation, please refer to the [new documentation website](https://docs.devalang.com) for the latest information.
12
+
13
+ ### ✨ Syntax
14
+
15
+ - Added namespaced banks of sounds, allowing for better organization and management of sound banks.
16
+ - Example: `.808.myTrigger` to access a specific trigger in the `808` bank.
17
+ - Added support for beat durations in `triggers` statements, allowing for more precise timing control.
18
+ - Example: `.myTrigger 1/4 { ... }` to trigger the sound every quarter beat.
19
+ - Added support for beat durations in `arrow_calls` statements, allowing for more precise timing control.
20
+ - Example: `mySynth -> note(C4, { duration: 1/8 })` to play a note for an eighth beat.
21
+
22
+ ### 🧠 Core Engine
23
+
24
+ - Implemented `bank` resolver to resolve banks of sounds in the code.
25
+ - Example: `bank 808` will resolve to a bank of sounds named `808` if exists (check bank available command).
26
+
27
+ ### 🧰 Commands
28
+
29
+ > Use the `bank 808` statement to access the default sounds and triggers !
30
+ > Then you can use `808.myTrigger` to access a specific trigger in the `808` bank.
31
+
32
+ - Added `bank` command to manage banks of sounds.
33
+
34
+ - `bank list` to list installed banks of sounds.
35
+ - `bank available` to list available banks of sounds for installation.
36
+ - `bank info <bank_name>` to show information about a specific bank.
37
+ - `bank remove <bank_name>` to remove a bank.
38
+ - `bank update` to update all banks of sounds.
39
+ - `bank update <bank_name>` to update a specific bank.
40
+
41
+ - Added `install` command to install banks of sounds.
42
+ - `install bank <bank_name>` to install a specific bank of sounds.
43
+
44
+ ### 🧪 Experimental
45
+
46
+ - Introduced lazy loading and namespace-based resolution of installed sound banks.
47
+
48
+ ## Version 0.0.1-alpha.10 (2025-07-19)
49
+
50
+ ### 📖 Documentation
51
+
52
+ - Updated [new documentation website](https://docs.devalang.com) with new features and examples.
53
+
54
+ ### 🧠 Core Engine
55
+
56
+ - Patched `call`, `spawn` to handle correct cursor time.
57
+ - Patched `advance_char` to handle correct indentation and dedentation.
58
+ - Patched `bank` resolver to handle numbers in bank names.
59
+ - Patched `spawn` calls that was not calling a variable.
60
+
61
+ ### 🧩 Web Assembly
62
+
63
+ - Added `load_wasm_module` function to the WASM module to load Devalang modules dynamically.
64
+ - Added `render_audio` function to the WASM module to render audio files.
65
+
66
+ ## Version 0.0.1-alpha.9 (2025-07-14)
67
+
68
+ ### ✨ Syntax
69
+
70
+ - Added support for `synth` directives to define synthesizer sounds directly in code
71
+ → Example:
72
+
73
+ ```deva
74
+ let mySynth = synth sine
75
+ ```
76
+
77
+ ### 🧠 Core Engine
78
+
79
+ - ✅ **Major refactor** of the resolution layer:
80
+
81
+ - `condition`, `loop`, `group`, `trigger`, `call`, `spawn`, and `driver` were fully rewritten
82
+ - Ensures **correct variable scoping**, **cross-module references**, and **imported symbol resolution**
83
+
84
+ - ✅ Audio interpreter updated:
85
+ - `call` and `spawn` now execute correctly in parallel, preserving **temporal alignment** across groups
86
+
87
+ ### 🧩 Language Features
88
+
89
+ - Improved `@import` behavior:
90
+ - Modules can now be imported using **relative paths only**
91
+ - No need for absolute or root-based imports
92
+
93
+ ## Version 0.0.1-alpha.8 (2025-07-12)
94
+
95
+ ### Syntax
96
+
97
+ - Implemented `if` directive to conditionally execute blocks of code.
98
+ - Implemented `else` directive to provide an alternative block of code when the `if` condition is not met.
99
+ - Implemented `else if` directive to provide additional conditions for the `if` directive.
100
+
101
+ ### Core Components
102
+
103
+ - Implemented evaluator for audio statements, to execute conditional statements.
104
+ - Fixed `group` resolution and export issues.
105
+ - Implemented `Global Store` debugger to inspect variables by module for build command.
106
+ - Organized `TokenKind` and `StatementKind` enums for better clarity and maintainability.
107
+ - Refactored audio interpreter to handle the new syntax and directives.
108
+ - Refactored lexer to handle new directives and improve tokenization.
109
+ - Refactored parser to handle new directives and improve parsing logic.
110
+ - Added support for `call` and `spawn` execution of imported groups.
111
+ - Enforced scoped resolution of groups in `spawn` and `call` (must be imported in current module).
112
+
113
+ ## Version 0.0.1-alpha.7 (2025-07-11)
114
+
115
+ ## Examples
116
+
117
+ - Added examples in `examples` folder (group, loop, variables, index).
118
+
119
+ ## Structure
120
+
121
+ - Moved `rust/audio` folder to `rust/core/audio` to better organize the project structure.
122
+
123
+ ### Core Components
124
+
125
+ - Implemented `group` directive to define groups of sounds.
126
+ - Implemented `call` directive to call a group of sounds.
127
+ - Implemented `spawn` directive to spawn a group of sounds in parallel.
128
+ - Implemented `sleep` directive to pause execution for a specified duration.
129
+ - Patched line and column tracking in the lexer to ensure correct indentation handling.
130
+ - Patched string lexing advancing to handle first character correctly.
131
+
132
+ ## Version 0.0.1-alpha.5 (2025-07-05)
133
+
134
+ ### Syntax
135
+
136
+ - Fixed block parsing issues caused by missing or incorrect `Indent` / `Dedent` token detection.
137
+ - Indentation handling now triggers correctly at each newline.
138
+ - Improved reliability of nested blocks (e.g., inside `loop`) with consistent `Dedent` termination.
139
+
140
+ ### Core Components
141
+
142
+ - Added full **WebAssembly (WASM)** support — Devalang can now be compiled for browser or Node.js environments.
143
+ - Prepared the ground for future IDE integrations (e.g., VSCode extension) by stabilizing core syntax parsing.
144
+
145
+ ## Version 0.0.1-alpha.4 (2025-07-03)
146
+
147
+ ### Audio Engine
148
+
149
+ - Integrated Audio Engine to handle audio playback and rendering.
150
+ - Implemented Audio Player to play audio files.
151
+ - Added support for audio playback with the `play` command.
152
+
153
+ ### Commands
154
+
155
+ - Implemented `play` command to play Devalang files.
156
+
157
+ - Added `--watch` option to watch for changes in files and automatically rebuild and play them. (once)
158
+ - Added `--repeat` option to repeat the playback of the audio file. (infinite)
159
+
160
+ Note : You cannot use `--watch` and `--repeat` options together. Use `--repeat` instead.
161
+
162
+ ## Version 0.0.1-alpha.3 (2025-07-01)
163
+
164
+ - /!\ Major refactor of the project structure and module system /!\
165
+ - Refactored module system to support multiple modules and submodules.
166
+ - Patched all directives to be compatible with the new project structure.
167
+ - Prepared for the upcoming audio engine integration and sound rendering capabilities.
168
+ - Updated documentation to reflect the new project structure and features.
169
+
170
+ ## Version 0.0.1-alpha.2 (2025-06-26)
171
+
172
+ ### Commands
173
+
174
+ - Implemented `init` command to initialize a new Devalang project.
175
+ - Implemented `template` command to manage templates.
176
+ - Added `list` subcommand to list available templates.
177
+ - Added `info` subcommand to show information about a specific template.
178
+ - Implemented `watch` subcommand for the `build` and `check` command to watch for changes in files and automatically rebuild or check them.
179
+
180
+ ### Core Components
181
+
182
+ - Implemented Config manager to handle configuration files.
183
+ - Added support for `.devalang` configuration file as a TOML file.
184
+ - Implemented File System watcher to monitor file changes.
185
+ - Implemented Template manager to handle templates and their metadata.
186
+
187
+ ### Syntax
188
+
189
+ - Added support for built-in triggers for `.snare`, `.hihat`, `.clap`, `.tom`, `.crash`, `.ride`, `.synth`, `.bass`, and `.pad`.
190
+
191
+ ## Version 0.0.1-alpha.1 (2025-06-25)
192
+
193
+ ### Syntax
194
+
195
+ - Added support for `@import` directive to import other Devalang files.
196
+ - Added support for `@export` directive to export variables and functions.
197
+ - Added support for `@load` directive to load external resources.
198
+ - Added support for `bpm` directive to set the beats per minute.
199
+ - Added support for `bank` directive to define a bank of sounds.
200
+ - Added support for `loop` directive to define loops in the code.
201
+
202
+ ### Commands
203
+
204
+ - Implemented `check` command to check the syntax of Devalang files.
205
+ - Implemented `build` command to build the Abstract Syntax Tree (AST) of Devalang files.
206
+
207
+ ### Core Components
208
+
209
+ - Implemented Lexer to tokenize Devalang source code.
210
+ - Implemented Parser to parse the tokens and build the AST.
211
+ - Implemented Preprocessor to handle directives and preprocess the source code.
212
+ - Implemented Debugger to debug Devalang code.
213
+ - Implemented Builder to build the final output from the AST.
package/docs/ROADMAP.md CHANGED
@@ -1,12 +1,16 @@
1
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">
2
+ <img src="https://devalang.com/images/devalang-logo-cyan.svg" alt="Devalang Logo" width="300" />
3
3
  </div>
4
4
 
5
5
  # Roadmap
6
6
 
7
7
  Devalang is a work in progress. Here’s what we’re planning next:
8
8
 
9
+ ## Completed
10
+
11
+ - ✅ **Audio engine**: Integrate the audio engine for sound playback.
9
12
  - ✅ **Basic syntax**: Implement the core syntax for Devalang, including data types and basic statements.
13
+ - ✅ **Watch mode**: Add a watch mode to automatically rebuild on file changes.
10
14
  - ✅ **Module system**: Add support for importing and exporting variables between files using `@import` and `@export`.
11
15
  - ✅ **AST generation**: Implement the Abstract Syntax Tree (AST) generation for debugging and future compilation.
12
16
  - ✅ **Basic data types**: Support strings, numbers, booleans, maps, and arrays.
@@ -16,12 +20,11 @@ Devalang is a work in progress. Here’s what we’re planning next:
16
20
  - ✅ **Instruction calls**: Add support for instruction calls with parameters (e.g. `.kick auto {reverb:10, decay:20}`).
17
21
  - ✅ **Let assignments**: Implement `let` assignments for storing reusable values.
18
22
  - ✅ **Sample loading**: Add `@load` assignment to load samples (.mp3, .wav) for use as values.
23
+ - ✅ **WASM support**: Compile Devalang to WebAssembly for use in web applications and other environments.
24
+ - ✅ **VSCode extension**: Create a VSCode extension for syntax highlighting and code completion.
25
+
26
+ ## Upcoming
19
27
 
20
- - ⏳ **VSCode extension**: Create a VSCode extension for syntax highlighting and code completion.
21
- - ⏳ **WASM support**: Compile Devalang to WebAssembly for use in web applications.
22
- - ⏳ **Other statements**: Implement `if`, `else`, and other control structures.
23
- - ⏳ **Pattern and group statements**: Add support for `@pattern` and `@group` to organize code.
24
- - ⏳ **Watch mode**: Add a watch mode to automatically rebuild on file changes.
25
- - ⏳ **Functions**: Add support for defining and calling functions.
26
- - ⏳ **Audio engine**: Integrate the audio engine for sound playback.
28
+ - ⏳ **Smart modules**: Let Devalang detect and use groups, samples, and variables without needing to import them manually.
29
+ - ⏳ **Other statements**: Implement `pattern`, `function`, and other control structures.
27
30
  - ⏳ **Testing**: Expand test coverage for all features.
package/docs/TODO.md CHANGED
@@ -1,5 +1,5 @@
1
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">
2
+ <img src="https://devalang.com/images/devalang-logo-cyan.svg" alt="Devalang Logo" width="300" />
3
3
  </div>
4
4
 
5
5
  # TODOs list
@@ -8,26 +8,29 @@ This is a list of tasks and features to be implemented in Devalang. Note that th
8
8
 
9
9
  ## Commands
10
10
 
11
- - [ ] New project
12
- - [ ] Template
13
- - [ ] Implement template list
14
- - [ ] Implement template info
11
+ - [x] Init project
12
+ - [x] Implement init command
13
+ - [x] Implement template selector
14
+ - [ ] Implement project name validation
15
+ - [x] Template
16
+ - [x] Implement template list
17
+ - [x] Implement template info
15
18
  - [x] Checking
16
- - [ ] Implement watch mode
19
+ - [x] Implement watch mode
17
20
  - [ ] Implement debug mode
18
21
  - [ ] Implement compilation mode
19
22
  - [x] Building
20
- - [ ] Implement watch mode
23
+ - [x] Implement watch mode
21
24
  - [ ] Implement debug mode
22
25
  - [ ] Implement compilation mode
23
26
  - [ ] Implement compression mode
24
- - [ ] Play
25
- - [ ] Implement Audio Engine
26
- - [ ] Implement loop mode
27
+ - [x] Play
28
+ - [x] Implement Audio Engine
29
+ - [x] Implement loop mode
27
30
 
28
31
  ## Core components
29
32
 
30
- - [ ] Audio Engine
33
+ - [x] Audio Engine
31
34
  - [x] Lexer
32
35
  - [x] Parser
33
36
  - [x] Preprocessor
@@ -36,31 +39,31 @@ This is a list of tasks and features to be implemented in Devalang. Note that th
36
39
 
37
40
  ## Syntax elements
38
41
 
39
- - [ ] #
42
+ - [x] #
40
43
  - [x] @import
41
44
  - [x] @export
42
- - [ ] @group
43
- - [ ] @pattern
44
- - [ ] @function
45
45
  - [x] @load
46
46
  - [ ] @include
47
+ - [ ] function
48
+ - [ ] pattern
49
+ - [x] group
50
+ - [x] call
51
+ - [x] spawn
52
+ - [x] sleep
47
53
  - [x] bpm
48
54
  - [x] bank
49
55
  - [x] loop
50
56
  - [x] let
51
- - [ ] if
52
- - [ ] else
53
- - [ ] else if
57
+ - [x] if
58
+ - [x] else
59
+ - [x] else if
54
60
 
55
- ## Built-in triggers
61
+ ## Triggers
56
62
 
57
- - [x] .kick
58
- - [ ] .snare
59
- - [ ] .hihat
60
- - [ ] .tom
61
- - [ ] .clap
62
- - [ ] .crash
63
- - [ ] .ride
64
- - [ ] .synth
65
- - [ ] .bass
66
- - [ ] .pad
63
+ - [x] Built-in triggers
64
+ - [x] Custom triggers
65
+
66
+ ## Other TODOs
67
+
68
+ - [ ] Comment all core components
69
+ - [ ] Add unit tests for all core components
@@ -0,0 +1,9 @@
1
+ # This file demonstrates the use of banks in Devalang.
2
+
3
+ let default_bank = 808
4
+
5
+ bank default_bank
6
+
7
+ .808.kick auto
8
+ .808.snare auto
9
+ .808.hat auto
@@ -0,0 +1,20 @@
1
+ # This file demonstrates the use of conditional blocks in Devalang.
2
+
3
+ @import { duration, default_bank, params, loopCount, tempo } from "./variables.deva"
4
+ @import { myGroup } from "./group.deva"
5
+
6
+ @load "./samples/kick-808.wav" as kickCustom
7
+ @load "./samples/hat-808.wav" as hatCustom
8
+
9
+ group conditionBlock:
10
+ if tempo > 120:
11
+ # Will be executed if the condition is true
12
+ .kickCustom auto
13
+ else if tempo > 155:
14
+ # Will be executed if the condition is false
15
+ .hatCustom auto
16
+ else:
17
+ .kickCustom auto
18
+ .hatCustom auto
19
+
20
+ @export { conditionBlock }