Hacker News new | ask | show | jobs
by syngrog66 1638 days ago
I love math but prefer programming type syntax to express math ideas, rather than much of traditional math notation. Much of it feels too alien and non-intuitive. Too irregular and random, and not predictable. Various styles duct taped together over centuries. The names of the various symbols are hard to remember, and dont get me started on the pain from not being on the standard PC/ASCII/Western computer keyboards.

In short, a similar critique to that of Perl and PHP, except math is even worse.

Show me a Python-like notation for a math construct and I'm good to go. Even a Lisp!

3 comments

You might like Structure and Interpretation of Classical Mechanics by Sussman and Wisdom. It does classical mechanics using an MIT-Scheme library.

Lean/mathlib is a mix of functional programming and classical math notation. The community likes unicode quite a lot, with support by the editor (using quasi-Latex input methods in both VS Code and emacs). Here's an example from graph theory (I removed some conceptually irrelevant parts):

  theorem simple_graph.sum_degrees_eq_twice_card_edges (G : simple_graph V) [fintype V] :
    ∑ (v : V), G.degree v = 2 * G.edge_finset.card
Speaking of which, there's a comment today about SICM in Clojure: https://news.ycombinator.com/item?id=29714267
Do you have a sample comparison between an expression/statement in math syntax versus in pseudocode syntax?
I think having 15 different ways to express multiplication is charming.
agreed. heh. thankfully though at least 3 of them can be expressed with a normal keyboard:

ab

a * b

a X b