C
Chung-chieh Shan
conway.rutgers.edu/~ccshan · Personal blog · on HN since 2010
Chung-chieh Shan, a programming languages researcher at Rutgers, writes a wiki-style blog on Haskell, types, effects, and language puzzles.
What HN saysCommenters point to it as a classic of clever programming writing, citing the word numbers posts and a Sudoku solver written in SQL.
15HN people shared it
10linked it in comments
6stories submitted
82story points
1 year agolast shared
2010people per year2026
Most-shared posts
- 1Word numbers: Billion approaches (2008)5 people · 21 points · first shared 2010 · 4 comments on HN
- 2Differentiation3 people · first shared 2013
- 3Higher-order Shell2 people · 58 points · first shared 2010 · 13 comments on HN
- 4Really understanding effects1 people · 2 points · first shared 2010 · discussion on HN
- 5Haskell Symposium program chair report1 people · 1 points · first shared 2013 · discussion on HN
- 6Keep1 people · first shared 2010
- 7Tmp1 people · first shared 2010
- 8Sudoku in SQL1 people · first shared 2023
- 9Discussion %E8%A8%8E%E8%AB%961 people · first shared 2025
- 10WordNumbers41 people · first shared 2011
What HN people wrote when they linked it
lupire · 2025-09-13
Enjoy the ultimate classic tour de force from world treasure Chung-chieh (Ken) Shan’s wikiblog "Proper Treatment"
discussion / punchline http://conway.rutgers.edu/~ccshan/wiki/blog/posts/WordNumbers1/discuss…
Start of main content: http://conway.rutgers.edu/~ccshan/wiki/blog/posts/WordNumbers1/
tel · 2013-08-12
You'd be amazed how few do. I'm frequently amazed. Furthermore, when you start getting into advanced types it's amazing how many errors become simply impossible since your types encode the logic your program is intended to represent.
For an example, here's a blog article linked elsewhere on this page which talks about encoding various "dimensions" of infinitesimals in an automatic differentiation program that thus eliminate a whole class of value errors.
http://conway.rutgers.edu/~ccshan/wiki/blog/posts/Differentiation/
carterschonwald · 2013-03-30
The post mentions motivation being symbolic differentiation.
Let me instead advocate auto differentiaton. It enables writing mathematical expressions as normal programs, is less error prone for the programmer, is well defined at every valid point in the derivative, and is better at using sharing when computing higher order derivatives. An excellent library for this is, called ad, is available in Haskell.
edit: link to package is http://hackage.haskell.org/package/ad/
edit2: I should also add that MOST auto differentiation libraries also have a problem of not being able to distinguish the differential/ epsilon used in two independent derivative calculations, and this can lead to subtle / large numerical errors.
The AD library uses some haskell type system cleverness to prevent users from making that mistake!
a nice exposition of this problem can be found in this excellent blog post http://conway.rutgers.edu/~ccshan/wiki/blog/posts/Differentiation/
refset · 2023-10-22
> defining the rules of suduko [...] in SQL
Two rather distinct solutions:
https://www.sqlite.org/lang_with.html#outlandish_recursive_query_examp…
http://conway.rutgers.edu/~ccshan/wiki/blog/posts/Sudoku_in_SQL/
gohrt · 2013-10-21
http://book.realworldhaskell.org/
Spoiler alert: you can't really get anything signifant+useful done with that book, because Haskell is a language where only experts can get anything significant done.
If you just want the mindblow experience of Haskell:
http://conway.rutgers.edu/~ccshan/wiki/blog/posts/WordNumbers1/
eru · 2013-08-12
http://conway.rutgers.edu/~ccshan/wiki/blog/posts/Differentiation/ was linked in the reddit comment.
lurker17 · 2011-12-30
That's because you missed the hidden Part 4 where Shan&Thurston finish their solution:
http://conway.rutgers.edu/~ccshan/wiki/blog/posts/WordNumbers4
mukyu · 2011-12-30
http://conway.rutgers.edu/~ccshan/wiki/blog/posts/WordNumbers1/ I read this write-up of the problem years ago that takes a different approach.
nixme · 2010-01-17
They're written in Perl. Take a look at the sources:
tmp: http://conway.rutgers.edu/~ccshan/wiki/blog/posts/Higher-order_shell/t…
keep:
http://conway.rutgers.edu/~ccshan/wiki/blog/posts/Higher-order_shell/k…
partition · 2010-11-24
I thought group theory was the easy part. Indeed, that's pretty much what crypto is based on. Many other security applications in CS also rely on group-theoretic notions. Consider homomorphic encryption; the idea that one can develop an encryption algorithm that allows an untrusted source to work with your sensitive data without discovering your data itself, due to the fact that there exist 'one-way' functions from plaintext to gibberish that actually preserve certain operations you care about; i.e., if
encrypt(x) = x'
encrypt(y) = y'
encrypt(z) = z'
and x + y = z, homomorphic encryption for (+) gives you that x' + y' = z'.
Farther away from completely direct applications like these are algebraic ways of viewing a CS problem. Consider vectorizing a for loop that does in-place update of a variable with +=. We know that this can be turned into a parallel reduction, where if N is the length of the list over which the for loop is iterating, the parallel reduction will take O(log N) time. But what other operations does it work with? Associative ones? What can we do if it's not associative, or the return type of the in-place update is different? And so on.
That's pretty much the tip of the iceberg when it comes to abstract algebra being used in CS.
Now on to category theory. I'm still very, very new to it, but I've been seeing tons of connections anyway. I figure I can view the higher level of abstractness two different ways; that it's going to be hard and impractical to…