5 ms·
> Little of computing--almost nothing--is declarative... That's just wrong. * Artificial general intelligence * Operating systems * Video games * Emulators for
by Konohamaru 6y ago
> Little of computing--almost nothing--is declarative... That's just wrong.
* Artificial general intelligence
* Operating systems
* Video games
* Emulators for hardware
* Interpreters
* Debuggers
* Word editors
* Image editors
* Graphical user interfaces
* Robotics
* Web browsers
* Servers
Basically everything that makes computing interesting is non-declarative and concurrent. Financial math on K street, parser combinators, and SQL queries are the declarative segment of programming.
- throwaway_pdp09 6y agoOK, good comeback. It's forcing me to be precise. Declarative/imperative are models, not necessarily implementations (although they often are treated as model x = implementation x). You need to separate the two conceptually, but in implementation you can do both. Anything you can do declaratively you can do imperatively and the reverse. As such it makes it meaningless to say that almost nothing is declarative because how you choose to create it is a choice. How well it runs is another matter because real hardware is relentlessly state-y, but that's an implementation issue. And that's fine, and sometimes imperative stuff is just cleaner. But you can write a web browser or a GUI or whatever declaratively, but underneath it will be imperative because that's hardware. Declarative vs imperative is a choice, not necessarily a 'natural' thing, (depending on the problem, I'd say a web page renderer is distinctly stateless - take some static HTNL, render it, where's the state?). A web server can be stateless too, a request comes in, a web page goes out. I need someone else to speak for others, pretty sure stateless GUIs have been written. Any big data cruncher that works on petabytes, purely with output coming from input deterministically is effectively stateless.
- jolux 6y agoNothing is declarative or imperative outside of a certain implementation of a solution. All of the things named trivially have declarative solutions because of Turing completeness. Whether or not a paradigm lends itself easily to something is a bit of a different question, but I think a lot of people tend to say “oh, that’s obviously stateful and imperative” merely because they haven’t thought about the problem in a different way.
- Konohamaru 6y agoTuring machines only model mathematical functions. They cannot model anything on my list. That's why computer scientists invented I/O automata in an attempt to build a theoretical model that handles some of those items on my list. > “oh, that’s obviously stateful and imperative” merely because they haven’t thought about the problem in a different way. No I am not a conventionalist.
- jolux 6y agoThis is like...not even wrong.
- throwaway_pdp09 6y ago> Turing machines only model mathematical functions. They cannot model anything on my list. Since turing machines are turing complete, and existing general purpose CPUs are turing complete, this is trivially incorrect. > That's why computer scientists invented I/O automata ... those items on my list wat?
- Konohamaru 6y agoHow can a Turing machine simulate concurrency?
- throwaway_pdp09 6y agoIt doesn't need to because it's implementation details. Where it's needed such as in modelling the very important implementation detail of parallelism on multi-core machines to ensure correctness (such as with model checkers like Spin) then stuff like buchi automata are used, but that's dragging maths into the real world to solve real world problems. Turing machines don't live in the real world. Please just stop.
- Konohamaru 6y agoWe know a Turing machine can't model all aspects of concurrency because a Turing machine with threads can compute an integer of unbounded size while there's always a bound on the greatest integer an unthreaded Turing machine can. But this is all naval-gazing anyway. What's even the point of a purely-declarative OS when it's either gonna: 1. Act as a glorified C preprocessor for an imperative language like Haskell and its do-notation? 2. Look like brainfuck?