{"id":15394244,"url":"https://github.com/xyproto/jit","last_synced_at":"2026-03-05T12:02:09.443Z","repository":{"id":57496372,"uuid":"162570566","full_name":"xyproto/jit","owner":"xyproto","description":":vulcan_salute: Go module and utility for executing machine code","archived":false,"fork":false,"pushed_at":"2026-02-11T15:43:36.000Z","size":42,"stargazers_count":24,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-11T22:29:38.788Z","etag":null,"topics":["assembly","go","jit","machinecode","programming-language"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xyproto.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-12-20T11:30:23.000Z","updated_at":"2026-02-11T15:43:41.000Z","dependencies_parsed_at":"2024-03-28T20:36:02.019Z","dependency_job_id":"addb4a61-b448-4b31-a43c-92a3409de163","html_url":"https://github.com/xyproto/jit","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/xyproto/jit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Fjit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Fjit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Fjit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Fjit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xyproto","download_url":"https://codeload.github.com/xyproto/jit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Fjit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30123729,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T11:11:57.947Z","status":"ssl_error","status_checked_at":"2026-03-05T11:11:29.001Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["assembly","go","jit","machinecode","programming-language"],"created_at":"2024-10-01T15:22:44.144Z","updated_at":"2026-03-05T12:02:09.438Z","avatar_url":"https://github.com/xyproto.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jit [![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/xyproto/jit/master/LICENSE) [![Go Report Card](https://goreportcard.com/badge/github.com/xyproto/jit)](https://goreportcard.com/report/github.com/xyproto/jit)\n\n`jit` is a Go module for executing machine code instructions directly, without having to store instructions in an executable file.\n\nIt was inspired by this post: [Hello, JIT World: The Joy of Simple JITs](http://blog.reverberate.org/2012/12/hello-jit-world-joy-of-simple-jits.html).\n\n`jit` is also an extremely simple programming language.\n\nFor a similar project written in Rust, check out [machinecode](https://github.com/xyproto/machinecode).\n\n## Example usage\n\n```go\ncode := []byte{0xb8, 0x2a, 0x00, 0x00, 0x00, 0xc3}\njit.Execute(code)\n```\n\n## The `jitrun` command\n\n`jit` includes a small machine code execution program named `jitrun` that can be installed with Go 1.17 or later:\n\n```bash\ngo install github.com/xyproto/jit/cmd/jitrun@latest\n```\n\nYou can provide a file, and run it:\n\n*`42.mc`*:\n\n```\n// This program moves 42 into eax and returns\n\nb8 2a 00 00 00  // mov 2a000000 into the eax register. b8 is the \"mov eax\" part. 0x2a is 42.\nc3              // return to the caller (the return value is held in eax)\n```\n\n    ./jitrun 42.mc\n\nIt's possible to pipe the machine code directly to `jitrun`:\n\n    $ echo 'b8 2a 00 00 00 c3' | jitrun -\n    Stripped source code:\n    b8 2a 00 00 00 c3\n\n    Source bytes:\n    [184 42 0 0 0 195]\n\n    The program returned: 42\n\n`jitrun` can be run silently with the `-s` flag:\n\n    $ echo 'b8 2a 00 00 00 c3' | jitrun -s -\n    $ echo $?\n    42\n\nHere is another example program:\n\n```\n// This program takes the square root of 1024 and returns the answer (in eax), which is 32\n\nb8 00 04 00 00  // mov 1024 (0x400) into eax\nf3 0f 2a c0     // mov eax into the xmm0 register\nf3 0f 51 c0     // take the square root of the xmm0 register and place it into xmm0\nf3 0f 2c c0     // move xmm0 back into eax\nc3              // return to the caller (the return value is held in eax)\n```\n\n## Dependencies\n\n* `cgo` for the `jit` package.\n* The [`hexstring`](https://github.com/xyproto/hexstring) module for the `jitrun` command.\n\n## General info\n\n* License: BSD-3\n* Version: 1.0.1\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxyproto%2Fjit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxyproto%2Fjit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxyproto%2Fjit/lists"}