{"id":17822177,"url":"https://github.com/samuelschlesinger/monolang","last_synced_at":"2025-04-02T10:40:31.678Z","repository":{"id":88732004,"uuid":"63097077","full_name":"SamuelSchlesinger/Monolang","owner":"SamuelSchlesinger","description":"An idea I had for a monomorphic language on the way to the bus.","archived":false,"fork":false,"pushed_at":"2016-07-11T20:20:43.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-08T01:41:49.789Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","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/SamuelSchlesinger.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":"2016-07-11T19:45:13.000Z","updated_at":"2016-07-11T20:20:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"02c7195d-ed94-4509-89ff-ac645d5727fe","html_url":"https://github.com/SamuelSchlesinger/Monolang","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/SamuelSchlesinger%2FMonolang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelSchlesinger%2FMonolang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelSchlesinger%2FMonolang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelSchlesinger%2FMonolang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SamuelSchlesinger","download_url":"https://codeload.github.com/SamuelSchlesinger/Monolang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246801788,"owners_count":20836361,"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-10-27T17:36:30.375Z","updated_at":"2025-04-02T10:40:31.653Z","avatar_url":"https://github.com/SamuelSchlesinger.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Monolang\n\n## Introduction\n\nThis is a monomorphically typed language which\nis emphatically inspired by the Curry-Howard\nisomorphism. In this spirit, there are minimal\nconstructs, but I believe that the few provided\nwill be effective for the construction of\nprograms which will be extremely optimizable.\n\nThe basic constructions allowed for can define\ntypes, terms, and type synonyms. As a first\ndraft, I will not add any built in types, though\nthis will obviously make the initial prototype\nlack certain efficiency. It is an experimental\nproject mainly for myself, so I do not care much.\n\n## Syntax\n\nThere are purposefully few constructs in Monolang,\nand those which are there are those which I find\nI cannot do without.\n\nInspired by Haskell, I have decided to allow types\nand data constructors only to begin with uppercase\nletters, and variable names only to begin with\nlowercase. No characters other than lowercase\nand uppercase letters are allowed in identifiers.\n\nThe two productions following are the basis for\nthe above.\n\n\u003e Name ::= [A-Z]{A-Za-z}  \n\u003e name ::= [a-z]{A-Za-z}  \n\nAs well, there shall be two operators which will\nbe used for a great variety of things, so I will\ndefine their productions as well.\n\n\u003e SmallStepRight ::= \"-\u003e\"  \n\u003e SmallStepLeft  ::= \"\u003c-\"  \n\u003e TypeOr ::= \"|\"  \n\u003e Proves ::= \":\"  \n\nThe type system is quite simple, it simply consists\nof unions of constructors.\n\n\u003e Type ::= CDef {TypeOr CDef}  \n\u003e CDef ::= Name {Type}  \n\nUnlike in Haskell and many other languages with\nalgebraic data types, each construction can\nbelong to arbitrarily many types, so it must\nbe treated as an enumeration in a different,\nmore global way. This can be optimized away,\nsurely, but does not to me seem to present major\nperformance problems.\n\n\u003e TypeDef ::= Name SmallStepRight Type  \n\u003e SynDef ::= Name SmallStepLeft Name  \n\nTerm construction is slightly different, as you\ncan state which type a term is a construction,\nor a proof of, and you should also be able to\nstate what reduction should take place on a small\nstep, or what the definition of the function is.\n\nThe syntax for this is going to look different\nthan expected, but it will expand the things you\nare able to write, not reduce it. \n\n\u003e Assertion ::= Term Proves Type  \n\u003e FunDef ::= name SmallStepRight Term  \n\nWith each of these things in place, we can now show\nthe syntax for each of the top level declarations.\n\n\u003e Statement ::= Assertion | FunDef | TypeDef | SynDef  \n\nIn selecting which terms are allowed in the language,\nI had a few things in mind. One, I would like this\nlanguage to have as little sugar as possible, not for\nany reason of parsing, but in the spirit of mathematics.\n\nI must of course allow the lambda, and I must as well\nallow for type assertions next to all terms, as this\nis could be helpful in enforcing invariants for the user\nwhich may not be checked automatically by the type system.\n\nI must allow for applications of functions, as well as for\ndestruction of constructions, the syntax of which will be\nparallel to the syntax for their definition.\n\n\u003e Term ::= Application | Destruction | Abstraction | Construction | Annotated  \n\u003e Application ::= Term Term  \n\u003e CPattern ::= name | Name {CPattern}  \n\u003e Destruction ::= Term SmallStepRight [(CPattern SmallStepRight Term) {TypeOr (CPattern SmallStepRight Term}]  \n\u003e Abstraction ::= '?' name SmallStepRight Term\n\u003e Construction ::= Name {Term}\n\u003e Annotated ::= Assertion\n\n## Type System\n\nThe type system should work in such a way that it\nencourages totality. I think that, while it is\npractical that each of your programs terminate,\nit is often more important for real life to make\nthem well defined over all of the possible inputs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelschlesinger%2Fmonolang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamuelschlesinger%2Fmonolang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelschlesinger%2Fmonolang/lists"}