{"id":23824781,"url":"https://github.com/kmr-ankitt/s-lang","last_synced_at":"2026-02-20T19:02:02.915Z","repository":{"id":244738126,"uuid":"816105695","full_name":"kmr-ankitt/S-lang","owner":"kmr-ankitt","description":"S-lang is a programming language for newbies.","archived":false,"fork":false,"pushed_at":"2024-09-04T13:07:03.000Z","size":93,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-13T06:39:35.527Z","etag":null,"topics":["interpreter","programming-language"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kmr-ankitt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-17T03:54:35.000Z","updated_at":"2024-12-20T12:27:29.000Z","dependencies_parsed_at":"2024-08-28T06:48:04.900Z","dependency_job_id":"0ea66e4f-3476-48df-8bfd-db65a3ec65f4","html_url":"https://github.com/kmr-ankitt/S-lang","commit_stats":null,"previous_names":["kmr-ankitt/s-lang"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kmr-ankitt/S-lang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmr-ankitt%2FS-lang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmr-ankitt%2FS-lang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmr-ankitt%2FS-lang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmr-ankitt%2FS-lang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kmr-ankitt","download_url":"https://codeload.github.com/kmr-ankitt/S-lang/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmr-ankitt%2FS-lang/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29661585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T16:33:43.953Z","status":"ssl_error","status_checked_at":"2026-02-20T16:33:43.598Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","programming-language"],"created_at":"2025-01-02T11:15:33.339Z","updated_at":"2026-02-20T19:02:02.899Z","avatar_url":"https://github.com/kmr-ankitt.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![slangBanner](https://github.com/user-attachments/assets/787387f0-07e0-4912-ab34-7e89b3aa8ebb)\n\n# S-lang\n\nS-lang is a Dynamically typed Language Object Oriented programming language designed for simplicity and ease of use.\n\n## Why\n\nS-lang is designed in such a way that it is easy to learn and use for Gen-z newbies to programming world.\n\n I know It's a weird descision to build a TypeScript based Interpreter. But ok.\n\n## Prerequisites\n\n- [Node.js](https://nodejs.org/en/download/)\n- Make (Optional)\n\n## Installation\n\n1. Clone `S-lang` offical repository:\n\n```bash\ngit clone https://github.com/kmr-ankitt/S-lang.git \ncd S-lang\n```\n\n2. Install `S-lang` dependencies:\n```bash\nnpm install\n```\n\n3. Run `S-lang` REPL:\n\n```bash\nnpm run slang\n```\nYou can also run `S-lang` through Makefile:\n\n```bash\nmake slang\n```\n\n4. Compile and run `.sx` file :\n\n```ts\nnpm run slang FILE_DIRECTORY/FILE_NAME.sx\n```\n\n## S-lang Documentation\n\n### File extension\n\nS-lang supports only `.sx` file extension.\nexample: `main.sx`\n\n\n### Hello, world!\nA simple hello world program in S-lang:\n```python\necho \"Hello, World!\";\n```\n**Semi-colons at the end of every line is mandatory in S-lang.**\n\n### Datatypes\nS-lang has following datatypes\n\n#### Numbers\nThere can be 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: `\"S-lang\"`, `\"Strings are easy\"`\n\n### Booleans\nThese are boolean literals which can be either `real` or `noi`.\n\nexamples: `real`, `noi`\n\n### Null Type\nS-lang has null datatype. It can be defined using the `void` keyword. All uninitialized variables are given the value of `void`. \n\nexamples: `void`\n\n\n### Operators\n\nS-lang has following operators:\n\n#### Assignment\n`=` - equals\n\n#### Unary operators\n`-` - Unary negation\n\n### Logical operators\n`nd` - 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### Comments\nS-lang support both single line and multi line comment.\n\n- Single line comment\n```c\n// This is a single line comment.\n// The Lexer completely ignores any line starting with // \n```\n\n- Multiline comment\n```c\n/*This is a mulit line comment in S-lang similar to that of C.*/\n```\n\n### Variables \n\n```rust\nlet num = 15; // number\nlet name = \"radiohead\"; // string\nlet goat = real; // booleans\nlet noob = noi; // booleans\nlet nullable = void; // null type\n```\n\n\n### Logical operators\n```rust\n!real;  // false.\n!noi; // true.\nreal nd noi; // false.\nreal nd real;  // true.\nnoi or noi; // false.\nreal or noi;  // true.\n```\n\n### Control flow\n```rust\nlet num = 15;\n\niffy(num \u003e 0){\n    echo \"num is positive\";\n}oof {\n    echo \"num is negative\";\n}\n```\n\n### Loops \n```rust\nroll(let i = 0; i \u003c 10; i = i + 1){\n    echo i;\n}\n\nlet num = 1;\nloop(num \u003e 0){\n    echo num;\n    num = num - 1;\n}\n```\n\n### Functions\n```rust\nfun add(a, b){\n    return a + b;\n}\n\necho add(5, 10);\n```\n\n\n### Closures\n```rust\nfun addPair(a, b) {\nreturn a + b;\n}\n\nfun identity(a) {\nreturn a;\n}\n\necho identity(addPair)(1, 2); // Prints \"3\".\n\nfun makeCounter(){\n    let c = 0;\n    fun counter(){\n        c = c + 1;\n        echo c;\n    }\n    return counter;\n}\n\nlet counter1 = makeCounter();\nlet counter2 = makeCounter();\n\ncounter1(); // 1\ncounter2(); // 1\n```\n\n## Classes\nS-lang has classes. It's a group of functions that can be used to create objects.\n\n- keywords: `fam` for class, `here` for current context or this keyword in other langs.\n\n```rust\nfam Bacon {\n  eat() {\n    echo \"Crunch crunch crunch!\";\n  }\n}\n\nBacon().eat(); // Prints \"Crunch crunch crunch!\".\n\nfam Thing {\n  getCallback() {\n    fun localFunction() {\n      echo this;\n    }\n\n    return localFunction;\n  }\n}\n\nlet callback = Thing().getCallback();\ncallback();\n``` \n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkmr-ankitt%2Fs-lang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkmr-ankitt%2Fs-lang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkmr-ankitt%2Fs-lang/lists"}