4 ms·
Graphical data flow languages like Max/MSP, Puredata, LabVIEW, and even Quartz Composer make a lot more sense for functional programing. Every time I see someo
by nerme 17y ago
Graphical data flow languages like Max/MSP, Puredata, LabVIEW, and even Quartz Composer make a lot more sense for functional programing.
Every time I see someone "explaining" what is going on in a functional language, it looks just like a Max patch! There are multiple inputs attached to multiple outputs. Of course, if you're well familiar with whatever textual based language you're working with, you are visualizing this process, but still, why aren't all functional languages moving in this direction?
The great thing is you can still drop text-based code in to one of these graphical dataflow languages.
I write a LOT of code in Max/MSP and Quartz Composer. Thankfully, both support Javascript, because some things are just plain easier if you can drop back in to a procedural, text-based language.
Even writing your own compiled plugins/externals is pretty straightforward. Quartz uses Obj-C and Max/MSP uses C++, although I think you can mix in or use pure Obj-C as well. I haven't had to write any functionality in to Max that wasn't already available with the core package or from CNMAT, UBC Toolbox, etc. (yet!)
Anyways, what I'm getting at is that there is a huge advantage in laying things out in a graphical way, especially for concurrent programming.
What I find interesting is that there is very little support for these languages. There are no patterns, best-practices, etc... I've had to bring over the basic concepts from other text-based languages when I'm writing a larger project... and often when I'm looking at other people's patches I'm astonished at the lack of maintainability, the amount of code repetition, etc... it can easily turn in to a spidery mess if you're not used to what you're doing!
- eru 17y agoCan you do higher-order functions in Max?
- nerme 17y agoObviously not in the same manner... but I feel that proper use of patcher/bpatcher objects and utilizing the meta-programming capabilities of it's javascript environment by allowing you to dynamically generate objects and connections allow you to accomplish pretty much whatever it is that you need to do... while gaining my favorite benefits of higher-order functions, namely, tighter, more organized code with less redundancy and awesome interfaces. That being said, Max is still missing some very important aspects, however, such as iteration and recursion. Interestingly, Quartz Composer does have a method for iteration, one that I frequently use... it works really well, actually! I really like text-based programming, but I'm increasingly seeing the benefits of graphical programming.
- eru 17y agoGraphical programming and lambda calculus can go together well. Have a look at "To Dissect a Mockingbird: A Graphical Notation for the Lambda Calculus with Animated Reduction" (http://dkeenan.com/Lambda/ http://dkeenan.com/Lambda/) for some ideas.