6 ms·
i want to see someone elaborate a state-maximizing, instead of state-minimizing, philosophy. lean in
by philosopher1234 4y ago
i want to see someone elaborate a state-maximizing, instead of state-minimizing, philosophy. lean in
- swagasaurus-rex 4y ago... Recurrent neural networks?
- deleted 4y ago[deleted]
- chapium 4y agoSpaghetti architecture. There is so much state organizational controls outside the codebase limit which parts of the code may be executed at any given time.
- mostlylurks 4y agoForth in its simpler implementations seems like it goes about as far as one could conceivably go in terms of maximizing state, or minimizing non-state. No parameters or perhaps even local variables, everything is just pushed onto a stack (or one of many stacks) that can be freely manipulated at any point. No major opaque control flow mechanisms, ifs and loops are implemented as functions operating on an exposed "return stack" which can be freely manipulated. No opaque function definitions compiled into a binary, function implementations are placed in a data structure that can be freely accessed at any time. No separate compile stage that manipulates state otherwise inaccessible to the program, compilation happens at run-time by manipulating freely accessible data structures, and the "syntax" for compiling things is essentially just function calls that manipulate globally accessible state based on what's in the input stream and you can write your own alternatives if you want. If the functional paradigm tends towards avoiding state, then it would seem to me that forth does the opposite: making almost everything a part of the state of a program that a developer can access and manipulate, even things that most structured programming languages do not expose to the developer.
- dqpb 4y agoState machines?
- taneq 4y agoBefunge is a bit like that, with its 2D grid of state/program/wtf being the entirety of the program.
- jayd16 4y agoMaybe OOO counts? Every bit of code gets its own state?
- Twisol 4y agoThe MOV-only CPU [1, 2] is probably about as close to this as you can get. If you think about it, every structured programming affordance is sugar for writing a state machine. MOV-only pushes all control flow into a state machine, and does so without using any branches itself. It's all MOVs all the time. [1] https://github.com/xoreaxeaxeax/movfuscator https://github.com/xoreaxeaxeax/movfuscator [2] https://harrisonwl.github.io/assets/courses/malware/spring2017/papers/mov-is-turing-complete.pdf https://harrisonwl.github.io/assets/courses/malware/spring20...
- analog31 4y agoBASIC, as in the original line-numbered version. Every variable is global. Every line is an entry point. The philosophy is: It works just fine, so long as you're careful. Also: Any assembly language that predates memory protection.
- pasquinelli 4y agoi've been thinking about this for a while. my basic question is: languages give or don't give features mostly to avoid spaghetti code; what if what's really needed is tools to make dealing with spaghetti code easy?
- philosopher1234 4y agoI’m right there with you. It feels much more interesting than the 3 strategies we have collectively formulated for avoiding code. Those strategies have plateaued. Functional programming isn’t good enough. We need something different.
- CrimsonCape 4y agoThe problem with your desire is that the most cutting edge OOP paradigm is event-sourcing, which is essentially functional. Event sourcing isn't a clearly defined pattern, but it kinda blends functional ideas, "given a state and a change, i'll give you a new state" such that your system will give a non-deterministic new state based on a change. That's de facto functional programming. Having said that, the leanest system will be reference types under the hood, as for example, the C# stack frame is limited to 1mb and can't contain your app's entire state. So we arrive at today's cutting edge which is F#, Clojure, etc. that are functional wrappers around heap-based lookups.
- msla 4y agoAssembly language, where most opcodes in a given application are concerned with moving data around and every opcode (including the no-op) mutates at least one register, in that the no-op causes the program counter to advance even if it does absolutely nothing else.
- MichaelMoser123 4y agolisp - code is data (meaning state).