{"id":19397671,"url":"https://github.com/dmosc/jpp","last_synced_at":"2025-06-14T06:04:02.895Z","repository":{"id":38339111,"uuid":"480105861","full_name":"dmosc/jpp","owner":"dmosc","description":"Object-oriented programming language stemming Javascript and C++ roots from syntax to behavior.","archived":false,"fork":false,"pushed_at":"2022-06-07T04:43:59.000Z","size":35463,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-24T22:53:27.127Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/dmosc.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}},"created_at":"2022-04-10T18:32:21.000Z","updated_at":"2022-05-02T03:25:29.000Z","dependencies_parsed_at":"2022-08-24T00:31:00.027Z","dependency_job_id":null,"html_url":"https://github.com/dmosc/jpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dmosc/jpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmosc%2Fjpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmosc%2Fjpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmosc%2Fjpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmosc%2Fjpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmosc","download_url":"https://codeload.github.com/dmosc/jpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmosc%2Fjpp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259768509,"owners_count":22908228,"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":[],"created_at":"2024-11-10T10:43:30.723Z","updated_at":"2025-06-14T06:04:02.879Z","avatar_url":"https://github.com/dmosc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# J++\nJ++ is a programming language aimed at offering commonly found mechanism\nmost major modern languages offer like: **arithmetic expressions**, **native iteration syntax**,\n**subroutines**, **conditional flows**, **multi-dimensional variables**, \n**module creation and imports**, etc. Additionally, during intermediate code generation, \nJ++ implements code optimization strategies to compress object code output and improve execution times.\n\n## Run\nRun the following command to compile and run a project\n\n```\nyarn compile -[d,p,r] [path/to/file].jpp\n\n-d: Log intermediate code representation in console.\n-p: Combine with -d to debug addresses.\n-r: Run after compiling project.\n```\n\n## Getting started\n\n```\nimport(\"lib/io.jpp\") // Load read and write functions. //\n\nprogram HelloWorld {\n    var string name;\n    name = read(\"What's your name? \");\n    write(\"Hello \" + name);\n}\n```\nJ++ philosophy and syntax follow tints of some of the most popular programming languages, promoting\na relatable and intuitive onboarding experience. The following code snippets aim at displaying the full\nrange of motion J++ can add to your thoughts when trying to express them as code.\n\n### Type casting\nAll external data entering a program commonly arrives in the form of text. The `string.jpp` native\nlibrary exposes some useful type casting functions to arithmetically operate over numeric data. \n```\nimport(\"libs/io.jpp\", \"libs/string.jpp\")\n\nprogram TypeCasting {\n    var int a;\n    var float b;\n    a = str_to_int(\"10.5\");\n    b = str_to_float(\"10.5\");\n    write(a); // 10 // \u003c-- This is how you add comments.\n    write(b); // 10 //\n}\n```\n\n### Arithmetic\nJ++'s arithmetic precedence follows that of [C++](https://en.cppreference.com/w/cpp/language/operator_precedence),\nallowing you to have a common expectation of results when computing complex expressions.\n```\nimport(\"libs/io.jpp\", \"libs/math.jpp\")\n\nprogram Arithmetic {\n    var int a, b, c;\n    a = 7;\n    b = 2;\n    c = 10;\n    write(a / b * (c * c / 5)); // 60 //\n}\n```\n\n### Binary search\nTypical search algorithm in a sorted array programmed in J++.\n```\nimport(\"libs/io.jpp\", \"libs/string.jpp\")\n\nprogram BinarySearch {\n    var int i, k, left, right, middle, arr[10];\n    var bool found;\n\n    i = 0;\n    while (i \u003c 10) {\n        arr[i] = str_to_int(read(\"Value: \"));\n        i = i + 1;\n    }\n\n    k = str_to_int(read(\"Search for value: \"));\n    left = 0;\n    right = 10;\n    found = false;\n    while (left \u003c right \u0026\u0026 !found) {\n        middle = (left + right) / 2;\n        write(middle);\n        if (arr[middle] == k) {\n            write(k + \" at index \" + middle);\n            found = true;\n        } elif (arr[middle] \u003c k) {\n            left = middle + 1;\n        } else {\n            right = middle - 1;\n        }\n    }\n    if (!found) {\n        write(k + \" not in array\");\n    }\n}\n```\n\n### Objects\nThis is how you can instantiate objects in J++ and use them in your\nprogram.\n```\nimport(\"libs/io.jpp\")\n\nclass Point {\n    var int x, y;\n\n    construct(int a, int b) {\n        this.x = a;\n        this.y = b;\n    }\n\n    func int getX() {\n        return this.x;\n    }\n\n    func int getY() {\n        return this.y;\n    }\n}\n\nprogram Objects {\n    var Point p1;\n    p1 = new Point(1, 3);\n    write(\"p1(x): \" + p1.getX());\n    write(\"p1(y): \" + p1.getY());\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmosc%2Fjpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmosc%2Fjpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmosc%2Fjpp/lists"}