
A cheat-sheet for mathematical notation with translations to JavaScript - fanf2
https://github.com/Jam3/math-as-code
======
candiodari
I sometimes feel like I would be helped in some programming tasks by a
language that would:

1) allow more complex mathematical expressions to be put inside expressions
(why for instance does sum need a for loop in most/all languages)

2) have that language then compile both to mathematical notation AND machine
code. The math notation would be usable because it would be far easier to spot
errors (because it's way, way shorter)

~~~
theoh
The example of summation is really what "fold" in functional programming
languages does. Pure functional programming is close to the idea of
mathematical notation, particularly in the sense that "equational reasoning"
is possible.

Another functional idea related to the concepts you mentioned is the "where"
clause:

"A notationally distinctive feature of ISWIM is its use of “where” clauses. An
ISWIM program is a single expression qualified by “where” clauses (auxiliary
definitions including equations among variables), conditional expressions and
function definitions. Along with CPL, ISWIM was one of the first programming
languages to use “where” clauses." (From the page for ISWIM on Wikipedia)

If this sounds good, see Haskell etc.

------
MildlySerious
As a self taught developer, the "scientific" end of the job is always
something I feel I need to improve on, and guides like this are extremely
helpful. Thank you!

