{"id":22136022,"url":"https://github.com/mahmoudimus/lichen-lang","last_synced_at":"2025-07-29T00:33:27.443Z","repository":{"id":136719372,"uuid":"563685757","full_name":"mahmoudimus/lichen-lang","owner":"mahmoudimus","description":"mercurial-mirror: Lichen is both a Python-like language and a toolchain for that language.","archived":false,"fork":false,"pushed_at":"2022-11-09T05:38:03.000Z","size":1008,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T10:14:33.251Z","etag":null,"topics":["compiler","compilers","lichen","python","python-like"],"latest_commit_sha":null,"homepage":"https://projects.boddie.org.uk/Lichen/","language":"Python","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/mahmoudimus.png","metadata":{"files":{"readme":"README.txt","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":"2022-11-09T05:37:00.000Z","updated_at":"2023-01-26T01:23:58.000Z","dependencies_parsed_at":"2023-07-08T10:21:10.680Z","dependency_job_id":null,"html_url":"https://github.com/mahmoudimus/lichen-lang","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mahmoudimus/lichen-lang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahmoudimus%2Flichen-lang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahmoudimus%2Flichen-lang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahmoudimus%2Flichen-lang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahmoudimus%2Flichen-lang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mahmoudimus","download_url":"https://codeload.github.com/mahmoudimus/lichen-lang/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahmoudimus%2Flichen-lang/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267610405,"owners_count":24115434,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"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":["compiler","compilers","lichen","python","python-like"],"created_at":"2024-12-01T19:18:25.011Z","updated_at":"2025-07-29T00:33:27.418Z","avatar_url":"https://github.com/mahmoudimus.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Introduction\n============\n\nLichen is both a Python-like language and a toolchain for that language. The\nlanguage foregoes various dynamic aspects of Python to provide a foundation\nupon which more predictable programs can be built, while preserving essential\nfunctionality to make the core of the language seem very much \"like Python\"\n(thus yielding the name \"Lichen\"). The general syntax is largely identical to\nPython, with only certain syntactic constructs being deliberately unsupported,\nlargely because the associated features are not desired.\n\nThe toolchain employs existing tokeniser and parser software to obtain an\nabstract syntax tree which is then inspected to provide data to support\ndeductions about the structure and nature of a given program. With the\ninformation obtained from these processes, a program is then constructed,\nconsisting of a number of source files in the target compilation language\n(which is currently the C programming language). This generated program may be\ncompiled and run, hopefully producing the results intended by the source\nprogram's authors.\n\nLichen source files use the .py suffix since the language syntax is\nsuperficially compatible with Python, allowing text editors to provide\nhighlighting and editing support for Lichen programs without the need to\nreconfigure such tools. However, an alternative suffix is likely to be\nintroduced in future.\n\nGetting Started\n===============\n\nThe principal interface to the toolchain is the lplc command which can be run\non source files as in the following example:\n\nlplc tests/unicode.py\n\nThis causes the inspection of the indicated program file and all imported\nmodules, the deduction and optimisation of program information, and the\ngeneration and translation of the program to a form suitable for compilation.\nBy default, compilation is performed by invoking the widely-known make\nutility.\n\nThe results of this process are stored in the _lplc directory, with the\nexecutable program being written out as \"_main\" in the working directory\nunless the -o option is presented to lplc. For example:\n\nlplc -o unicode tests/unicode.py\n\nThe executable program here will be written out as \"unicode\" and can be run\ndirectly:\n\n./unicode\n\nSince the executable program is merely C source code and can be compiled using\na normal C compiler, it may also be compiled using a cross compiler by setting\nthe ARCH environment variable. For example:\n\nARCH=mipsel-linux-gnu lplc -o unicode tests/unicode.py\n\nThis employs a cross compiler targeting the mipsel (little-endian MIPS)\narchitecture running GNU/Linux.\n\nTest Suite\n==========\n\nA test suite is provided to exercise the toolchain and expose regressions.\nMore information is available by running the test_all.sh script with the\nappropriate option:\n\n./test_all.sh --help\n\nRunning it with the --build option should prove to be the most useful\napproach in testing code analysis and validating code generation.\n\nSource Code Overview\n====================\n\nThe source files implementing the toolchain are found in the distribution\ndirectory with .py suffixes. The lplc tool is also found in the distribution\ndirectory.\n\nThe following directories also contain source code employed by the toolchain:\n\ncompiler       - a modified version of the Python compiler package\npyparser       - a modified version of the PyPy parser package\n\nThe following directories provide tests:\n\ninternal_tests - a collection of tests exercising toolchain objects directly\ntests          - individual test programs exercising the toolchain itself\n\nThe toolchain relies on additional code when generating output programs:\n\nlib            - the standard library for Lichen programs\ntemplates      - runtime support libraries for generated programs\n\nFinally, a docs directory provides documentation about this project.\n\nContact, Copyright and Licence Information\n==========================================\n\nSee the following Web pages for more information about this work:\n\nhttp://projects.boddie.org.uk/Lichen\n\nThe author can be contacted at the following e-mail address:\n\npaul@boddie.org.uk\n\nCopyright and licence information can be found in the docs directory - see\ndocs/COPYING.txt and docs/gpl-3.0.txt for more information.\n\nGenerating the Wiki Pages\n=========================\n\nThe docs/tools/make_pages.sh script generates a page package for MoinMoin. The\nfollowing command will generate a page package called pages.zip using the\npages directory for staging, with Lichen as the page prefix:\n\ndocs/tools/make_pages.sh pages Lichen\n\nMake sure to include the page prefix where the pages are being deployed in a\nwiki with other content at the top level.\n\nCurrently, the wiki pages require the following extensions:\n\nImprovedTableParser     https://moinmo.in/ParserMarket/ImprovedTableParser\n\nMoinSupport             http://hgweb.boddie.org.uk/MoinSupport\n\nGraphvizParser          https://moinmo.in/ParserMarket/graphviz\n\nThe GraphvizParser requires diagram-tools for the notugly.xsl stylesheet,\nalthough a copy of the stylesheet is provided in the GraphvizParser\ndistribution for convenience.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahmoudimus%2Flichen-lang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmahmoudimus%2Flichen-lang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahmoudimus%2Flichen-lang/lists"}