Every programming-related community of a certain age eventually has this discussion.
I want a language that can provide both, like python or javascript. I use both methods a lot. For example, my encoders are OOP, but my ui code is all functional (because web browser event loops).
Functional allows concurrent programming, integration of networked components, integration of libraries with threaded dependencies, and interaction with time-sensitive asynchronous and even multiple levels of nested asynchronous interactions – WITHOUT SYNCHRONIZATION!
OOP allows rich semantics which reflect real world features being modeled.
I actually have started learning Haskell for this purpose, but can’t say it is sticking yet. Eventual hope would be to compile to FPGA with Clash and deploy to AWS F1 for HTM in hardware.
What about the downside of having everything you do produce a copy? How do you program for embedded systems with a behemoth that sneezes out object copies for every function (so as not to create side-effects)?
Didn’t they figure out a way around that with Ehrlang? Not sure… Still new to FP. But sometimes you want to reach in and modify your objects, don’t you? I mean, it’s just so damn efficient and convenient!
I agree that imperative is the choice for efficiency, but even when doing that I’d prefer Procedural programming over OOP anytime. simple C over the half breed monster C++.
Although a compatible GPU is required I have to mention CUDA, or similar parallel language for at least coding each brain process into separate CPU cores:
In both the spatial network model I’m experimenting with and a cortical sheet HTM models are based upon are hexagonally located CCU’s that need to be horizontally interconnected into a single network. The question is then (regardless of being written for parallel or not) what is the most efficient way to start with perhaps the simplest thing possible and pass waves by making each 6 bit CCU output the Not/Complement of its input? Optionally it’s then possible to cancel out signals that arrive at the same time, timestep. Either way the wave pattern matches the (signal geometry) concordant pair numbers from live rats during 2 frame place avoidance, though I can’t yet in neuroscientific detail explain exactly why.
The way a GPU forces the problem to be sorted out into information pipelines always seemed to me like the ideal starting point, where from there it’s coded into the closest language to CUDA, using loops instead. After that anything that gets written would be easy to recode for parallel.
I thought it would be helpful to describe the programming dilemma I’m having. It’s for me a very first step in setting up a hexagonal array. What the horizontal connections between neighboring CCU’s look like in parallel code might help set a standard for all of us working with them.