4 ms·
This guy just gave a cool name to an old concept.
by loandbehold 2y ago
This guy just gave a cool name to an old concept.
- cjk2 2y agoThat's Martin Fowler's job :)
- rwmj 2y agoI first heard about this concept in the early 1990s from netpbm (then called pbmtools). The exact language seems to have been removed from the current manual[1] but the basic idea was that if you have N image formats, you can either write NxN tools to convert between them, or you can have a few common image formats (ie. pbm - bitmap, pgm - greyscale and ppm - fullcolour) and then write 2xN tools to convert between the universe of all image formats and the common formats. You then use Unix pipes to connect the tools together. [1] https://netpbm.sourceforge.net/doc/ https://netpbm.sourceforge.net/doc/
- nottorp 2y agoExcept in that case you're converting to and from an uncompressed buffer... that could be in ram and not use a file format at all?
- rwmj 2y agoIt's much more useful to have a real file format. For example, you can generate images from your own code by doing this (with a bit more shell quoting and error checking in the real code): fp = popen ("ppmtojpeg > output.jpg", "w"); fprintf (fp, "P3 1024 1024 255\n"); for (y = 0; y < 1024; ++y) for (x = 0; x < 1024; ++x) fprintf (fp, "%d %d %d\n", 255*r[y][x], 255*g[y][x], 255*b[y][x]); fclose (fp);
- frutiger 2y agoThis is the first time I have seen anyone popen’ing a pipeline like that, and writing to its stdin. Bravo.
- ramses0 2y agoI miss a bit some of the old `xxx2yyy` programs. It's tempting to consider: FILE.csv.html.pdf.zip ...`csv2html | html2pdf | pdf2zip`, and vice-versa... how possible is it to make the pipeline reversible, eg: `zip2pdf | pdf2html | html2csv`, or in the absence of "reversibility", could you simply shortcut and get straight back to the original `*.csv`?
- deleted 2y ago[deleted]
- diego_moita 2y agoOther names for the same idea: "modularization", "loose coupling and strong cohesion", "program to interfaces, not implementations", ...
- rusk 2y agoParsimony
- chubot 2y ago(author here) I will probably write more about this, but it's not just modularity, or interfaces. Or at least those words are clouded by associations with specific mechanisms in whatever programming languages one has used One additional distinction that's relevant is strong vs. weak modules in the sense here: https://thunderseethe.dev/posts/whats-in-a-module/#strong-vs-weak-modules https://thunderseethe.dev/posts/whats-in-a-module/#strong-vs... Some of my comments here - https://lobste.rs/s/eccv1g/what_s_module https://lobste.rs/s/eccv1g/what_s_module and here - https://lobste.rs/s/u7y4lk/modules_matter_most_for_masses https://lobste.rs/s/u7y4lk/modules_matter_most_for_masses Harper doesn't use the term "strong modularity", but he says that REAL modularity is M x N, and that's closer to what I'm getting at: https://existentialtype.wordpress.com/2011/04/16/modules-matter-most/ https://existentialtype.wordpress.com/2011/04/16/modules-mat... To be most useful, it is important that the relationship between M and A be many-to-many, and not many-to-one or one-to-one. (Although I disagree with the assertions about static types -- I think he is making a very domain specific argument, nonetheless we agree on strong modularity) It needs more analysis, but I'd claim there are at least two kinds of modularity and programming to interfaces, but the difference is not clear to most people The interior vs. exterior distinction is a big one -- is the interface "owned by" one party, or does it stand alone? Are you able to do "interior" refactorings that change the interface, or is it fixed, outside the project? This is a big difference in practice
- rusk 2y agoparsimonius interfaces must have been taken
- chubot 2y ago(author here) It's an old name for an old concept :) See the previous post The Internet Was Designed With a Narrow Waist, especially the appendix with some history https://www.oilshell.org/blog/2022/02/diagrams.html https://www.oilshell.org/blog/2022/02/diagrams.html The name was apparently coined by Jon Postel in the late 1970's, but this fact is not well known. There are some misattributions in the appendix I apparently learned the term from a talk by Van Jacobsen on Named Data Networking at Google in 2006, but I forgot that I learned it that way! After I wrote the post, a reader Caleb Malchik reminded me about Van Jacobsen's talk, and then I went back and watched it, and realized that's where I got the term from! I then updated the appendix. --- I have searched Hacker News for "narrow waist", and it surprised me that it's not a very well known idea, despite being old and important. (And again - I wrote these articles specifically to gather related material from others, so I welcome any updates or corrections.) One place you can see it in passing is in a 2013 paper from Steven Kell - The operating system: should there be one? https://www.humprog.org/~stephen/research/papers/kell13operating.pdf https://www.humprog.org/~stephen/research/papers/kell13opera... Search for "waist in the hourglass" --- If you think about it, it is not surprising that the "narrow waist" concept from networking is becoming more important to software. Software has become more and more networked for the last 2 decades, and I don't think that trend has even topped out. It is hard to find any kind of software that is not networked. As an example, in 2002 I worked at EA on shrink wrapped video games. They were completely offline embedded systems. But 2004 was the first year we added networking to the game, and now pretty much all games are networked in some way. Also, the Internet is the probably the biggest and most successful thing ever engineered ... (not sure what you would compare it to, maybe nuclear reactors or aircraft carriers). It would be surprising if there weren't some lessons to learn from its engineering!
- Djeman 2y agoAircraft carriers and nuclear reactors are exactly not anything like internet. Huge physical engineering projects are like a huge jigsaw puzzle. Take one piece and picture is not complete. Internet is network, most physical thing to compare with is electric grid. But then again whole electric grid hums with one single frequency.
- samatman 2y ago