HNHacker News
TopNewBestAskShowJobs

sritchie

1,029 karma · joined June 2, 2011

I hack Clojure and Scala. Formerly Twitter, formerly Stripe. Founder of PaddleGuru and RacehubHQ.

Blog: https://samritchie.io

[ my public key: https://keybase.io/sritchie; my proof: https://keybase.io/sritchie/sigs/_TS462cmjfImFbiWim_Fn5sGsIBqvrf20BpHEYUnNt0 ]

submissionscomments
sritchie··on The Little Learner: A Straight Line to Deep Learning
Rated on dollars per hour of brain upgrades, thinking and enjoyment, it doesn’t get better than a good book.
sritchie··on Polynomial interpolation
Thank you, that's really nice to read.

I really leaned in to these essay-style namespaces for this project; I spent _so_ much time deciphering old numerical algorithms ported from uncommented FORTRAN, and decided that I had to go the other direction.

Someday I'll get around to publishing a static site that renders the math in the comments, like these:

- https://samritchie.io/functional-numerical-methods (numerical integration written in stateless functional style) - https://samritchie.io/dual-numbers-and-automatic-differentia... (automatic differentiation that works on higher order functions etc)

Send me some of your (public) code to read!

sritchie··on Polynomial interpolation
You don't! These techniques are for getting a perfect fit.
sritchie··on Polynomial interpolation
Here's some Clojure code I wrote for the Emmy computer algebra system that implements polynomial interpolation with a few different algorithms described in Numerical Recipes:

https://github.com/mentat-collective/emmy/blob/main/src/emmy...

I discovered while writing this that I could express each of these algorithms as folds that consumed a stream of points, accumulating a progressively higher order polynomial.

Here's the same sort of thing but for rational function interpolation: https://github.com/mentat-collective/emmy/blob/main/src/emmy...

sritchie··on The Child Is the Teacher: A Life of Maria Montessori
My understanding is that Maria Montessori never copyrighted her name or method, so it's actually a free-for-all where anyone can call their toys "Montessori", like STEM, not some central organization selling merch.

This goes for the schools too! There are "accredited Montessori schools", but any school can call itself Montessori with no penalty.

sritchie··on Maria: A ClojureScript coding environment for beginners
Haskell, Erlang, Pascal… Maria is a reference to Maria Montessori, whose educational philosophy inspired Maria.cloud.
sritchie··on Should You Have Kids?
It is implying that the only exotic place you're going to be able to go to indulge that desire is Disneyland, since your kids won't want to go anywhere else.

Not true in reality (speaking as a dad), and there's no way to read this other than as a joke example of a decision tree. Almost an advertisement for how decision trees can fail to capture any truly meaningful turning points of a big decision!

sritchie··on Show HN: Stock Photos Using Stable Diffusion
Or in any other context, for that matter!
sritchie··on Aleksandr Sorokin smashes 24-hour world record with 198.6 mile run
I wouldn’t say it’s a given that running torches your knees - mechanics, flexibility and musculature make a big difference.
sritchie··on I should have loved biology
That’s the joke!
sritchie··on Tracing an obsession with the Shakespeare authorship question
Well, there is a lot of scholarship refuting the snobby argument, including the book referenced in the reply. "Will in the World: How Shakespeare Became Shakespeare" covers this too, with lots of analysis of back and forth competitive poetry and passages between Shakespeare and contemporary playwrights like Marlowe, who knew Shakespeare well. Seems odd to imagine that they would also be involved in a coverup.
sritchie··on The last Howard Johnson's restaurant closes in Lake George, N.Y.
Wait, the Bell Picturephone was real! https://ethw.org/Picturephone I had known for years that my grandpa Alistair Ritchie worked on this at the Labs, but the book “The Idea Factory” colored in the story with great detail on how advanced the system was AND how few units they ever sold. Everyone wanted to see the other party, but no one wanted to be broadcast. One Bell exec iirc planted a headshot of himself in front of the camera.
sritchie··on Learning Chess at 40 (2016)
I had the same reaction. I have a 3.5yo daughter now, and it feels like spending time and attention being truly interested in the things she loves is a great way to bond. The extra zing of needing to beat her is ego, and as you say feels like it would sour the positive effect of all of those hours.

Same observations seems right for many other types of relationships. Time and attention is a gift, don't ruin it with ego.

sritchie··on Automatic Differentiation: Forward and Reverse
If you want to try a literate programming take on forward-mode automatic differentiation in Lisp (Clojure), check out the Differential implementation in my sicmutils library: https://github.com/sicmutils/sicmutils/blob/main/src/sicmuti...

Here's the org-mode export of the file, with all TeX rendered: https://samritchie.io/dual-numbers-and-automatic-differentia...

I worked on this with Gerald Sussman, and it has the somewhat unique feature of being able to take derivatives of higher-order functions. The system is also extensible, so this feature could have been installed outside of the core library, and in fact would need to be to support, say, functions that returns JS futures, scala functions etc.

Enjoy!

sritchie··on Space Math
If you want to try this out, give the sicmutils Computer Algebra System a go (I’m the maintainer). Repo lives here: https://github.com/sicmutils/sicmutils

The library works in the browser as well, so interactive TeX rendering from Clojure symbolic expressions and functions is available at the quickstart page here: https://nextjournal.com/try/samritchie/sicmutils

sritchie··on Literate programming is much more than just commenting code
Literate programming is going to feel far more powerful when we expand the definition to include:

- Smalltalk-ish things like writing suites of custom viewers for various types, - demos and examples in-line inside of a library - multiple stories about the same piece of code, but all with the ability to IMPORT the story as a library

I've been writing sicmutils[0] as a "literate library"; see the automatic differentiation implementation as an example[1].

A talk I gave yesterday at ELS[2] demos a much more powerful host that uses Nextjournal's Clerk[3] to power physics animations, TeX rendering etc, but all derived from a piece of Clojure source that you can pull in as a library, ignoring all of these presentation effects.

Code should perform itself, and it would be great if when people thought "LP" they imagined the full range of media through which that performance could happen.

[0] sicmutils: https://github.com/sicmutils/sicmutils

[1] autodiff namespace: https://github.com/sicmutils/sicmutils/blob/main/src/sicmuti...

[2] Talk code: https://github.com/sritchie/programming-2022

[3] Clerk: https://github.com/nextjournal/clerk

sritchie··on Physics in Clojure: Elliptical Paths
Yes, for these examples SICMUtils is handling the state updates and gives new coordinates to Mathbox to render.

The library works in both JS and the JVM, so I was able to generate an unevaluated code form for the equations of motion (simplified, optimized!), which clerk sends over the wire for the JS build of sicmutils to run.

Here is the code for that demo: https://github.com/sritchie/programming-2022/blob/main/src/p...

The api is settling, of course this, so this current version is all quite playful! I will add instructions on how to get this building when I’m back at the keyboard.

Another way this will all get more powerful is via the in-progress mathbox-react[0] project. When that’s settled we can send a data structure representing a full scene across the wire, and build stuff like math3d[1] , but with the full power of Clojure augmenting the UI equation editor. Dreamy stuff!

[0] https://github.com/ChristopherChudzicki/mathbox-react

[1] https://www.math3d.org/

sritchie··on Physics in Clojure: Elliptical Paths
Hey, so fun to see this here! These demos feature work from https://github.com/sicmutils/sicmutils and the newly maintained-by-me Mathbox library.

I’m around and happy to answer any questions about the library, future plans, etc.

sritchie··on Is information the fifth state of matter?
Good question; I think the answer from general relativity is that it doesn't, and that those changes are propagated out locally at the speed of light. So it's a Newtonian fudge to have variables like "distance between two bodies" in the equations.

Mass changes spacetime curvature, and spacetime curvature pushes masses around, back and forth in a grand dance!

sritchie··on Python built-ins worth learning (2019)
That condition would fail on non-list sequences, like `numbers == (1,2,3)`; the `len` version makes the code more permissive.
sritchie··on Cormac McCarthy’s tips on how to write a great science paper (2019)
Don't you think he does too, and is winking at you with that sentence? Especially given the spare "Remove extra words or commas whenever you can."
sritchie··on A neural network solves and generates mathematics problems by program synthesis
Give my SICMUtils computer algebra system a look as well, if you like Lisp / Clojure: https://github.com/sicmutils/sicmutils

Works on the web too, which is a big boost for sharing work.

sritchie··on Wind whipped fires raging through Boulder County
I am in Boulder too and I think the comment means, imminent in Boulder proper. But you are of course right, this is a horrifying thing happening right now for many people just a few miles away.
sritchie··on MIT Scheme on Apple Silicon
It is good enough! Almost all code forms from the book live in the tests (see the FDG directory[0], for example), and there are a few nice environments like Nextjournal[1] where everything from the books works in the browser.

The Clojure port is quite fast, faster than the original for all benchmarks GJS has sent me, and more fleshed out. (That will change, as I've been pushing bugfixes and performance improvements back upstream as I go, as a meager gift to GJS for making this huge, amazing library in the first place.)

I actually wrote to GJS this morning asking for instructions on how to compile the original "scmutils", since I have the same problem. He responded saying he'll get back to me this afternoon, so I'll post here once I have details.

If you are still interested in getting the books going with MIT-Scheme, I put a decent amount of work into the exercises using the original codebase here[2], including a dockerized version of mit-scheme[3] and the scmutils package[4] that might be useful.

- [0] https://github.com/sicmutils/sicmutils/tree/main/test/sicmut...

- [1] https://nextjournal.com/try/samritchie/sicmutils/

- [2] https://github.com/sicmutils/sicm-exercises

- [3] https://hub.docker.com/r/sritchie/mit-scheme

- [4] https://hub.docker.com/r/sritchie/mechanics

sritchie··on MIT Scheme on Apple Silicon
I've been engaged in a 1.5 year long (so far) project to port the entirety of GJS's "scmutils" package over to Clojure, and the erratic behavior of MIT Scheme over Rosetta has been a pain I've consigned myself to for months. I keep an old machine handy when I need to test functions that can't work on the M1.

I am SO HAPPY to see this work! Major timesaver for me and anyone looking to run the executable versions of Functional Differential Geometry[1] and Structure and Interpretation of Classical Mechanics[2] in the original language.

[0] https://github.com/sicmutils/sicmutils [1] https://github.com/sicmutils/fdg-book [2] https://github.com/sicmutils/sicm-book

sritchie··on Show HN: Web browser to help programmers think clearly
I was thrilled to see that SICMUtils, FDG and friends are there as one of the examples! This looks awesome, and thanks for taking a look at those projects :)
sritchie··on LSD and psilocybin increase the fractal dimension of brain activity
Adding one random bit increases the entropy by a bit because there are now two possible messages - your message with a 0 or with a 1. Add a bunch of noise and you add a bunch of bits; entropy is average bits per message.
sritchie··on Show HN: Science and math-flavored programming problems for beginners
Or give the exercises a try in the browser, using the Clojure(script) port! It’s a lovely book.

https://nextjournal.com/dashboard/sicm

sritchie··on Symbolics.jl: A Modern Computer Algebra System for a Modern Language
Hey, I have... I'm a co-author of Algebird[0], which has many ideas that I'd pull over.

I'm hoping to introduce Clojure's "spec" or "schema" libraries so that the types at play can at least be inspectable inside the system. In a fully typed language, I'd implement the extensible generics as typeclasses.

I suspect it would make it quite a bit tougher (at least in the approach I'm imagining) for folks to write new generic functions, due to many type constructors...

On the other hand, the complexity is there, even if you don't write it down!

It would be a big project, and a worthy effort, to write down types for everything in SICM.

[0] https://github.com/twitter/algebird

sritchie··on Symbolics.jl: A Modern Computer Algebra System for a Modern Language
SICMUtils co-author here, if anyone has any questions on the Clojure port.

One beautiful thing about a Clojure computer algebra system is that it can run completely in the browser. This includes automatic differentiation, numerical integration, all of the hardcore Lagrangian and Hamiltonian mechanics work, differential geometry... it is startling stuff.

For example, here's a(n interactive!) derivation of Kepler's Third Law in the browser (thanks to Nextjournal's lovely integration), if anyone wants to play: https://nextjournal.com/try/sicm/ex-1-11

Many more exercises live here: https://nextjournal.com/sicm/

← PreviousPage 2 of 4Next →