{"id":21454920,"url":"https://github.com/shurko0x4cfd/fsml","last_synced_at":"2026-01-23T00:28:33.972Z","repository":{"id":57242477,"uuid":"407270384","full_name":"shurko0x4cfd/FSML","owner":"shurko0x4cfd","description":"Homoiconic postfix concatenative programming language","archived":false,"fork":false,"pushed_at":"2023-11-14T12:04:09.000Z","size":408,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"unstable","last_synced_at":"2024-03-23T01:21:06.571Z","etag":null,"topics":["concatenative","homoiconic","point-free","postfix","postfix-notation","stack","tacit","transpile"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shurko0x4cfd.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}},"created_at":"2021-09-16T18:17:12.000Z","updated_at":"2024-03-12T20:22:43.000Z","dependencies_parsed_at":"2023-11-14T13:25:43.484Z","dependency_job_id":"a966bf50-7610-4b9a-b37a-e7efbc9a7737","html_url":"https://github.com/shurko0x4cfd/FSML","commit_stats":{"total_commits":36,"total_committers":2,"mean_commits":18.0,"dds":0.2222222222222222,"last_synced_commit":"2cb8cdc2ae498c9e0b3014bafd2a6c3354c3d706"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shurko0x4cfd%2FFSML","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shurko0x4cfd%2FFSML/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shurko0x4cfd%2FFSML/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shurko0x4cfd%2FFSML/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shurko0x4cfd","download_url":"https://codeload.github.com/shurko0x4cfd/FSML/tar.gz/refs/heads/unstable","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250240508,"owners_count":21397834,"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":["concatenative","homoiconic","point-free","postfix","postfix-notation","stack","tacit","transpile"],"created_at":"2024-11-23T05:09:41.297Z","updated_at":"2026-01-23T00:28:33.962Z","avatar_url":"https://github.com/shurko0x4cfd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FSML\n**Kawaii homoiconic postfix concatenative programming language**\n\nFSML is Forth/Factor-like programming language and transpiller for. Now in infancy. Language expected to be mainly procedural with wide functional style support. Intended mainly to static compilation to othes high-level languages. First to JavaScript, then to others on my choose. Then I hope add interpretation abilities for dialog work.\n\nStack is abstraction of compile time. Compiler \\[should\\] produce code with munimal runtime overhead. With no any virtual machine. With no any byte code or threaded code. With no any stack or stack juggling at run time. Look, text `1 2 3 swap drop +` compiled to JS code `var subex_0 = 1 + 3;` You see no any stack or stack manipulation in produced code, no interpretation at run time, hence no overhead.\n\nLanguage planed to be mainly lightweight, easy and portable frontend for target languages. It's what CoffeeScript for JavaScript.\n\nCurrently implemented quotations. Among control statements implemented 'if' and 'while' statement. Othes control statements not implemented yet.\n\nREPL environment currently not provide interpretation abilities, only manual control of step-by-step compilation process. After every **enter** hint system type stack from left window margin to right from top of stack to bottom separated by separator like ' -\u003e ' or ' | ' or ', ' or so. Arrow show direction to stack bottom. Stack items is expressions (in form of abstract tree inside system) which keep all history of operations on. Stack items is printed as infix expressions of target language.\n\nFeatures:\n\n* Stacks and quotations are the same thing. At time '\\[' occur, current stacks id keep in stacks chain, new empty stack allocated and established as current. At time '\\]' occur, id of current (nested) quotation/stack placed on top of embrace (previous) stack and previous stack established as current again. For example text `12 34 [ 56 78 ]` leave stack Quot -\u003e 34 -\u003e 12, where Quot is pointer to stack/quotation which contain elements 78 -\u003e 56.\n\n* Operations on empty stack allowed! It produce expressions with variables. Enclose it in brackets produce quotation. Text `1 2 [ [ + ] apply ] apply` also work as well as `1 2 [ + ] apply`.\n\n* Objects duplicated with classic Forth words as dup, over, etc accessible by reference not by value! Need 'ind' to detach stack item and some time 'dc' to deep copy of object which stack item refer to. Apply quotation on current stack convert this quotation and current stack to bunch of expressions of current stack which is quotation per se. It is not obligate expressions with variables. Although if arguments of quotation contain variables itself or just not enough arguments for quotation in current stack then 'apply' produce expressions with variables. Need use 'dc' on copy of quotation for keep original quotation for use late. Otherwise any 'apply' occured transform it in itself distinctive manner.\n\n1. From under the node just run `fsml` in the shell, if installed globally `sudo npm i -g fsmlang`. Or run `node dist/fsml.js`\n\n2. Run in browser from under the local server with the root in \"./simple sample browser console\".\n\n3. Or run [FSML playground](https://fsml.pages.dev). If unreachable try vpn.\n\nCommand line starts with '\u003e ' or 'fsml \u003e ' or 'fsml\u003e '. Almost no error handling yet. On error system often crush and require reload of page. Open browsers console to track it.\n\n\nExample of transpiling to JS with '.js' :\n\n```forth\n12 34 + 56 78 -\n\n\\ [2]  56 - 78 -\u003e 12 + 34\n\n.js\n\n\\ var subex_2 = 12 + 34;\n\\ var subex_3 = 56 - 78;\n```\n\n\nExample of JS evaluation with '.eval' :\n\n```forth\nas df + 56 78 -\n\n\\ [2]  56 - 78 -\u003e \"as\" + \"df\"\n\n.eval\n\n\\ evaluated stack: [ -22, asdf ]\n```\n\n\nExample of limited conversion of expression on top of the stack to an anonymous oneliner procedure with 'ol' :\n\n```forth\n+ * ol\n\n\\ [1]  (var_2, var_3, var_4) =\u003e var_4 * (var_3 + var_2)\n```\n\n\nExample of defining an anonymous procedure and assigning it to the variable 'mul' with '!' :\n\n```forth\n* ol mul !    .js\n\n\\ var mul = (var_0, var_1) =\u003e var_1 * var_0;\n```\n\nExample of computing factorial of 12 in functional manner with 'if', '1range' and '1fold' :\n\n```forth\n* ol mul !\n12 dup [ 1 1range mul @ 1fold ] [ 0 ] if .eval\n\n\\ evaluated stack: [479001600]\n```\n\nExample of computing factorial of 12 in procedural manner with 'if' and 'while' :\n\n```forth\n12 dup [ 1 [ over * over 1 - ] while swap dp ] [ 0 ] if .eval\n\n\\ evaluated stack: [479001600]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshurko0x4cfd%2Ffsml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshurko0x4cfd%2Ffsml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshurko0x4cfd%2Ffsml/lists"}