{"id":21543053,"url":"https://github.com/adamsol/pyxell","last_synced_at":"2025-04-10T04:38:09.494Z","repository":{"id":50143727,"uuid":"145288633","full_name":"adamsol/Pyxell","owner":"adamsol","description":"Multi-paradigm programming language compiled to C++, written in Python.","archived":false,"fork":false,"pushed_at":"2023-08-27T20:51:57.000Z","size":3404,"stargazers_count":56,"open_issues_count":5,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T05:51:59.901Z","etag":null,"topics":["compiler","cpp","generators","indentation","parser","programming-language","python","rational-numbers","syntax"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adamsol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-08-19T09:12:28.000Z","updated_at":"2025-01-06T06:39:18.000Z","dependencies_parsed_at":"2024-01-18T23:09:34.099Z","dependency_job_id":"99ea7eba-8cb6-4f61-b39d-05f68888dd04","html_url":"https://github.com/adamsol/Pyxell","commit_stats":null,"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamsol%2FPyxell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamsol%2FPyxell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamsol%2FPyxell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamsol%2FPyxell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamsol","download_url":"https://codeload.github.com/adamsol/Pyxell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248159783,"owners_count":21057385,"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":["compiler","cpp","generators","indentation","parser","programming-language","python","rational-numbers","syntax"],"created_at":"2024-11-24T05:12:43.838Z","updated_at":"2025-04-10T04:38:09.476Z","avatar_url":"https://github.com/adamsol.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Pyxell\n======\n\n### Clean and easy-to-use multi-paradigm programming language with static typing. ###\n\n\nDocumentation\n-------------\n\n* [Manual](docs/manual.md)\n* [Examples](docs/manual.md#examples)\n* [Specification](docs/specification.md)\n* [Why Pyxell?](docs/why-pyxell.md)\n\n\nMotivation\n----------\n\nPyxell [_pixel_] aims to combine the best features of different programming languages,\npack them into a clean and consistent syntax,\nand provide the execution speed of native machine code.\n\nIt draws mainly from Python, C++, C#, and Haskell,\ntrying to avoid common design flaws that have been nicely described\n[in this blog post](https://eev.ee/blog/2016/12/01/lets-stop-copying-c/).\n\n\nFeatures\n--------\n\n* Indentation-based syntax\n* Strongly static typing with partial type inference\n* 64-bit integers and double-precision floating-point numbers\n* Arbitrary-precision rational numbers\n* Immutable strings\n* String interpolation\n* Mutable containers: array, set, dictionary\n* Array/string slicing\n* Complex for-loops with ranges, steps, and zipping\n* Array/set/dictionary comprehension\n* Native tuples\n* First-class functions\n* Default, named, and variadic function arguments\n* Lambda expressions\n* Generic functions\n* Generators\n* Classes with safe references\n* Inheritance and virtual methods\n* Nullable types\n* Full transpilation to C++ and compilation to machine code\n* Automatic memory management (utilizing C++'s smart pointers)\n\nTo do:\n\n* Exception handling\n* Static class fields and methods\n* Complex numbers\n* Unicode support\n* Module system\n* Multiple inheritance\n* Generic classes\n* Operator overloading\n* Asynchronous programming\n\n\nDependencies\n------------\n\n* Python 3.6+\n\n* C++17 compiler: GCC 7+ or Clang 5+\n\n\nUsage\n-----\n\n```\npython pyxell.py program.px\n```\n\nIf the program is valid, `program.cpp` file and `program.exe` executable will be created in the same folder,\nand it will be automatically executed (unless you add the `-n` flag).\nOtherwise, errors will be displayed, pointing to the erroneous code location.\n\nBy default, `gcc` command is used to compile the code.\nYou can pick a different compiler using the `-c` parameter.\n\nThe executable is not optimized by default.\nYou can set an optimization level with the `-O` parameter, e.g. `-O2`.\nThis will make the program run faster, but also make the compilation slower.\n\nIn order to speed up the compilation, you can precompile the C++ header (`lib/base.hpp`) by first running the script with the `-p` flag.\nNote that the precompiled header is compatible only with the same C++ compiler, optimization level, and Pyxell version.\n\nUse `-s` to skip the compilation step and obtain transpiled C++ code with all headers included,\nready for manual compilation (with `-std=c++17`).\n\nTo see all command line options, use `-h`.\n\n\nTesting\n-------\n\n```\npip install -r test/requirements.txt\npython test.py\n```\n\nTests are divided into good (supposed to compile and run properly) and bad (should throw compilation errors).\n\nBy default, the whole C++ code for valid tests is merged, so that only one file is compiled,\nwhich is faster than compiling hundreds of files individually, even using multiple threads.\nTotal execution time (with default settings) should be around 30-60 seconds.\n\nIf, however, the script fails with an error like this: `too many sections` / `file too big`\n(seen with GCC 7.2 on Windows), or there is another compilation error that is hard to decipher,\nthen you might need to add the `-s` flag so that each test is compiled separately.\n\nYou can pass a path pattern to run only selected tests (e.g. `python test.py arrays`).\n\n\nDocumentation\n-------------\n\nTo build the documentation from source, go to the `docs` folder, run `npm install`, then `make`.\nTo start a documentation server locally, run `pip install -r requirements.txt` and `python server.py` in the same folder.\n\n\nPyInstaller\n-----------\n\nYou can build a standalone compiler application using `PyInstaller`.\nInstall `PyInstaller` with `pip`, then run `make exe`.\nAn executable (not requiring Python to run) will be created in the `dist/pyxell` folder.\n\n\nAlternatives\n------------\n\nThere are only a few languages with indentation-based syntax.\nSome more or less similar to Pyxell are, in alphabetical order:\n* [Boo](https://boo-language.github.io/) (based on .NET),\n* [CoffeeScript](https://coffeescript.org/) (transpiled to JS),\n* [F#](https://fsharp.org/) (functional, based on .NET),\n* [Genie](https://wiki.gnome.org/Projects/Genie) (compiled via C),\n* [Haskell](https://www.haskell.org/) (functional, compiled),\n* [Nim](https://nim-lang.org/) (compiled via C/C++ or transpiled to JS),\n* [Python](https://www.python.org/) (dynamically typed).\n\n\nHistory\n-------\n\n* The project was originaly written in Haskell, with BNFC as the parser generator, and used LLVM as the target language.\n* In version 0.7.0, the code was rewritten to Python, with ANTLR as the parser generator.\n* In version 0.9.0, the project was refactored to use C++ as the target language.\n* In version 0.12.0, a new parser was implemented to replace the one generated by ANTLR (due to performance reasons).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamsol%2Fpyxell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamsol%2Fpyxell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamsol%2Fpyxell/lists"}