{"id":20565013,"url":"https://github.com/aermoss/rsx","last_synced_at":"2025-04-14T15:14:07.019Z","repository":{"id":37550710,"uuid":"495076798","full_name":"Aermoss/RSX","owner":"Aermoss","description":"An interpreted statically typed multi paradigm general purpose programming language designed for cross platform applications.","archived":false,"fork":false,"pushed_at":"2023-12-09T20:05:20.000Z","size":3377,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T15:13:58.393Z","etag":null,"topics":["cross-platform","general-purpose","interpreted","interpreted-languages","interpreter","multi-paradigm","programming-language","rsharp","rsx","statically-typed"],"latest_commit_sha":null,"homepage":"","language":"Python","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/Aermoss.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}},"created_at":"2022-05-22T14:02:14.000Z","updated_at":"2024-11-22T20:58:14.000Z","dependencies_parsed_at":"2023-12-09T21:22:48.650Z","dependency_job_id":"4decc3b5-1383-4ac6-8e5d-dc01a1955a70","html_url":"https://github.com/Aermoss/RSX","commit_stats":{"total_commits":69,"total_committers":1,"mean_commits":69.0,"dds":0.0,"last_synced_commit":"3e2cf4c6430d8a05f230c9f2fd7a3575cd46cb03"},"previous_names":["aermoss/rsharp"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aermoss%2FRSX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aermoss%2FRSX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aermoss%2FRSX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aermoss%2FRSX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aermoss","download_url":"https://codeload.github.com/Aermoss/RSX/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248904637,"owners_count":21180835,"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":["cross-platform","general-purpose","interpreted","interpreted-languages","interpreter","multi-paradigm","programming-language","rsharp","rsx","statically-typed"],"created_at":"2024-11-16T04:30:21.803Z","updated_at":"2025-04-14T15:14:06.992Z","avatar_url":"https://github.com/Aermoss.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# R# - RSX\r\nAn interpreted statically typed multi paradigm general purpose programming language designed for cross platform applications.\r\n\r\n# R# Logo\r\n![R# Logo](rsxpy/logo.png)\r\n\r\n# RSX Icon\r\n![RSX Icon](rsxpy/icon.png)\r\n\r\n# Requirements\r\n- Python 3.10 or higher\r\n\r\n# Getting Started\r\n## How to install\r\n### Windows (Compiles RSX source files and places them in C:\\RSX, also installs the RSX python library)\r\n```\r\n.\\install.bat\r\n```\r\n\r\n### Linux (Compiles RSX source files and installs the RSX python library)\r\n```\r\n./install.sh\r\n```\r\n\r\n### Difference between rsxpy and rsx\r\n- rsx only works on Windows\r\n- rsxpy requires python but rsx doesn't\r\n\r\n## How to [run/build] a RSX program\r\n```\r\n[rsxpy/rsx] main.rsx [run/build]\r\n```\r\n\r\n## How to [run/build] a RSX bytecode\r\n```\r\n[rsxpy/rsx] main.rsxc [run/build]\r\n```\r\n\r\n## How to make a RSX library with python\r\n### Using RSX Tools\r\n```python\r\nfrom rsxpy.tools import *\r\n\r\ncreate_library(\"library\")\r\n\r\n@create_function(\"VOID\", {\"message\": \"STRING\"})\r\ndef log(environment):\r\n    print(environment[\"args\"][\"message\"], flush = True)\r\n\r\nlibrary = pack_library()\r\n```\r\n\r\n### Using RSXLib\r\n```python\r\nfrom rsxpy import rsxlib\r\n\r\nrsxlib.begin()\r\n\r\ndef log(message: str) -\u003e None:\r\n    print(environment[\"args\"][\"message\"], flush = True)\r\n\r\nrsxlib.end()\r\n```\r\n\r\n## How to make a RSX library with RSX header files\r\n### library.rsxh\r\n```c++\r\ninclude \"rsxio\" : *;\r\n\r\nvoid log(string message) {\r\n    std::rout(message + std::endl());\r\n}\r\n```\r\n\r\n### main.rsx\r\n```c++\r\ninclude \"library.rsxh\";\r\n\r\nint main(string[] args) {\r\n    library::log(\"Hello, World!\");\r\n}\r\n```\r\n\r\n## How to add an include folder\r\n```\r\n[rsxpy/rsx] main.rsx run -Imy-include-folder\r\n```\r\n\r\n# Command line arguments\r\n- -I[dir]\r\n- -rmI[dir]\r\n- -timeit=[true/false]\r\n- -gettok=[true/false]\r\n- -getast=[true/false]\r\n- -bytecode=[true/false]\r\n- -noconsole=[true/false]\r\n- -console=[true/false]\r\n- run\r\n- build\r\n\r\n# Examples\r\n## Hello, World!\r\n```c++\r\ninclude \"rsxio\" : *;\r\n\r\n// using namespace std;\r\n\r\nint main(string[] args) {\r\n    std::rout(\"Hello, World!\" + std::endl());\r\n    return 0;\r\n}\r\n```\r\n\r\n## Builder\r\n```c++\r\ninclude \"rsxbuild\", \"rsxsys\", \"rsxio\" : *;\r\n\r\nint main(string[] args) {\r\n    std::rout(\"file name \u003e \");\r\n    std::build_program(\r\n        std::rin(),\r\n        {std::getdir() + \"/include/\"},\r\n        true, std::getdir() + \"/icon.ico\"\r\n    ); return 0;\r\n}\r\n```\r\n\r\n## Web Server\r\n```c++\r\ninclude \"rsxsocket\", \"rsxio\" : *;\r\n\r\nint main(string[] args) {\r\n    auto server = std::socket(std::AF_INET, std::SOCK_STREAM);\r\n    std::bind(server, \"localhost\", 5656);\r\n    std::listen(server);\r\n\r\n    string index = \"HTTP/1.1 200 OK\\n\\n\u003cp\u003eHello, World!\u003c/p\u003e\";\r\n\r\n    while (true) {\r\n        auto connection = std::accept(server);\r\n        string response = std::recv(connection, 1024);\r\n        std::rout(response + std::endl());\r\n        std::send(connection, index);\r\n        std::close(connection);\r\n    }\r\n    \r\n    return 0;\r\n}\r\n```\r\n\r\n## Raylib\r\n```c++\r\ninclude \"rsxraylib\" : *;\r\n\r\nint main(string[] args) {\r\n    InitWindow(1200, 600, \"R#\");\r\n    // SetTargetFPS(60);\r\n\r\n    while (!WindowShouldClose()) {\r\n        BeginDrawing();\r\n        ClearBackground(RAYWHITE);\r\n        DrawFPS(10, 10);\r\n        EndDrawing();\r\n    }\r\n\r\n    CloseWindow();\r\n    return 0;\r\n}\r\n```\r\n\r\n## 3D Projection Using Raylib\r\n```c++\r\ninclude \"rsxio\", \"rsxraylib\" : *;\r\n\r\nfloat[] project_vertices(float[] vertices, float[] position, float focal_length) {\r\n    float[(int) (vertices.length() / 3 * 2)] projected_vertices;\r\n    int index = 0;\r\n\r\n    for (int i = 0; i \u003c vertices.length(); i += 3) {\r\n        if ((focal_length + (vertices[i + 2] + position[2])) == 0 || (focal_length * (vertices[i] + position[0])) == 0 || (focal_length * (vertices[i + 1] + position[1])) == 0)\r\n            continue;\r\n            \r\n        float x_projected = (focal_length * (vertices[i] + position[0])) / (focal_length + (vertices[i + 2] + position[2]));\r\n        float y_projected = (focal_length * (vertices[i + 1] + position[1])) / (focal_length + (vertices[i + 2] + position[2]));\r\n        projected_vertices[index++] = x_projected; projected_vertices[index++] = y_projected;\r\n    }\r\n\r\n    return projected_vertices;\r\n}\r\n\r\nfloat[] scale_vertices(float[] vertices, float scale) {\r\n    float[vertices.length()] new;\r\n\r\n    for (int i = 0; i \u003c vertices.length(); i++) {\r\n        new[i] = vertices[i] * scale;\r\n    }\r\n\r\n    return new;\r\n}\r\n\r\nint main() {\r\n    const int width = 1200, height = 600;\r\n    InitWindow(width, height, \"RSX\");\r\n    SetTargetFPS(60);\r\n\r\n    float[] vertices = scale_vertices({\r\n        -0.5f, -0.5f,  0.0f,\r\n        -0.5f,  0.5f,  0.0f,\r\n         0.5f,  0.5f,  0.0f,\r\n         0.5f, -0.5f,  0.0f,\r\n        -0.5f, -0.5f, -0.5f,\r\n        -0.5f,  0.5f, -0.5f,\r\n         0.5f,  0.5f, -0.5f,\r\n         0.5f, -0.5f, -0.5f,\r\n    }, 100);\r\n\r\n    int[] indices = {\r\n        0, 1,\r\n        1, 2,\r\n        2, 3,\r\n        3, 0,\r\n        4, 5,\r\n        5, 6,\r\n        6, 7,\r\n        7, 4,\r\n        0, 4,\r\n        1, 5,\r\n        2, 6,\r\n        3, 7\r\n    };\r\n\r\n    int[] offset = {width / 2, height / 2};\r\n    float[] position = {0.0f, 0.0f, 0.0f};\r\n    float speed = 0.0f;\r\n\r\n    float focal_length = 100.0f;\r\n\r\n    while (!WindowShouldClose()) {\r\n        BeginDrawing();\r\n        ClearBackground(BLACK);\r\n        DrawText((string) GetFPS() + \" FPS\", 10, 10, 20, RAYWHITE);\r\n\r\n        float[] projected_vertices = project_vertices(vertices, position, focal_length);\r\n\r\n        if (IsKeyDown(KEY_W)) position[2] -= speed;\r\n        if (IsKeyDown(KEY_S)) position[2] += speed;\r\n        if (IsKeyDown(KEY_A)) position[0] += speed;\r\n        if (IsKeyDown(KEY_D)) position[0] -= speed;\r\n        if (IsKeyDown(KEY_SPACE)) position[1] += speed;\r\n        if (IsKeyDown(KEY_LEFT_SHIFT)) position[1] -= speed;\r\n        if (IsKeyDown(KEY_LEFT_CONTROL)) speed = 3.0f;\r\n        else speed = 2.0f;\r\n\r\n        for (int i = 0; i \u003c projected_vertices.length(); i += 2)\r\n            DrawCircle(projected_vertices[i] + offset[0], projected_vertices[i + 1] + offset[1], 5, RAYWHITE);\r\n\r\n        for (int i = 0; i \u003c indices.length(); i += 2) {\r\n            if (projected_vertices.length() \u003e= indices[i] * 2) {\r\n                DrawLine(projected_vertices[indices[i] * 2] + offset[0], projected_vertices[indices[i] * 2 + 1] + offset[1],\r\n                         projected_vertices[indices[i + 1] * 2] + offset[0], projected_vertices[indices[i + 1] * 2 + 1] + offset[1], RAYWHITE);\r\n            }\r\n        }\r\n\r\n        EndDrawing();\r\n    }\r\n\r\n    CloseWindow();\r\n    return 0;\r\n}\r\n```\r\n\r\n# The RSX Package Manager: Raid\r\nA package manager for RSX\r\n\r\n# Raid Logo\r\n![Raid Logo](rsxpy/raidpy/raid_logo.png)\r\n\r\n## How to install\r\nRaid comes with RSX no need to install anything\r\n\r\n### Difference between raidpy and raid\r\n- raid only works on Windows\r\n- raidpy requires python but raid doesn't\r\n\r\n## How to create a new Raid project\r\n```\r\n[raidpy/raid] new console my_console_project\r\n```\r\n\r\n## How to [run/build] a Raid project\r\n```\r\n[raidpy/raid] [run/build] my_console_project\r\n```\r\n\r\n# Libraries\r\n- rsxbuild\r\n- rsxthread\r\n- rsxio\r\n- rsxf\r\n- rsxgui\r\n- rsxmath\r\n- rsxmixer\r\n- rsxrand\r\n- rsxraylib\r\n- rsxstr\r\n- rsxstd\r\n- rsxsys\r\n- rsxterm\r\n- rsxtime\r\n- rsxos\r\n- rsxsocket\r\n- rsxsdl2\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faermoss%2Frsx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faermoss%2Frsx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faermoss%2Frsx/lists"}