https://github.com/rcosta358/scripting-language
Attempt of a custom scripting language using Python
https://github.com/rcosta358/scripting-language
interpreter programming-language python scripting-language
Last synced: 4 months ago
JSON representation
Attempt of a custom scripting language using Python
- Host: GitHub
- URL: https://github.com/rcosta358/scripting-language
- Owner: rcosta358
- Created: 2023-01-24T00:29:38.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-10T14:36:13.000Z (almost 3 years ago)
- Last Synced: 2025-07-24T17:13:59.684Z (7 months ago)
- Topics: interpreter, programming-language, python, scripting-language
- Language: Python
- Homepage:
- Size: 64.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Scripting Language 
Custom scripting language using Python (in development)
### How to run the interpreter
```
cd src && python main.py
```
### Features
- [x] set x = 1
- [x] let y
- [x] const z = 1
- [x] x = 1
- [x] print
- [x] math operations and str concatenation
- [x] for loop
- [x] comments (# single-line and ### multi-line)
- [x] functions
- [x] ternary operator
- [x] str, int, bool and none types
- [x] log function for debugging
- [x] shell mode
- [ ] string formatting
- [ ] while
- [ ] loop 10
- [ ] if-else
- [ ] lists
- [ ] list and str slicing
- [ ] built-in functions (len, sum, enum, max, ...)
- [ ] maps
- [ ] lambda functions
- [ ] list comprehensions
- [ ] classes
- [ ] ...
### Example Code
```
fn my_function[str, n]
print str, n
const start = 0
const end = start + 10
let x
set step_str = 'two'
x = step_str == 'one' ? 1 : 2
log x
for i from start to end step x
my_function 'number:', i
```
### Output
```
x = 2 (int)
number: 0
number: 2
number: 4
number: 6
number: 8
number: 10
```
### Run Tests
```
cd tests && python -m unittest discover
```