4 ms·
I think one programming paradigm that is very underserved is something in the sorts of filters. GPU shaders, Signal Processing or a Nginx filter are all on thi
by oscargrouch 7y ago
I think one programming paradigm that is very underserved is something in the sorts of filters.
GPU shaders, Signal Processing or a Nginx filter are all on this line of thinking.
We should be more inclined into program things as filters where we manipulate and maybe mutate/transform the data that is passing through that filter, so this could be easily paralelized, cut a lot of expensive CPU branches and where humans and machines could work together making those filters. (It would be much easiar for an AI to infer/learn about how to program like this)
In this perspective how we layout and shape the data is much more important.. so if we could create new standards where we can represent anything as a matrix for instance, we could have state-of-the-art engines who would care about scheduling, compilation and paralelization so we could only focus on manipulate and transform data according to the goals of what we are trying to achieve.
- hderms 7y agoI'm inclined to agree but if an nginx filter is like (HttpRequest, HttpResponse) => (HttpRequest, HttpResponse) then aren't we basically saying we like purely problems that can be expressed as compositions of pure functions? Signal programming I have less feelings on
- oscargrouch 7y agoin Nginx HttpRequest/HttpResponse are larger abstractions but the "real fun" will happen at the buffers, where you will end up mostly manipulating bytes on the buffers. The fact that we are creating arbitrary abstractions to represent data and imposing to others is actually the core issue here. Supose we could set up the representation for the most things as a matrix. colors, words, sound, etc.. Than you can filter and process applying linear algebra, ML, etc.. I fell that the way we pack bytes, in arbitrary fashion, by mixing types is a core impediment for us to have a better experience with the program/data duality. But i guess that all of this data centered, AI focused world will make us understand a better way to deal with both programs and data. The need to make our ML agents understand our world will probably change the way we deal with code and data.
- viraptor 7y agoIs the jump to pure functions needed? I mean, nginx will happily include a cache lookup, or a random content in that transformation - that's very much not pure, but often desired.
- oscargrouch 7y agoJust to add to this, more to the spot of your question, i think a no side-effect is often desirable, but i dont think it should be an impediment. As you might need to call another function inside of our procedure that mutates some data. But i think there are some sort of problems we are imposing to ourselves just because we need to deal with the millions possible ways a data could be laid out or modeled based in our type-system centric world. In my perfect world, we should model functions in a DNA fashion, so function is also data, and if is mutable, could even be changed by the data depending of the what is in it. First, we would never have to re-create a function again, and if we do, the data signature would be exactly the same as the other one created before, so we can match in a index for instance. Im more inspired by the way things are done in the natural world, than the way we ended up shaping math (where the concepts of FP are more based on).
- Izkata 7y agoSemi-amusingly, to tie that to GP's comment, the few times they show "real" programming on Star Trek, that's exactly what it looks like - visually chaining transformations together in a directed graph.
- vanderZwan 7y agoNoodle interfaces are really old in terms of GUIs, and have the advantage of being very visual (important for a TV series) so that's not too surprising
- vanderZwan 7y agoYou might be interested in Halide: https://halide-lang.org/ https://halide-lang.org/
- oscargrouch 7y agoYes, this is much more into the spot. But i think will be a long way til we reach tools that are more like that. We are very dependent of the current data formats, software and tools, and going into this direction, would mean to leave a lot of working good stuff behind.