{"id":19583949,"url":"https://github.com/rishavs/nippy","last_synced_at":"2026-06-15T15:31:33.165Z","repository":{"id":147879496,"uuid":"72231917","full_name":"rishavs/nippy","owner":"rishavs","description":"A simple, minimalist and fast compiled language.","archived":false,"fork":false,"pushed_at":"2024-12-02T06:29:17.000Z","size":137,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-26T12:31:54.340Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/rishavs.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-10-28T18:24:30.000Z","updated_at":"2024-12-02T06:29:21.000Z","dependencies_parsed_at":"2024-11-11T07:46:03.327Z","dependency_job_id":"ff789848-98d1-4ca2-811d-8060d03bc481","html_url":"https://github.com/rishavs/nippy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rishavs/nippy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishavs%2Fnippy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishavs%2Fnippy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishavs%2Fnippy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishavs%2Fnippy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rishavs","download_url":"https://codeload.github.com/rishavs/nippy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishavs%2Fnippy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34369839,"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-15T02:00:07.085Z","response_time":63,"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-11T07:45:57.036Z","updated_at":"2026-06-15T15:31:33.147Z","avatar_url":"https://github.com/rishavs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nippy\n\nnippy is a small, fast and easy programming language, meant for application development, currently under design. It will be a statically typed, compiled language with garbage collection. The current plan is to go for a procedural approach with simple composition based OOPs.\n\nA sample nippy program is;\n\n```\nvar $a: Num|Nil\na = 10\n\nmyColors: @Red | @Blue\nmyColors = @Red\n\nmyAdderFunc: Fun(x: Num, y: Num): Num {\n    return x + y\n}\nmyAdderFunc: (x: Num, y: Num): Num =\u003e\n    return x + y\nend\n\nmyVoidFunc: Func(x: Num, y: Num) {\n    show x, y\n}\n\nmyObject: Object { \n    Text, Text | Object { Text, Text }\n}\nmyObject = {\n    \"id\" = \"dingdong\"\n    `foo` = `bar`,\n    \"left\" = \"right\",\n    `whoAmI` = {\n        \"name\" = \"Rishav\",\n        \"profession\" = \"slacker\",\n    }\n}\nshow myObject.\"whoAmI.\"name\"\n\nnewObj = myObject.each(item, \n    Func(item, self):Text {\n        return item.\"id\"\n    }\n)\n\n-- List is just a sugared Object with hidden index --\nmyList: List { Num | Text }\nmyList = [1, 3, 8, `foo`, \"bar\"]\n\nmyList.each with Func(item):Text {\n    show item\n} \n\nnewTextList \u003c\u003c myList.each(item, Func():Text {\n    \n    \n})\nsum: Num = 0\n[1..10].each (item, Func(item, self):Text {\n    sum = sum + item    \n})\n\n\n-- Set is just a sugared List with unique items --\nmySet: Set ( x: Num | Text )\nmySet = [1, 3, 8]\n\ngetLargest = mySet.reduce with Func():Num {\n}\n\nPoint: Class {\n    var x: Num,\n    y: Num,\n    distanceFromPoint: Func (p2: Point) -\u003e Num {\n        return p2.x - self.x\n    }\n}\n\n-- Classes have the following event ethods; onInit, onDestruct, onInherit, onCompose --\n\np1 = Point(20, 30)\np1.x = 25\nshow p1.y\nshow p1.distanceFromPoint(10, 40)\n\n-- composition --\np1.a \u003c\u003c someVar:Num = 10\n\np = when x is\n| 1 -\u003e returnSometing1()\n| 2 -\u003e returnSomething2()\n| _ -\u003e returnSomething3()\n\n\n\na: Num = 10\nmyList = [1, 2, 3]\n[a].append [1, 2, 3]\nmyList.append [4, 5]\nmyList.prepend [0]\n```\n\n\n\n\n\n------\n\n## Core Philosophy\n\nThe key goals of the language, in the order of priority, are;\n\n1. **DevEx first:** Optimize for Developer happiness\n2. **Batteries Included:** Nippy places more importance on having a robust stdlib, toolchain and ecosystem than on language semantics.\n3. **Easy:** Nippy must be easy to learn and use, above anything else. \n4. **Small:** Nippy will have a small syntax and only a small feature set.\n5. **Fast Compilation:** The language will always try to be elegant and expressive whenever possible.\n6. **One way:** There should be only one way to do things in Nippy\n7. **Performant:** 80% of the peroformance of C with 20% of the headache\n8. **Readability:** It should be easy to read and understand the written code at a glance\n\nWhile being fast, having low memory overhead, small binaries and other attributes are also very important, nippy will always try adhere closely to its core philosophy.\nNippy aims to compile down to C99 for interop. Nippy doesn't try to blaze the frontiers of language design but instead aims to mplement the best ideas from other great languages.\n\n#### What Nippy isn't:\n\nIt isn't an all purpose low level programming language. Nippy doesn't aims to be another C/C++\n\nPlease keep in mind that we are in the design phase itself. so there is nothing much to see right now. I am writig this document only to put down the ideas that I have on paper. The various phases that I expect the language to go through are:\n\n- [ ] Design -- we are currently here --\n\n- [ ] Development with LLVM as backend\n\n- [ ] Working language\n\n- [ ] Turing complete\n\n- [ ] Self Host compiler\n\n- [ ] Package Manager\n\n- [ ] Basic 2d game engine based on Love2d\n\n- [ ] Micro web framework\n\n- [ ] UI\n\n------\n\n## Language Features\n\nNippy is a good thief. It plans to steal all the best features from the best languages out there;\n\n- Elm's Error messaging\n\n- Crystal's/F#s type system including Nil types\n\n- F#'s 'pipeline operator\n\n- Lua's coroutines\n\n- Lua's list implementation (List are sugared tables, with key = index)\n\n- JS's explicit imports and exports\n\n- Pyret's inline tests for functions\n\n- Zig's errdefer and custom allocators?\n\nOther key language features will be;\n\n- JSON is a first class citizen\n\n- Everything is an object\n\n- Everything is an expression\n\n- Pattern Matching\n\n- Each file is a module\n\n- Value types\n\n- Nested/hierarchical Types\n\n- Composition based OOPs\n\n- Operator/Function overloading\n\n- Generics\n\n- Object destructuring\n\n- x.func(y) is sugar for func(x, y)\n\n- Functions always return?\n\n- Pass by value?\n\n- returning multiple values\n\n- Primitive types : num(f64), text(list of chars), symbol, bool, stream\n\n- Advanced Types - Vector2, Vector3, \n\n- Complex types - Objects\n\n- Collection Types - Lists and Sets\n\n- Infinity as a special Num value like 0\n\n- Fortran like rational number type?\n\n- single loop type alongwith iterators and map/reduce\n\n- no if else or case statements\n\n- 1 based indexing by default, but allow devs to change this\n\n- state machine as a first class citizen. think a directional enum where values can only go in the defined direction\n\nMemory Management;\n\n- Manual to start with. see https://www.microsoft.com/en-us/research/wp-content/uploads/2017/03/kedia2017mem.pdf\n  \n  \"Also, custom allocators, hands-down. Pair them with a defer mechanism, and they make manual memory management as easy as using a GC for most cases, and they're incredibly fast. Where a GC might take milliseconds to clean up garbage, a custom allocator can do the same work in nanoseconds. I won't say they're always better than GC because there may be some problems where you have to use heap allocations for everything, and I'd rather use a GC than trash like RAII with ARC, but for most problems custom allocators are just really nice.\"\n\n- Immix/Arc later?\n\nSome basic language features that I expect nippy to have, are:\n\n- Use of indentation for code blocks. For this we look at languages like lua, ruby and python for inspiration.\n- Fully Garbage collected. User should be able to specify the kind of GC they want\n- Pattern Matching\n\nsome Functional Lang traits. More stuff will go here as I work on the design.\n\n\n\n## Running nippy\n\nA nippy code file is in the form of a `.nip` file.\n\nTo run a single file, you can simply do\n\n`$ nippy run \u003cfile path\u003e`\n\nfor example;\n\n`$ nippy run MyScript.nip`\n\nThis will create a debug binary in that very folder and then run it.\n\n## Nippy Toolset\n\nnippy is a language which comes with its own toolset and package manager. \n\nnippy code can be run as simple single files or as entire projects. For any serious development, you will want to get working on a project. However, you can still use your own project structure and simply run it using the `nippy run` command.\n\nnippy package manager will install the latest version of the compiler in global. But for each project, the compiler itself is added as a dependency.\n\n#### New nippy project\n\nA new nippy project can be created using the following command:\n\n`nippy create MyApp`\n\nThis will create a project structure like this;\n\n```\nProjectFolder\n    ├── bin/\n    │   ├── dev/\n    │   ├── prod/\n    │   └── \u003cAny other env\u003e/\n    ├── deps/\n    │   ├── \u003csome nippy package\u003e/\n    │   └── \u003csome nippy package\u003e/\n    ├── docs/\n    ├── libs/\n    │    └── \u003csome non-nippy object or lib\u003e/\n    ├── src/\n    │   ├── app/\n    │   └── main.nip\n    ├── tests/\n    ├── tools/\n    ├── docs/\n    ├── .gitignore\n    ├── README.md\n    ├── LICENSE.md\n    └── build.nip\n```\n\n`build.nip` is the project definition and contains details of the project and its dependencies.\nwhen nippy is run in any project, it will always look for this file to parse through.\n\n#### Build project\n\nTo build a project, use;\n\n`nippy build \u003cenv\u003e`\n\nHere, if you don't give an `env` identifier, nippy will assume it to be a dev build.\n\nThis will create the binaries and place them at `bin/\u003cenv\u003e`\n\n`nippy init` can be used to initialize nippy in an existing project directory. This will create a default `build.nip` file in the project root.\n\n#### Run Project\n\nThis will likely be the command you use most often. This will compile the project into `bin/\u003cenv\u003e` and then run the compiled binary. To use it, type:\n\n`nippy run \u003cenv?\u003e \u003cloglevel?\u003e`\n\nHere, if you don't give an `env` identifier, nippy will assume it to be a dev build.\n\n#### Install Dependencies\n\nDependencies can be installed with \n\n`nippy get deps`\n\nIf you want to get a specific package then do;\n\n`nippy get AwesomePackage@1.2.3`\n\nThe version is optional. Multiple package can be comma separated.\n\n## Main file\n\nnippy project code will always start at the \n\n## Language Concepts\n\n1. ### Comments\n\nnippy treats anything between two `--` double dashes, or `--` and `\\n` to be a comment.\n\nso this is a comment;\n\n```\n-- anything that goes here will be skipped by the compiler for this line\n```\n\n```\n-- This is a multiline comment.\n\ncontinues on the other line.\n\nBecause why the heck not. --\n```\n\n### Modules\n\nnippy uses modules as a way of structuring projects and namespacing.\n\nEvery program MUST begin at a Main module\n\nIt is recommended to have only 1 module in 1 file.\n\n### Namespaces\n\nnippy has no global namespace at all. All namespaces are specific to a module.\n\n### Assignment\n\nnippy doesn't uses `=` for assignment, as is the case in many languages. instead nippy uses `\u003c\u003c` or `\u003e\u003e` symbols for assignments.\n\nx \u003c\u003c 10\n\n### Basic Types\n\n1. num\n2. text\n3. bool\n4. vec\n5. obj\n6. fn\n7. struct\n\n### Range\n\n{3 to 7 } is the same as {3, 4, 5, 6, 7} which in turn is the same as;\n{1 : 3, 2: 4, 3:5, 4:6, 5:7}\n\n### Functions\n\nsum \u003c\u003c fn(x,y) is                -- block style --\n\n​    return x + y\n\nend\n\nsum \u003c\u003c fn (x,y) is x+y            -- single line style --\n\nFunction Guards\n\nA functions can have optional guards where attributes of input and output can be given. this ensures that the compiler can check them during compile time and see if there are any cases of type mismatch or such.\n\nsum of [x,y] is                -- block style --\n\n​    guarded by\n\n​        x.type is Int and\n\n​        y.type is Int and\n\n​        result.type is Int and result \u003e x and result \u003e y\n\n​        \n\n​    defined by\n\n​        return x + y\n\n​    end\n\nend\n\nsum \u003c\u003c fn (...) is\n\n​    overloaded by\n\n### Chaining functions\n\ny \u003c\u003c add_two: \u003c\u003c find_2_primes: \u003c\u003c x\n\nx \u003e\u003e find2primes: \u003e\u003e add_two \u003e\u003e y\n\nrgb of [RED, BLUE, GREEN] \n\n## Sample Programs\n\n### Hello World\n\nThe good old Hello world program. Where will we be without it?!\n\nnippy uses the \"say\" function. it works like \"print\" commands in other languages.\n\nCase statement\n\nnippy doesnt have if-elseif-else conditionals. Instead, we use Case to check for truthiness.\n\ncase (x == y) ?\n\n​    == true; say: \"x equals y\"\n\n​    == false -\u003e \n\n​        say: \"x equals y\"\n\n​    end\n\n​    == else -\u003e say: \"This will never run, so may not use * when checking for truthiness\"\n\nend\n\nno declaring a variable without giving it a value.\n\nany variable can be null but it will stil have type. \n\nsome_val.type #=\u003e Num\n\nsome_val.value #=\u003e None\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frishavs%2Fnippy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frishavs%2Fnippy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frishavs%2Fnippy/lists"}