3 ms·
> The formal semantics of programming languages maps expressions in programming languages to mathematical expressions. Which mathematical expressions do memcpy
by runeks 7y ago
> The formal semantics of programming languages maps expressions in programming languages to mathematical expressions.
Which mathematical expressions do memcpy, fork, and putchar map to?
- Koshkin 7y agoLibrary functions are not part of the formal semantics of programming languages.
- antonvs 7y agomemcpy is trivially modeled as an operation on an underlying store. Such stores are a basic feature of any programming language semantics. Putchar is easily modeled in terms of something like a state monad. In earlier semantics, such as the original denotational semantics, it was just modeled directly as a store that was threaded through a program, i.e. passed to every function. Fork is modeled by process calculi. If you think programming languages somehow can't be modeled by mathematics, you're essentially taking the position that they're doing something supernatural.