3 ms·
>Do you not know how to perform a specific task within functional code? It's not that I didn't know, it's that the process was imperative at its core. For exa
by davexunit 11y ago
>Do you not know how to perform a specific task within functional code?
It's not that I didn't know, it's that the process was imperative at its core. For example, I am working on a rendering engine using OpenGL. The high-level scene graph interface is purely functional, but rendering such a scene graph is an imperative process: binding textures, vertex arrays, shaders, writing to a framebuffer, etc. This low-level rendering code is the functional runtime for the high-level API.
- TazeTSchnitzel 11y agoAh, I see. You could do that within a purely functional language (via monads), but given how locked to C and the imperative paradigm OpenGL is, it would make sense to simply write that in C, yes.
- davexunit 11y agoI think monads are orthogonal to this issue. Using a monad would provide a pure interface around the imperative stuff, but the imperative stuff would still be there. Someone's gotta write the gross stuff so that we can build our pleasant, pure world on top of it.