2 ms·
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 exp
by candiodari 9y ago
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 9y agoThe 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.