It's not the only possible way to model the world, but it absolutely is a unified approach that you can apply to a whole system, and it tends to work better when you do - trying to apply "FP as a tool" within a fundamentally mutation-oriented system (for example) gets you a very limited subset of the benefits, IME.
To me, a functional language without tail recursion seems pointless. Is it possible to abstract away whether you are recursive or iterative, like an iterative recursion scheme?
One thing that I think would be great is if there was a Python approach to effects systems like Polysemy (free monads); what might an in between be for this?
Tail recursion is a low-level detail IMO. Scala does fine without it.
We are in Erlang though, so I wouldn't call it 'mutation' necessarily. The stateful bits are individual actors, creating a new internal state in response to messages.
Right. Which is very much opposed to your initial "FP is a tool, not a unified theory on how to model the world".
I enjoyed reading that line - made me chuckle :) Would you mind sharing what it is that keeps bringing you back to play?
I'm a grey beard programmer, husband, father, and vanilla Linux kinda guy - and I've seen Factorio being mentioned on this forum quite a bit over the years. The chatter here today has once again piqued my interest to say the least.
I was once an avid gamer in my youth, but these days I have little free time - so if I were to pick up a game, it would have to be the sort of experience that I can play for a few minutes here and there (and / or immerse myself in for several hours at a time when the opportunity arises). It would also need to run smoothly on Linux, and be relatively easy on computing resources.
I tried Minecraft for a bit - and it ticked most of the above boxes - but I didn't much enjoy the interface and lack of "systems" if that makes sense. I love building things, but I also just enjoy sitting back and watching systems work. I prefer top-down planning / building games like the Sim City of old but that got boring pretty quickly.
Anyhow I think I oughta just install Factorio and check it out - but I'm deeply curious what it is that keeps bringing you back for more.
There's a demo version which gives you a pretty good idea of how Factorio feels. I forget whether the demo runs on Linux, but the full game is straightforward to run on Linux, by which I mean I forget whether you need an emulation layer.
> Would you mind sharing what it is that keeps bringing you back to play?
To be fair, I did reach the "I'm done with Factorio" point. I have one last hurrah of getting one last accomplishment in progress, and then I'm realistically done with the game.
But to answer your question: it's because Factorio's systems are extremely deep, where the nature of the puzzles and the way you think about them keep evolving. And as you solve those problems you get the satisfaction of seeing those systems working. It's the same high I get from seeing my code work, but in video game form.
> it would have to be the sort of experience that I can play for a few minutes here and there (and / or immerse myself in for several hours at a time when the opportunity arises).
Factorio isn't the type of game you can play for a few minutes at a time. For me, Factorio relies on the same kind of flow state I use for other focused work. So I play it when I opportunistically have long blocks of time. Most of my hours put into Factorio were from earlier years of my life when I had fewer responsibilities and obligations.
> I tried Minecraft [...] but I didn't much enjoy the [...] lack of "systems"
> I also just enjoy sitting back and watching systems work
> I prefer top-down planning
Yeah, you should love Factorio!
These kinds of projects are one of the only things I get FOMO over studying physics - I really like the idea of getting a few months to (say) write a compiler as a group rather than piles of utterly inane lab work teaching me how to use equipment I already know how to use
it's literally arrows
I'm having some trouble coming up with plausible inferences from that fact. Do you mean to imply that "when you have a hammer everything looks like a nail"?
The category theory for programmers crowd argue that categorical diagrams (annotated graphs) are the right way to reason about software to gain insights — and the rest is describing the equivalence between functions in a type theory and maps in a category.
Your mental model of directed graphs is a functional model.
In the more general sense that may be true, but I was talking about Factorio specifically, where I'm using the graph representation to do the analysis.
Or rather, just because a functional interpretation exists doesn't mean I actually reach for the toolkit filed in my memory in the box labeled "functional stuff". In practice I mostly reach for the boxes I've filed away under "linear algebra", "graph theory", and "circuit design", which aren't things I typically reach for when I'm actually doing functional programming.
On the other hand, and this is speaking as someone who has played the game for an embarrassing number of hours all the way into endgame "megabase" territory: my mental abstraction of the game isn't really functional. It's directed graphs. Sure, the two views can be equivalent representations, but I find thinking about the game as a directed graph (and reasoning about throughputs in a graph representing a network) to be the perspective that gives actionable insights most readily.