3 ms·
The great thing about compilers is they're conceptually pure functions - take an array of characters as input and produce an array of bytes as output. You can d
by chrisseaton 7y ago
The great thing about compilers is they're conceptually pure functions - take an array of characters as input and produce an array of bytes as output. You can do that in any general-purpose language - high level, low level, old, new, whatever, you don't even need any libraries - it's all just numbers in and numbers out! So yeah pick whatever you want. Algebraic and object-oriented languages seem to work well in practice as the problems are data-structure-intensive, but many other paradigms also work well. I really love compilers, I think they're the perfect program.
- JadeNB 7y ago> The great thing about compilers is they're conceptually pure functions - take an array of characters as input and produce an array of bytes as output. While this is undoubtedly strictly true, it seems so high-level that the same could be said of essentially any programming task, with I/O suitably modelled, and so gets awfully close to "the C language is purely functional" (http://conal.net/blog/posts/the-c-language-is-purely-functional http://conal.net/blog/posts/the-c-language-is-purely-functio...).
- chrisseaton 7y agoMy friends who work on web services have to send out tens of requests to other services to get anything done. So their request handlers aren’t pure functions. People think about compilers as being systems code but it’s the opposite. It’s the web and business code that’s a nest of state and dependencies on systems. Compilers are just numbers in numbers out.