{"id":16701408,"url":"https://github.com/deadtrickster/smerl","last_synced_at":"2025-03-21T19:33:14.418Z","repository":{"id":57549603,"uuid":"76116434","full_name":"deadtrickster/smerl","owner":"deadtrickster","description":"Simple Metaprogramming for Erlang","archived":false,"fork":false,"pushed_at":"2016-12-11T08:27:53.000Z","size":2055,"stargazers_count":20,"open_issues_count":5,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-18T04:42:44.283Z","etag":null,"topics":["erlang"],"latest_commit_sha":null,"homepage":null,"language":"Erlang","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/deadtrickster.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":"2016-12-10T14:10:08.000Z","updated_at":"2024-02-10T00:34:02.000Z","dependencies_parsed_at":"2022-08-27T01:40:29.875Z","dependency_job_id":null,"html_url":"https://github.com/deadtrickster/smerl","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/deadtrickster%2Fsmerl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadtrickster%2Fsmerl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadtrickster%2Fsmerl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadtrickster%2Fsmerl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deadtrickster","download_url":"https://codeload.github.com/deadtrickster/smerl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244855713,"owners_count":20521691,"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":["erlang"],"created_at":"2024-10-12T18:43:56.945Z","updated_at":"2025-03-21T19:33:13.568Z","avatar_url":"https://github.com/deadtrickster.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# Smerl #\n\nCopyright (c) 2006-2007, 2016 AUTHORS\n\n__Version:__ 0.0.1\n\n[![Hex.pm][Hex badge]][Hex link]\n[![Hex.pm Downloads][Hex downloads badge]][Hex link]\n[![Build Status][Travis badge]][Travis link]\n[![Coverage Status][Coveralls badge]][Coveralls link]\n\n*\u003cb\u003eS\u003c/b\u003eimple \u003cb\u003eM\u003c/b\u003eetaprogramming for \u003cb\u003eErl\u003c/b\u003eang*\n\n*Smerl* is an Erlang library that simplifies the creation and manipulation of\nErlang modules at runtime, using Erlang's capabilities for hot code swapping and\nabstract syntax tree transformations to do its magic.\n\nNew functions can be expressed either as strings of Erlang code or as abstract\nforms.\n\nFor more information, read\nthe [Abstract Format section in the ERTS User's guide][Abstract Format].\n\n## Origins\n\n*Smerl* was inspired by the [`rdbms_codegen`][] module in the [RDBMS][]\napplication (part of [Jungerl][]) written by [Ulf Wiger][].\n\nThe [`smerl`][] module was extracted from the abandoned [ErlyWeb][]\nand patches from [ErlyWeb forks][].\n\n## Examples\n\nDefine a module `foo`:\n\n\u003cpre lang=\"erlang\"\u003e\nM1 = smerl:new(foo).\n\u003c/pre\u003e\n\nDefine a function `foo:bar/0` using a string of Erlang code:\n\n\u003cpre lang=\"erlang\"\u003e\n{ok, M2} = smerl:add_func(M1, \"bar() -\u003e 1 + 1.\").\n\u003c/pre\u003e\n\n... or using the Erlang Abstract Format:\n\n\u003cpre lang=\"erlang\"\u003e\n{ok, M2} = smerl:add_func(M1, {function, 1, bar, 0,\n                               [{clause, 1, [], [],\n                                [{op, 1, '+',\n                                 {integer, 1, 1},\n                                 {integer, 1, 1}}]}]}).\n\u003c/pre\u003e\n\n*The abstract format may look more verbose in this example,\nbut it's also easier to manipulate in code.*\n\nCompile the `foo` module and confirm the expected results:\n\n\u003cpre lang=\"erlang\"\u003e\nsmerl:compile(M2),\nfoo:bar(),                                      % returns 2\nsmerl:has_func(M2, bar, 0).                     % returns true\n\u003c/pre\u003e\n\n## Contributing\n\nSection order:\n\n- Types\n- Macros\n- Callbacks\n- Public API\n- Deprecations\n- Private Parts\n\nInstall the `git` pre-commit hook:\n\n\u003cpre lang=\"bash\"\u003e\n./bin/pre-commit.sh install\n\u003c/pre\u003e\n\nThe pre-commit check can be skipped by passing `--no-verify` to `git commit`.\n\n## AUTHORS\n\nSee the [AUTHORS][] file.\n\n## License\n\n*Smerl* is licensed under [The MIT License][LICENSE].\n\n\u003c!-- Named Links --\u003e\n\n[Hex badge]: https://img.shields.io/hexpm/v/smerl.svg?maxAge=2592000?style=plastic\n[Hex link]: https://hex.pm/packages/smerl\n[Hex downloads badge]: https://img.shields.io/hexpm/dt/smerl.svg?maxAge=2592000\n[Travis badge]: https://travis-ci.org/deadtrickster/smerl.svg?branch=master\n[Travis link]: https://travis-ci.org/deadtrickster/smerl\n[Coveralls badge]: https://coveralls.io/repos/github/deadtrickster/smerl/badge.svg?branch=master\n[Coveralls link]: https://coveralls.io/github/deadtrickster/smerl?branch=master\n[Erlyweb]: https://github.com/yariv/erlyweb\n[Abstract Format]: http://erlang.org/doc/doc-5.5/erts-5.5/doc/html/absform.html#4\n[`rdbms_codegen`]: https://github.com/yurrriq/jungerl/blob/master/lib/rdbms/src/rdbms_codegen.erl\n[RDBMS]: https://github.com/yurrriq/jungerl/tree/master/lib/rdbms\n[Jungerl]: https://github.com/yurrriq/jungerl\n[Ulf Wiger]: https://github.com/uwiger\n[`smerl`]: ./src/smerl.erl\n[Erlyweb forks]: https://github.com/yariv/erlyweb/network\n[AUTHORS]: https://github.com/deadtrickster/smerl/blob/master/doc/AUTHORS.md\n[LICENSE]: https://github.com/deadtrickster/smerl/blob/master/LICENSE\n\n\n## Modules ##\n\n\n\u003ctable width=\"100%\" border=\"0\" summary=\"list of modules\"\u003e\n\u003ctr\u003e\u003ctd\u003e\u003ca href=\"https://github.com/deadtrickster/smerl/blob/master/doc/smerl.md\" class=\"module\"\u003esmerl\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeadtrickster%2Fsmerl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeadtrickster%2Fsmerl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeadtrickster%2Fsmerl/lists"}