{"id":27940998,"url":"https://github.com/pumascript/puma","last_synced_at":"2025-06-26T21:36:07.213Z","repository":{"id":65371457,"uuid":"11010978","full_name":"pumascript/puma","owner":"pumascript","description":"Meta-programming framework for JavaScript based on LayerD concepts ","archived":false,"fork":false,"pushed_at":"2019-04-02T23:22:26.000Z","size":10285,"stargazers_count":30,"open_issues_count":39,"forks_count":28,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-06-09T01:13:46.992Z","etag":null,"topics":["argentina","ast","cordoba","javascript","metaprogramming","puma","utn"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/pumascript.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-06-28T00:00:34.000Z","updated_at":"2022-09-05T03:02:58.000Z","dependencies_parsed_at":"2023-01-19T22:35:17.161Z","dependency_job_id":null,"html_url":"https://github.com/pumascript/puma","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pumascript/puma","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pumascript%2Fpuma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pumascript%2Fpuma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pumascript%2Fpuma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pumascript%2Fpuma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pumascript","download_url":"https://codeload.github.com/pumascript/puma/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pumascript%2Fpuma/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262145377,"owners_count":23265909,"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":["argentina","ast","cordoba","javascript","metaprogramming","puma","utn"],"created_at":"2025-05-07T10:34:59.934Z","updated_at":"2025-06-26T21:36:07.184Z","avatar_url":"https://github.com/pumascript.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PumaScript [![Build Status](https://travis-ci.org/pumascript/puma.svg?branch=master)](https://travis-ci.org/pumascript/puma) [![Join the chat at https://gitter.im/emravera/puma](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/emravera/puma?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nPumaScript is a research programming language that adds meta-programming capabilities to JavaScript and is develop at the Universidad Tecnologica Nacional (UTN-FRC) in Cordoba, Argentina.\n\nIt has exactly the same syntax and semantic than regular JavaScript plus meta-programming capabilities such as introspection and re-writing features.\n\nA number of PumaScript features are based on LayerD project. Which is a meta-programming framework for statically typed languages.\n\n## Getting started with Puma\n```\nnpm install -g grunt grunt-cli\n```\n\nIn order to set-up PumaScript environment to give a try follow these steps:\n\n```\ngit clone https://github.com/pumascript/puma.git\nnpm install\ngrunt init\n\n```\n\nAfter these steps PumaScript editor is ready to start coding. Open in your browser puma's editor:\n\n```\neditor/puma-editor.html\n```\n\nThe editor shows two frames side by side. The one in the left allows writing code in PumaScript language and the one in the right is used to see the results of re-writing after pressing the button \"Execute\".\n\nNow is time to write the Simple PumaScript program!\n\n### Simple PumaScript Program\n\nAny JavaScript program is a PumaScript program. Write the following snippet in the PumaScript section of the editor:\n\n```\n    /** @meta */\n    function sum(a, b)\n    {\n        return pumaAst( $a +  $b);\n    }\n    sum(5, 6);\n```\n\nThe sample declares the meta-function \"sum\" that takes two arguments. These arguments are not values but AST (Abstract Syntax Tree) of the actual arguments.\n\nThe return expression use the special function \"pumaAst\" to build a new AST and replace the identifiers \"$a\" and \"$b\" with the AST of the actual arguments. In the sample, \"sum\" is called with literals \"5\" and \"6\".\n\nSo, the expression \"sum(5, 6)\" will be re-written in the JavaScript panel as:\n\n```\n5 + 6\n```\n\n### A more useful example of usage:\n\nThis example show how to use PumaScript metafunctions to re-write JQuery selectors into native JavaScript functions:\n\n```\n/* @meta */\nfunction $(a){\n    return pumaAst( jQuery(document.getElementById($a)) );\n}\n\n```\n\nWill re-write:\n\n```\n$(\"#some-panel\");\n```\n\nInto this line:\n\n```\njQuery(document.getElementById('#some-panel'));\n```\n\nA meta-function can avoid re-writing the caller expression by returning null instead of the AST.\n\nIf you wish want more examples, you could go to PumaScript [wiki](https://github.com/pumascript/puma/pull/106 \"PumaScript Wiki\").\n\n## Using PumaScript with require\n\nPumaScript was developed as a AMD module so it can be used with any JavaScript module loader. In order to use in your project copy the src folder to your project.\n\nTo include the functionality using requireJS into your code add the following:\n\n```\n\u003cscript data-main=\"/src/pumascript.js\" src=\"require.js\"\u003e\u003c/script\u003e\n```\n\nNow you can use PumaScript in your code in this way:\n\n```\n    var puma = require('pumascript');\n    puma.evalPuma('\u003cPUMA PROGRAM STRING HERE\u003e');\n```\n\n## Bugs Report\n\nFeel free to create an issue onto Github issues tracker and add the right label. Also you can get in touch and we will do that for you.\n\n## Would do you like contribute?\n\nWe have ton of work that need to be claimed. From coding to documentation. Don't hesitate to contact. We'll waiting for you.\n\n## License\n\nMIT. Details on LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpumascript%2Fpuma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpumascript%2Fpuma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpumascript%2Fpuma/lists"}