{"id":22840536,"url":"https://github.com/shouya/neko","last_synced_at":"2026-02-03T09:34:47.243Z","repository":{"id":27216807,"uuid":"30687868","full_name":"shouya/neko","owner":"shouya","description":"An adorable typed calculus langauge for STLC, System F, and System F-ω! (stalled)","archived":false,"fork":false,"pushed_at":"2015-03-01T07:07:31.000Z","size":200,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-10T05:24:52.457Z","etag":null,"topics":["racket","typing"],"latest_commit_sha":null,"homepage":"","language":"Racket","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/shouya.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}},"created_at":"2015-02-12T05:50:17.000Z","updated_at":"2018-11-10T20:16:57.000Z","dependencies_parsed_at":"2022-08-19T12:12:30.615Z","dependency_job_id":null,"html_url":"https://github.com/shouya/neko","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shouya/neko","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shouya%2Fneko","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shouya%2Fneko/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shouya%2Fneko/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shouya%2Fneko/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shouya","download_url":"https://codeload.github.com/shouya/neko/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shouya%2Fneko/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265360239,"owners_count":23752661,"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":["racket","typing"],"created_at":"2024-12-13T01:12:29.775Z","updated_at":"2026-02-03T09:34:47.235Z","avatar_url":"https://github.com/shouya.png","language":"Racket","funding_links":[],"categories":[],"sub_categories":[],"readme":"# neko\nAn adorable typed calculus langauges for Simply Typed Lambda\nCaculus (STLC), System F, and System F-ω!\n\n![neko](http://i.imgur.com/n4j7vuIl.png)\n\nneko was, again, a cute cat-girl.\n\n## syntax\n\nNeko uses s-expression as its syntax. Neko source code can be written\nin a quoted racket list.\n\n### types\n\n```\nType ::= '*\n       | Type '-\u003e Type ('-\u003e Type)*\n       | '( Type ')\n```\n\n**Note:** function type is right associative, `t1 -\u003e t2 -\u003e t3` is\nequivalent to `t1 -\u003e (t2 -\u003e t3)`.\n\nThe unit type `(*)` is rigid. That means it's not for\npolymorphism. For example: `(a :: * -\u003e *)` does not accept argument\nwith type `* -\u003e *`. Polymorphism is supported in System F and System F-ω\nvia type variables.\n\n\n\n### terms\n\n```\nType    ::= \u003csee above definition\u003e\nTermVar ::= \u003cany racket symbol\u003e\n\nTerm ::= TermVar\n       | 'λ '( TermVar ... ':: Type ') Term     -- lambda abstraction\n       | Term Term ...                          -- functional application\n       | '( Term ')\n```\n\n**Note:** lambda terms supports multiple variable lambda as a syntatic\nsugar, which means, `λ (v1 v2 ... vn :: T) t` will be expanded into\n`λ (v1 :: T) (λ (v2 :: T) ... (λ (vn :: T) t) ...)`.\n\nFunctional application curries in neko. `t1 t2 t3 ... tn` is treated as a\nsyntatic sugar to `( ... ((t1 t2) t3) ... ) tn`.\n\n\n### commands\n\n* `(system \u003ctype-system\u003e)`: specify the type system. This command must be the first line of a program. Valid type systems is one of `'(stlc system-f system-f-omega)`.\n* `(annotate var type)`: annotate an identifier with given type.\n* `(unanno var)`: delete an annotated identifier\n* `(reduce-step term)`: reduce a term for one step, with current environment.\n* `(reduce-full term)`: reduce a term to normal form, it's not garenteeded to terminate for systems with fix-point operator.\n* `(normal? term)`: print if a term is in normal form.\n* `(type term)`: show the deduced type of a term.\n* `(define var term)`: defining an identifier with some value.\n* `(undef var)`: delete an defined identifier.\n\n### program structure\n\nneko program contains a list of commands. those commands will be\nexecuted orderly. commands are independent each other and the\nenvironment will carry forward.\n\n\n## essential functions for a system\n\nThese functions are available for all systems, but notice they may\nbehave differently. You won't need these information unless you want to\nlook into the implementation or you're going to extend neko with a new\nsystem.\n\n```racket\n;; compiles neko syntax code\n(compile-type type)\n(compile-term term)\n\n;; convert compiled entities to readable strings\n;; these two functions are implemented in `common.rkt`.\n(show-type type)\n(show-expr term)\n\n;; reduction functions\n(reduce-step term env)\n(reduce-full term env)\n(normal-form? term env)\n\n;; types deduction\n(deduce-type term env)\n\n;; provide an pre-initialized environment for reduction\n(init-env)\n\n;; handle commands specified for different systems, this function does\n;; actions and returns new `env`.\n(do-command command env)\n```\n\n\n## references\n* [An Introduction to System F - PPS](http://www.pps.univ-paris-diderot.fr/~miquel/slides/got03-1.pdf)\n* [A Short Introduction to Systems F and F-ω](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.137.2063\u0026rep=rep1\u0026type=pdf)\n* (Software Foundations) [STLC: Simply Typed Lambda Calclus](http://www.cis.upenn.edu/~bcpierce/sf/current/Stlc.html)\n* [Type systems for programming languages](http://gallium.inria.fr/~remy/mpri/cours1.pdf)\n\n\n# license\nMIT, see `LICENSE` for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshouya%2Fneko","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshouya%2Fneko","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshouya%2Fneko/lists"}