{"id":13896482,"url":"https://github.com/pallene-lang/pallene","last_synced_at":"2025-07-17T12:33:46.472Z","repository":{"id":36797175,"uuid":"135494297","full_name":"pallene-lang/pallene","owner":"pallene-lang","description":"Pallene Compiler","archived":false,"fork":false,"pushed_at":"2024-09-14T17:54:40.000Z","size":4358,"stargazers_count":678,"open_issues_count":59,"forks_count":29,"subscribers_count":23,"default_branch":"master","last_synced_at":"2024-09-15T03:28:06.337Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","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/pallene-lang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-30T20:29:23.000Z","updated_at":"2024-09-14T18:30:15.000Z","dependencies_parsed_at":"2024-04-07T22:32:11.465Z","dependency_job_id":"e7aab808-433f-4b93-a3fb-9aa07453f2ae","html_url":"https://github.com/pallene-lang/pallene","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallene-lang%2Fpallene","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallene-lang%2Fpallene/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallene-lang%2Fpallene/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallene-lang%2Fpallene/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pallene-lang","download_url":"https://codeload.github.com/pallene-lang/pallene/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226265521,"owners_count":17597222,"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":[],"created_at":"2024-08-06T18:02:57.064Z","updated_at":"2025-07-17T12:33:46.466Z","avatar_url":"https://github.com/pallene-lang.png","language":"Lua","funding_links":[],"categories":["Lua","C","Resources"],"sub_categories":["Lua 5.3"],"readme":"# Pallene\n[![Actions Status](https://github.com/pallene-lang/pallene/workflows/Github%20Actions%20CI/badge.svg)](https://github.com/pallene-lang/pallene/actions)\n\nPallene is a statically typed and ahead-of-time compiled sister language to\n[Lua](https://www.lua.org), with a focus on performance.\nIt is intended for writing performance sensitive code that interacts with\nLua, a space that is currently filled by C modules and by LuaJIT. Compared to\nC, Pallene should offer better support for interacting with Lua data types,\nbypassing the unfriendly syntax and performance overhead of the Lua-C API.\nCompared to LuaJIT, Pallene aims to offer more predictable run-time performance.\n\n## Installing Pallene\n\nPallene requires a special version of Lua, which you will need to build from source.\nYou will also need to install the Luarocks package manager.\n\n### Install the special Lua\n\nYou must download and compile the Lua from [our other repository](https://www.github.com/pallene-lang/lua-internals).\nThis version of Lua is patched to expose some additional C APIs that Pallene needs.\n\n```sh\ngit clone https://www.github.com/pallene-lang/lua-internals/\ncd lua-internals\nmake guess -j4\nsudo make install\ncd -\n```\n\nIf you are on Linux and would like the up arrow to work in the Lua REPL,\nthen run `make linux-readline` instead of `make guess`.\nAfter Lua is installed, run `lua -v` to check if you have the right version.\nIt needs to say `Lua 5.x.x with core API`.\nIf it doesn't have the \"with core API\",\nthat means you're using the default Lua instead of the special Lua.\n\n### Install Pallene Tracer\n\nFor debugging purposes, Pallene uses a tool called Pallene Tracer, which is required to trace function calls throughout\nPallene and Lua environments. You must clone and compile Pallene Tracer from its repository\n[pallene-tracer](https://github.com/pallene-lang/pallene-tracer). You need to use a specific version, `0.5.0a`.\n\n```sh\ngit clone https://www.github.com/pallene-lang/pallene-tracer --depth 1 --branch 0.5.0a\ncd pallene-tracer\nmake LUA_PREFIX=/usr/local\nsudo make install\n```\n\nHere, `LUA_PREFIX=/usr/local` is used to point to the patched Lua for Pallene.\n\n### Install Luarocks\n\nThe next step is to get the Luarocks package manager.\nBecause we built our Lua from source, we must also [build Luarocks from source](https://github.com/luarocks/luarocks/wiki/Installation-instructions-for-Unix).\nYou can't download Luarocks from your Linux distro, because that would use the wrong version of Lua.\nTo build Luarocks, unpack the sources and run `configure`, `make`, and `make install`.\nIn the configure step, use `--with-lua` to point to our special Lua.\n\n```sh\nwget https://luarocks.org/releases/luarocks-3.11.1.tar.gz\ntar xf luarocks-3.11.1.tar.gz\ncd luarocks-3.11.1\n./configure --with-lua=/usr/local\nmake\nsudo make install\ncd -\n```\n\nBy default, Luarocks installs packages into /usr/local, which requires sudo.\nIf you prefer to install to your home directory by default, enable the `local_by_default` setting.\n\n```sh\nluarocks config local_by_default true\n```\n\nRemember that in order for the local rocks tree to work, you must to set the PATH and LUA_PATH environment variables.\n\n```sh\n# Add this line to your ~/.bashrc\neval \"$(luarocks path)\"\n```\n\n### Install Pallene\n\nFinally, we can use Luarocks to build and install the Pallene compiler.\nThis will also download and install the necessary Lua libraries.\n\n```sh\nluarocks make pallene-dev-1.rockspec\n```\n\nIf you used non-standard install locations in the previous steps, you may have to specify them.\n\n```sh\nexport CPATH=/usr/local/include\nluarocks make pallene-dev-1.rockspec PTRACER_DIR=/usr/local\n```\n\nTo avoid specifying PTRACER_DIR every time you run Luarocks, you can add it to the config.\n\n```\nluarocks config PTRACER_DIR /usr/local\nluarocks make pallene-dev-1.rockspec\n```\n\n## Using Pallene\n\nTo compile a `foo.pln` file to a `foo.so` module, call `pallenec` as follows.\n\n```sh\npallenec foo.pln\n```\n\nThe resulting `foo.so` can be loaded via the usual `require` mechanism.\n\n```sh\nlua -l foo\n```\n\nIt is possible to change the compiler optimization level, for the Pallene compiler and C compiler.\nHere are some examples:\n\n```sh\n# disable Pallene optimization passes\npallenec test.pln -O0\n\n# disable C compiler optimization\nexport CFLAGS='-O0'\npallenec test.pln\n```\n\nFor more compiler options, see `./pallenec --help`\n\n## Developing Pallene\n\nIf you want to contribute to Pallene, it is helpful to know how to run our test suite\nand how to configure your text editor to preserve our style standard.\nFor all the details, please consult the [CONTRIBUTING](CONTRIBUTING.md) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpallene-lang%2Fpallene","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpallene-lang%2Fpallene","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpallene-lang%2Fpallene/lists"}