kiddo-lang 1.0.1__tar.gz
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.
- kiddo_lang-1.0.1/LICENSE +21 -0
- kiddo_lang-1.0.1/PKG-INFO +238 -0
- kiddo_lang-1.0.1/README.md +203 -0
- kiddo_lang-1.0.1/kiddo/__init__.py +3 -0
- kiddo_lang-1.0.1/kiddo/__main__.py +7 -0
- kiddo_lang-1.0.1/kiddo/ast_nodes.py +296 -0
- kiddo_lang-1.0.1/kiddo/builtins.py +556 -0
- kiddo_lang-1.0.1/kiddo/cli.py +562 -0
- kiddo_lang-1.0.1/kiddo/compiler/__init__.py +22 -0
- kiddo_lang-1.0.1/kiddo/compiler/bytecode.py +245 -0
- kiddo_lang-1.0.1/kiddo/compiler/codegen.py +167 -0
- kiddo_lang-1.0.1/kiddo/compiler/ir.py +713 -0
- kiddo_lang-1.0.1/kiddo/compiler/native_explorer.py +444 -0
- kiddo_lang-1.0.1/kiddo/compiler/optimizer.py +282 -0
- kiddo_lang-1.0.1/kiddo/compiler/packager.py +258 -0
- kiddo_lang-1.0.1/kiddo/compiler/vm.py +662 -0
- kiddo_lang-1.0.1/kiddo/devtools/__init__.py +9 -0
- kiddo_lang-1.0.1/kiddo/devtools/debugger.py +334 -0
- kiddo_lang-1.0.1/kiddo/devtools/highlighter.py +214 -0
- kiddo_lang-1.0.1/kiddo/devtools/pkg.py +337 -0
- kiddo_lang-1.0.1/kiddo/devtools/registry_packages.py +227 -0
- kiddo_lang-1.0.1/kiddo/devtools/terminal.py +456 -0
- kiddo_lang-1.0.1/kiddo/devtools/updater.py +109 -0
- kiddo_lang-1.0.1/kiddo/environment.py +66 -0
- kiddo_lang-1.0.1/kiddo/errors.py +178 -0
- kiddo_lang-1.0.1/kiddo/ide/__init__.py +5 -0
- kiddo_lang-1.0.1/kiddo/ide/app.py +124 -0
- kiddo_lang-1.0.1/kiddo/ide/editor.py +718 -0
- kiddo_lang-1.0.1/kiddo/ide/panels.py +570 -0
- kiddo_lang-1.0.1/kiddo/ide/runner.py +316 -0
- kiddo_lang-1.0.1/kiddo/ide/server.py +556 -0
- kiddo_lang-1.0.1/kiddo/ide/theme.py +45 -0
- kiddo_lang-1.0.1/kiddo/ide/tk_app.py +152 -0
- kiddo_lang-1.0.1/kiddo/ide/web/index.html +336 -0
- kiddo_lang-1.0.1/kiddo/ide/web/logo.png +0 -0
- kiddo_lang-1.0.1/kiddo/ide/web/studio.css +1344 -0
- kiddo_lang-1.0.1/kiddo/ide/web/studio.js +1489 -0
- kiddo_lang-1.0.1/kiddo/interpreter.py +1248 -0
- kiddo_lang-1.0.1/kiddo/lexer.py +466 -0
- kiddo_lang-1.0.1/kiddo/parser.py +898 -0
- kiddo_lang-1.0.1/kiddo/runtime.py +255 -0
- kiddo_lang-1.0.1/kiddo/stdlib.py +629 -0
- kiddo_lang-1.0.1/kiddo/tokens.py +175 -0
- kiddo_lang-1.0.1/kiddo_lang.egg-info/PKG-INFO +238 -0
- kiddo_lang-1.0.1/kiddo_lang.egg-info/SOURCES.txt +53 -0
- kiddo_lang-1.0.1/kiddo_lang.egg-info/dependency_links.txt +1 -0
- kiddo_lang-1.0.1/kiddo_lang.egg-info/entry_points.txt +2 -0
- kiddo_lang-1.0.1/kiddo_lang.egg-info/top_level.txt +1 -0
- kiddo_lang-1.0.1/pyproject.toml +26 -0
- kiddo_lang-1.0.1/setup.cfg +4 -0
- kiddo_lang-1.0.1/tests/test_kiddo.py +327 -0
- kiddo_lang-1.0.1/tests/test_phase3.py +220 -0
- kiddo_lang-1.0.1/tests/test_phase4_compiler.py +214 -0
- kiddo_lang-1.0.1/tests/test_phase5_devtools.py +219 -0
- kiddo_lang-1.0.1/tests/test_phase6_ide.py +239 -0
kiddo_lang-1.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Arijit Chakraborty (ItzAjx / lonewolfFSD)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kiddo-lang
|
|
3
|
+
Version: 1.0.1
|
|
4
|
+
Summary: KIDDO Programming Language — Read it like English. Run anything for real.
|
|
5
|
+
Author: Arijit Chakraborty
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Arijit Chakraborty (ItzAjx / lonewolfFSD)
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/lonewolfFSD/kiddo-lang
|
|
29
|
+
Project-URL: Repository, https://github.com/lonewolfFSD/kiddo-lang.git
|
|
30
|
+
Project-URL: Issues, https://github.com/lonewolfFSD/kiddo-lang/issues
|
|
31
|
+
Requires-Python: >=3.10
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
License-File: LICENSE
|
|
34
|
+
Dynamic: license-file
|
|
35
|
+
|
|
36
|
+
<p align="center">
|
|
37
|
+
<img src="https://raw.githubusercontent.com/lonewolfFSD/kiddo-lang/main/assets/kiddo-128.png" width="110" height="110" alt="KIDDO Logo">
|
|
38
|
+
</p>
|
|
39
|
+
|
|
40
|
+
<h1 align="center">KIDDO Programming Language</h1>
|
|
41
|
+
|
|
42
|
+
<p align="center">
|
|
43
|
+
<strong>Read it like English. Run anything for real.</strong><br>
|
|
44
|
+
A human-first programming language with its own Lexer, Parser, Tree-Walk Interpreter, Optimizing Bytecode Compiler, Stack Virtual Machine, Package Manager, Interactive Debugger, VS Code Extension, and Standalone Desktop IDE (<strong>KIDDO Studio</strong>).
|
|
45
|
+
</p>
|
|
46
|
+
|
|
47
|
+
<p align="center">
|
|
48
|
+
<a href="https://github.com/lonewolfFSD/kiddo-lang/releases/latest"><img src="https://img.shields.io/badge/Windows%20Setup-v1.0.1%20(.exe)-2ea043?logo=windows" alt="Windows Setup Wizard"></a>
|
|
49
|
+
<a href="https://pypi.org/project/kiddo-lang/"><img src="https://img.shields.io/badge/PyPI-pip%20install%20kiddo--lang-3775a9?logo=pypi&logoColor=white" alt="PyPI"></a>
|
|
50
|
+
<a href="https://marketplace.visualstudio.com/items?itemName=ItzAjx.kiddo-lang"><img src="https://img.shields.io/badge/VS%20Code%20Marketplace-ItzAjx.kiddo--lang-7c3aed?logo=visualstudiocode" alt="VS Code Marketplace"></a>
|
|
51
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="MIT License"></a>
|
|
52
|
+
</p>
|
|
53
|
+
|
|
54
|
+
<p align="center">
|
|
55
|
+
<img src="https://raw.githubusercontent.com/lonewolfFSD/kiddo-lang/main/assets/kiddo-demo.gif" width="880" alt="KIDDO Studio & Optimizing Bytecode VM Demo">
|
|
56
|
+
</p>
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Why KIDDO?
|
|
61
|
+
|
|
62
|
+
Most languages force beginners to memorize cryptic ceremony before writing their first loop. **KIDDO** reads like natural English on Day 1 — yet scales all the way to **object-oriented blueprints, closures, JSON & CSV automation, HTTP servers, graphics, bytecode compilation (`.kidc`), and standalone Windows `.exe` binaries**.
|
|
63
|
+
|
|
64
|
+
| Python | KIDDO (`.kid`) |
|
|
65
|
+
| :--- | :--- |
|
|
66
|
+
| <pre lang="python">num = int(input("Enter number: "))<br>ans = 1<br>for i in range(1, num + 1):<br> ans = ans * i<br>print(ans)</pre> | <pre>num = ask("Enter number: ")<br>answer = 1<br><br>repeat 1 to num:<br> answer = answer * current<br><br>show(answer)</pre> |
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Installation
|
|
71
|
+
|
|
72
|
+
### Option 1 — Windows Graphical Setup Wizard (Recommended)
|
|
73
|
+
1. Download **[`KIDDO-Setup-v1.0.1.exe`](https://github.com/lonewolfFSD/kiddo-lang/releases/download/v1.0.1/KIDDO-Setup-v1.0.1.exe)** from [GitHub Releases](https://github.com/lonewolfFSD/kiddo-lang/releases/latest).
|
|
74
|
+
2. Run the wizard — it installs the `kiddo` compiler & CLI onto your `PATH`, associates `.kid` files with the KIDDO purple **`K`** icon, creates a **KIDDO Studio** desktop shortcut, and installs the VS Code extension automatically.
|
|
75
|
+
|
|
76
|
+
### Option 2 — Install via `pip` (Windows / macOS / Linux)
|
|
77
|
+
```bash
|
|
78
|
+
pip install kiddo-lang
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Option 3 — Visual Studio Code Extension
|
|
82
|
+
Search **`KIDDO`** (or `ItzAjx.kiddo-lang`) in the VS Code Extensions tab, or install from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=ItzAjx.kiddo-lang).
|
|
83
|
+
|
|
84
|
+
### Option 4 — Install from Source
|
|
85
|
+
Requires **Python 3.10+**:
|
|
86
|
+
```bash
|
|
87
|
+
git clone https://github.com/lonewolfFSD/kiddo-lang.git
|
|
88
|
+
cd kiddo-lang
|
|
89
|
+
python scripts/install_cli.py
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Quick Language Tour
|
|
95
|
+
|
|
96
|
+
### 1. Variables, Smart `ask()` & String Interpolation
|
|
97
|
+
```python
|
|
98
|
+
name = ask("What is your name? ")
|
|
99
|
+
age = ask("How old are you? ") # Automatically parsed as a Number!
|
|
100
|
+
|
|
101
|
+
show("Hello {name}, next year you turn {age + 1}!")
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### 2. Conditions & `choose` Pattern Matching
|
|
105
|
+
```python
|
|
106
|
+
if age >= 18:
|
|
107
|
+
show("Adult")
|
|
108
|
+
else if age >= 13:
|
|
109
|
+
show("Teenager")
|
|
110
|
+
else:
|
|
111
|
+
show("Child")
|
|
112
|
+
|
|
113
|
+
choose grade.upper():
|
|
114
|
+
when "A":
|
|
115
|
+
show("Outstanding!")
|
|
116
|
+
when "B", "C":
|
|
117
|
+
show("Good job!")
|
|
118
|
+
otherwise:
|
|
119
|
+
show("Keep practicing!")
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### 3. Unified `repeat` Loops
|
|
123
|
+
Every loop in KIDDO starts with `repeat`:
|
|
124
|
+
```python
|
|
125
|
+
repeat 5 times:
|
|
126
|
+
show("Hello #{current}")
|
|
127
|
+
|
|
128
|
+
repeat 10 to 2 step -2 as count:
|
|
129
|
+
show(count)
|
|
130
|
+
|
|
131
|
+
repeat each key, val in {"lang": "KIDDO", "version": 1}:
|
|
132
|
+
show("{key} = {val}")
|
|
133
|
+
|
|
134
|
+
repeat forever:
|
|
135
|
+
if ask("Type quit: ") == "quit":
|
|
136
|
+
stop
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### 4. Functions, Closures & Variadics
|
|
140
|
+
```python
|
|
141
|
+
define summarize(student, *scores):
|
|
142
|
+
return "{student}: avg {format_num(average(scores), 1)}"
|
|
143
|
+
|
|
144
|
+
show(summarize("Alex", 92, 96, 88))
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### 5. Effortless OOP with `blueprint` & `me`
|
|
148
|
+
No `__init__` or `self` parameter clutter — `me` is bound automatically inside methods:
|
|
149
|
+
```python
|
|
150
|
+
blueprint Character:
|
|
151
|
+
define setup(name, hp = 100):
|
|
152
|
+
me.name = name
|
|
153
|
+
me.hp = hp
|
|
154
|
+
|
|
155
|
+
blueprint Wizard from Character:
|
|
156
|
+
define fireball(target):
|
|
157
|
+
target.hp -= 35
|
|
158
|
+
show("{me.name} hits {target.name}! ({target.hp} HP left)")
|
|
159
|
+
|
|
160
|
+
merlin = Wizard("Merlin")
|
|
161
|
+
goblin = Character("Goblin", hp = 60)
|
|
162
|
+
merlin.fireball(goblin)
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### 6. Friendly Error Handling & Built-in Modules
|
|
166
|
+
```python
|
|
167
|
+
from math use sqrt, is_prime
|
|
168
|
+
use files
|
|
169
|
+
|
|
170
|
+
try:
|
|
171
|
+
files.write_json("stats.json", {"root": sqrt(144), "prime": is_prime(97)})
|
|
172
|
+
data = files.read_json("stats.json")
|
|
173
|
+
show("Saved:", data)
|
|
174
|
+
catch err:
|
|
175
|
+
show("Error: {err}")
|
|
176
|
+
always:
|
|
177
|
+
show("Done!")
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## CLI, Compiler, Debugger & KIDDO Studio IDE
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
# Run any .kid source file (or compiled .kidc bytecode file)
|
|
186
|
+
kiddo hello.kid
|
|
187
|
+
|
|
188
|
+
# Compile & execute on the Phase 4 Stack Bytecode Virtual Machine
|
|
189
|
+
kiddo run hello.kid --vm
|
|
190
|
+
|
|
191
|
+
# Compile to binary .kidc or standalone Windows .exe!
|
|
192
|
+
kiddo compile hello.kid -o hello.kidc
|
|
193
|
+
kiddo build hello.kid
|
|
194
|
+
|
|
195
|
+
# Inspect Lexer Tokens, AST, Linear IR, Bytecode, C99, or x86-64 Assembly
|
|
196
|
+
kiddo tokens hello.kid
|
|
197
|
+
kiddo ast hello.kid
|
|
198
|
+
kiddo ir hello.kid
|
|
199
|
+
kiddo disasm hello.kid
|
|
200
|
+
kiddo native hello.kid --emit-asm
|
|
201
|
+
|
|
202
|
+
# Launch the Interactive Source-Level Step Debugger
|
|
203
|
+
kiddo debug examples/factorial.kid
|
|
204
|
+
|
|
205
|
+
# Manage KIDDO Packages (colors, algorithms, geometry, testing, ascii_art)
|
|
206
|
+
kiddo pkg search
|
|
207
|
+
kiddo pkg install algorithms
|
|
208
|
+
|
|
209
|
+
# Launch KIDDO Studio (Dedicated Dark Modern Desktop IDE)
|
|
210
|
+
kiddo ide
|
|
211
|
+
|
|
212
|
+
# Check for & install new KIDDO language releases
|
|
213
|
+
kiddo upgrade
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Architecture Overview
|
|
219
|
+
|
|
220
|
+
```text
|
|
221
|
+
.kid Source ─► Lexer (INDENT/DEDENT & {expr} Interpolation)
|
|
222
|
+
─► Recursive-Descent Parser ─► Typed AST
|
|
223
|
+
├──► Tree-Walk Interpreter & Interactive Step Debugger
|
|
224
|
+
└──► Linear IR ─► Multi-Pass Optimizer (-O1)
|
|
225
|
+
├──► Bytecode Codegen (.kidc) ─► KIDDO Stack VM ─► Standalone .exe
|
|
226
|
+
└──► Experimental Native C99 / x86-64 ASM Explorer
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
- Language Grammar & Specification: [`SPEC.md`](SPEC.md)
|
|
230
|
+
- Compiler & VM Design: [`COMPILER_ARCHITECTURE.md`](COMPILER_ARCHITECTURE.md)
|
|
231
|
+
- Engineering Roadmap: [`ROADMAP.md`](ROADMAP.md)
|
|
232
|
+
- Contributing Guide: [`CONTRIBUTING.md`](CONTRIBUTING.md)
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## License
|
|
237
|
+
|
|
238
|
+
Released under the [MIT License](LICENSE). Created by **Arijit Chakraborty** ([@lonewolfFSD](https://github.com/lonewolfFSD)).
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/lonewolfFSD/kiddo-lang/main/assets/kiddo-128.png" width="110" height="110" alt="KIDDO Logo">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">KIDDO Programming Language</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>Read it like English. Run anything for real.</strong><br>
|
|
9
|
+
A human-first programming language with its own Lexer, Parser, Tree-Walk Interpreter, Optimizing Bytecode Compiler, Stack Virtual Machine, Package Manager, Interactive Debugger, VS Code Extension, and Standalone Desktop IDE (<strong>KIDDO Studio</strong>).
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="https://github.com/lonewolfFSD/kiddo-lang/releases/latest"><img src="https://img.shields.io/badge/Windows%20Setup-v1.0.1%20(.exe)-2ea043?logo=windows" alt="Windows Setup Wizard"></a>
|
|
14
|
+
<a href="https://pypi.org/project/kiddo-lang/"><img src="https://img.shields.io/badge/PyPI-pip%20install%20kiddo--lang-3775a9?logo=pypi&logoColor=white" alt="PyPI"></a>
|
|
15
|
+
<a href="https://marketplace.visualstudio.com/items?itemName=ItzAjx.kiddo-lang"><img src="https://img.shields.io/badge/VS%20Code%20Marketplace-ItzAjx.kiddo--lang-7c3aed?logo=visualstudiocode" alt="VS Code Marketplace"></a>
|
|
16
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="MIT License"></a>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<img src="https://raw.githubusercontent.com/lonewolfFSD/kiddo-lang/main/assets/kiddo-demo.gif" width="880" alt="KIDDO Studio & Optimizing Bytecode VM Demo">
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Why KIDDO?
|
|
26
|
+
|
|
27
|
+
Most languages force beginners to memorize cryptic ceremony before writing their first loop. **KIDDO** reads like natural English on Day 1 — yet scales all the way to **object-oriented blueprints, closures, JSON & CSV automation, HTTP servers, graphics, bytecode compilation (`.kidc`), and standalone Windows `.exe` binaries**.
|
|
28
|
+
|
|
29
|
+
| Python | KIDDO (`.kid`) |
|
|
30
|
+
| :--- | :--- |
|
|
31
|
+
| <pre lang="python">num = int(input("Enter number: "))<br>ans = 1<br>for i in range(1, num + 1):<br> ans = ans * i<br>print(ans)</pre> | <pre>num = ask("Enter number: ")<br>answer = 1<br><br>repeat 1 to num:<br> answer = answer * current<br><br>show(answer)</pre> |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
### Option 1 — Windows Graphical Setup Wizard (Recommended)
|
|
38
|
+
1. Download **[`KIDDO-Setup-v1.0.1.exe`](https://github.com/lonewolfFSD/kiddo-lang/releases/download/v1.0.1/KIDDO-Setup-v1.0.1.exe)** from [GitHub Releases](https://github.com/lonewolfFSD/kiddo-lang/releases/latest).
|
|
39
|
+
2. Run the wizard — it installs the `kiddo` compiler & CLI onto your `PATH`, associates `.kid` files with the KIDDO purple **`K`** icon, creates a **KIDDO Studio** desktop shortcut, and installs the VS Code extension automatically.
|
|
40
|
+
|
|
41
|
+
### Option 2 — Install via `pip` (Windows / macOS / Linux)
|
|
42
|
+
```bash
|
|
43
|
+
pip install kiddo-lang
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Option 3 — Visual Studio Code Extension
|
|
47
|
+
Search **`KIDDO`** (or `ItzAjx.kiddo-lang`) in the VS Code Extensions tab, or install from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=ItzAjx.kiddo-lang).
|
|
48
|
+
|
|
49
|
+
### Option 4 — Install from Source
|
|
50
|
+
Requires **Python 3.10+**:
|
|
51
|
+
```bash
|
|
52
|
+
git clone https://github.com/lonewolfFSD/kiddo-lang.git
|
|
53
|
+
cd kiddo-lang
|
|
54
|
+
python scripts/install_cli.py
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Quick Language Tour
|
|
60
|
+
|
|
61
|
+
### 1. Variables, Smart `ask()` & String Interpolation
|
|
62
|
+
```python
|
|
63
|
+
name = ask("What is your name? ")
|
|
64
|
+
age = ask("How old are you? ") # Automatically parsed as a Number!
|
|
65
|
+
|
|
66
|
+
show("Hello {name}, next year you turn {age + 1}!")
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 2. Conditions & `choose` Pattern Matching
|
|
70
|
+
```python
|
|
71
|
+
if age >= 18:
|
|
72
|
+
show("Adult")
|
|
73
|
+
else if age >= 13:
|
|
74
|
+
show("Teenager")
|
|
75
|
+
else:
|
|
76
|
+
show("Child")
|
|
77
|
+
|
|
78
|
+
choose grade.upper():
|
|
79
|
+
when "A":
|
|
80
|
+
show("Outstanding!")
|
|
81
|
+
when "B", "C":
|
|
82
|
+
show("Good job!")
|
|
83
|
+
otherwise:
|
|
84
|
+
show("Keep practicing!")
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 3. Unified `repeat` Loops
|
|
88
|
+
Every loop in KIDDO starts with `repeat`:
|
|
89
|
+
```python
|
|
90
|
+
repeat 5 times:
|
|
91
|
+
show("Hello #{current}")
|
|
92
|
+
|
|
93
|
+
repeat 10 to 2 step -2 as count:
|
|
94
|
+
show(count)
|
|
95
|
+
|
|
96
|
+
repeat each key, val in {"lang": "KIDDO", "version": 1}:
|
|
97
|
+
show("{key} = {val}")
|
|
98
|
+
|
|
99
|
+
repeat forever:
|
|
100
|
+
if ask("Type quit: ") == "quit":
|
|
101
|
+
stop
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### 4. Functions, Closures & Variadics
|
|
105
|
+
```python
|
|
106
|
+
define summarize(student, *scores):
|
|
107
|
+
return "{student}: avg {format_num(average(scores), 1)}"
|
|
108
|
+
|
|
109
|
+
show(summarize("Alex", 92, 96, 88))
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### 5. Effortless OOP with `blueprint` & `me`
|
|
113
|
+
No `__init__` or `self` parameter clutter — `me` is bound automatically inside methods:
|
|
114
|
+
```python
|
|
115
|
+
blueprint Character:
|
|
116
|
+
define setup(name, hp = 100):
|
|
117
|
+
me.name = name
|
|
118
|
+
me.hp = hp
|
|
119
|
+
|
|
120
|
+
blueprint Wizard from Character:
|
|
121
|
+
define fireball(target):
|
|
122
|
+
target.hp -= 35
|
|
123
|
+
show("{me.name} hits {target.name}! ({target.hp} HP left)")
|
|
124
|
+
|
|
125
|
+
merlin = Wizard("Merlin")
|
|
126
|
+
goblin = Character("Goblin", hp = 60)
|
|
127
|
+
merlin.fireball(goblin)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### 6. Friendly Error Handling & Built-in Modules
|
|
131
|
+
```python
|
|
132
|
+
from math use sqrt, is_prime
|
|
133
|
+
use files
|
|
134
|
+
|
|
135
|
+
try:
|
|
136
|
+
files.write_json("stats.json", {"root": sqrt(144), "prime": is_prime(97)})
|
|
137
|
+
data = files.read_json("stats.json")
|
|
138
|
+
show("Saved:", data)
|
|
139
|
+
catch err:
|
|
140
|
+
show("Error: {err}")
|
|
141
|
+
always:
|
|
142
|
+
show("Done!")
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## CLI, Compiler, Debugger & KIDDO Studio IDE
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# Run any .kid source file (or compiled .kidc bytecode file)
|
|
151
|
+
kiddo hello.kid
|
|
152
|
+
|
|
153
|
+
# Compile & execute on the Phase 4 Stack Bytecode Virtual Machine
|
|
154
|
+
kiddo run hello.kid --vm
|
|
155
|
+
|
|
156
|
+
# Compile to binary .kidc or standalone Windows .exe!
|
|
157
|
+
kiddo compile hello.kid -o hello.kidc
|
|
158
|
+
kiddo build hello.kid
|
|
159
|
+
|
|
160
|
+
# Inspect Lexer Tokens, AST, Linear IR, Bytecode, C99, or x86-64 Assembly
|
|
161
|
+
kiddo tokens hello.kid
|
|
162
|
+
kiddo ast hello.kid
|
|
163
|
+
kiddo ir hello.kid
|
|
164
|
+
kiddo disasm hello.kid
|
|
165
|
+
kiddo native hello.kid --emit-asm
|
|
166
|
+
|
|
167
|
+
# Launch the Interactive Source-Level Step Debugger
|
|
168
|
+
kiddo debug examples/factorial.kid
|
|
169
|
+
|
|
170
|
+
# Manage KIDDO Packages (colors, algorithms, geometry, testing, ascii_art)
|
|
171
|
+
kiddo pkg search
|
|
172
|
+
kiddo pkg install algorithms
|
|
173
|
+
|
|
174
|
+
# Launch KIDDO Studio (Dedicated Dark Modern Desktop IDE)
|
|
175
|
+
kiddo ide
|
|
176
|
+
|
|
177
|
+
# Check for & install new KIDDO language releases
|
|
178
|
+
kiddo upgrade
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Architecture Overview
|
|
184
|
+
|
|
185
|
+
```text
|
|
186
|
+
.kid Source ─► Lexer (INDENT/DEDENT & {expr} Interpolation)
|
|
187
|
+
─► Recursive-Descent Parser ─► Typed AST
|
|
188
|
+
├──► Tree-Walk Interpreter & Interactive Step Debugger
|
|
189
|
+
└──► Linear IR ─► Multi-Pass Optimizer (-O1)
|
|
190
|
+
├──► Bytecode Codegen (.kidc) ─► KIDDO Stack VM ─► Standalone .exe
|
|
191
|
+
└──► Experimental Native C99 / x86-64 ASM Explorer
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
- Language Grammar & Specification: [`SPEC.md`](SPEC.md)
|
|
195
|
+
- Compiler & VM Design: [`COMPILER_ARCHITECTURE.md`](COMPILER_ARCHITECTURE.md)
|
|
196
|
+
- Engineering Roadmap: [`ROADMAP.md`](ROADMAP.md)
|
|
197
|
+
- Contributing Guide: [`CONTRIBUTING.md`](CONTRIBUTING.md)
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## License
|
|
202
|
+
|
|
203
|
+
Released under the [MIT License](LICENSE). Created by **Arijit Chakraborty** ([@lonewolfFSD](https://github.com/lonewolfFSD)).
|