big-mamba 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.
@@ -0,0 +1,23 @@
1
+ # Changelog
2
+
3
+ All notable changes to Big Mamba will be documented in this file.
4
+
5
+ ## [1.0.0] - 2026-07-07
6
+
7
+ ### Added
8
+ - Complete language engine: lexer, parser, AST, transpiler, executor
9
+ - Interactive REPL with multi-line support
10
+ - CLI with run, repl, transpile, and tokens commands
11
+ - 80+ keyword and function shortenings
12
+ - 20+ method shortenings
13
+ - Special operators: ++, --, <>, ??, $""
14
+ - Control flow: ? / ?? / !: for if / elif / else
15
+ - For loops with @ syntax
16
+ - List and dict comprehensions with @
17
+ - Class support with me (self) and init (__init__)
18
+ - Import system: use, ->, =>
19
+ - Error handling: try / catch / fin / throw / chk
20
+ - Comments with // and docstrings with ///
21
+ - 5 example programs
22
+ - Full README documentation
23
+ - .mamba file extension (unique, not used by any other language)
@@ -0,0 +1,88 @@
1
+ # Contributing to Big Mamba
2
+
3
+ Thank you for your interest in contributing to Big Mamba.
4
+
5
+ ## How to Contribute
6
+
7
+ ### Reporting Bugs
8
+ - Open an issue on GitHub
9
+ - Include the `.mamba` code that causes the bug
10
+ - Include the error message
11
+ - Include your Python version and OS
12
+
13
+ ### Suggesting Features
14
+ - Open an issue with the title prefixed by `[Feature]`
15
+ - Describe what the feature does
16
+ - Show example Big Mamba syntax for the feature
17
+ - Explain how it maps to Python
18
+
19
+ ### Submitting Code
20
+ 1. Fork the repository
21
+ 2. Create a branch: `git checkout -b feature/your-feature`
22
+ 3. Make your changes
23
+ 4. Test all examples: run each file in the `examples/` directory
24
+ 5. Commit: `git commit -m "Add your feature"`
25
+ 6. Push: `git push origin feature/your-feature`
26
+ 7. Open a Pull Request
27
+
28
+ ### Code Standards
29
+ - No comments in source code
30
+ - No emojis in any file
31
+ - No external dependencies (pure Python 3.6+)
32
+ - All files must be clean and professional
33
+ - Test all examples before submitting
34
+
35
+ ### Project Structure
36
+
37
+ ```
38
+ bigmamba/
39
+ __init__.py Package metadata
40
+ lexer.py Tokenizer
41
+ parser.py Recursive descent parser
42
+ ast_nodes.py AST node definitions
43
+ transpiler.py AST to Python code generator
44
+ executor.py Python code executor
45
+ repl.py Interactive REPL
46
+ builtins.py Keyword and function mappings
47
+ errors.py Custom error types
48
+
49
+ examples/ Example .mamba programs
50
+ mamba.py CLI entry point
51
+ ```
52
+
53
+ ### Adding a New Keyword or Shorthand
54
+ 1. Add the mapping to `bigmamba/builtins.py`
55
+ 2. If it is a keyword, add it to `KEYWORDS` in `bigmamba/lexer.py`
56
+ 3. If it needs special parsing, update `bigmamba/parser.py`
57
+ 4. If it needs special transpilation, update `bigmamba/transpiler.py`
58
+ 5. Add the runtime alias to `RUNTIME_PREAMBLE` in `bigmamba/builtins.py`
59
+ 6. Update `README.md` with the new syntax
60
+ 7. Add an example demonstrating the feature
61
+
62
+ ### Adding a New Method Shorthand
63
+ 1. Add the mapping to `METHOD_MAP` in `bigmamba/builtins.py`
64
+ 2. Add the mapping to `method_remap` in `bigmamba/parser.py` (in `parse_postfix`)
65
+ 3. Update the Method Reference table in `README.md`
66
+
67
+ ### Testing
68
+ Run all examples to verify nothing is broken:
69
+
70
+ ```bash
71
+ python mamba.py run examples/hello.mamba
72
+ python mamba.py run examples/fibonacci.mamba
73
+ python mamba.py run examples/calculator.mamba
74
+ python mamba.py run examples/classes.mamba
75
+ python mamba.py run examples/guessing_game.mamba
76
+ ```
77
+
78
+ Verify transpiled output is correct:
79
+
80
+ ```bash
81
+ python mamba.py transpile examples/hello.mamba
82
+ ```
83
+
84
+ Test the REPL:
85
+
86
+ ```bash
87
+ python mamba.py repl
88
+ ```
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Big Mamba Team
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,6 @@
1
+ include LICENSE
2
+ include README.md
3
+ include CHANGELOG.md
4
+ include CONTRIBUTING.md
5
+ recursive-include examples *.mamba
6
+ recursive-include bigmamba *.py
@@ -0,0 +1,325 @@
1
+ Metadata-Version: 2.4
2
+ Name: big-mamba
3
+ Version: 1.0.0
4
+ Summary: Big Mamba - The shorthand programming language. Python, but faster to type.
5
+ Home-page: https://github.com/redhatsam09/big-mamba
6
+ Author: Big Mamba Team
7
+ License: MIT
8
+ Project-URL: Homepage, https://github.com/redhatsam09/big-mamba
9
+ Project-URL: Issues, https://github.com/redhatsam09/big-mamba/issues
10
+ Project-URL: Documentation, https://github.com/redhatsam09/big-mamba#readme
11
+ Keywords: programming-language,transpiler,shorthand,mamba,big-mamba
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Operating System :: Microsoft :: Windows
16
+ Classifier: Operating System :: POSIX :: Linux
17
+ Classifier: Operating System :: MacOS
18
+ Classifier: Topic :: Software Development :: Compilers
19
+ Classifier: Topic :: Software Development :: Interpreters
20
+ Classifier: Intended Audience :: Developers
21
+ Classifier: Intended Audience :: Education
22
+ Requires-Python: >=3.6
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Dynamic: author
26
+ Dynamic: home-page
27
+ Dynamic: license-file
28
+ Dynamic: requires-python
29
+
30
+ # Big Mamba Programming Language
31
+
32
+ [![Test Big Mamba](https://github.com/redhatsam09/big-mamba/actions/workflows/test.yml/badge.svg)](https://github.com/redhatsam09/big-mamba/actions/workflows/test.yml)
33
+ [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
34
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/redhatsam09/big-mamba/blob/main/LICENSE)
35
+
36
+ **Python, but faster to type.**
37
+
38
+ Big Mamba shortens Python the same way Python shortened C++. It transpiles to Python under the hood.
39
+
40
+ The `.mamba` file extension is exclusive to Big Mamba. No other language uses it.
41
+
42
+ ```
43
+ Python Big Mamba
44
+ ------ ---------
45
+ def fibonacci(n): fn fibonacci(n):
46
+ if n <= 1: ? n <= 1:
47
+ return n ret n
48
+ return fib(n-1) + fib(n-2) ret fib(n-1) + fib(n-2)
49
+
50
+ for i in range(10): @ i in rng(10):
51
+ print(f"fib({i}) = {fib(i)}") say $"fib({i}) = {fib(i)}"
52
+ ```
53
+
54
+ ---
55
+
56
+ ## Installation
57
+
58
+ ### pip install (Recommended)
59
+
60
+ ```bash
61
+ pip install big-mamba
62
+ ```
63
+
64
+ After installation, use the `mamba` command from anywhere:
65
+
66
+ ```bash
67
+ mamba run hello.mamba
68
+ mamba repl
69
+ mamba version
70
+ ```
71
+
72
+ ### Install from source
73
+
74
+ ```bash
75
+ git clone https://github.com/redhatsam09/big-mamba.git
76
+ cd big-mamba
77
+ pip install .
78
+ ```
79
+
80
+ ### Run without installing
81
+
82
+ ```bash
83
+ git clone https://github.com/redhatsam09/big-mamba.git
84
+ cd big-mamba
85
+ python mamba.py run examples/hello.mamba
86
+ python mamba.py repl
87
+ ```
88
+
89
+ No external dependencies. Pure Python 3.9+.
90
+
91
+ ---
92
+
93
+ ## Quick Start
94
+
95
+ ```bash
96
+ mamba run examples/hello.mamba # Run a program
97
+ mamba repl # Interactive mode
98
+ mamba transpile examples/hello.mamba # See generated Python
99
+ mamba tokens examples/hello.mamba # See lexer tokens
100
+ mamba help # All commands
101
+ mamba version # Version info
102
+ ```
103
+
104
+ ---
105
+
106
+ ## Language Reference
107
+
108
+ ### Variables and Types
109
+
110
+ ```
111
+ name = "Big Mamba"
112
+ age = 1
113
+ pi = 3.14
114
+ active = T
115
+ nothing = N
116
+ ```
117
+
118
+ ### Print and Input
119
+
120
+ ```
121
+ say "Hello, World!"
122
+ say $"Hello {name}"
123
+ name = ask "What's your name? "
124
+ ```
125
+
126
+ ### Control Flow
127
+
128
+ ```
129
+ ? x > 0:
130
+ say "positive"
131
+ ?? x == 0:
132
+ say "zero"
133
+ !:
134
+ say "negative"
135
+
136
+ @ item in items:
137
+ say item
138
+
139
+ @ i in rng(10):
140
+ say i
141
+
142
+ wl running:
143
+ process()
144
+ ```
145
+
146
+ ### Functions
147
+
148
+ ```
149
+ fn greet(name):
150
+ say $"Hello {name}!"
151
+ ret $"Hi {name}"
152
+
153
+ double = lm x: x * 2
154
+ ```
155
+
156
+ ### Classes
157
+
158
+ ```
159
+ cls Dog(Animal):
160
+ fn init(me, name):
161
+ me.name = name
162
+
163
+ fn bark(me):
164
+ say "Woof!"
165
+ ```
166
+
167
+ ### Special Operators
168
+
169
+ ```
170
+ x++ x += 1
171
+ x-- x -= 1
172
+ a <> b a, b = b, a
173
+ result = value ?? "default" value if value is not None else "default"
174
+ $"Hello {name}" f"Hello {name}"
175
+ ```
176
+
177
+ ### Imports
178
+
179
+ ```
180
+ use os import os
181
+ use os -> path from os import path
182
+ use numpy => np import numpy as np
183
+ use os -> path, getcwd from os import path, getcwd
184
+ ```
185
+
186
+ ### Error Handling
187
+
188
+ ```
189
+ try:
190
+ risky()
191
+ catch ValueError as e:
192
+ say $"Error: {e}"
193
+ fin:
194
+ cleanup()
195
+
196
+ throw ValueError("oops")
197
+ chk x > 0
198
+ ```
199
+
200
+ ### Comprehensions
201
+
202
+ ```
203
+ squares = [x**2 @ x in rng(10)]
204
+ evens = [x @ x in rng(20) ? x % 2 == 0]
205
+ ```
206
+
207
+ ### Built-in Function Reference
208
+
209
+ | Big Mamba | Python | Big Mamba | Python |
210
+ |-----------|---------------|-----------|---------------|
211
+ | say x | print(x) | l(x) | len(x) |
212
+ | ask "?" | input("?") | rng(n) | range(n) |
213
+ | i(x) | int(x) | s(x) | str(x) |
214
+ | fl(x) | float(x) | ls(x) | list(x) |
215
+ | dt() | dict() | tp(x) | tuple(x) |
216
+ | st(x) | set(x) | bl(x) | bool(x) |
217
+ | srt(x) | sorted(x) | rev(x) | reversed(x) |
218
+ | mx(x) | max(x) | mn(x) | min(x) |
219
+ | sm(x) | sum(x) | ab(x) | abs(x) |
220
+ | enum(x) | enumerate(x) | zp(a,b) | zip(a,b) |
221
+ | mp(f,x) | map(f,x) | flt(f,x) | filter(f,x) |
222
+
223
+ ### Method Reference
224
+
225
+ | Big Mamba | Python | Big Mamba | Python |
226
+ |-------------|-----------------|--------------|-----------------|
227
+ | .add(x) | .append(x) | .rm(x) | .remove(x) |
228
+ | .up() | .upper() | .lo() | .lower() |
229
+ | .trim() | .strip() | .spl(x) | .split(x) |
230
+ | .jn(x) | .join(x) | .rep(a,b) | .replace(a,b) |
231
+ | .starts(x) | .startswith(x) | .ends(x) | .endswith(x) |
232
+ | .ks() | .keys() | .vs() | .values() |
233
+ | .its() | .items() | .addall(x) | .extend(x) |
234
+
235
+ ### Keyword Reference
236
+
237
+ | Big Mamba | Python | Big Mamba | Python |
238
+ |-----------|----------|-----------|----------|
239
+ | fn | def | ret | return |
240
+ | cls | class | me | self |
241
+ | init | __init__ | lm | lambda |
242
+ | ? | if | ?? | elif |
243
+ | !: | else: | @ | for |
244
+ | wl | while | brk | break |
245
+ | cnt | continue | .. | pass |
246
+ | use | import | throw | raise |
247
+ | catch | except | fin | finally |
248
+ | chk | assert | gl | global |
249
+ | yld | yield | rm | del |
250
+ | w/ | with | T/F/N | True/False/None |
251
+ | && | and | \|\| | or |
252
+ | ~ | not | // | # (comment) |
253
+
254
+ ---
255
+
256
+ ## Architecture
257
+
258
+ Big Mamba is a transpiler. It converts Big Mamba source code to Python and executes it.
259
+
260
+ ```
261
+ .mamba source -> Lexer -> Tokens -> Parser -> AST -> Transpiler -> Python -> Execution
262
+ ```
263
+
264
+ ### Project Structure
265
+
266
+ ```
267
+ bigmamba/
268
+ __init__.py Package metadata
269
+ lexer.py Tokenizer
270
+ parser.py Recursive descent parser
271
+ ast_nodes.py AST node definitions
272
+ transpiler.py AST to Python code generator
273
+ executor.py Python code executor
274
+ repl.py Interactive REPL
275
+ builtins.py Keyword and function mappings
276
+ errors.py Custom error types
277
+
278
+ examples/ Example .mamba programs
279
+ mamba.py CLI entry point
280
+ ```
281
+
282
+ ---
283
+
284
+ ## Comparison
285
+
286
+ | Feature | C++ | Python | Big Mamba |
287
+ |---------------|----------------------------|---------------------|--------------------|
288
+ | Hello World | 5 lines | 1 line | 1 line (shorter) |
289
+ | Function def | int f(int x) { | def f(x): | fn f(x): |
290
+ | Print | cout << x << endl; | print(x) | say x |
291
+ | For loop | for(int i=0;i<n;i++) | for i in range(n): | @ i in rng(n): |
292
+ | Swap | 3 lines + temp var | a, b = b, a | a <> b |
293
+ | Self ref | this->x | self.x | me.x |
294
+ | Import | #include <x> | import x | use x |
295
+ | Boolean | bool b = true; | b = True | b = T |
296
+
297
+ ---
298
+
299
+ ## Platform Support
300
+
301
+ | Platform | Install Command |
302
+ |----------|----------------|
303
+ | Windows | `pip install big-mamba` |
304
+ | macOS | `pip3 install big-mamba` |
305
+ | Linux | `pip3 install big-mamba` |
306
+
307
+ Works on any system with Python 3.9+. No external dependencies.
308
+
309
+ See [INSTALL.md](INSTALL.md) for detailed installation instructions for every OS.
310
+
311
+ ---
312
+
313
+ ## Contributing
314
+
315
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
316
+
317
+ ---
318
+
319
+ ## License
320
+
321
+ MIT License. See [LICENSE](LICENSE) for details.
322
+
323
+ ---
324
+
325
+ Big Mamba -- Write Python at the speed of thought.