4 ms·
What are you talking about? Programming is mathematics. Using a formal language to express solutions to formally defined problems is, by definition, mathematics
by sklogic 11y ago
What are you talking about? Programming is mathematics. Using a formal language to express solutions to formally defined problems is, by definition, mathematics.
- parasubvert 11y agoProgramming is not mathematics, except perhaps in the most narrow manner of recognizing that a syntactically formal language is likely used somewhere in the bowels of a solution. However, formal methods and semantically formal languages are rarely used to arrive at the solution. Our mainstream programming languages are difficult to reason about semantically. The formality is mostly relegated to the grammar/syntax. Formal languages and methods might be used in rare cases to validate a solution after it was specified by other means. But those other means are usually a combination of art, engineering and a high-level imperative language.
- sklogic 11y agoYou're recording your solution in a formal language. This is mathematics, by definition. Any programming language that ever existed is a formal language. No matter how clumsy it is, it is always formal, otherwise it won't be possible to execute it. Even those stochastic languages are formal as well.
- parasubvert 11y agoThis is the fallacy of composition. (Human beings are mostly made of water. Therefore humans are water. Programming is about arranging numbers (code). Therefore programming is numbers. etc. ) Programming languages involved both syntax and semantics. Formal languages are concerned predominantly with syntax. Most programming languages do not have complete formal semantics grounded in logic. Pieces, sure. Most programming languages are a goulash of various formalisms mixed up with notions of aesthetics and mechanism. Also, we're confusing code (which I agree is a mathematical construct, among other things), and a practice, programming. Almost no one programming is thinking purely in terms of mathematical logic. They're thinking about aesthetics, engineering constraints, user experience, timelines, procedures, libraries, version control, type systems, etc.
- sklogic 11y ago> Formal languages are concerned predominantly with syntax. No. I'm using a broader notion of a formal language. Algebra, for example, is a formal language. One of the ways of defining a formal language is: "anything that can be strictly defined as a term rewriting system", and all the programming languages are fitting. > Most programming languages do not have complete formal semantics grounded in logic. They always do, otherwise their execution won't be deterministic. A programming language implementation + semantics of the hardware and runtime library = semantics of a formal language. > They're thinking about aesthetics, engineering constraints, user experience, timelines, procedures, libraries, version control, type systems, etc. This is exactly how problems are solved in mathematics too.