{"id":19664838,"url":"https://github.com/fluxml/mjolnir.jl","last_synced_at":"2026-04-01T18:42:34.700Z","repository":{"id":45490069,"uuid":"244695927","full_name":"FluxML/Mjolnir.jl","owner":"FluxML","description":"A little less conversation, a little more abstraction","archived":false,"fork":false,"pushed_at":"2021-12-10T20:14:10.000Z","size":173,"stargazers_count":87,"open_issues_count":17,"forks_count":13,"subscribers_count":20,"default_branch":"master","last_synced_at":"2026-03-04T22:03:05.667Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FluxML.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-03T17:13:19.000Z","updated_at":"2024-02-10T22:02:26.000Z","dependencies_parsed_at":"2022-07-18T23:17:53.499Z","dependency_job_id":null,"html_url":"https://github.com/FluxML/Mjolnir.jl","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/FluxML/Mjolnir.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluxML%2FMjolnir.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluxML%2FMjolnir.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluxML%2FMjolnir.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluxML%2FMjolnir.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FluxML","download_url":"https://codeload.github.com/FluxML/Mjolnir.jl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluxML%2FMjolnir.jl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31008780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-27T01:56:05.093Z","status":"online","status_checked_at":"2026-03-27T02:00:08.055Z","response_time":164,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-11T16:19:14.343Z","updated_at":"2026-03-27T02:05:25.991Z","avatar_url":"https://github.com/FluxML.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"⚠️ This project was experimental and is not currently maintained. It may be picked up at some point in the future, but for now it is both incomplete and likely non-functional on newer versions of Julia. For a discussion of why development has not continued, see [this thread](https://github.com/FluxML/Mjolnir.jl/pull/34#issuecomment-952526860).\n\n# Mjolnir\n\n[![Build Status](https://travis-ci.org/FluxML/Mjolnir.jl.svg?branch=master)](https://travis-ci.org/FluxML/Mjolnir.jl)\n[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)\n\nMjolnir is a hybrid approach to partial evaluation / abstract interpretation,\nwith an implementation in Julia. It can be thought of as a blend of\noperator-overloading based tracing (as in JAX, PyTorch Script, staged\nprogramming systems etc.) and dataflow-based abstract interpretation (as in the\ntype inference systems of Julia, TypeScript and Crystal). It is aimed at package\ndevelopers rather than Julia end-users.\n\nMjolnir can reproduce the compact, linear traces (aka computation graphs or\nWengert lists) of tracing systems.\n\n```julia\njulia\u003e function pow(x, n)\n         r = 1\n         while n \u003e 0\n           n -= 1\n           r *= x\n         end\n         return r\n       end\npow (generic function with 1 method)\n\njulia\u003e using Mjolnir\n\njulia\u003e @trace pow(::Int, 3)\n1: (%1 :: const(pow), %2 :: Int64, %3 :: const(3))\n  %4 = (*)(1, %2) :: Int64\n  %5 = (*)(%4, %2) :: Int64\n  %6 = (*)(%5, %2) :: Int64\n  return %6\n```\n\nHowever, it avoids several of the downsides of those systems. It supports\narbitrary Julia types (not just 'tensors' but also strings and structs). It\nsupports value-dependent control flow (as it can encode branches in the trace).\nIt supports side effects and mutating operators. Functions like `println` don't\nhave to be evaluated at compile time. It can enforce its assumptions (i.e.\nreferential transparency) rather than making the user responsible for them, and\ncan generate diagnostics when there are issues. Mjolnir can thus compile a much\nwider range of Julia programs than OO approaches.\n\n```julia\njulia\u003e @trace pow(::Int, ::Int)\n1: (%1 :: const(pow), %2 :: Int64, %3 :: Int64)\n  %4 = (\u003e)(%3, 0) :: Bool\n  br 3 (1) unless %4\n  br 2 (%3, 1)\n2: (%5 :: Int64, %6 :: Int64)\n  %7 = (-)(%5, 1) :: Int64\n  %8 = (*)(%6, %2) :: Int64\n  %9 = (\u003e)(%7, 0) :: Bool\n  br 3 (%8) unless %9\n  br 2 (%7, %8)\n3: (%10 :: Int64)\n  return %10\n```\n\n```julia\njulia\u003e function pow(x, n)\n         r = 1\n         while n \u003e 0\n           n -= 1\n           r *= x\n           @show r\n         end\n         return r\n       end\npow (generic function with 1 method)\n\njulia\u003e @trace pow(2, 3)\n1: (%1 :: const(pow), %2 :: const(2), %3 :: const(3))\n  %4 = (println)(\"r = \", \"2\") :: Nothing\n  %5 = (println)(\"r = \", \"4\") :: Nothing\n  %6 = (println)(\"r = \", \"8\") :: Nothing\n  return 8\n```\n\nMjolnir is designed to be [highly\ncustomisable](https://github.com/MikeInnes/Mjolnir.jl/blob/master/docs/types.md),\nand to give as much control as possible to packages that build on it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluxml%2Fmjolnir.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluxml%2Fmjolnir.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluxml%2Fmjolnir.jl/lists"}