5 ms·
Needle: ASCII-fied arrow notation
- al2o3cr 12y ago"Hopefully this is a lot clearer." Really hope that was a joke, because the immediately preceding mishmash of ASCII art is pretty much the OPPOSITE of clearer. I'm also imagining the source-code diffs from editing one of these. Yow. But perhaps that's the idea: make circuitous functions so painful to write that people refactor to smaller ones.
- xg15 12y agoI don't even need diffs, I imagine writing and editing code like this will be painful enough. Good luck having your program structure limited by the need to force it into a rectangular 2D grid. Also rewriting half of your program because one of your tracks changed sounds like huge fun. The thing is of course that the basic idea of "visually" representing the function graph is extremely fascinating. I just think that a real graphical editor would be better suited for this. Trying to shoehorn it back into a text representation does more damage than good.
- RubyPinch 12y ago> Good luck having your program structure limited by the need to force it into a rectangular 2D grid. could be worse. I remember seeing a method for... visualizing the size of integers in code, '|---------|' being the 1d example, and an ascii square to describe 2d, and I believe a cube would work for 3d (1,2, and 3 integers respectively) I think it was either ruby or C that it was done in, but I havn't seen it in a long time
- jberryman 12y ago> Really hope that was a joke, because the immediately preceding mishmash of ASCII art is pretty much the OPPOSITE of clearer. Do you really think it's a joke or are you just being nasty? I thought it was quite clear (although perhaps the choices of visual ascii characters could be tweaked a little), and it certainly makes the structure of the circuit more apparent than in the original arrow notation. Obviously this is an experiment, and a quite clever one in my opinion.
- blktiger 12y agoIt was not clear at all to me. I find the original function much easier to read myself.
- jrochkind1 12y agoI thought it was a joke, and a cool hack, but not actually intended for real use. But I wasn't sure, and came here to post "So... is this a joke?"
- Dewie 12y agoDid you understand the original Haskell function?
- thu 12y agoThere was a thread on /r/haskell with 116 comments. In particular there were alternative Unicode character sets that made the rendering clearer. http://www.reddit.com/r/haskell/comments/2hpzpu/announcing_needle_asciified_arrow_notation/ http://www.reddit.com/r/haskell/comments/2hpzpu/announcing_n...
- RubyPinch 12y agoit seems like something that would be good for visualizing/gui editing, then unicode could be supported easily and the parsing troubles wouldn't be so bad
- CGamesPlay 12y agoThe concept is very interesting, but I feel like building actual software with this would be better-implemented not with a 1-dimensional text stream, but with a 3-dimensional VR environment, moving wires and such between tangible machines. Redstone programming in Minecraft comes to mind.
- zokier 12y agoSomehow I'm reminded of "Multi-Dimensional Analog Literals" project for C++: assert( ( o-------------o |L \ | L \ | L \ | o-------------o | ! ! ! ! ! o | ! L | ! L | ! L| ! o-------------o ).volume == ( o-------------o | ! ! ! ! ! o-------------o ).area * int(I-------------I) ); http://www.eelis.net/C++/analogliterals.xhtml http://www.eelis.net/C++/analogliterals.xhtml
- nijiko 12y agoI cannot even... It's like 10 times harder to read.
- anigbrowl 12y agoTunnels can overlay each other. The following arrow swaps the outer two elements of a 3-tuple. I can't tell if this is intentional or not, but it's a prime example of when programmers should Stop Writing Code and use a high-level flow diagramming tool, for the same reason that large projects shouldn't be done in assembler, that chip designers long ago gave up doing layout by hand, and architects use drawings instead of writing out step-by-step instructions. Code is a really terrible medium for defining structural relationships. Sticking with the architecture metaphor, if you look at the plan for a building it requires skill and effort to understand properly - and for large buildings, a capacity for understanding abstraction - but even to the untrained eye there's a clear isomorphism between the plan and the actual structure. When you first encounter a large body of code it's more like a jigsaw puzzle without the reference picture. There are some standard reference points you can rely on - analogous to identifying edge and corner tiles, and knowing about different conventions of interlocking tiles - but you have to do a good bit of reading before the flow of the program emerges and you get a sense of where most of the computational effort takes place. My mental representation of a program is as a causal network, somewhere between the operation of a clock and a Rube Goldberg machine (probably because I spent a lot of time dismantling clocks as a child); reading code in order to figure out the operational structure often feels to me like closing my eyes and trying to infer the structure of something through my hands.
- petercooper 12y agoThis is clever, whatever the intent. Are there any truly visual programming environments that are functionally based in this way? I don't think ASCII is the right venue for this sort of idea, but such ideas must have been tried before for functional languages.
- chrisBob 12y agoAnyone who likes this notation should look into Labview. It is a visual language where you draw the network the data will follow, and is in use in a lot of university labs. There are even companies that sell equipment programmed this way. People who have done much programming usually hate it, but you can get non-programmers to build the interface for a scanning confocal microscope this way and expect it to actually work in a few weeks. I have found that it is a horrible way to do easy things[1], but it can be a useful way to put together fairly complicated programs with multiple concurrent pieces and a nice UI. [1] Hello world is something like find the graphic that creates an integer box and add it to the UI. Then repeat for a second and third number. Find the plus sign and connect the first two with wires as inputs and the third as the output. Change to the UI view and organize everything and add appropriate labels. You now have a display that will show x=a+b. For a programmer that is painful.
- HCIdivision17 12y agoMy college roommate made the observation that "Everything is equally hard to do in LabView." He was a physicist and generalizing, but it holds up nicely. You can either sum up and divide a few numbers, or automatically collect data from a sensor every five seconds and store to an Excel file with about the same difficulty. I both adore and hate the language for that weirdness.