# MRT Programming Language
MRT is a modern, expressive programming language designed for simplicity and readability. It combines intuitive syntax with powerful features for both beginners and experienced programmers.
## Features
- Simple and expressive syntax
- Dynamic typing with type inference
- First-class functions
- Rich built-in functions
- Comprehensive array operations
- Powerful string manipulation
- Modern module system
## Installation
You can install MRT using pip:
```bash
pip install mrt-lang
```
After installation, you can run MRT programs using the `mrt` command:
```bash
mrt your_program.mrt
```
## Quick Start
1. Create a file `hello.mrt`:
```mrt
func main() {
print("Hello, World!")
}
```
2. Run the program:
```bash
mrt hello.mrt
```
## Language Examples
### Variables and Basic Types
```mrt
func variables_demo() {
var name = "Alice"
var age = 25
var height = 1.75
var isStudent = true
print("Name: " + name)
}
```
### Arrays
```mrt
func array_demo() {
var numbers = [1, 2, 3, 4, 5]
push(numbers, 6)
print("Length:", len(numbers))
print("First element:", numbers[0])
}
```
### String Operations
```mrt
func string_demo() {
var text = " Hello, World! "
print("Trimmed:", trim(text))
print("Uppercase:", toUpper(text))
print("Contains 'World':", contains(text, "World"))
}
```
## Built-in Functions
### Array Operations
- `len(array)`: Returns array length
- `push(array, element)`: Adds element to end
- `pop(array)`: Removes and returns last element
- `slice(array, start, end)`: Returns array subset
- `join(array, separator)`: Joins elements into string
- `indexOf(array, element)`: Finds element index
### String Operations
- `split(str, separator)`: Splits string into array
- `substring(str, start, end)`: Extracts string portion
- `toUpper(str)`: Converts to uppercase
- `toLower(str)`: Converts to lowercase
- `trim(str)`: Removes whitespace
- `replace(str, old, new)`: Replaces text
- `startsWith(str, prefix)`: Checks string start
- `endsWith(str, suffix)`: Checks string end
- `contains(str, substr)`: Checks for substring
## Project Structure
- `src/`: Source code for the MRT interpreter
- `lexer.py`: Tokenizes source code
- `parser.py`: Parses tokens into AST
- `interpreter.py`: Executes MRT programs
- `ast.py`: Abstract Syntax Tree definitions
- `docs/`: Comprehensive documentation
- `language_guide.md`: Complete language reference
- `examples.md`: Example programs and tutorials
- `getting_started.md`: Installation and quick start
- `examples/`: Example MRT programs
- `tests/`: Test suite
## Documentation
For more detailed information, check out:
- [Language Guide](docs/language_guide.md): Complete language reference
- [Examples](docs/examples.md): Example programs and tutorials
- [Getting Started](docs/getting_started.md): Installation and quick start
## Development
To set up the development environment:
1. Clone the repository:
```bash
git clone <repository-url>
cd mrt
```
2. Install in development mode:
```bash
pip install -e .
```
3. Install development dependencies:
```bash
pip install -r requirements-dev.txt
```
## Contributing
We welcome contributions! Whether it's:
- Bug reports
- Feature requests
- Documentation improvements
- Code contributions
Please feel free to open issues and pull requests.
## License
MIT License - see [LICENSE.txt](LICENSE.txt) for details.
Raw data
{
"_id": null,
"home_page": "https://github.com/rithymeth/mrt",
"name": "mrt-lang",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "programming language interpreter compiler",
"author": "MRT Team",
"author_email": "rithy1331@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/a6/31/6559a81d9527cf072a2f0a6a6975d7ca1d9d4ba1b9812838a53a60df693e/mrt_lang-0.1.2.tar.gz",
"platform": null,
"description": "# MRT Programming Language\r\n\r\nMRT is a modern, expressive programming language designed for simplicity and readability. It combines intuitive syntax with powerful features for both beginners and experienced programmers.\r\n\r\n## Features\r\n\r\n- Simple and expressive syntax\r\n- Dynamic typing with type inference\r\n- First-class functions\r\n- Rich built-in functions\r\n- Comprehensive array operations\r\n- Powerful string manipulation\r\n- Modern module system\r\n\r\n## Installation\r\n\r\nYou can install MRT using pip:\r\n\r\n```bash\r\npip install mrt-lang\r\n```\r\n\r\nAfter installation, you can run MRT programs using the `mrt` command:\r\n```bash\r\nmrt your_program.mrt\r\n```\r\n\r\n## Quick Start\r\n\r\n1. Create a file `hello.mrt`:\r\n```mrt\r\nfunc main() {\r\n print(\"Hello, World!\")\r\n}\r\n```\r\n\r\n2. Run the program:\r\n```bash\r\nmrt hello.mrt\r\n```\r\n\r\n## Language Examples\r\n\r\n### Variables and Basic Types\r\n```mrt\r\nfunc variables_demo() {\r\n var name = \"Alice\"\r\n var age = 25\r\n var height = 1.75\r\n var isStudent = true\r\n \r\n print(\"Name: \" + name)\r\n}\r\n```\r\n\r\n### Arrays\r\n```mrt\r\nfunc array_demo() {\r\n var numbers = [1, 2, 3, 4, 5]\r\n push(numbers, 6)\r\n print(\"Length:\", len(numbers))\r\n print(\"First element:\", numbers[0])\r\n}\r\n```\r\n\r\n### String Operations\r\n```mrt\r\nfunc string_demo() {\r\n var text = \" Hello, World! \"\r\n print(\"Trimmed:\", trim(text))\r\n print(\"Uppercase:\", toUpper(text))\r\n print(\"Contains 'World':\", contains(text, \"World\"))\r\n}\r\n```\r\n\r\n## Built-in Functions\r\n\r\n### Array Operations\r\n- `len(array)`: Returns array length\r\n- `push(array, element)`: Adds element to end\r\n- `pop(array)`: Removes and returns last element\r\n- `slice(array, start, end)`: Returns array subset\r\n- `join(array, separator)`: Joins elements into string\r\n- `indexOf(array, element)`: Finds element index\r\n\r\n### String Operations\r\n- `split(str, separator)`: Splits string into array\r\n- `substring(str, start, end)`: Extracts string portion\r\n- `toUpper(str)`: Converts to uppercase\r\n- `toLower(str)`: Converts to lowercase\r\n- `trim(str)`: Removes whitespace\r\n- `replace(str, old, new)`: Replaces text\r\n- `startsWith(str, prefix)`: Checks string start\r\n- `endsWith(str, suffix)`: Checks string end\r\n- `contains(str, substr)`: Checks for substring\r\n\r\n## Project Structure\r\n\r\n- `src/`: Source code for the MRT interpreter\r\n - `lexer.py`: Tokenizes source code\r\n - `parser.py`: Parses tokens into AST\r\n - `interpreter.py`: Executes MRT programs\r\n - `ast.py`: Abstract Syntax Tree definitions\r\n- `docs/`: Comprehensive documentation\r\n - `language_guide.md`: Complete language reference\r\n - `examples.md`: Example programs and tutorials\r\n - `getting_started.md`: Installation and quick start\r\n- `examples/`: Example MRT programs\r\n- `tests/`: Test suite\r\n\r\n## Documentation\r\n\r\nFor more detailed information, check out:\r\n- [Language Guide](docs/language_guide.md): Complete language reference\r\n- [Examples](docs/examples.md): Example programs and tutorials\r\n- [Getting Started](docs/getting_started.md): Installation and quick start\r\n\r\n## Development\r\n\r\nTo set up the development environment:\r\n\r\n1. Clone the repository:\r\n```bash\r\ngit clone <repository-url>\r\ncd mrt\r\n```\r\n\r\n2. Install in development mode:\r\n```bash\r\npip install -e .\r\n```\r\n\r\n3. Install development dependencies:\r\n```bash\r\npip install -r requirements-dev.txt\r\n```\r\n\r\n## Contributing\r\n\r\nWe welcome contributions! Whether it's:\r\n- Bug reports\r\n- Feature requests\r\n- Documentation improvements\r\n- Code contributions\r\n\r\nPlease feel free to open issues and pull requests.\r\n\r\n## License\r\n\r\nMIT License - see [LICENSE.txt](LICENSE.txt) for details.\r\n",
"bugtrack_url": null,
"license": null,
"summary": "MRT Programming Language - A modern, expressive programming language",
"version": "0.1.2",
"project_urls": {
"Homepage": "https://github.com/rithymeth/mrt"
},
"split_keywords": [
"programming",
"language",
"interpreter",
"compiler"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cef426c354031c42954fa369674fe2b8f5d62853862c402a54ccbe4602d4767f",
"md5": "13bc6e751fc67072d50b552c5c5920dd",
"sha256": "1cd5b2723f49e26d17d8f1227feba11713a07e6f62aa9697c1b934412a24e57e"
},
"downloads": -1,
"filename": "mrt_lang-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "13bc6e751fc67072d50b552c5c5920dd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 11378,
"upload_time": "2024-12-10T12:34:34",
"upload_time_iso_8601": "2024-12-10T12:34:34.179380Z",
"url": "https://files.pythonhosted.org/packages/ce/f4/26c354031c42954fa369674fe2b8f5d62853862c402a54ccbe4602d4767f/mrt_lang-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a6316559a81d9527cf072a2f0a6a6975d7ca1d9d4ba1b9812838a53a60df693e",
"md5": "5bf32da71237d10c6c9dd78ba32b7967",
"sha256": "2aa14ca7ea4a8b970f79ba8c7671f391b39e3b22fc817d3eec8b14a13e2beb4b"
},
"downloads": -1,
"filename": "mrt_lang-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "5bf32da71237d10c6c9dd78ba32b7967",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 16226,
"upload_time": "2024-12-10T12:34:36",
"upload_time_iso_8601": "2024-12-10T12:34:36.137100Z",
"url": "https://files.pythonhosted.org/packages/a6/31/6559a81d9527cf072a2f0a6a6975d7ca1d9d4ba1b9812838a53a60df693e/mrt_lang-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-10 12:34:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rithymeth",
"github_project": "mrt",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "mrt-lang"
}