maliklang 1.0.0__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.
- maliklang-1.0.0/LICENSE +21 -0
- maliklang-1.0.0/PKG-INFO +297 -0
- maliklang-1.0.0/README.md +264 -0
- maliklang-1.0.0/malik_lang/__init__.py +24 -0
- maliklang-1.0.0/malik_lang/cli/__init__.py +7 -0
- maliklang-1.0.0/malik_lang/cli/cli.py +196 -0
- maliklang-1.0.0/malik_lang/cli/formatter.py +40 -0
- maliklang-1.0.0/malik_lang/interpreter/__init__.py +7 -0
- maliklang-1.0.0/malik_lang/interpreter/interpreter.py +718 -0
- maliklang-1.0.0/malik_lang/lexer/__init__.py +8 -0
- maliklang-1.0.0/malik_lang/lexer/lexer.py +376 -0
- maliklang-1.0.0/malik_lang/lexer/token.py +121 -0
- maliklang-1.0.0/malik_lang/parser/__init__.py +69 -0
- maliklang-1.0.0/malik_lang/parser/ast_nodes.py +232 -0
- maliklang-1.0.0/malik_lang/parser/parser.py +545 -0
- maliklang-1.0.0/malik_lang/repl/__init__.py +7 -0
- maliklang-1.0.0/malik_lang/repl/repl.py +168 -0
- maliklang-1.0.0/malik_lang/runtime/__init__.py +47 -0
- maliklang-1.0.0/malik_lang/runtime/environment.py +75 -0
- maliklang-1.0.0/malik_lang/runtime/errors.py +113 -0
- maliklang-1.0.0/malik_lang/runtime/formatter.py +25 -0
- maliklang-1.0.0/malik_lang/runtime/values.py +118 -0
- maliklang-1.0.0/malik_lang/stdlib/__init__.py +64 -0
- maliklang-1.0.0/malik_lang/stdlib/builtins.py +204 -0
- maliklang-1.0.0/malik_lang/stdlib/crypto_mod.py +108 -0
- maliklang-1.0.0/malik_lang/stdlib/file_mod.py +112 -0
- maliklang-1.0.0/malik_lang/stdlib/http_mod.py +163 -0
- maliklang-1.0.0/malik_lang/stdlib/json_mod.py +30 -0
- maliklang-1.0.0/malik_lang/stdlib/log_mod.py +103 -0
- maliklang-1.0.0/malik_lang/stdlib/math_mod.py +109 -0
- maliklang-1.0.0/malik_lang/stdlib/network_mod.py +133 -0
- maliklang-1.0.0/malik_lang/stdlib/process_mod.py +78 -0
- maliklang-1.0.0/malik_lang/stdlib/random_mod.py +47 -0
- maliklang-1.0.0/malik_lang/stdlib/regex_mod.py +64 -0
- maliklang-1.0.0/malik_lang/stdlib/system_mod.py +63 -0
- maliklang-1.0.0/malik_lang/stdlib/text_mod.py +95 -0
- maliklang-1.0.0/malik_lang/stdlib/time_mod.py +48 -0
- maliklang-1.0.0/maliklang/__init__.py +22 -0
- maliklang-1.0.0/maliklang.egg-info/PKG-INFO +297 -0
- maliklang-1.0.0/maliklang.egg-info/SOURCES.txt +53 -0
- maliklang-1.0.0/maliklang.egg-info/dependency_links.txt +1 -0
- maliklang-1.0.0/maliklang.egg-info/entry_points.txt +2 -0
- maliklang-1.0.0/maliklang.egg-info/top_level.txt +2 -0
- maliklang-1.0.0/pyproject.toml +56 -0
- maliklang-1.0.0/setup.cfg +4 -0
- maliklang-1.0.0/setup.py +21 -0
- maliklang-1.0.0/tests/test_cli_and_repl.py +109 -0
- maliklang-1.0.0/tests/test_interpreter.py +292 -0
- maliklang-1.0.0/tests/test_lexer.py +181 -0
- maliklang-1.0.0/tests/test_networking_crypto.py +140 -0
- maliklang-1.0.0/tests/test_parser.py +200 -0
- maliklang-1.0.0/tests/test_programs.py +46 -0
- maliklang-1.0.0/tests/test_security_scripting.py +102 -0
- maliklang-1.0.0/tests/test_stability_and_edge_cases.py +205 -0
- maliklang-1.0.0/tests/test_stdlib.py +193 -0
maliklang-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MalikLang Contributors
|
|
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.
|
maliklang-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: maliklang
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A beginner-friendly programming language designed for natural readability and defensive cybersecurity automation.
|
|
5
|
+
Author: MalikLang Contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/maliklang/maliklang
|
|
8
|
+
Project-URL: Documentation, https://github.com/maliklang/maliklang#readme
|
|
9
|
+
Project-URL: Repository, https://github.com/maliklang/maliklang.git
|
|
10
|
+
Project-URL: Issues, https://github.com/maliklang/maliklang/issues
|
|
11
|
+
Project-URL: Changelog, https://github.com/maliklang/maliklang/blob/main/CHANGELOG.md
|
|
12
|
+
Keywords: programming-language,interpreter,beginner-friendly,cybersecurity,education,automation,scripting,maliklang
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Education
|
|
16
|
+
Classifier: Intended Audience :: Information Technology
|
|
17
|
+
Classifier: Natural Language :: English
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Topic :: Software Development :: Interpreters
|
|
26
|
+
Classifier: Topic :: Software Development :: Compilers
|
|
27
|
+
Classifier: Topic :: Security
|
|
28
|
+
Requires-Python: >=3.8
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
Dynamic: requires-python
|
|
33
|
+
|
|
34
|
+
# MalikLang 🚀
|
|
35
|
+
|
|
36
|
+
[](https://github.com/maliklang/maliklang/actions/workflows/ci.yml)
|
|
37
|
+
[](https://pypi.org/project/maliklang/)
|
|
38
|
+
[](https://pypi.org/project/maliklang/)
|
|
39
|
+
[](LICENSE)
|
|
40
|
+
[](vscode-extension/)
|
|
41
|
+
|
|
42
|
+
> **A complete, beginner-friendly programming language designed from scratch.**
|
|
43
|
+
> Simpler than Python, natural English-like syntax, zero external runtime dependencies, 13 built-in standard library modules, defensive cybersecurity automation tools, interactive REPL, formatted diagnostics, and VS Code support.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 🌟 Language Philosophy & Key Highlights
|
|
48
|
+
|
|
49
|
+
- **Natural English Commands**: Write `say "Hello"`, `name = ask "What is your name?"`, `repeat 5 ... end`.
|
|
50
|
+
- **Zero Syntax Clutter**: No mandatory semicolons, brackets, or weird symbols.
|
|
51
|
+
- **Defensive Cybersecurity Ready**: Built-in modules for safe port checking, DNS lookups, cryptographic hashes, HTTP requests, and log forensics.
|
|
52
|
+
- **Friendly Diagnostics**: Clear error messages pointing directly to the line and column with actionable hints.
|
|
53
|
+
- **Zero External Dependencies**: Runs out of the box on Windows, macOS, and Linux with standard Python 3.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## ⚡ Installation & Quickstart
|
|
58
|
+
|
|
59
|
+
### 1. Installation via PyPI
|
|
60
|
+
```bash
|
|
61
|
+
pip install --upgrade maliklang
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Verify your installation:
|
|
65
|
+
```bash
|
|
66
|
+
malik --version
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 2. Run a MalikLang File
|
|
70
|
+
```bash
|
|
71
|
+
malik run examples/hello.malik
|
|
72
|
+
# Or simply:
|
|
73
|
+
malik examples/hello.malik
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 3. Launch Interactive REPL Shell
|
|
77
|
+
```bash
|
|
78
|
+
malik repl
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
malik> x = 10 + 20
|
|
83
|
+
malik> say "Result: " + x
|
|
84
|
+
Result: 30
|
|
85
|
+
malik> repeat 3
|
|
86
|
+
... say "MalikLang is awesome!"
|
|
87
|
+
... end
|
|
88
|
+
MalikLang is awesome!
|
|
89
|
+
MalikLang is awesome!
|
|
90
|
+
MalikLang is awesome!
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 4. Run Built-in Automated Tests
|
|
94
|
+
```bash
|
|
95
|
+
malik test
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## 📖 Syntax at a Glance
|
|
101
|
+
|
|
102
|
+
### Variables & Data Types
|
|
103
|
+
```malik
|
|
104
|
+
name = "Malik"
|
|
105
|
+
age = 20
|
|
106
|
+
active = true
|
|
107
|
+
score = 98.5
|
|
108
|
+
items = ["apple", "banana", "cherry"]
|
|
109
|
+
person = { name: "Malik", role: "admin" }
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Input & Output
|
|
113
|
+
```malik
|
|
114
|
+
say "Hello World!"
|
|
115
|
+
user_name = ask "Enter your name: "
|
|
116
|
+
say "Welcome, " + user_name
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Conditions
|
|
120
|
+
```malik
|
|
121
|
+
if age >= 18
|
|
122
|
+
say "You are an adult"
|
|
123
|
+
else if age >= 13
|
|
124
|
+
say "You are a teenager"
|
|
125
|
+
else
|
|
126
|
+
say "You are a child"
|
|
127
|
+
end
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Loops
|
|
131
|
+
```malik
|
|
132
|
+
# Fixed count loop
|
|
133
|
+
repeat 5 as i
|
|
134
|
+
say "Iteration: " + i
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Condition-based loop
|
|
138
|
+
count = 3
|
|
139
|
+
while count > 0
|
|
140
|
+
say count
|
|
141
|
+
count -= 1
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# List / Collection loop
|
|
145
|
+
for item in items
|
|
146
|
+
say "Item: " + item
|
|
147
|
+
end
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Functions & Closures
|
|
151
|
+
```malik
|
|
152
|
+
function add(a, b)
|
|
153
|
+
return a + b
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
result = add(10, 25)
|
|
157
|
+
say "Sum: " + result
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Defensive Cybersecurity & Log Forensics
|
|
161
|
+
```malik
|
|
162
|
+
import crypto
|
|
163
|
+
import network
|
|
164
|
+
import log
|
|
165
|
+
|
|
166
|
+
# SHA-256 Hash Verification
|
|
167
|
+
hash = crypto.sha256("AdminSecret")
|
|
168
|
+
say "SHA-256: " + hash
|
|
169
|
+
|
|
170
|
+
# Port Connectivity Check
|
|
171
|
+
if network.port_check("127.0.0.1", 80, 0.5)
|
|
172
|
+
say "Web server port 80 is listening."
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Brute Force Log Detection
|
|
176
|
+
suspicious_ips = log.detect_brute_force(log_lines, 5)
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## 🛠️ CLI Commands
|
|
182
|
+
|
|
183
|
+
| Command | Description | Example |
|
|
184
|
+
|---|---|---|
|
|
185
|
+
| `malik run <file.malik>` | Executes a MalikLang program | `malik run examples/hello.malik` |
|
|
186
|
+
| `malik <file.malik>` | Shortcut to execute a script | `malik examples/calculator.malik` |
|
|
187
|
+
| `malik check <file.malik>` | Validates syntax without running | `malik check script.malik` |
|
|
188
|
+
| `malik repl` | Starts the interactive REPL shell | `malik repl` |
|
|
189
|
+
| `malik format <file.malik>` | Auto-formats code indentation | `malik format script.malik` |
|
|
190
|
+
| `malik test` | Runs the automated test suite (108+ tests) | `malik test` |
|
|
191
|
+
| `malik examples` | Lists all built-in example programs | `malik examples` |
|
|
192
|
+
| `malik version` | Displays version and platform info | `malik version` |
|
|
193
|
+
| `malik help` | Displays full help manual | `malik help` |
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## 💻 Visual Studio Code Extension
|
|
198
|
+
|
|
199
|
+
Install the MalikLang extension for VS Code:
|
|
200
|
+
```bash
|
|
201
|
+
code --install-extension vscode-extension/maliklang-1.0.0.vsix
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
**Features Included:**
|
|
205
|
+
- Full syntax highlighting for `.malik` and `.mlk` files.
|
|
206
|
+
- Auto-closing brackets and comment toggling (`#`).
|
|
207
|
+
- Built-in snippets (`if`, `repeat`, `while`, `for`, `function`, `try`).
|
|
208
|
+
- Editor Run button & `Ctrl+F5` execution shortcut.
|
|
209
|
+
- Inline syntax error diagnostics in the VS Code Problems panel.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## 📁 Project Structure
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
MalikLang/
|
|
217
|
+
│
|
|
218
|
+
├── malik_lang/ # Core Language Engine
|
|
219
|
+
│ ├── lexer/ # Tokenizer & Token structures
|
|
220
|
+
│ ├── parser/ # Recursive-Descent Parser & AST Nodes
|
|
221
|
+
│ ├── runtime/ # Environment, Scopes, Values & Diagnostics
|
|
222
|
+
│ ├── interpreter/ # Tree-Walking AST Evaluator
|
|
223
|
+
│ ├── stdlib/ # 13 Built-in Standard Modules
|
|
224
|
+
│ ├── cli/ # Command-Line Interface & Formatter
|
|
225
|
+
│ └── repl/ # Interactive REPL Shell
|
|
226
|
+
│
|
|
227
|
+
├── tests/ # 108 Automated Unit & Integration Tests
|
|
228
|
+
│ ├── test_lexer.py
|
|
229
|
+
│ ├── test_parser.py
|
|
230
|
+
│ ├── test_interpreter.py
|
|
231
|
+
│ ├── test_stdlib.py
|
|
232
|
+
│ ├── test_networking_crypto.py
|
|
233
|
+
│ ├── test_security_scripting.py
|
|
234
|
+
│ ├── test_cli_and_repl.py
|
|
235
|
+
│ ├── test_programs.py
|
|
236
|
+
│ └── test_stability_and_edge_cases.py
|
|
237
|
+
│
|
|
238
|
+
├── examples/ # 11 Working Example Scripts
|
|
239
|
+
│ ├── hello.malik
|
|
240
|
+
│ ├── calculator.malik
|
|
241
|
+
│ ├── guessing_game.malik
|
|
242
|
+
│ ├── todo.malik
|
|
243
|
+
│ ├── file_reader.malik
|
|
244
|
+
│ ├── json_example.malik
|
|
245
|
+
│ ├── network_example.malik
|
|
246
|
+
│ ├── http_example.malik
|
|
247
|
+
│ ├── cybersecurity_defensive_example.malik
|
|
248
|
+
│ ├── security_log_analyzer.malik
|
|
249
|
+
│ └── file_integrity_checker.malik
|
|
250
|
+
│
|
|
251
|
+
├── docs/ # Comprehensive Documentation Suite
|
|
252
|
+
│ ├── installation.md # Installation Guide
|
|
253
|
+
│ ├── vscode.md # VS Code Setup & Extension Guide
|
|
254
|
+
│ ├── language.md # Beginner Language Manual
|
|
255
|
+
│ ├── standard-library.md # Standard Library Reference
|
|
256
|
+
│ ├── security.md # Defensive Cybersecurity Guide
|
|
257
|
+
│ ├── contributing.md # Developer & Contributing Guide
|
|
258
|
+
│ ├── spec.md # Formal Language Specification
|
|
259
|
+
│ ├── tutorial.md # 10-Minute Beginner Tutorial
|
|
260
|
+
│ └── architecture_and_compiler_roadmap.md
|
|
261
|
+
│
|
|
262
|
+
├── vscode-extension/ # Visual Studio Code Syntax Extension & VSIX Package
|
|
263
|
+
├── .github/ # GitHub Actions CI/CD Workflows
|
|
264
|
+
│ └── workflows/
|
|
265
|
+
│ ├── ci.yml # Multi-OS CI Matrix
|
|
266
|
+
│ ├── release.yml # PyPI Trusted Publishing & Release Assets
|
|
267
|
+
│ ├── testpypi.yml # TestPyPI Publishing
|
|
268
|
+
│ └── vscode-marketplace.yml# VS Code Extension Release
|
|
269
|
+
│
|
|
270
|
+
├── malik.py # Root Python Entrypoint
|
|
271
|
+
├── malik.bat # Windows CLI Batch Wrapper
|
|
272
|
+
├── pyproject.toml # Standard Package Configuration
|
|
273
|
+
├── setup.py # Setuptools Configuration
|
|
274
|
+
├── RELEASE-CHECKLIST.md # Release Step-by-Step Checklist
|
|
275
|
+
├── SECURITY.md # Security & Anti-Malware Policy
|
|
276
|
+
├── CHANGELOG.md # Release Notes
|
|
277
|
+
└── README.md
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## 📚 Documentation Index
|
|
283
|
+
|
|
284
|
+
- [Installation Guide](docs/installation.md)
|
|
285
|
+
- [Visual Studio Code Setup](docs/vscode.md)
|
|
286
|
+
- [Language Guide](docs/language.md)
|
|
287
|
+
- [Standard Library Reference](docs/standard-library.md)
|
|
288
|
+
- [Defensive Cybersecurity Scripting](docs/security.md)
|
|
289
|
+
- [Contributing Guide](docs/contributing.md)
|
|
290
|
+
- [Language Specification](docs/spec.md)
|
|
291
|
+
- [Security Policy](SECURITY.md)
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## 📜 License
|
|
296
|
+
|
|
297
|
+
MIT License. See [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
# MalikLang 🚀
|
|
2
|
+
|
|
3
|
+
[](https://github.com/maliklang/maliklang/actions/workflows/ci.yml)
|
|
4
|
+
[](https://pypi.org/project/maliklang/)
|
|
5
|
+
[](https://pypi.org/project/maliklang/)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](vscode-extension/)
|
|
8
|
+
|
|
9
|
+
> **A complete, beginner-friendly programming language designed from scratch.**
|
|
10
|
+
> Simpler than Python, natural English-like syntax, zero external runtime dependencies, 13 built-in standard library modules, defensive cybersecurity automation tools, interactive REPL, formatted diagnostics, and VS Code support.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 🌟 Language Philosophy & Key Highlights
|
|
15
|
+
|
|
16
|
+
- **Natural English Commands**: Write `say "Hello"`, `name = ask "What is your name?"`, `repeat 5 ... end`.
|
|
17
|
+
- **Zero Syntax Clutter**: No mandatory semicolons, brackets, or weird symbols.
|
|
18
|
+
- **Defensive Cybersecurity Ready**: Built-in modules for safe port checking, DNS lookups, cryptographic hashes, HTTP requests, and log forensics.
|
|
19
|
+
- **Friendly Diagnostics**: Clear error messages pointing directly to the line and column with actionable hints.
|
|
20
|
+
- **Zero External Dependencies**: Runs out of the box on Windows, macOS, and Linux with standard Python 3.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## ⚡ Installation & Quickstart
|
|
25
|
+
|
|
26
|
+
### 1. Installation via PyPI
|
|
27
|
+
```bash
|
|
28
|
+
pip install --upgrade maliklang
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Verify your installation:
|
|
32
|
+
```bash
|
|
33
|
+
malik --version
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 2. Run a MalikLang File
|
|
37
|
+
```bash
|
|
38
|
+
malik run examples/hello.malik
|
|
39
|
+
# Or simply:
|
|
40
|
+
malik examples/hello.malik
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 3. Launch Interactive REPL Shell
|
|
44
|
+
```bash
|
|
45
|
+
malik repl
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
malik> x = 10 + 20
|
|
50
|
+
malik> say "Result: " + x
|
|
51
|
+
Result: 30
|
|
52
|
+
malik> repeat 3
|
|
53
|
+
... say "MalikLang is awesome!"
|
|
54
|
+
... end
|
|
55
|
+
MalikLang is awesome!
|
|
56
|
+
MalikLang is awesome!
|
|
57
|
+
MalikLang is awesome!
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 4. Run Built-in Automated Tests
|
|
61
|
+
```bash
|
|
62
|
+
malik test
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 📖 Syntax at a Glance
|
|
68
|
+
|
|
69
|
+
### Variables & Data Types
|
|
70
|
+
```malik
|
|
71
|
+
name = "Malik"
|
|
72
|
+
age = 20
|
|
73
|
+
active = true
|
|
74
|
+
score = 98.5
|
|
75
|
+
items = ["apple", "banana", "cherry"]
|
|
76
|
+
person = { name: "Malik", role: "admin" }
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Input & Output
|
|
80
|
+
```malik
|
|
81
|
+
say "Hello World!"
|
|
82
|
+
user_name = ask "Enter your name: "
|
|
83
|
+
say "Welcome, " + user_name
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Conditions
|
|
87
|
+
```malik
|
|
88
|
+
if age >= 18
|
|
89
|
+
say "You are an adult"
|
|
90
|
+
else if age >= 13
|
|
91
|
+
say "You are a teenager"
|
|
92
|
+
else
|
|
93
|
+
say "You are a child"
|
|
94
|
+
end
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Loops
|
|
98
|
+
```malik
|
|
99
|
+
# Fixed count loop
|
|
100
|
+
repeat 5 as i
|
|
101
|
+
say "Iteration: " + i
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Condition-based loop
|
|
105
|
+
count = 3
|
|
106
|
+
while count > 0
|
|
107
|
+
say count
|
|
108
|
+
count -= 1
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# List / Collection loop
|
|
112
|
+
for item in items
|
|
113
|
+
say "Item: " + item
|
|
114
|
+
end
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Functions & Closures
|
|
118
|
+
```malik
|
|
119
|
+
function add(a, b)
|
|
120
|
+
return a + b
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
result = add(10, 25)
|
|
124
|
+
say "Sum: " + result
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Defensive Cybersecurity & Log Forensics
|
|
128
|
+
```malik
|
|
129
|
+
import crypto
|
|
130
|
+
import network
|
|
131
|
+
import log
|
|
132
|
+
|
|
133
|
+
# SHA-256 Hash Verification
|
|
134
|
+
hash = crypto.sha256("AdminSecret")
|
|
135
|
+
say "SHA-256: " + hash
|
|
136
|
+
|
|
137
|
+
# Port Connectivity Check
|
|
138
|
+
if network.port_check("127.0.0.1", 80, 0.5)
|
|
139
|
+
say "Web server port 80 is listening."
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Brute Force Log Detection
|
|
143
|
+
suspicious_ips = log.detect_brute_force(log_lines, 5)
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## 🛠️ CLI Commands
|
|
149
|
+
|
|
150
|
+
| Command | Description | Example |
|
|
151
|
+
|---|---|---|
|
|
152
|
+
| `malik run <file.malik>` | Executes a MalikLang program | `malik run examples/hello.malik` |
|
|
153
|
+
| `malik <file.malik>` | Shortcut to execute a script | `malik examples/calculator.malik` |
|
|
154
|
+
| `malik check <file.malik>` | Validates syntax without running | `malik check script.malik` |
|
|
155
|
+
| `malik repl` | Starts the interactive REPL shell | `malik repl` |
|
|
156
|
+
| `malik format <file.malik>` | Auto-formats code indentation | `malik format script.malik` |
|
|
157
|
+
| `malik test` | Runs the automated test suite (108+ tests) | `malik test` |
|
|
158
|
+
| `malik examples` | Lists all built-in example programs | `malik examples` |
|
|
159
|
+
| `malik version` | Displays version and platform info | `malik version` |
|
|
160
|
+
| `malik help` | Displays full help manual | `malik help` |
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## 💻 Visual Studio Code Extension
|
|
165
|
+
|
|
166
|
+
Install the MalikLang extension for VS Code:
|
|
167
|
+
```bash
|
|
168
|
+
code --install-extension vscode-extension/maliklang-1.0.0.vsix
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**Features Included:**
|
|
172
|
+
- Full syntax highlighting for `.malik` and `.mlk` files.
|
|
173
|
+
- Auto-closing brackets and comment toggling (`#`).
|
|
174
|
+
- Built-in snippets (`if`, `repeat`, `while`, `for`, `function`, `try`).
|
|
175
|
+
- Editor Run button & `Ctrl+F5` execution shortcut.
|
|
176
|
+
- Inline syntax error diagnostics in the VS Code Problems panel.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## 📁 Project Structure
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
MalikLang/
|
|
184
|
+
│
|
|
185
|
+
├── malik_lang/ # Core Language Engine
|
|
186
|
+
│ ├── lexer/ # Tokenizer & Token structures
|
|
187
|
+
│ ├── parser/ # Recursive-Descent Parser & AST Nodes
|
|
188
|
+
│ ├── runtime/ # Environment, Scopes, Values & Diagnostics
|
|
189
|
+
│ ├── interpreter/ # Tree-Walking AST Evaluator
|
|
190
|
+
│ ├── stdlib/ # 13 Built-in Standard Modules
|
|
191
|
+
│ ├── cli/ # Command-Line Interface & Formatter
|
|
192
|
+
│ └── repl/ # Interactive REPL Shell
|
|
193
|
+
│
|
|
194
|
+
├── tests/ # 108 Automated Unit & Integration Tests
|
|
195
|
+
│ ├── test_lexer.py
|
|
196
|
+
│ ├── test_parser.py
|
|
197
|
+
│ ├── test_interpreter.py
|
|
198
|
+
│ ├── test_stdlib.py
|
|
199
|
+
│ ├── test_networking_crypto.py
|
|
200
|
+
│ ├── test_security_scripting.py
|
|
201
|
+
│ ├── test_cli_and_repl.py
|
|
202
|
+
│ ├── test_programs.py
|
|
203
|
+
│ └── test_stability_and_edge_cases.py
|
|
204
|
+
│
|
|
205
|
+
├── examples/ # 11 Working Example Scripts
|
|
206
|
+
│ ├── hello.malik
|
|
207
|
+
│ ├── calculator.malik
|
|
208
|
+
│ ├── guessing_game.malik
|
|
209
|
+
│ ├── todo.malik
|
|
210
|
+
│ ├── file_reader.malik
|
|
211
|
+
│ ├── json_example.malik
|
|
212
|
+
│ ├── network_example.malik
|
|
213
|
+
│ ├── http_example.malik
|
|
214
|
+
│ ├── cybersecurity_defensive_example.malik
|
|
215
|
+
│ ├── security_log_analyzer.malik
|
|
216
|
+
│ └── file_integrity_checker.malik
|
|
217
|
+
│
|
|
218
|
+
├── docs/ # Comprehensive Documentation Suite
|
|
219
|
+
│ ├── installation.md # Installation Guide
|
|
220
|
+
│ ├── vscode.md # VS Code Setup & Extension Guide
|
|
221
|
+
│ ├── language.md # Beginner Language Manual
|
|
222
|
+
│ ├── standard-library.md # Standard Library Reference
|
|
223
|
+
│ ├── security.md # Defensive Cybersecurity Guide
|
|
224
|
+
│ ├── contributing.md # Developer & Contributing Guide
|
|
225
|
+
│ ├── spec.md # Formal Language Specification
|
|
226
|
+
│ ├── tutorial.md # 10-Minute Beginner Tutorial
|
|
227
|
+
│ └── architecture_and_compiler_roadmap.md
|
|
228
|
+
│
|
|
229
|
+
├── vscode-extension/ # Visual Studio Code Syntax Extension & VSIX Package
|
|
230
|
+
├── .github/ # GitHub Actions CI/CD Workflows
|
|
231
|
+
│ └── workflows/
|
|
232
|
+
│ ├── ci.yml # Multi-OS CI Matrix
|
|
233
|
+
│ ├── release.yml # PyPI Trusted Publishing & Release Assets
|
|
234
|
+
│ ├── testpypi.yml # TestPyPI Publishing
|
|
235
|
+
│ └── vscode-marketplace.yml# VS Code Extension Release
|
|
236
|
+
│
|
|
237
|
+
├── malik.py # Root Python Entrypoint
|
|
238
|
+
├── malik.bat # Windows CLI Batch Wrapper
|
|
239
|
+
├── pyproject.toml # Standard Package Configuration
|
|
240
|
+
├── setup.py # Setuptools Configuration
|
|
241
|
+
├── RELEASE-CHECKLIST.md # Release Step-by-Step Checklist
|
|
242
|
+
├── SECURITY.md # Security & Anti-Malware Policy
|
|
243
|
+
├── CHANGELOG.md # Release Notes
|
|
244
|
+
└── README.md
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## 📚 Documentation Index
|
|
250
|
+
|
|
251
|
+
- [Installation Guide](docs/installation.md)
|
|
252
|
+
- [Visual Studio Code Setup](docs/vscode.md)
|
|
253
|
+
- [Language Guide](docs/language.md)
|
|
254
|
+
- [Standard Library Reference](docs/standard-library.md)
|
|
255
|
+
- [Defensive Cybersecurity Scripting](docs/security.md)
|
|
256
|
+
- [Contributing Guide](docs/contributing.md)
|
|
257
|
+
- [Language Specification](docs/spec.md)
|
|
258
|
+
- [Security Policy](SECURITY.md)
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## 📜 License
|
|
263
|
+
|
|
264
|
+
MIT License. See [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""
|
|
2
|
+
MalikLang Programming Language
|
|
3
|
+
A beginner-friendly, English-like programming language built from scratch.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
__version__ = "1.0.0"
|
|
7
|
+
__author__ = "MalikLang Contributors"
|
|
8
|
+
|
|
9
|
+
from malik_lang.lexer.lexer import Lexer
|
|
10
|
+
from malik_lang.parser.parser import Parser
|
|
11
|
+
from malik_lang.interpreter.interpreter import Interpreter
|
|
12
|
+
from malik_lang.runtime.environment import Environment
|
|
13
|
+
from malik_lang.runtime.errors import MalikError, MalikSyntaxError, MalikRuntimeError
|
|
14
|
+
|
|
15
|
+
__all__ = [
|
|
16
|
+
"Lexer",
|
|
17
|
+
"Parser",
|
|
18
|
+
"Interpreter",
|
|
19
|
+
"Environment",
|
|
20
|
+
"MalikError",
|
|
21
|
+
"MalikSyntaxError",
|
|
22
|
+
"MalikRuntimeError",
|
|
23
|
+
"__version__",
|
|
24
|
+
]
|