{"id":23896571,"url":"https://github.com/brecert/macro_transpile","last_synced_at":"2025-06-25T22:05:44.277Z","repository":{"id":113036327,"uuid":"141485963","full_name":"brecert/macro_transpile","owner":"brecert","description":"macro_transpile","archived":false,"fork":false,"pushed_at":"2018-08-13T05:51:52.000Z","size":4052,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-23T07:33:05.695Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Crystal","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/brecert.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-18T20:21:54.000Z","updated_at":"2018-11-14T15:25:07.000Z","dependencies_parsed_at":"2023-06-06T12:38:24.874Z","dependency_job_id":null,"html_url":"https://github.com/brecert/macro_transpile","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/brecert/macro_transpile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brecert%2Fmacro_transpile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brecert%2Fmacro_transpile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brecert%2Fmacro_transpile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brecert%2Fmacro_transpile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brecert","download_url":"https://codeload.github.com/brecert/macro_transpile/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brecert%2Fmacro_transpile/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261960503,"owners_count":23236572,"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":"2025-01-04T16:53:20.493Z","updated_at":"2025-06-25T22:05:44.269Z","avatar_url":"https://github.com/brecert.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# macro_transpile\ntranspile a very limited subset of crystal to mkb language\n\n## Example\n```cr\n# Automatic Assignment\n# Automatic Typings\nx = 0\nn = \"Hello World!\"\na = [\"Hello Array!\"]\n\n# Automatic calls (can act weird at times)\ny = a[0]\n\n# Easy array usage\nz = [x, n, a, y]\nz[x]\n\n# Use traditional methods without a lot of syntax\nlog \"Hello World!\"\n\n# Easy interpolation\ntext = \"world\"\nlog \"Hello #{text}!\"\n\n# Method Emulation (not feature complete, buggy)\ndef say(name)\n  \"Hello my name is #{name}.\"\nend\n\nsay \"Bree\"\n\n# Globals\ndef stuff(more)\n  @result = more\nend\n\nlog @result\n\n# Basic If and While conditionals.\nworking = true\ni = 0\nwhile working\n  i += 1\n  log \"#{i}. mining..\"\n  if i \u003e 10\n    log \"Phewf, glad that's done\"\n    working = false\n  end\nend\n```\ntranspiles to\n```\n#x = 0;\n\u0026n = \"Hello World!\";\n\u0026a[] = [\"Hello Array!\"];\n\u0026y = %\u0026a[0]%;\n\u0026z[] = [%#x%, %\u0026n%, %\u0026a[]%, %\u0026y%];\n%\u0026z[%#x%]%\nLOG(\"Hello World!\");\n\u0026text = \"world\";\nLOG(\"Hello %\u0026text%!\");\n\n// @FILE say.txt\n// @METHOD say(name)\n\u0026name = $$0\n\"Hello my name is %\u0026name%.\"\n\n\n// @CALL say\nEXEC(say.txt,say,\"Bree\")\n\n\n// @FILE stuff.txt\n// @METHOD stuff(more)\n\u0026more = $$0\n@\u0026result = %\u0026more%;\n\nLOG(%@\u0026result%);\nworking = true;\n#i = 0;\nWHILE(%working%);\n  i += 1\n  LOG(\"%#i%. mining..\");\n    IF(\"%#i% \u003e 10\");\n      LOG(\"Phewf, glad that's done\");\n      working = false;\n    ENDIF;\nENDIF;\n```\n\nIf you're wondering why @CALL and other comments are in there, it's easy to get lost in the code without the crystal code for reference, this just makes it easier to tell where it is.\n\nIt also makes creating the correct files easier.\n\n## Todo\nrewrite, the code is an awful mess right now, initially wrote after staying up 30 hours in an attempt to research the internals of crystal-lang\n\nautomatic float calculation. (using a transpiler standard library of sorts)\n\nnamespaces, namespaces for easy namespace naming for namespaces\n\nautomatic file outputs, right now files need to manually be named if emulated method.\n\nclasses, classes can be emulated by having inline methods. (emulated differently)\ntoo tired to think of a full solution, this is very unprofessional.\n\n\n## Usage\ndependencies\n  - Crystal 0.25.1\n  \n1. Clone the repository\n2. Built command.cr with `crystal build src/command.cr` \n3. use the generated binary however you like\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/your-github-user/macro_transpile/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [brecert](https://github.com/brecert) Brecert - creator, maintainer\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrecert%2Fmacro_transpile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrecert%2Fmacro_transpile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrecert%2Fmacro_transpile/lists"}