{"id":15608741,"url":"https://github.com/hypercubed/f-flat_node","last_synced_at":"2025-04-28T11:46:55.039Z","repository":{"id":3508814,"uuid":"49807330","full_name":"Hypercubed/f-flat_node","owner":"Hypercubed","description":"F♭ (pronounced F-flat) is a toy language.","archived":false,"fork":false,"pushed_at":"2023-01-04T21:37:49.000Z","size":2458,"stargazers_count":25,"open_issues_count":20,"forks_count":4,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-24T05:47:28.793Z","etag":null,"topics":["complex-numbers","con","concatenative-language","programming-language","stack","toy-language"],"latest_commit_sha":null,"homepage":"http://hypercubed.github.io/f-flat_node/","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/Hypercubed.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}},"created_at":"2016-01-17T07:19:50.000Z","updated_at":"2024-07-12T20:33:49.000Z","dependencies_parsed_at":"2023-01-13T12:33:51.286Z","dependency_job_id":null,"html_url":"https://github.com/Hypercubed/f-flat_node","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hypercubed%2Ff-flat_node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hypercubed%2Ff-flat_node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hypercubed%2Ff-flat_node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hypercubed%2Ff-flat_node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hypercubed","download_url":"https://codeload.github.com/Hypercubed/f-flat_node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251309531,"owners_count":21568844,"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":["complex-numbers","con","concatenative-language","programming-language","stack","toy-language"],"created_at":"2024-10-03T05:22:04.312Z","updated_at":"2025-04-28T11:46:54.994Z","avatar_url":"https://github.com/Hypercubed.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# F♭\n\nF♭ (pronounced F-flat) is a toy language.\n\nF♭ is a dynamically typed array-oriented concatenative language like Forth, Joy, and [others](http://www.concatenative.org/). F♭ is meant to be used interactively, for example in a CLI REPL, like R or the command shell, or in a stack based calculator.  This constraint dictates many of the language features.\n\n## Features\n\n### Flat functional [concatenative language](http://concatenative.org/wiki/view/Front%20Page)\n\n### Stack based\n\n### RPN\n\n### Dynamic Types\n\n### Arbitrary-precision decimal and complex number type.\n\n### JSON format is a valid f-flat programs.\n\n## Why?\n\n* Designing a programming language in another language is a great way to learn about programming languages in general and the host language in particular.\n\n* Concatenative languages, with inherent functional composition, are a great way to explore functional programming and mathematics.  Higher order functions (including math functions) are composed of smaller functions.\n\n* Because 0.1 + 0.2 = 0.3 and sqrt of -1 is not \"not a number\".\n\n## Example\n\n[![asciicast](https://asciinema.org/a/39282.png)](https://asciinema.org/a/39282)\n\n```forth\nWelcome to F♭ REPL Interpreter\nF♭ Version 0.0.0 (C) 2000-2017 J. Harshbarger\n\nf♭\u003e 0.1 0.2 +\n[ 0.3 ]\n\nf♭\u003e 0.3 =\n[ true ]\n\nf♭\u003e clr\n[]\n\nf♭\u003e -1 sqrt\n[ 0+1i ]\n\nf♭\u003e 1 atan 4 *\n[ 0+1i, 3.1415926535897932385 ]\n\nf♭\u003e * exp\n[ -1-3.7356616720497115803e-20i ]\n\nf♭\u003e abs\n[ 1 ]\n\nf♭\u003e clr\n[]\n\nf♭\u003e \"mersenne?\" [ 2 swap ^ 1 - prime? ] ;\n[]\n\nf♭\u003e 10 integers\n[ [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] ]\n\nf♭\u003e [ mersenne? ] map\n[ [ true, true, true, false, true, false, true, false, false, false ] ]\n\nf♭\u003e clr\n[]\n\nf♭\u003e 1000 !\n[ 4.0238726007709377384e+2567 ]\n\nf♭\u003e clr\n[]\n\nf♭\u003e i !\n[ 0.49801566811835599106-0.15494982830181068731i ]\n\nf♭\u003e { first: \"Manfred\" }\n[ { first: 'Manfred' } ]\n\nf♭\u003e { last: 'von Thun' }\n[ { first: 'Manfred' }, { last: 'von Thun' } ]\n\nf♭\u003e +\n[ { first: 'Manfred', last: 'von Thun' } ]\n\nf♭\u003e clr\n[  ]\n\nf♭\u003e [ 1 2 3 ]\n[ [ 1 2 3 ] ]\n\nf♭\u003e dup\n[ [ 1 2 3 ] [ 1 2 3 ] ]\n\nf♭\u003e [ 2 * ]\n[ [ 1 2 3 ] [ 1 2 3 ] [ 2 * ] ]\n\nf♭\u003e map\n[ [ 1 2 3 ] [ 2 4 6 ] ]\n\nf♭\u003e +\n[ [ 1 2 3 2 4 6 ] ]\n\nf♭\u003e +\n[ [ 1 2 3 2 4 6 ] ]\n\nf♭\u003e clr\n[  ]\n\nf♭\u003e dbl-sqr-cat: [ dup [ 2 * ] map + ] ;\n[  ]\n\nf♭\u003e [ 1 2 3 ]\n[ [ 1 2 3 ] ]\n\nf♭\u003e  dbl-sqr-cat\n[ [ 1 2 3 2 4 6 ] ]\n\nf♭\u003e 'dbl-sqr-cat' see\n[ '[ dup [ 2 * ] map + ]' ]\n\nf♭\u003e drop\n[  ]\n\nf♭\u003e dbl-sqr-cat: expand\n[ dup,2,*,*,Symbol((),swap,eval,dequote,+ ]\n\n```\n\nSee other examples and guides [here](./docs/).\n\n## Project Goals\n\n* conceptually simple\n* interactive first\n  * minimal hidden state\n  * easy to type and read\n  * reads left to right, top to bottom\n  * whitespace not significant syntax\n  * no lambdas/parameters\n  * interactive development\n  * case insensitive\n* flat concatenative language\n  * name code not values\n  * multiple return values\n  * concatenation is composition/pipeline style\n  * no unnecessary parentheses\n* no surprises\n  * immutable data\n  * arbitrary-precision decimal and complex numbers\n  * percent values\n  * both double and single quotes\n  * returns error objects (TBD)\n* pure functions\n* host language interface (TBD)\n* session saving (TBD)\n  * undo/redo\n  * state is serializable (TBD)\n* modules, namespaces, and \"closures\"\n\n## Influences\n\n* [Many concatenative languages](http://concatenative.org/wiki/view/Front%20Page) (HP RPL, Forth, Joy, Factor, XY)\n* Haskell\n* JavaScript\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypercubed%2Ff-flat_node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhypercubed%2Ff-flat_node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypercubed%2Ff-flat_node/lists"}