{"id":21269801,"url":"https://github.com/prashantrahul141/splax","last_synced_at":"2025-07-30T23:10:24.639Z","repository":{"id":217619830,"uuid":"744366186","full_name":"prashantrahul141/splax","owner":"prashantrahul141","description":"A memory safe, easy, dynamic programming language.","archived":false,"fork":false,"pushed_at":"2024-02-16T17:41:02.000Z","size":122,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T02:23:47.651Z","etag":null,"topics":["interpreter","lexer","parser","programming-language","rust","tree-walk-interpreter"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prashantrahul141.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-17T06:35:44.000Z","updated_at":"2024-06-01T07:40:48.000Z","dependencies_parsed_at":"2024-02-16T18:54:02.502Z","dependency_job_id":null,"html_url":"https://github.com/prashantrahul141/splax","commit_stats":null,"previous_names":["prashantrahul141/sbp-lang"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prashantrahul141%2Fsplax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prashantrahul141%2Fsplax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prashantrahul141%2Fsplax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prashantrahul141%2Fsplax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prashantrahul141","download_url":"https://codeload.github.com/prashantrahul141/splax/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243725542,"owners_count":20337667,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["interpreter","lexer","parser","programming-language","rust","tree-walk-interpreter"],"created_at":"2024-11-21T08:12:01.300Z","updated_at":"2025-03-15T11:44:29.991Z","avatar_url":"https://github.com/prashantrahul141.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Splax language\n\nInterpreter for Splax, A dynamic programming language I made while learning how compilers and interpreters work.\n\n## Splax Language Documentation\n\n\n### File Extension\nSplax supports text files with `spx` file extension.\nexample: `main.spx`\n\n### Hello, world!\nA simple hello world program in splax:\n```python\nprint \"Hello, World!\";\n```\nSemi-colons at the end of every line is mandatory in Splax.\n\n### Datatypes\nSplax has following datatypes\n\n#### Numbers\nThese can number literals which can be both integers and floating point numbers.\n\nexamples: `1`, `2.5`, `9`\n\n#### Strings\nThese are string literals defined inside `\"`\n\nexamples: `\"Splax\"`, `\"Strings are easy\"`\n\n### Booleans\nThese are boolean literals which can be either `true` or `false`.\n\nexamples: `true`, `false`\n\n### Null\nSplax has nulls, the trillion dollar mistale. It can be defined using the `null` keyword. All uninitialized variables are given the value of `null`.\n\nexamples: `null`\n\n\n\n### Operators.\nSplax has following operators:\n#### Assignment\n`=` - equals\n\n#### Unary operators\n`-` - Unary negation\n\n### Logical operators\n`and` - logical AND\n\n`or`  - logical OR\n\n`!`   - logical NOT\n\n\n#### Arithmetic operators\n`+` - sum\n\n`-` - difference\n\n`*` - product \n\n`/` - division \n\n`%` - mod\n\n\n#### Comparison operators\n`==` - is equals\n\n`!=` - is not equals\n\n`\u003e`  - is less than\n\n`\u003e=` - is less than or equals\n\n`\u003e`  - is greater than\n\n`\u003e=` - is greater than or equals\n\n\n\n\n### Comments\nSplax has only one type of comment, single line comments, which can be defined using `//` at the beginning of a line.\n\n```c\n// This is a comment.\n// The Lexer completely ignores any line starting with //\n// The Whole line is ignored.\n```\n\n### Variables\nSplax has variables which can be defined using the `let` keyword without defining any data type, splax can automatically detect datatype at runtime.\n\nsyntax:\n```rust\nlet variable_name;\nlet variable_name = initial_value;\n```\n\nexample:\n```rust\nlet a; // default value is null if nothing is assigned.\nlet b = 2; // numbers: both integers\nlet c = 2.5; // and floats\nlet d = \"Strings are easy\"; // strings\nlet e = true; // booleans\n```\n\n\n### Scope\nSplax variables have scope like any other modern programming language (the term `modern` here can be understood as the same as modern in `modern chess`)\n\n```rust\nlet a = 1;\n{\n    let a = 2;\n    print a; // 2\n}\nprint a; // 1\n```\n\n\n### Conditionals\nSplax has `if` `else` conditionals. It can be defined using the following syntax:\n```c\nif (condition) {\n    // todo\n} else {\n    // else todo\n}\n```\n\nexample: \n```rust\nlet a = 1;\nif (a == 1) {\n    print \"A is infact 1\";\n} else {\n    print \"A is not 1\";\n}\n```\n\n### While loop\nwhile loops in splax can be defined using the following syntax:\n```c\nwhile (condition) {\n    // todo\n}\n```\nexample:\n```rust\nlet a = 10;\nwhile (a \u003e 1) {\n    print a;\n    a = a - 1;\n}\n```\n\n### For loops\nSplax has syntactic sugar for `for` loops.\n\nsyntax:\n```c\nfor(initialiser; condition; incrementer) {\n    // todo\n}\n```\nexample:\n\n```c\nfor(let i = 0; i \u003c 10; i = i + 1) {\n    print i;\n}\n```\n\n\n### Functions\nSplax have user defined functions, and ability to call them.\n#### Function declaration\nA function in splax can be defined using the following syntax:\n```rust\nfn function_name(parameters) {\n    // todo\n}\n```\nexample:\n```rust\nfn greet(name) {\n    print \"Hello \" + name;\n}\n```\n\n#### Calling functions\nA function can be called using the following syntax:\n```c\nfunction_name(parameters);\n```\nexample\n```c\ngreet(\"Splax\");\n```\n\n## Using the interpreter\n\n### Running the interpreter on a spx file.\n```sh\nsplax run main.spx\n```\n\n### Running the live repl ( doesn't work half of the time )\n```sh\nsplax repl\n```\n\n### The help message\n```sh\nsplax\n```\n\n```\nA learning programming language.\n\nUsage: splax \u003cCOMMAND\u003e\n\nCommands:\n  repl  Interactive repl\n  run   Run from a file\n  docs  See docs\n  help  Print this message or the help of the given subcommand(s)\n\nOptions:\n  -h, --help  Print help\n```\n\n\n\n## Building from source.\n1. Clone the repo and make sure you have installed rust compiler and cargo. Here's the [official installation guide](https://rustup.rs/).\n\n2. Build using cargo.\n```sh\ncargo build --release\n```\n\nYou can test the interpreter on example present in [/examples](https://github.com/prashantrahul141/splax/tree/main/examples) folder","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprashantrahul141%2Fsplax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprashantrahul141%2Fsplax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprashantrahul141%2Fsplax/lists"}