{"id":13780070,"url":"https://github.com/schani/SimpLang","last_synced_at":"2025-05-11T13:31:27.528Z","repository":{"id":15565514,"uuid":"18300811","full_name":"schani/SimpLang","owner":"schani","description":"A very simple programming language for teaching interpreter and compiler building.","archived":false,"fork":false,"pushed_at":"2017-06-29T23:15:16.000Z","size":91,"stargazers_count":14,"open_issues_count":0,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-14T10:50:57.514Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"aricaldeira/PySPED","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/schani.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":"2014-03-31T16:58:29.000Z","updated_at":"2024-04-09T05:57:44.000Z","dependencies_parsed_at":"2022-07-10T18:31:15.676Z","dependency_job_id":null,"html_url":"https://github.com/schani/SimpLang","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schani%2FSimpLang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schani%2FSimpLang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schani%2FSimpLang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schani%2FSimpLang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schani","download_url":"https://codeload.github.com/schani/SimpLang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225056762,"owners_count":17414204,"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-08-03T18:01:12.045Z","updated_at":"2024-11-17T15:30:53.815Z","avatar_url":"https://github.com/schani.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"SimpLang - A Simple Language\n============================\n\nAll values are signed 64 bit integers.  All global definitions are\nfunctions.  Calls are not tail recursive.  All functions return\nvalues.  Functions are not first class.\n\nSome pieces in the language grammar, like `end`, are superfluous.\nThey are there to make parsing and later extension easier.\n\n# Example program\n\n\tlet fac n =\n\t\tloop acc = 1 and\n\t\t\t i = 2\n\t\tin\n\t\t\tif n \u003c i then\n        \t\tacc\n      \t\telse\n\t\t\t\trecur (acc * i) (i + 1)\n\t\t\tend\n\t\tend\n\tend\n\n\tlet main n =\n\t\tfac (n)\n\tend\n\n# Control constructs\n\n`let` introduces variable bindings.  They are only visible within the\nright hand sides of later bindings in the same `let` expression and\nthe body of the `let` expression.  Later bindings can hide earlier\nones:\n\n    let a = 1 and\n\t\tb = a + 1\n\tin\n\t\tb\n\tend\n\ngives `2`.\n\n\tlet a = 31415\n\tin\n\t\tlet a = 1 and\n\t\t\ta = a + 1\n\t\tin\n\t\t\ta\n\t\tend\n\tend\n\nalso gives `2`, because the first `a` in the inner `let` hides the\nouter `a`.\n\n`if` works as expected.  It must have both `then` and `else` clauses.\n\n`loop` introduces variable bindings like `let`, but it also provides a\njump target for uses of `recur` in the body.  `recur` invocations jump\nto the innermost `loop` containing that `recur`, giving new values to\nthe bound variables.\n\n`recur` is only legal within a `loop` and can only occur in a tail\nposition, i.e., where the continuation is the same as the continuation\nof the containing `loop`.  In particular, a `recur` can never be the\ncondition of an `if`, an argument in a function call, an operand to an\noperator, the right hand side of a `let` or `loop` binding.\n\nFunctions can only be used in their own definitions or in later\ndefinitions.  All functions must have different names.\n\nAll arguments to function calls and `recur` must be parenthesized,\ni.e.,\n\n    recur (a) (-b)\n\nis legal, while\n\n    recur a -b\n\nis not.\n\n# Values\n\n`if` and all logical operators consider `0` to be false, all other\nvalues to be true.  Logical operators return `0` for false and `1` for\ntrue.\n\n# Operators\n\nThese are all the operators, in increasing order of precedence:\n\n\t\u0026\u0026, ||\n\t!\n\t\u003c, ==\n\t+\n\t*\n\t- (unary)\n\tfunction application\n\n`\u0026\u0026` and `||` are logical operators, using shortcut evaluation.  That\nmeans `\u0026\u0026` will not evaluate its right hand side if the left hand side\nevaluates to `0`, and `||` will only evaluate its right hand side if\nits left hand side evaluates to `0`.\n\n# Miscellaneous\n\nFunctions must take at least one argument.\n\n# Syntax\n\nIdentifiers can contain only letters, digits, and the underscore, but\ncannot start with a digit.\n\nFunction calls use ML/Haskell syntax: Function name followed by\narguments.\n\n# Tests\n\nRun the testsuite with\n\n    ./tests/test.py TEST-SUITE YOUR-EXE [YOUR-EXE-ARG ...]\n\nwhere `TEST-SUITE` is the name of one of the directories in `tests`,\nsuch as `full`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschani%2FSimpLang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschani%2FSimpLang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschani%2FSimpLang/lists"}