{"id":39467296,"url":"https://github.com/asegs/fever-lang","last_synced_at":"2026-01-18T04:51:16.845Z","repository":{"id":91333145,"uuid":"560667112","full_name":"asegs/fever-lang","owner":"asegs","description":"an unorthodox language that knows what you mean","archived":false,"fork":false,"pushed_at":"2025-11-19T05:22:48.000Z","size":359,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-16T00:10:09.375Z","etag":null,"topics":["interpreter","language","lisp","programming-language"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asegs.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-11-02T01:50:32.000Z","updated_at":"2025-11-19T05:22:52.000Z","dependencies_parsed_at":"2023-12-12T01:24:48.190Z","dependency_job_id":"5ae209ea-ccb3-4ed5-adce-61c08da6840d","html_url":"https://github.com/asegs/fever-lang","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/asegs/fever-lang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asegs%2Ffever-lang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asegs%2Ffever-lang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asegs%2Ffever-lang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asegs%2Ffever-lang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asegs","download_url":"https://codeload.github.com/asegs/fever-lang/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asegs%2Ffever-lang/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28530347,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"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":["interpreter","language","lisp","programming-language"],"created_at":"2026-01-18T04:51:16.228Z","updated_at":"2026-01-18T04:51:16.827Z","avatar_url":"https://github.com/asegs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"_I've got a fever of a hundred and three._\n\n[![.github/workflows/ci.yml](https://github.com/asegs/fever-lang/actions/workflows/ci.yml/badge.svg?branch=master\u0026event=push)](https://github.com/asegs/fever-lang/actions/workflows/ci.yml)\n## Fever: A Lisp From Your Wildest Dreams\n\n#### Fever is a completely new type of programming language.  It offers a glimpse into what a language unbound by convention can be.\n\n### What is it?\n\nFever is a completely from scratch programming language, not based on any other.  It's interpreted, functional, declarative, intuitive, unintuitive, and different.\nFever strives for total self-consistency.  This comes primarily at the expense of performance.\nThere is a simple type system and heavy pattern matcher which work together to perform logic on the left side of expressions.\n\nA large proportion of Fever's internals are implemented within the confines of its own type system and interpreter.\n\n### What is it for?\n\nFever is for gasping in surprise and then diabolically laughing.  It has an application for teaching programming, with its minimal and natural functional elements.\n\n### Why do you call it Fever?\n\nIt came to me in a fever dream.\n\n\n### How do I use it?\nFever tries to do exactly what you might imagine it would when you look at its code.\n\nYou can run it by cloning this repo and running `tsx Fever.ts` in the directory.  As arguments you may pass in additional Fever files to be run and loaded into scope in order, such as `tsx Fever.ts examples/std.fv`.  `ts-node` or any other Typescript runner works as well.\n\nYou can also use this web REPL, if it suits you.\nhttps://asegs.github.io/fever-lang/interactives/playground.html\n\n#### Expressions\n```js\n1 + 2 //3\n\n3 * 3 //9\n\n3 + 3 * 10 //33\n```\n\nVariables can be assigned with the `=` operator (a function).\n```js\na = 3 //3\na * 8 //24\n```\n\nYou can make lists as well.\n```js\n[1,2,3] //[1,2,3]\n1..5 //[1,2,3,4,5]\n5..3 //[5,4,3]\n[1,2,a] //[1,2,3]\n```\n\nAnd tuples.\n```js\n(1,2,3) //(1,2,3)\n(1,2,(3 + 5)) //(1,2,8)\n(\"hello\", \"world\", 10, [1,2,3], (4,5,6)) //(\"hello\", \"world\", 10, [1,2,3], (4,5,6))\n\n```\n\nYou can also make expressions which are evaluated if they have no mysteries.\n```js\n(1 + 5) //6\n(a + 5) //8\n(n + 5) // \"+(n,5)\" (this is the parsed s-expression)\n```\n\n#### Higher Order Functions\n\nYou can apply higher order functions on lists as well.\n\n```js\n[1,2,3] -\u003e (@ + 1) //[2,3,4] (@ refers to the current element)\n[1,2,3] -\u003e (@ + #) //[1,3,5] (# refers to the current index)\n[1,2,3] -\u003e (len(^)) //[0,1,2] (^ refers to the current list)\n\n[1,2,3] ~\u003e (# % 2 == 0) //[1,3] (The squiggly \"dubious arrow\" is a filter operator)\n[1,2,3] \\\u003e (0, ($ + @)) //6 (This is a reduce.  The $ is the accumulator, the 0 is the starting value)\n```\n\n#### Functions and Patterns\n\nYou can define your own functions too.\n\n```js\nadd = {a, b} =\u003e (a + b)\nadd(1,2) //3\n```\n\nYou can add types to the signature as well.\n\n```js\nadd = {a:number, b:number} =\u003e (a + b)\nadd(1,2) //3\nadd(\"hello\", \"world\") //No satisfactory match for add.\n```\n\nTypes are not strictly enforced but they are used to perform pattern matching.\n\nValues can also be used to pattern match.\n\n```js\nis_twenty? = {20} =\u003e true\nis_twenty? = {n} =\u003e false\n\nis_twenty?(20) // true\nis_twenty?(19) //false\nis_twenty?(\"hello\") //false\n```\n\nMore specific patterns will be preferred over more generic ones in order of matching.\nFunctions can be called recursively.\n```js\nfib = {0} =\u003e 0\nfib = {1} =\u003e 1\nfib = {n:number} =\u003e (fib(n-1) + fib(n-2))\n\nfib(1) //1\nfib(0) //0\nfib(2) //1\nfib(5) //5\n0..10 -\u003e (fib(@)) //[0,1,1,2,3,5,8,13,21,34,55]\nfib(-1) //Oops!\n```\n\nLet's see if we can catch that last case.\n```js\nfib = {(a \u003c 0)} =\u003e false\n```\n\nFunction signatures can also be self-referential.  For example:\n```js\nis_equal = {_,_} =\u003e false\nis_equal = {a, a} =\u003e true\nis_equal(1,2) //false\nis_equal(1,1) //true\n```\n\nThis works for expressions in signatures as well:\n```js\nis_double = {_,_} =\u003e false\nis_double = {n, (n * 2)} =\u003e true\nis_double(1,1) //false\nis_double(1,2) //true\n```\n\nPretty cool!\n\n#### Types\n\nWhile types can be inferred, Fever supports nominal typing derived from named tuples.\nYou can instantiate a type with the `new` function.\n\nGetters are also generated.\n\nIn general, if no specific method is declared for something that operates on tuples, we recursively call that method on the tuple.\n\n```js\ncoord = {x:number, y:number}\nlocation = new(coord,1,2) //(1,2)\n\nf = {_:coord} =\u003e true\nf = {_} =\u003e false\n\nf(location) //true\nf((1,2)) //false\n\nx(location) //1\ny(location) //2\n\nsecond_location = new(coord,2,4)\n\n// This is now deprecated.  You'll have to write an add function yourself.\nlocation + second_location // (3,6)\n```\n\nOne novel feature is implicit constructors.  You can define a normal signature like:\n\n```js\nset = {(unique(l)):[]}\n\nitem = new(set,[1,2,2]) //[1,2]\n```\n\nYou can see that the given expression is applied to the argument before constructing the object.\nAlso, when you define single list types like this, they will be registered not as a typed tuple but as a named list type.\n\n#### Generics\nFever supports a very simple generics implementation.  Unknown types are considered generic at function definition time.\nOnce the function is called, they are realized and assigned to that value during evaluation of that function.\nDuring invocation of the function, the generics are available as type variables.\n\n```js\ntypes_match = {a:T, b:T} =\u003e true\ntypes_match = {_,_} =\u003e false\n\ntypes_match(1,2) //true\ntypes_match(1,\"hello\") //false\n\nget_type = {_:T} =\u003e (T)\n```\n\nGenerics can occur in the same type clause.  For example:\n```js\nf = {x:(T,T)} =\u003e ...\ng = {x:(T,S,T), y:S} =\u003e ...\nh = {x:T, xs:[T]} =\u003e ...\n```\n\n#### Morphisms\n\nFever supports \"morphisms\" (loosely based on the real thing) which automatically convert types into matching ones via a predefined function if a path can be found.\nThey are registered in a global morphism table using the morph function.\n\n```js\nbool_to_int = {true} =\u003e 1\nbool_to_int = {false} =\u003e 0\n\nmorph(bool_to_int, boolean, number)\n\nf = {x:#} =\u003e (x + 1)\n\nf(true) //2\nf(false) //1\n```\n\nMorphisms are considered increasingly treacherous as they require a farther path to the given type, so a longer morphism chain is worth less in a pattern match than a short one.\n\n#### Syntax Tricks\n\nFever has a few novel syntax features.  One common one is the inclusion of non-alphanumeric characters in variables and function names.  For example:\n```js\ncontains?([1,2,3],3) //true\n+ = {a:my_type, b:my_type} =\u003e ... //overrides the add function for a given type\nquit!(code)\n```\n\nFever also supports universal function call syntax (UFCS) in which each function can be called as a method.\n```js\n[1,2,3].contains?(3) //true\n3.square() //9\n5.plus(3).times(2) //16, methods are chained sequentially\nf(x).g()\n```\n\nMethod calls effectively have the highest operator precedence and will always be grouped first, before any reordering.\n\nFever also supports whitespace-ignoring multiline functions.  The last line is returned.\n\n```js\nf = {x} =\u003e (\n    y = x * 2\n    x * y\n)\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasegs%2Ffever-lang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasegs%2Ffever-lang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasegs%2Ffever-lang/lists"}