{"id":25304870,"url":"https://github.com/leops/hatchet","last_synced_at":"2025-10-06T23:02:06.926Z","repository":{"id":79172415,"uuid":"80994594","full_name":"leops/hatchet","owner":"leops","description":"A non-scripting language for the Source engine","archived":false,"fork":false,"pushed_at":"2017-11-08T17:40:55.000Z","size":60,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-13T08:50:08.345Z","etag":null,"topics":["programming-language","scripting-language","source-engine"],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/leops.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2017-02-05T13:28:32.000Z","updated_at":"2023-03-13T17:27:00.000Z","dependencies_parsed_at":"2023-05-18T17:45:49.861Z","dependency_job_id":null,"html_url":"https://github.com/leops/hatchet","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/leops%2Fhatchet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leops%2Fhatchet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leops%2Fhatchet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leops%2Fhatchet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leops","download_url":"https://codeload.github.com/leops/hatchet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247589817,"owners_count":20963025,"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":["programming-language","scripting-language","source-engine"],"created_at":"2025-02-13T08:34:09.886Z","updated_at":"2025-10-06T23:02:01.881Z","avatar_url":"https://github.com/leops.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The Hatchet Language\nA non-scripting language for the Source engine\n\n# Concept\nHatchet is a metalanguage designed to apply compile-time transformations to source code\n(specifically, to the code of a VMF file generated by the Hammer editor).\n\nLike [Focus](https://github.com/leops/focus/), it's aimed at solving some usability issues commonly\nencountered with the Source engine's I/O system, and its programming interface in Hammer. However,\nit goes in completely different direction by empowering the user through the capabilities of a\nprogramming language instead of a visually compelling interface.\n\nIt's also different from the VScript system implemented in the engine, as Hatchet scripts are\nexecuted as a step of the compilation process, and not at runtime. Both languages can be used to\nsolve some problems like the setup of complicated choreographed sequences, but each of them covers\nmostly different use cases.\n\n# Syntax\nThe most common construct of the Hatchet language is the subscriber definition, used to define an\nevent connection:\n```hatchet\nfloor_button_1.OnPressed {\n    motor_wheel.Open()\n    ramp_rotator.Open()\n    button_1_texturetoggle.SetTextureIndex(1)\n}\n```\n\nSinces Hatchet is a domain-specific language, it provides a simple syntax to define Source specific\nentities:\n```hatchet\nrelay paintdropper_1_trigger_to_start {\n    paint_sprayer_1.Start()\n}\n\nauto {\n    @glados.RunScriptCode(\"sp_a3_speed_ramp_entrance()\")\n    paintdropper_1_trigger_to_start()\n}\n```\n\nLike any programming language Hatchet allows the definition of variable and loops:\n```hatchet\nlet buttons = [{\n    button: button1_btn,\n    indic: button1_indic,\n}, {\n    button: button2_btn,\n    indic: button2_indic,\n}, {\n    button: button3_btn,\n    indic: button3_indic,\n}]\n\nfor btn in buttons {\n    btn.button:relay_activated.OnTrigger {\n        btn.indic:indicator_timer_start_rl()\n        laser:counter.Add()\n    }\n\n    btn.button:relay_deactivated.OnTrigger {\n        laser:counter.Subtract()\n    }\n}\n```\n\nIt also lets you interact directly with the entities in the map, by manually editing their properties\nor using built-in functions:\n```hatchet\nfor i in range(0, 10) {\n    let mesh = clone(mesh_template)\n    mesh.origin.x = rand(-3175, 3175)\n    mesh.origin.y = rand(-3175, 3175)\n    mesh.origin.z = rand(-3175, 3175)\n}\n\nremove(mesh_template)\n```\n\n# Modules\n* [lang](https://github.com/leops/hatchet/blob/master/lang/): The source code for the Hatchet\n    compiler, written in Rust\n* [syntax](https://github.com/leops/hatchet/blob/master/syntax/): Syntax highlighting definitions\n    for the Atom editor\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleops%2Fhatchet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleops%2Fhatchet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleops%2Fhatchet/lists"}