HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
enkimute
ganja.js
JavaScript2017–2025
enkimute / ganja.js

ganja.js

:triangular_ruler: Javascript Geometric Algebra Generator for Javascript, c++, c#, rust, python. (with operator overloading and algebraic literals) -

15Distinct people
20Mentions
0Explicit recommenders
1.6KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

:triangular_ruler: Javascript Geometric Algebra Generator for Javascript, c++, c#, rust, python. (with operator overloading and algebraic literals) -

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year20 dated mentions

Observed mentions: 2017-09-06 07:58:45 UTC to 2025-04-26 17:00:44 UTC.

0123452017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 4 mentions; 3 submissions, 1 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 5 mentions; 2 submissions, 3 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2025

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC431
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC202
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC404
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC523
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC101
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC000
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC101
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC202

What Hacker News says

20 sources
>web dev/gradle/java knowledge to build something like this Web dev (and not just in java) is dominated by "component integration" concerns, containing lots of structure but little content. Computation is delegated to libraries, and the problems more about complexity of integration (at build time) scaled distributed systems (at runtime). In contrast, writing a simulation is computationally intensive, so most of the code is content. It's homogenous where web dev is heterogenous. The problems are entirely constrained by single process performance within a time budget determined by fps. All that means is that you can focus on one runtime. I suggest the browser, since it solves the distribution problem. Ganja[1] is perhaps the ultimate "content, not structure" simulation project. It's very strange, and lies unmaintained because it's impenetra
Read the rest
ble. Yet it works. A bit more structured is D3 who's authors have written cutting edge visulation/layout algorithms for you, for example in support of force directed graphs[2]. A more friendly way to get started would be with some variant of Processing[3], which started as a Java thing and then got ported around, including to Python and JavaScript. A word of warning: something like cloth simulation is to a game engine what a single cell is to a mouse. Game engines are huge, in other words, and again you won't be writing simulations, lots of (internal) integrations. 1 - https://github.com/enkimute/ganja.js/blob/master/ganja.js 2 - https://github.com/d3/d3-force/tree/main/src 3 - https://processing.org/
In Cloth
As an aside, I'm getting lots of stuttering when scrolling the website on a variable-refresh rate monitor + an M1 laptop. This is a static-content website – a profiling tells me consent SVG animation and their ganja.gs [1] math library accounts for this. Not a good sign for the engineering applications of this theory... https://github.com/enkimute/ganja.js
In Geometric Algebra
Some people's brains just work this way. Here's an example of a somewhat popular and regularly maintained library written in a similar style: https://github.com/enkimute/ganja.js/blob/6e97cb45d780cd7c66... Another example is Jarek Duda's paper on the ANS compression algorithm. A brilliant guy by all accounts, but his diagrams are... well... impenetrable. Check out Figure 4 on page 10: https://arxiv.org/pdf/1311.2540.pdf There's lines and arrows going every which way. There's about five different concepts layered on top of each other into one diagram, with nothing to obviously disambiguate them. Like... what is the black dot between C(s,x) and D(x), and why is it pointing in random directions!? The most extreme and stereotypical version of this style are the billboards written by some homeless people. You can probably picture it already in
Read the rest
your mind's eye: A wall of very dense text with little whitespace or structure, and a mix of fonts and colours seemingly at random. I had a brilliant mathematician friend who wrote like this. He would squeeze an entire semester's worth of study notes into a single sheet of paper, on one side. It was impenetrable gibberish to everyone else, but the colours and 2D positioning let him build a mental mind-map. For people like this, if you reformat their code even a tiny bit, their mental map is invalidated, and they lose track of it completely and become upset. I discovered this (the hard way) when applying automatic code formatting tools to the codebases I mentioned previously. Personally, I find this type of thing to be absolutely fascinating, because it's the intersection of many scientific fields but belongs in none, and hence is under-studied. There's elements of pedagogy, psychology, literacy, neuroscience, computer science, etc... It remains an open question how we can get large groups of neurodiverse humans to collaborate on a codebase when they don't even "read" or "think" in compatible ways! Enforcing a single style may work for most developers, but clearly not all. PS: Even on an anecdotal level, when I was a beginner programmer I could only read a single brace and indentation style. After two decades, I can now read almost any style, including inconsistent and outright crazy indentation without even noticing that something is amiss.
In The Montreal problem: Why programming languages need a style czar
Well I've been on a real Geometric Algebra (aka Clifford Algebra) kick lately, and ran across ganja.js [1]. It's a single no deps file that is...impressive. 120k uncompressed, and with it you can construct any degree algebra (including the more esoteric hyperbolic/parabolic ones), render to canvas, svg or webgl(!). It also includes a clever little DSL parser and interpreter (it overloads the scientific notation to name basis vectors!) that lets you construct more complex things from simple things using various kinds of products. The author, Steven De Keninck, is quite impressive as well, having got his start in the demoscene some time ago. He has a good video from SIGGRAPH 2019 [2] that explains why this algebra is better than [matrices, tensors, vectors, complex numbers]. Of particular interest (to me anyway) is the 2D projective geometr
Read the rest
y. I don't want to oversell it, but ganja is fucking amazing and there is a great deal I want to do with it. For one, I'd like to recapitulate my physics degree with it. [1] https://github.com/enkimute/ganja.js [2] https://www.youtube.com/watch?v=tX4H_ctggYo
In Manim: An animation engine for explanatory math videos
That library pisses me off on a visceral level. The author "Enki Mute" is no doubt a brilliant mathematician, his library looks awesome, the online demos are unreal, but he's squandered his talent. The code he writes is unreadable gibberish. Zero useful comments. One-character variable names. Stringly-typed programming. Regex soup. It's psychotic. I tried to reverse-engineer it in order to write a SIMD-optimised Rust version. But fuck me. It's like disassembling the machine code of an obfuscated anti-cheat library. Even with good tooling and industrial-strength refactoring, I couldn't make enough sense of it to make any useful headway. Just try and read this. Seriously: https://github.com/enkimute/ganja.js/blob/master/ganja.js What saddens me is that every other library I looked at was ancient and no longer maintained. Half wouldn't even
Read the rest
compile. Most started with an explicit assumption that only 2D, 3D, or non-degenerate metrics are needed. Very few have efficient code-generation, and those that do are invariably C++ only, but I'm never going back there, even at gunpoint. Just shoot me now, I'd rather eat a bullet than face another STL compilation error that I have to decode from a linker error to do with __malloc() or some garbage I don't care about. Enki Mute's Ganja.js is the only recent GA library I've seen that ticks all the checkboxes, but when I opened it up, I faced only the unspeakable horror of yet another dead end. GA is going nowhere because everyone cooks up their own special version, the terminology is unique and special to each researcher, and most libraries stop just short of being useful. What we need is standardisation around a well-documented and extensible library with polyglot code-gen. Something with expression simplification, SIMD, and both maths-centric and 3D graphics optimised capabilities. Ganja.js is not it, unfortunately.
In Basic skeletal animation with geometric algebra
Here are some direct links to some of the PGA (Projective Geometric Algebra) resources mentioned in the talk: 1. The 2D and 3D cheat sheets are here: https://bivector.net/doc.html 2. The talk is also available in "paper form" on the arXiv: https://arxiv.org/abs/1901.05873 3. Ganja.js repo https://github.com/enkimute/ganja.js and the associated demos in the Ganja coffee shop https://enkimute.github.io/ganja.js/examples/coffeeshop.html ____ For more background about the concepts like quaternions, projective geometry, and exterior algebra, etc. that are all united in PGA, you can check this nice book by Jean Gallier and Jocelyn Quaintance: https://www.cis.upenn.edu/~jean/gbooks/geomath.html direct link https://www.cis.upenn.edu/~jean/math-deep.pdf I haven't read, but sampled it on several topics and found the explanations to be very good.
Read the rest
(edit) first-added links specific to PGA, and typo fix s/external/exterior/
In Siggraph2019 Geometric Algebra (2019) [video]

Showing the 15 most recent of 20 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.