{"id":19199653,"url":"https://github.com/aaroncoplan/simpleinterpretedlanguage","last_synced_at":"2026-06-23T07:31:27.137Z","repository":{"id":67336529,"uuid":"145263998","full_name":"AaronCoplan/SimpleInterpretedLanguage","owner":"AaronCoplan","description":"Simple interpreted programming language, built in phases.","archived":false,"fork":false,"pushed_at":"2018-08-20T00:23:44.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-23T05:22:54.123Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/AaronCoplan.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":"2018-08-19T01:23:12.000Z","updated_at":"2018-08-20T00:23:46.000Z","dependencies_parsed_at":"2023-05-12T08:15:13.044Z","dependency_job_id":null,"html_url":"https://github.com/AaronCoplan/SimpleInterpretedLanguage","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AaronCoplan/SimpleInterpretedLanguage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AaronCoplan%2FSimpleInterpretedLanguage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AaronCoplan%2FSimpleInterpretedLanguage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AaronCoplan%2FSimpleInterpretedLanguage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AaronCoplan%2FSimpleInterpretedLanguage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AaronCoplan","download_url":"https://codeload.github.com/AaronCoplan/SimpleInterpretedLanguage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AaronCoplan%2FSimpleInterpretedLanguage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34680620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-09T12:28:16.380Z","updated_at":"2026-06-23T07:31:27.122Z","avatar_url":"https://github.com/AaronCoplan.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SimpleInterpretedLanguage\n\nCompile: `javac src/main/java/com/aaroncoplan/**/*.java`\n\nRun: `java -cp ./src/main/java com.aaroncoplan.Application \u003cfilepath\u003e \u003cphasenumber (optional)\u003e`\n\nNote that each phase has its own sample file that highlights the main features included in that phase (`phase1sample`, `phase2sample`, etc)\n\n### Summary\n\nSimple stack based language.  Each phase adds incremental functionality so those visiting the repository can see how\ncommon programming language features are implemented in a simplified manner.  The programming language takes the following form / syntax:\n\n`arg arg ... function`\n\nExamples:\n\n```\n1 2 add print -\u003e prints 3\n2 4 multiply 3 add print -\u003e prints 11\n```\n\n### Phase 1\n\nBasic interpreter with 3 built in functions - add, multiply, and print.  Limited error checking.  \nNote there is no concept of strings or doubles, only integers and functions.\nSplits each line using spaces as the delimiter and pushes each item to the stack unless it is a function name.\nFor example, `3 4 add print` would push 3 to the stack, push 4 to the stack, recognize `add` as a function and execute it\n(which would pop 3, pop 4, add them, then push the result to the stack), then recognize `print` as a function and execute it\n(which would pop 7 from the stack and print it).\n\n### Phase 2\n\nExtends the Phase 1 interpreter by implementing the ability to deal with integers and doubles.\nFor example, `1 2 add` will treat both numbers as integers, and will push the result of `3` to the stack.\nHowever, `1 2.5 add` will first try to treat both numbers as integers, fail to do so on `2.5`, and then reattempt by\ntreating both values as doubles.  Thus, the result pushed to the stack will be `3.5`.  The same is executed for multiplication.\nThis phase also adds error handling for invalid arguments.  When an argument is not a number, such as `hello 2 add`,\nthe interpreter will recognize this and display an error message.\n\n### Phase 3\n\nExtends Phase 2 by adding a very simple type system.  Now, instead of treating everything as a `String`, arguments are \ntyped into `Value` objects, which contain a `type` field.  This allows us to do easy comparison of types for the add and\nmultiply functions in the updated phase 3 interpreter.  The major difference is that instead of determining types on popping\nfrom the stack, we now do so before pushing.\n\n### Phase 4\n\nExtends Phase 3 by making use of the type system to implement the ability to create variables.  Introduces the `set` function,\nwhich can be used to set the value of a variable.  For simplicity, variable names must begin with a dollar sign ($).\nTo implement this functionality, a new type has been introduced, `REFERENCE`, which tells the interpreter to lookup\nthe variable name in the table to obtain its value.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaroncoplan%2Fsimpleinterpretedlanguage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faaroncoplan%2Fsimpleinterpretedlanguage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaroncoplan%2Fsimpleinterpretedlanguage/lists"}