{"id":15402408,"url":"https://github.com/pirj/l","last_synced_at":"2026-03-19T09:16:36.784Z","repository":{"id":66314131,"uuid":"349568200","full_name":"pirj/l","owner":"pirj","description":"L programming language","archived":false,"fork":false,"pushed_at":"2023-11-25T20:20:03.000Z","size":119,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-24T05:29:52.630Z","etag":null,"topics":["l"],"latest_commit_sha":null,"homepage":"","language":"Roff","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/pirj.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}},"created_at":"2021-03-19T22:15:27.000Z","updated_at":"2023-11-25T20:20:58.000Z","dependencies_parsed_at":"2023-11-25T21:25:04.921Z","dependency_job_id":"41641a85-3395-4003-aa68-049fbbf51bc0","html_url":"https://github.com/pirj/l","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pirj/l","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirj%2Fl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirj%2Fl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirj%2Fl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirj%2Fl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pirj","download_url":"https://codeload.github.com/pirj/l/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirj%2Fl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29988054,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T22:42:38.399Z","status":"ssl_error","status_checked_at":"2026-03-01T22:41:51.863Z","response_time":124,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["l"],"created_at":"2024-10-01T16:03:05.048Z","updated_at":"2026-03-02T00:33:22.332Z","avatar_url":"https://github.com/pirj.png","language":"Roff","funding_links":[],"categories":[],"sub_categories":[],"readme":"# L programming language\n\nWelcome to L\n\n## What is L?\n\nL is a new programming language. It is:\n - simple, easy to read (when you dig it)\n - concise, easy to type\n\n## Inspiration Sources\n\n[Factor](https://factorcode.org/), [Forth](https://en.wikipedia.org/wiki/Forth_(programming_language)), [Lisp](https://en.wikipedia.org/wiki/Lisp_(programming_language)), [Clojure](https://clojure.org/about/rationale), [Erlang](https://rvirding.blogspot.com/2019/01/the-erlang-rationale.html), [Python](https://en.m.wikipedia.org/wiki/Zen_of_Python), Paul Graham's work on [Arc](http://www.paulgraham.com/lisp.html), partially by [Ruby](https://www.ruby-lang.org/) and [Crystal](https://crystal-lang.org/), and lately [RetroForth](http://retroforth.org) and [Koka](https://koka-lang.github.io/koka).\n\n\u003e One reason Lisp cores evolve so slowly is that we get used to them. You start to think in the operators that already exist. It takes a conscious effort to imagine how your code might be rewritten using operators that don't. -- Paul Graham\n\n\u003e Making things easy to do is a false economy. Focus on making things easy to understand and the rest will follow. -- Peter Bourgon\n\n## Sneak Peek\n\nStraight to the code!\n\n```\n5 puts\n```\n\nFeels a bit backwards? It is, but it is always the way the computer runs it anyway.\nWhen you'll get used to it, you will never have to think what evaluates first again:\n\nRuby:\n```ruby\nputs File.read(gets.chomp)\n```\nin that order: `gets` -\u003e `chomp` -\u003e `File.read` -\u003e `puts`\n\nL:\n```\ngets chomp file:read puts\n```\n\n## Building Blocks\n\nWord, a named function:\n```\nrecent-emails\n```\n\nLiteral:\n```\n1\n'hello'\n6.626\n```\n\nQuote, an anonymous function, a value denoting a snippet of code:\n```\n[ 3 + ]\n```\n\nOne-word quote, can be used as a unique value:\n```\n'album\n```\n\nor as a singleton if a correspondingly named function exists:\n```\n'false\n```\nit is equal to itself only.\n\n### Reuse\n\nFunctions and methods most probably sound familiar to you. L is not exception to that.\n\nQuotes can be associated with a word.\nFirst comes quoted word that serves as a function handle, then the quote the function implementation, and a `def` to associate the two:\n```\n'multiply-by-two [ 2 * ] def\n```\n\nIt can be used right away, pass it a `5` as input, tell it to print the result, and, to no surprise, this prints `10`:\n```\n5 multiply-by-two puts\n```\n\n### Data Structures (not implemented yet)\n\nYou can build nearly anything using a list: hash maps, trees.\n```\n[\n  [ 'name 'Bob' ]\n  [ 'surname 'Bean' ]\n]\n\n'surname of  = \u003e 'Bean'\n```\n\nOr define a blueprint:\n```\n'person [\n  'name\n  'surname\n  optional 'age\n] blueprint\n\n'person 'full-name [ [ name ' ' surname ] join ] def-method\n\n[ 'Bob' 'Bean' ] 'person new\n\n'full-name of puts  = \u003e 'Bob Bean'\n```\n\n## Running\n\nInstall Ruby.\n\nRun the test suite:\n```\nruby naive-interpreter.rb tests/all.l\n```\n\nRun REPL:\n```\nruby naive-interpreter.rb repl.l\n```\n\n## Learn\n\nNo learning resources for a language that young exist (~it's just one day old!~).\nArticles about concatenative languages should get you going:\n\nhttps://github.com/andreaferretti/factor-tutorial\nhttps://evincarofautumn.blogspot.com/2012/02/why-concatenative-programming-matters.html\n\n## Status\n\nWork in progress. The current lexer/parser/interpreter are written in Ruby.\n\nShort-term plans:\n - [x] parsing of simplified form for single-word quotes `'square`\n - [ ] add error traces\n - [ ] bootstrap so L can interpret itself\n - [ ] settle on a set of base functions\n\n## Design Decisions\n\nConcatenative, Reverse Polish Notation (vs parenthesis).\n\nHomoiconicity, code is data.\n\nNames and special characters:\n - hyphen vs underscore in names (`paint-green`)\n - lower-case (`president-of-united-world`)\n - single-quote (`'hello, united world!'`, `divide 'conquer each`)\n - equals sign for comments (`1 puts  = this outputs '1' to the standard output`)\n - square brackets (`[ spare-your-pinkies ]`)\n - question mark for words with a boolean result (`pick-apple yellow? 'eat if`)\n\nNo special syntax if possible, e.g. no symbols (a one-word quote is identical to itself).\n\nParsing words vs compile-time inlining. Due to homoiconicity, it is impossible to tell if a quote will be evaluated or used as a data structure:\n```\n[ 1 1 + ] call  = 2\n= vs\n[ 1 1 + ] [ 1 ] compose = [ 1 1 + 1 ]\n```\n\nA parsing word would run during parsing, and can specify inlining and any other code transformation before execution.\n```\n'two [ 1 1 + ] \\inline def\n= transformed to just:\n'two [ 2 ] def\n\n= or\n'red [ f00 \\rgb ] def\n= transformed to:\n'red [ '#FF0000' ] def\n```\n\n## License\n\nCopyright 2021 Phil Pirozhkov\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this software except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirj%2Fl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpirj%2Fl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirj%2Fl/lists"}