{"id":23919586,"url":"https://github.com/martinjrobins/diffsl","last_synced_at":"2026-01-16T06:58:12.754Z","repository":{"id":228633276,"uuid":"514338565","full_name":"martinjrobins/diffsl","owner":"martinjrobins","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-29T22:36:40.000Z","size":1700,"stargazers_count":4,"open_issues_count":3,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-11T21:07:50.208Z","etag":null,"topics":["compiler","dsl","mass-matrix","ode","ode-model","sparse","tensor"],"latest_commit_sha":null,"homepage":"https://martinjrobins.github.io/diffsl/","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/martinjrobins.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2022-07-15T16:40:49.000Z","updated_at":"2025-02-03T22:01:13.000Z","dependencies_parsed_at":"2024-05-28T19:05:24.948Z","dependency_job_id":"6e4fbc38-ff75-41a3-8ed6-c934342273bc","html_url":"https://github.com/martinjrobins/diffsl","commit_stats":{"total_commits":215,"total_committers":1,"mean_commits":215.0,"dds":0.0,"last_synced_commit":"484552ec948583146b22b136735b800b6da04b8b"},"previous_names":["martinjrobins/diffsl"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinjrobins%2Fdiffsl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinjrobins%2Fdiffsl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinjrobins%2Fdiffsl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinjrobins%2Fdiffsl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martinjrobins","download_url":"https://codeload.github.com/martinjrobins/diffsl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248480433,"owners_count":21110937,"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":["compiler","dsl","mass-matrix","ode","ode-model","sparse","tensor"],"created_at":"2025-01-05T14:53:40.711Z","updated_at":"2026-01-16T06:58:12.683Z","avatar_url":"https://github.com/martinjrobins.png","language":"Rust","readme":"# DiffSL\n\n\u003cimg src=\"https://github.com/martinjrobins/diffsl/actions/workflows/ci.yml/badge.svg\" alt=\"CI build status badge\"\u003e\n\nA compiler for a domain-specific language for ordinary differential equations (ODEs) of the following form:\n\n$$\nM(t) \\frac{d\\mathbf{u}}{dt} = F(\\mathbf{u}, t)\n$$\n\nAs an example, the following code defines a classic DAE testcase, the Robertson\n(1966) problem, which models the  kinetics of an autocatalytic reaction, given\nby the following set of equations:\n\n$$\n\\begin{align}\n\\frac{dx}{dt} \u0026= -0.04x + 10^4 y z \\\\\n\\frac{dy}{dt} \u0026= 0.04x - 10^4 y z - 3 \\cdot 10^7 y^2 \\\\\n0 \u0026= x + y + z - 1\n\\end{align}\n$$\n\nThe DiffSL code for this problem is as follows:\n\n\n```\nin = [k1, k2, k3]\nk1 { 0.04 }\nk2 { 10000 }\nk3 { 30000000 }\nu_i {\n  x = 1,\n  y = 0,\n  z = 0,\n}\ndudt_i {\n  dxdt = 1,\n  dydt = 0,\n  dzdt = 0,\n}\nM_i {\n  dxdt,\n  dydt,\n  0,\n}\nF_i {\n  -k1 * x + k2 * y * z,\n  k1 * x - k2 * y * z - k3 * y * y,\n  1 - x - y - z,\n}\nout_i {\n  x,\n  y,\n  z,\n}\n```\n\n## DiffSL Language Features\n\nSee the [DiffSL language documentation](https://martinjrobins.github.io/diffsl/) for a full description.\n\n* Tensor types:\n  * Scalars (double precision floating point numbers)\n  * Vectors (1D arrays of scalars)\n  * N-dimensional tensor of scalars\n  * Sparse/dense/diagonal tensors\n* Tensor operations:\n  * Elementwise operations\n  * Broadcasting\n  * Tensor contractions/matmul/translation etc via index notation\n  \n## Usage\n\nGenerally the easiest way to make use of DiffSL is via an ode solver that supports the language, for example the [diffsol](https://github.com/martinjrobins/diffsol) library. Please see the diffsol documentation and consult the [DiffSL language documentation](https://martinjrobins.github.io/diffsl/) for more information.\n\nIf you are writing your own ode solver and want to make use of the DiffSL compiler, please either get in touch by opening an issue, contacting the [author](mailto:martinjrobins@gmail.com) or by looking at the [diffsol source code](https://github.com/martinjrobins/diffsol/blob/main/src/ode_solver/diffsl.rs).\n\n\n## Dependencies\n\nTo use the llvm backend (optional) You will need to install the [LLVM project](https://llvm.org/). The easiest way to\ninstall this is to use the package manager for your operating system. For\nexample, on Ubuntu you can install these with the following command:\n\n```bash\nsudo apt-get install llvm\n```\n\n## Installation\n\nYou can install DiffSL using cargo. By default the cranelift backend will be used. To use the llvm backend (which generates more optimised code), you will need to indicate the llvm version you have installed using a feature flag. For example, for llvm 16:\n\n```bash\ncargo add diffsl --features llvm16-0\n```\n\nOther versions of llvm are also supported given by the features `llvm15-0`, `llvm16-0`, `llvm17-0`, `llvm18-0`.\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinjrobins%2Fdiffsl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartinjrobins%2Fdiffsl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinjrobins%2Fdiffsl/lists"}