HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
staltz
matrixmultiplication.xyz
TypeScript2016–2016
staltz / matrixmultiplication.xyz

matrixmultiplication.xyz

Discover this repository through its Hacker News conversations.

2Distinct people
4Mentions
0Explicit recommenders
1.2KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A public description has not been verified.

Where it is used

No documented product use has been verified yet.

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 hour4 dated mentions

Observed mentions: 2016-11-25 14:30:57 UTC to 2016-11-25 17:22:23 UTC.

012016-11-25 14:00:00 UTC to 2016-11-25 15:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsNov 25, 14:002016-11-25 15:00:00 UTC to 2016-11-25 16:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsNov 25, 15:002016-11-25 16:00:00 UTC to 2016-11-25 17:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2016-11-25 17:00:00 UTC to 2016-11-25 18:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsNov 25, 17:00

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
Nov 25, 14:002016-11-25 14:00:00 UTC2016-11-25 15:00:00 UTC101
Nov 25, 15:002016-11-25 15:00:00 UTC2016-11-25 16:00:00 UTC101
Nov 25, 16:002016-11-25 16:00:00 UTC2016-11-25 17:00:00 UTC101
Nov 25, 17:002016-11-25 17:00:00 UTC2016-11-25 18:00:00 UTC101

What Hacker News says

4 sources
Yes, I'm very happy with that code, apart from one thing: how animations are done sometimes with tweens in JS, and sometimes with CSS. I'm sure it could have been built with less code. In general, the more shortcuts you take and the less abstraction you use, the less amount of code you will have. But also, it's likely that you would mix concerns more easily. So in general, when separating concerns, you end up getting more LOCs. That's what I've perceived in my experience, not a fact that I can prove. So I do feel like model-view-intent shines here. Model only has state concerns. I was careful in moving away DOM-related code from the model. So theoretically you could reuse this model for React Native or any other UI target. View only displays state in a visual representation, and intent only captures user events and represents them in a fo
Read the rest
rm suitable for the model. About some TypeScript code, I think you referred to https://github.com/staltz/matrixmultiplication.xyz/blob/mast.... These could have been avoided. The only purpose they serve is to make inference work out for lines like these: https://github.com/staltz/matrixmultiplication.xyz/blob/mast... TypeScript knows that `action` is of type StartMultiplyAction. If we had only done `.filter(ac => ac.type === 'START_MULTIPLY')`, TypeScript couldn't infer anymore. So I understand those isFoo functions are very boilerplatey, but they serve the purpose to provide accurate typings. It's optional and depending how you write TypeScript code, you can use more type casting and more `any`, or you can go down the route of providing accurate types everywhere, which is what I did. This is not at all related to Cycle.js nor MVI. Feel free to ask more architecture-related questions. I like these. What else feels like "too much code"?
In Matrix Multiplication
Question for staltz - are you happy with the cycle code at https://github.com/staltz/matrixmultiplication.xyz/ ? It feels like a lot of work for this sort of task which I feel could have been achieved by using an existing (mutable) matrix lib and drawing ad-hoc. It feels like an awful lot of code written - especially with all the `.something === "SOME_STRING_CONSTANT"` (couldn't those be typed directly in TS btw?). Still, you're a smart guy - I'm trying to see why it's worth it. Do you really feel model-view-intent shines here? (Nice visualization by the way)
In Matrix Multiplication

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.