HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
yogthos
clj-tetris
Clojure2019–2019
yogthos / clj-tetris

clj-tetris

Example Tetris in Clojure

2Distinct people
2Mentions
0Explicit recommenders
44GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Example Tetris in Clojure

GitHub

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

Observed mentions: 2019-01-31 01:49:12 UTC to 2019-04-21 19:23:08 UTC. Weeks start Monday, UTC.

012019-01-28 00:00:00 UTC to 2019-02-04 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsJan 282019-02-04 00:00:00 UTC to 2019-02-11 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-02-11 00:00:00 UTC to 2019-02-18 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-02-18 00:00:00 UTC to 2019-02-25 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-02-25 00:00:00 UTC to 2019-03-04 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-03-04 00:00:00 UTC to 2019-03-11 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsMar 42019-03-11 00:00:00 UTC to 2019-03-18 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-03-18 00:00:00 UTC to 2019-03-25 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-03-25 00:00:00 UTC to 2019-04-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-04-01 00:00:00 UTC to 2019-04-08 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-04-08 00:00:00 UTC to 2019-04-15 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-04-15 00:00:00 UTC to 2019-04-22 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsApr 15

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
Jan 282019-01-28 00:00:00 UTC2019-02-04 00:00:00 UTC101
Feb 42019-02-04 00:00:00 UTC2019-02-11 00:00:00 UTC000
Feb 112019-02-11 00:00:00 UTC2019-02-18 00:00:00 UTC000
Feb 182019-02-18 00:00:00 UTC2019-02-25 00:00:00 UTC000
Feb 252019-02-25 00:00:00 UTC2019-03-04 00:00:00 UTC000
Mar 42019-03-04 00:00:00 UTC2019-03-11 00:00:00 UTC000
Mar 112019-03-11 00:00:00 UTC2019-03-18 00:00:00 UTC000
Mar 182019-03-18 00:00:00 UTC2019-03-25 00:00:00 UTC000
Mar 252019-03-25 00:00:00 UTC2019-04-01 00:00:00 UTC000
Apr 12019-04-01 00:00:00 UTC2019-04-08 00:00:00 UTC000
Apr 82019-04-08 00:00:00 UTC2019-04-15 00:00:00 UTC000
Apr 152019-04-15 00:00:00 UTC2019-04-22 00:00:00 UTC101

What Hacker News says

2 sources
You bring up a good point, and I've had similar conversations with my friend who is an avid Unity developer, which has a mostly imperative programming (IP) runtime with a declarative GUI. Since functional programming (FP) and declarative programming (DP) have many similarities, the same issue of hardness (for lack of a better term) exists in languages like Elixer/Clojure/Julia/Haskell/Scala/F# etc etc. This all comes down to one of the most poorly understood concepts in FP, the monad: https://en.wikipedia.org/wiki/Monad_(functional_programming)... Honestly, I'm still not sure I understand internally how monads work, or if there are related terms for how I think of them. But monads (and related devices) are a way to deal with imperative logic and side effects when pure FP can't. Imagine you're writing Tetris in a spreadsheet. It's easy to
Read the rest
visualize how you might enter a piece's (x,y) coordinate in 2 cells and then pipe that through a series of cells containing logic that examines the blocks and outputs the next (x,y) coordinate for the following main loop. But the actual main loop (that grabs input events) is very hard to visualize as a spreadsheet. This "glue" with the imperative stuff is where the monad comes in. Another way to think of it is, how to represent exceptions in a spreadsheet or a pure functional implementation of a promise chain (you can't without monads). To write Tetris in HTML/CSS with no Javascript, we'd probably have to write a ton of CSS rules to show/hide/move DOM elements based on the state. That's an intractable problem for humans, so we'd probably compile the CSS from another language, which defeats the whole purpose. Maybe someone has tried it, I can't tell: https://news.ycombinator.com/item?id=6709466 https://codepen.io/alexdevp/pen/pgdKf But if we had something like a CSS monad, then we could write rules that are based on dynamic state from other rules. Writing this all out now, something like this might be useful, if anyone knows of such a thing. Anyway, from what I understand, languages like Clojurescript get around this by suspending execution via a monad and then entering again with new input. Here is an almost purely functional Tetris clone written in Clojurescript: https://github.com/yogthos/clj-tetris Piece definitions, with code to offset/rotate the matrices and check for collisions by counting the number of cells to see if any have overlapped: https://github.com/yogthos/clj-tetris/blob/master/src/tetris... https://github.com/yogthos/clj-tetris/blob/master/src/tetris... What I assume to be a thread sleep and JS setTimeout monads: https://github.com/yogthos/clj-tetris/blob/master/src/tetris... https://github.com/yogthos/clj-tetris/blob/master/src/tetris... https://github.com/yogthos/clj-tetris/blob/master/src/tetris... I know that code looks a little strange. But conceptually it's orders of magnitude simpler than that equivalent imperative code. Note that this is different from easy: https://medium.com/@kiksdium/simple-vs-easy-bfd897ab293c TL;DR; you bring up a really good point. FP and DP probably shouldn't be considered proven techniques until they can be used in the same problem domains as IP.
In Why isn't the internet more fun and weird?

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.