{"id":22340485,"url":"https://github.com/dankolesnikov/simplelanguage","last_synced_at":"2025-03-26T09:16:32.127Z","repository":{"id":67650323,"uuid":"128711373","full_name":"dankolesnikov/SimpleLanguage","owner":"dankolesnikov","description":"Programming language - Scala subset","archived":false,"fork":false,"pushed_at":"2018-04-09T10:24:19.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-31T10:34:04.784Z","etag":null,"topics":["interpreters","parsing","scala"],"latest_commit_sha":null,"homepage":"","language":"Scala","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/dankolesnikov.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}},"created_at":"2018-04-09T03:49:36.000Z","updated_at":"2018-09-08T21:53:45.000Z","dependencies_parsed_at":"2023-05-18T02:02:07.338Z","dependency_job_id":null,"html_url":"https://github.com/dankolesnikov/SimpleLanguage","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/dankolesnikov%2FSimpleLanguage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankolesnikov%2FSimpleLanguage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankolesnikov%2FSimpleLanguage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankolesnikov%2FSimpleLanguage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dankolesnikov","download_url":"https://codeload.github.com/dankolesnikov/SimpleLanguage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245623080,"owners_count":20645681,"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":["interpreters","parsing","scala"],"created_at":"2024-12-04T07:11:50.952Z","updated_at":"2025-03-26T09:16:32.099Z","avatar_url":"https://github.com/dankolesnikov.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Language\n\u003e Programming language interpreter, similar to Scala subset\n\n## Description\n\nA programming language interpreter developed in a Programming Paradigms class with Professor Cay Horstmann at SJSU.\nSimple Language is similar to Scala subset but differs in several ways:\n\n* Only two types: integer and functions\n* Defs end with semicolons\n* Block has a single expression\n* Function literals have syntax `{ ident, ident, ... =\u003e block }`\n* `if` fakes `Boolean` similar to C: \u003e 0 is true, \u003c= 0 is false\n\n## Grammar\n\n\tblock ::= (valdef | fundef)* expr\n\texpr ::= expr2 | \"if\" \"(\" expr \")\" block \"else\" block\n\texpr2 ::= term (( \"+\" | \"-\" ) term)*\n\tterm ::= factor (( \"*\" | \"/\" ) factor)*\n\tfactor ::= wholeNumber | \"(\" expr \")\" | ident | funcall | funliteral\n\tfuncall ::= ident \"(\" (expr (\",\" expr)*)? \")\"\n\tfunliteral ::= \"{\" (ident (\",\" ident)*)? \"=\u003e\" block \"}\"\n\tvaldef ::= \"val\" ident \"=\" expr \";\"\n\tfundef ::= \"def\" ident \"=\" funliteral \";\" \n\n## Examples \n\nSimple addition and multiplication\n\n\tval a = 1;\n\tval b = 6;\n\ta * a + b * b\n\t\nFunction literal\n\n\tval max = { x, y =\u003e if (x - y) x else y };\n\nHigher-order function\n\n\tval twoTimes = { f, x =\u003e f(f(x)) }; \n\ttwoTimes({x =\u003e x * x}, 2)\n\t\nRecursion\n\n\tdef fac = { x =\u003e if (x) x * fac(x - 1) else 1 };\n\n**Curry**\n\nMultiplication\n\n\tval multiply = { x =\u003e { y =\u003e x * y } } ;\n\tmultiply(3)(4)\n\nLists:\n\n\tval list = 1 :: 2 :: Nil;\n\tval y = isEmpty(list);\n\tval x = head(1 :: Nil);\n\n### Credits\n\n[Cay Horstmann](http://horstmann.com/), SJSU\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdankolesnikov%2Fsimplelanguage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdankolesnikov%2Fsimplelanguage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdankolesnikov%2Fsimplelanguage/lists"}