{"id":18641728,"url":"https://github.com/honza/inertia","last_synced_at":"2025-04-11T11:30:34.225Z","repository":{"id":8432113,"uuid":"10021056","full_name":"honza/inertia","owner":"honza","description":"A Lisp to Javascript compiler","archived":false,"fork":false,"pushed_at":"2016-08-09T10:22:35.000Z","size":59,"stargazers_count":79,"open_issues_count":0,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-04-16T01:44:54.646Z","etag":null,"topics":["compiler","javascript","lisp"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/honza.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}},"created_at":"2013-05-12T23:20:48.000Z","updated_at":"2023-08-28T14:53:02.000Z","dependencies_parsed_at":"2022-09-14T08:51:04.976Z","dependency_job_id":null,"html_url":"https://github.com/honza/inertia","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honza%2Finertia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honza%2Finertia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honza%2Finertia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honza%2Finertia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/honza","download_url":"https://codeload.github.com/honza/inertia/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223466481,"owners_count":17149774,"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","javascript","lisp"],"created_at":"2024-11-07T05:59:51.068Z","updated_at":"2024-11-07T05:59:51.542Z","avatar_url":"https://github.com/honza.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"inertia\n=======\n\n[![Build Status](https://travis-ci.org/honza/inertia.svg?branch=master)](https://travis-ci.org/honza/inertia)\n\nA LISP to Javascript compiler.\n\n*work in progress*\n\n*a learning exercise*\n\nRead the [accompanying blog post][4].\n\n\nHow it works\n------------\n\nIt uses [PEG.js][1] to parse the source to a [Parser API][2] compatible AST.\nThe AST is then transformed to Javascript via [escodegen][3].\n\nIt can optionally compress the output via Uglify.\n\nExample\n-------\n\nSource:\n\n```clojure\n(def name \"honza\")\n\n(def greet\n  (fn [name]\n    (console.log \"hey\" name)))\n\n(greet name)\n```\n\nOutput:\n\n```js\nvar name = 'honza';\nvar greet = function (name) {\n    return console.log('hey', name);\n};\ngreet(name);\n```\n\nUsage\n-----\n\n    Usage: inertia [options] \u003cfile...\u003e\n\n    Options:\n\n        -h, --help           output usage information\n        -V, --version        output the version number\n        -t, --ast            Print the AST\n        -o, --output [file]  Redirect output to file\n        -c, --compress       Minify with uglify\n\nYou can use the Makefile to install the dependencies:\n\n    $ make install\n\nOr to build the compiler:\n\n    $ make\n\nOr to build all the examples:\n\n    $ make example\n\n\nWhat works\n----------\n\n* `def`\n* `list`\n* `+`, `-`, `*`, `/`, `=`, `!=`, `\u003c`, `\u003e`, `\u003c=`, `\u003e=`\n* `if`\n* `(fn [] ...)`\n* `{}`, `{\"name\" \"honza\"}`\n* comments `;;`\n* `let`\n\nStandard library\n----------------\n\n* nth\n* first\n* rest\n* second\n* last\n* partition\n* cons\n* conj\n* get\n* map\n* filter\n* update (update a key in a map `(update obj key value)`)\n\n**Note**: The standard library functions are modelled after Clojure.\n\n### `join`\n\njoin two strings\n\n### `expose`\n\nexport a name in a module\n\n```clojure\n(expose \"name\" name)\n```\n\nwill compile to\n\n```js\nmodule.exports['name'] = name;\n```\n\nTODO\n----\n\n* Macro support\n\nLicense\n-------\n\nBSD, short and sweet\n\nFeedback\n--------\n\nAll feedback is most welcome.  Open an issue for any purpose.\n\n[1]: http://pegjs.majda.cz/\n[2]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API\n[3]: https://github.com/Constellation/escodegen\n[4]: http://honza.ca/2013/05/building-a-lisp-to-javascript-compiler\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhonza%2Finertia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhonza%2Finertia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhonza%2Finertia/lists"}