1. 1

    Where did you find this, @nicebyte?

    1. 1

      I am the author

      1. 1

        I get that. I meant, where did you find the quine you describe?

        1. 1

          Oh, the author posted it on twitter and i came across it via retweets/likes

    1. 6

      Extensibility and re-usability are potential goals for system boundaries only. ..creating something that’s re-usable is pretty inherently about creating something that’s a system boundary, to some degree or another. And if you’re knowingly working on a system boundary… you’re knowingly working on something that supposed to be re-usable already. It’s pretty redundant to hail it as a design goal.

      This is great. I’ve been collecting anti-reuse, anti-abstraction links. Everytime I add one to my collection I’m going to share the whole thing.

      1. 4

        The part you quoted is also followed by:

        System boundaries are the danger zones of design. To whatever extent possible, we don’t want to create them unnecessarily. Any mistakes we make there are frozen, under threat of expensive breaking changes to fix.

        This is a nice counter to the approach of “all classes should be isolated”, “inject everything”, “never use ‘new’”, “mock everything”, etc. that I’ve encoutered in old jobs. It turns the implementation detail of internal code organisation boundaries (i.e. classes) into faux system boundaries, which makes them much more rigid and burdensome to change, slowing us down and discouraging refactoring.

      1. 33

        Good talk.

        I recently used systemd “in anger” for the first time on a raspi device to orchestrate several scripts and services, and I was pleasantly surprised (but also not surprised, because the FUD crowd is becoming more and more fingerprintable to me). systemd gives me lifecycle, logging, error handling, and structure, declaratively. It turns out structure and constraints are really useful, this is also why go has fast dependency resolution.

        It violates unix philosohpy

        That accusation was also made against neovim. The people muttering this stuff are slashdot markov chains, they don’t have any idea what they’re talking about.

        1. 21

          The declarative units are definitely a plus. No question.

          I was anti-systemd when it started gaining popularity, because of the approach (basically kitchen-sinking a lot of *NIX stuff into a single project) and the way the project leader(s) respond to criticism.

          I’ve used it since it was default in Debian, and the technical benefits are very measurable.

          That doesnt mean the complaints against it are irrelevant though - it does break the Unix philosophy I think most people are referring to:

          Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new “features”.

          1. 30

            If you believe composability (one program’s output is another program’s input) is an important part of The Unix Philosophy, then ls violates it all day long, always has, likely always will. ls also violates it by providing multiple ways to sort its output, when sort is right there, already doing that job. Arguably, ls formatting its output is a violation of Do One Thing, because awk and printf exist, all ready to turn neat columns into human-friendly text. My point is, The Unix Philosophy isn’t set in stone, and never has been.

            1. 7

              Didn’t ls predate the Unix Philosophy? There’s a lot of crufthistory in unix. dd is another example.

              None of that invalidates the philosophy that arose through an extended design exploration and process.

              1. 4

                nobody said it’s set in stone; it’s a set of principles to be applied based on practicality. like any design principle, it can be applied beyond usefulness. some remarks:

                • i don’t see where ls violates composability. the -l format was specifically designed to be easy to grep.
                • the sorting options are an example of practicality. they don’t require a lot of code, and would be much more clumsy to implement as a script (specifically when you don’t output the fields you’re sorting on)
                • about formatting, i assume you’re referring to columniation, which to my knowledge was not in any version of ls released by Bell Labs. checking whether stdout is a terminal is indeed an ugly violation.
                1. 5

                  i don’t see where ls violates composability. the -l format was specifically designed to be easy to grep.

                  People have written web pages on why parsing the output of ls is a bad idea. Using ls -l doesn’t solve any of these problems.

                  As a matter of fact, the coreutils people have this to say about parsing the output of ls:

                  However ls is really a tool for direct consumption by a human, and in that case further processing is less useful. For futher processing, find(1) is more suited.

                  Moving on…

                  the sorting options are an example of practicality. they don’t require a lot of code, and would be much more clumsy to implement as a script (specifically when you don’t output the fields you’re sorting on)

                  This cuts closer to the point of what we’re saying, but here I also have to defend my half-baked design for a True Unix-y ls Program: It would always output all the data, one line per file, with filenames quoted and otherwise prepared such that they always stick to one column of one line, with things like tab characters replaced by \t and newline characters replaced by \n and so on. Therefore, the formatting and sorting programs always have all the information.

                  But, as I said, always piping the output of my ls into some other script would be clumsier; it would ultimately result in some “human-friendly ls” which has multiple possible pipelines prepared for you, selectable with command-line options, so the end result looks a lot like modern ls.

                  about formatting, i assume you’re referring to columniation, which to my knowledge was not in any version of ls released by Bell Labs. checking whether stdout is a terminal is indeed an ugly violation.

                  I agree that ls shouldn’t check for a tty, but I’m not entirely convinced no program should.

                  1. 4

                    just because some people discourage composing ls with other programs doesn’t mean it’s not the unix way. some people value the unix philosophy and some don’t, and it’s not surprising that those who write GNU software and maintain wikis for GNU software are in the latter camp.

                    your proposal for a decomposed ls sounds more unixy in some ways. but there are still practical reasons not to do it, such as performance and not cluttering the standard command lexicon with ls variants (plan 9 has ls and lc; maybe adding lt, lr, lu, etc. would be too many names just for listing files). it’s a subtle point in unix philosophy to know when departing from one principle is better for the overall simplicity of the system.

              2. 25

                With all due respect[1], did your own comment hit your fingerprint detector? Because it should. It’s extrapolating wildly from one personal anecdote[2], and insulting a broad category of people without showing any actual examples[3]. Calling people “markov chains” is fun in the instant you write it, but contributes to the general sludge of ad hominem dehumanization. All your upvoters should be ashamed.

                [1] SystemD arouses strong passions, and I don’t want this thread to devolve. I’m pointing out that you’re starting it off on the wrong foot. But I’m done here and won’t be responding to any more name-calling.

                [2] Because God knows, there’s tons of badly designed software out there that has given people great experiences in the short term. Design usually matters in the long term. Using something for the first time is unlikely to tell you anything beyond that somebody peephole-optimized the UX. UX is certainly important, rare and useful in its own right. But it’s a distinct activity.

                [3] I’d particularly appreciate a link to NeoVim criticism for being anti-Unix. Were they similarly criticizing Vim?

                1. 9

                  [3] I’d particularly appreciate a link to NeoVim criticism for being anti-Unix. Were they similarly criticizing Vim?

                  Yes, when VIM incorporated a terminal. Which is explicitly against its design goals. From the VIM 7.4 :help design-not

                  VIM IS... NOT                                           *design-not*
                  
                  - Vim is not a shell or an Operating System.  You will not be able to run a
                    shell inside Vim or use it to control a debugger.  This should work the
                    other way around: Use Vim as a component from a shell or in an IDE.
                    A satirical way to say this: "Unlike Emacs, Vim does not attempt to include
                    everything but the kitchen sink, but some people say that you can clean one
                    with it.  ;-)"
                  

                  Neo-VIM appears to acknowledge their departure from VIM’s initial design as their :help design-not has been trimmed and only reads:

                  NVIM IS... NOT                                          design-not
                  
                  Nvim is not an operating system; instead it should be composed with other
                  tools or hosted as a component. Marvim once said: "Unlike Emacs, Nvim does not
                  include the kitchen sink... but it's good for plumbing."
                  

                  Now as a primarily Emacs user I see nothing wrong with not following the UNIX philosophy, but at it is clear that NeoVIM has pushed away from that direction. And because that direction was an against their initial design it is reasonable for users that liked the initial design to criticism NeoVIM because moving further away from the UNIX philosophy.

                  Not that VIM hadn’t already become something more than ‘just edit text’, take quickfix for example. A better example of how an editor can solve the same problem by adhering to the Unix Philosophy of composition through text processing would be Acme. Check out Acme’s alternative to quickfix https://youtu.be/dP1xVpMPn8M?t=551

                  1. 0

                    akkartik, which part of my comment did you identify with? :) FWIW, I’m fond of you personally.

                    I’d particularly appreciate a link to NeoVim criticism for being anti-Unix

                    Every single Hacker News thread about Neovim.

                    Were they similarly criticizing Vim?

                    Not until I reply as such–and the response is hem-and-haw.

                    1. 8

                      To be fair I don’t think the hacker news hive mind is a good judge of anything besides what is currently flavour of the week.

                      Just yesterday I had a comment not just downvoted but flagged and hidden-by-default, because I suggested Electron is a worse option than a web app.

                      HN is basically twitter on Opposite Day: far too happy to remove any idea even vaguely outside what the group considers “acceptable”.

                      1. 4

                        Indeed, I appreciate your comments as well in general. I wasn’t personally insulted, FWIW. But this is precisely the sort of thing I’m talking about, the assumption that someone pushing back must have their identity wrapped up in the subject. Does our community a disservice.

                        1. 0

                          OTOH, I spent way too much of my life taking the FUD seriously. The mantra-parroting drive-by comments that are common in much of the anti-systemd and anti-foo threads should be pushed back. Not given a thoughtful audience.

                          1. 2

                            Totally fair. Can you point at any examples?

                            1. 3

                              https://news.ycombinator.com/item?id=7289935

                              The old Unix ways are dying… … Vim is, in the spirit of Unix, a single purpose tool: it edits text.

                              https://news.ycombinator.com/item?id=10412860

                              thinks that anything that is too old clearly has some damage and its no longer good technology, like the neovim crowd

                              Also just search for “vim unix philosophy” you’ll invariably find tons of imaginary nonsense:

                              https://hn.algolia.com/?query=vim%20unix%20philosophy&sort=byPopularity&prefix&page=0&dateRange=all&type=comment

                              Please don’t make me search /r/vim :D

                              1. 4

                                thinks that anything that is too old clearly has some damage and its no longer good technology, like the neovim crowd

                                That’s not saying that neovim is ‘anti-Unix philosophy’, it’s saying that neovim is an example of a general pattern of people rewriting and redesigning old things that work perfectly well on the basis that there must be something wrong with anything that’s old.

                                Which is indeed a general pattern.

                                1. 1

                                  That’s not saying that neovim is ‘anti-Unix philosophy’

                                  It’s an example of (unfounded) fear, uncertainty, and doubt.

                                  rewriting and redesigning old things that work perfectly well on the basis that there must be something wrong with anything that’s old.

                                  That’s a problem that exists, but attaching it to project X out of habit, without justification, is the pattern I’m complaining about. In Neovim’s case it’s completely unfounded and doesn’t even make sense.

                                  1. 1

                                    It’s not unfounded. It’s pretty obvious that many of the people advocating neovim are doing so precisely because they think ‘new’ and ‘modern’ are things that precisely measure the quality of software. They’re the same people that change which Javascript framework they’re using every 6 weeks. They’re not a stereotype, they’re actual human beings that actually hold these views.

                                    1. 2

                                      Partial rewrite is one of the fastest ways to hand off software maintainership, though. And vim needed broader maintainer / developer community.

                                      1. 0

                                        Vim’s maintainer/developer community is more than sufficient. It’s a highly extensible text editor. Virtually anything can be done with plugins. You don’t need core editor changes very often if at all, especially now that the async stuff is in there.

                                        1. 3

                                          You don’t need core editor changes very often if at all, especially now that the async stuff is in there.

                                          Which required pressure from NeoVim, if I understood the situation correctly. Vim is basically a one-man show.

                                2. 2

                                  Thanks :) My attitude is to skip past crap drive-by comments as beneath notice (or linking). But I interpreted you to be saying FUD (about SystemD) that you ended up taking seriously? Any of those would be interesting to see if you happen to have them handy, but no worries if not.

                                  Glad to have you back in the pro-Neovim (which is not necessarily anti-Vim) camp!

                      2. 19

                        What is FUD is this sort of comment: the classic combination of comparing systemd to the worst possible alternative instead of the best actual alternative with basically claiming everyone that disagrees with you is a ‘slashdot markov chain’ or similar idiotic crap.

                        On the first point, there are lots of alternatives to sysvinit that aren’t systemd. Lots and lots and lots. Some of them are crap, some are great. systemd doesn’t have a right to be compared only to what it replaced, but also all the other things that could have replaced sysvinit.

                        On the second point, it’s just bloody rude. But it also shows you don’t really understand what people are saying. ‘I think [xyz] violates the unix philosophy’ is not meaningless. People aren’t saying it for fun. They’re saying it because they think it’s true, and that it’s a bad thing. If you don’t have a good argument for the Unix philosophy not matter, or you think systemd doesn’t actually violate it, please go ahead and explain that. But I’ve never actually seen either of those arguments. The response to ‘it violates the Unix philosophy’ is always just ‘shut up slashdotter’. Same kind of comment you get when you say anything that goes against the proggit/hn hivemind that has now decided amongst other things that: microsoft is amazing, google is horrible, MIT-style licenses are perfect, GPL-style licenses are the devil-incarnate, statically typed languages are perfect, dynamically typed languages are evil, wayland is wonderful, x11 is terrible, etc.

                        1. 8

                          claiming everyone that disagrees with you is a ‘slashdot markov chain’ or similar idiotic crap

                          My claim is about the thoughtless shoveling of groundless rumors. Also I don’t think my quip was idiotic.

                          there are lots of alternatives to sysvinit that aren’t systemd

                          That’s fine, I never disparaged alternatives. I said: systemd is good and I’m annoyed that the grumblers said it wasn’t.

                          1. 2

                            It’s not good though, for all the reasons that have been said. ‘Better than what you had before’ and ‘good’ aren’t the same thing.

                            1. 1

                              seriously. If you don’t like systemd, use something else and promote its benefits. Tired of all the talking down of systemd. It made my life so much easier.

                              1. 1

                                seriously. If you like systemd, use it and shut up about it. Tired of all the talking up of systemd as if it’s actually any better than its alternatives, when it is objectively worse, and is poorly managed by nasty people.

                                1. 4

                                  Have you watched the video this thread is about? Because you really sound like the kind of dogmatist the presenter is talking about.

                                  If you like systemd, use it and shut up about it

                                  Also, isn’t this a double-standard, since when it comes to complaining about systemd, this attitude doesn’t seem that prevalent.

                                  1. 2

                                    No, because no other tool threatens the ecosystem like systemd does.

                                    Analogy: it wasn’t a double-standard 10 years ago to complain about Windows and say ‘if you like Windows, use it and shut up about it’.

                                    1. 3

                                      I see this kind of vague criticism when it comes to systemd alot. What ecosystem is it really breaking? It’s all still open source, there aren’t any proprietary protocols or corporate patents that prevent people from modifying the software to not have to rely on systemd. This “threat”, thr way I see it, has turned out to be at most a “ minor inconvenience “.

                                      I suppose you’re thinking about examples like GNOME, but on the one hand, GNOME isn’t a unix-dogmatist project, but instead they aim to create a integrated desktop experience, consciously trading this in for ideal modularity – and on the other, projects like OpenBSD have managed to strip out what required systemd and have a working desktop environment. Most other examples, of which I know, have a similar pattern.

                        2. 6

                          I think that the problem is fanboyism, echo chambers and ideologies.

                          I might be wrong, so please don’t consider this an accusation. But you writing this sounds like someone hearing that systemd is bad, therefore never looking at it, yet copying it. Then one tries it and finding out that baseless prejudices were in fact baseless.

                          After that the assumption is that everyone else must have been doing the same and one is enlightened now to see it’s actually really cool.

                          I think that this group behavior and blindly copying opinions is one of the worst things in IT these days, even though of course it’s not limited to this field.

                          A lot of people criticizing systemd actually looked at systemd, really deep, maybe even built stuff on it, or at least worked with it in production as sysadmin/devop/sre/…

                          Yes, I have used systemd, yes I understand why decisions we’re taken, where authors if the software were going, read specs of the various parts (journald for example), etc.

                          I think I have a pretty good understanding compared to at least most people that only saw it from a users perspective (considering writing unit files to be users perspective as well).

                          So I could write about that in my CV and be happy that I can answer a lot of questions regarding systemd, advocate its usage to create more demand and be happy.

                          To sum it up: I still consider systemd to be bad on multiple layers, both implementation and some ideas that I considered great but then through using it seeing that it was a wrong assumption. By the way that’s the thing I would not blame anyone for. It’s good that stuff gets tried, that’s how research works. It’s not the first and not the last project that will come out sounding good, to only find out a lot of things either doesn’t make a difference or make it worse.

                          I am a critic of systemd but I agree that there’s a lot of FUD as well. Especially when there’s people that blame everything, including own incompetence on systemd. Nobody should ever expect a new project to be a magic bullet. That’s just dumb and I would never blame systemd for trying a different approach or for not being perfect. However I think it has problems on many levels. While I think the implementation isn’t really good that’s something that can be fixed. However I think some parts of the concept level are either pretty bad or have turned out to be bad decisions.

                          I was very aware that especially in the beginning the implementation was bad. A lot got better. That’s to be expected. However next to various design decisions I consider bad I think many more were based on ideas that I think to most people in IT sound good and reasonable but in the specific scenarios that systemd is used it at least in my experience do not work out at all or only work well in very basic cases.

                          In other words the cases where other solutions are working maybe not optimal, but that aren’t considered a problem worth fixing because the added complexity isn’t worth it systemd really shines. However when something is more complex I think using systemd frequently turns out to be an even worse solution.

                          While I don’t wanna go into detail because I don’t think this is the right format for an actual analysis I think systemd in this field a lot in common with both configuration management and JavaScript frameworks. They tend to be amazing for use cases that are simple (todo applications for example), but together with various other complexities often make stuff unnecessarily complicated.

                          And just like with JavaScript frameworks and configuration management there’s a lot of FUD, ideologies, echochambers, following the opinion of some thought leaders, and very little building your own solid opinion.

                          Long story short. If you criticize something without knowing what it is about then yes that’s dumb and likely FUD. However assuming that’s the only possible reason for someone criticizing software is similarly dumb and often FUD regarding this opinion.

                          This by the way also works the reverse. I frequently see people liking software and echoing favorable statements for the same reasons. Not understanding what they say, just copying sentences of opinion leaders, etc.

                          It’s the same pattern, just the reversal, positive instead of negative.

                          The problem isn’t someone disliking or liking something, but that opinions and thoughts are repeated without understanding which makes it hard to have discussions and arguments that give both sides any valuable insides or learnings

                          Then things also get personal. People hate on Poetteing and think he is dumb and Poetteing thinks every critic is dumb. Just because that’s a lot of what you see when every statement is blindly echoed.

                          1. 1

                            That’s nice, but the implication of the anti-systemd chorus was that sys v init was good enough. Not all of these other “reasonable objections” that people are breathless to mention.

                            The timbre reminded me of people who say autotools is preferrable to cmake. People making a lot of noise about irrelevant details and ignoring the net gain.

                            But you writing this sounds like someone hearing that systemd is bad, therefore never looking at it, yet copying it.

                            No, I’m reacting to the idea that the systemd controversy took up any space in my mind at all. It’s good software. It doesn’t matter if X or Y is technically better, the popular narrative was that systemd is a negative thing, a net-loss.

                            1. 2

                              In your opinion it’s good software and you summed up the “anti-systemd camp” with “sys v init was good enough” even though people from said “anti-systemd camp” on this very thread disagreed that that was their point.

                              To give you an entirely different point of view, I’m surprised you don’t want to know anything about a key piece of a flagship server operating systems (taking that one distro is technically an OS) affecting the entire eco system and unrelated OS’ (BSDs etc.) that majorly affects administration and development on Linux-based systems. Especially when people have said there are clear technical reasons for disliking the major change and forced compliance with “the new way”.

                              1. 2

                                you summed up the “anti-systemd camp” with “sys v init was good enough” even though people from said “anti-systemd camp” on this very thread disagreed that that was their point.

                                Even in this very thread no one has actually named a preferred alternative. I suspect they don’t want to be dragged into a discussion of details :)

                                affecting the entire eco system and unrelated OS’ (BSDs etc.)

                                BSDs would be a great forum for demonstrating the alternatives to systemd.

                                1. 2

                                  Well, considering how many features that suite of software has picked up, there isn’t currently one so that shortens the conversation :)

                                  launchd is sort of a UNIX alternative too, but it’s currently running only on MacOS and it recently went closed source.

                          2. 3

                            It violates unix philosohpy

                            That accusation was also made against neovim. The people muttering this stuff are slashdot markov chains, they don’t have any idea what they’re talking about.

                            i don’t follow your reasoning. why is it relevant that people also think neovim violates the unix philosophy? are you saying that neovim conforms to the unix philosophy, and therefore people who say it doesn’t must not know what they’re talking about?

                            1. 1

                              are you saying that neovim conforms to the unix philosophy, and therefore people who say it doesn’t must not know what they’re talking about?

                              When the implication is that Vim better aligns with the unix philosophy, yes, anyone who avers that doesn’t know what they’re talking about. “Unix philosophy” was never a goal of Vim (”:help design-not” was strongly worded to that effect until last year, but it was never true anyways) and shows a deep lack of familiarity with Vim’s features.

                              Some people likewise speak of a mythical “Vim way” which again means basically nothing. But that’s a different topic.

                              1. 1

                                vim does have fewer features which can be handled by other tools though right? not that vim is particularly unixy, but we’re talking degrees

                            2. 1

                              The people muttering this stuff are slashdot markov chains, they don’t have any idea what they’re talking about

                              I’ll bookmark this comment just for this description.

                            1. 4

                              After spending a few months with Forth earlier this year, I absolutely agree that Forth can be extraordinarily simple and compact, that mainstream software is an endless brittle tower of abstractions, and that the aha moment when you find the right abstractions of a problem can be transcendent. But writings like this also indicate limitations that the Forth community unquestioningly accepts.

                              Forth is quite “individualistic”, tailored to single persons or small groups of programmers.. nobody says that code can’t be shared, that one should not learn to understand other people’s code or that designs should be hoarded by lone rangers. But we should understand that in many cases it is a single programmer or very small team that does the main design and implementation work.

                              This is fine. However, the next step is not:

                              once it becomes infeasible for a single person to rewrite the core functionality from scratch, it is dead. The ideal is: you write it, you understand it, you maintain and change it, you rewrite it as often as necessary, you throw it away and do something else.

                              I’ll suggest an alternative meaning of “dead”: when it stops being used. By this definition, most Forth programs are dead. (duck) More seriously, it is abuse of privilege to claim some software is dead just because it’s hard to modify. If people are using it, it is providing value.

                              It is the fundamental property and fate of all software to outlive its creator. The mainstream approach, for all of its many problems, allows software to continue to serve its users long after the original authors leave the scene. They decay, yes, but in some halting, limping fashion they continue to work for a long time. It’s worth acknowledging the value of this longevity. Any serious attempt to replace mainstream software must design for longevity. That requires improving on our ability to comprehend each other’s creations. And Forth (just like Scheme and Prolog) doesn’t really improve things much here. Even though ‘understanding’ is mentioned above, it is in passing and clearly not a priority. Even insightful Forth programs can take long periods of work to appreciate. If a tree has value in the forest but nobody can appreciate it, does it really have value? I believe comprehensibility is the last missing piece that will help Forth take over the world. Though it may have to change beyond recognition in the process.

                              (This comment further develops themes I wrote about earlier this year. Lately I’ve been working on more ergonomic machine code, adding only the minimum syntax necessary to improve checking of programs, adding guardrails to help other programmers comprehend somebody else’s creation. Extremely rudimentary, highly speculative, very much experimental.)

                              1. 5

                                I’ll suggest an alternative meaning of “dead”: when it stops being used. By this definition, most Forth programs are dead. (duck) More seriously, it is abuse of privilege to claim some software is dead just because it’s hard to modify. If people are using it, it is providing value.

                                We ought to distinguish dead-like-a-tree from dead-like-a-duck. A dead tree still stands there and you can probably even put a swing on it & use it for another 15-20 years, but it’s no longer changing in response to the weather. A dead duck isn’t useful for much of anything, and if you don’t eat it real quick or otherwise get rid of it, it’ll liable to stink up the whole place.

                                A piece of code that is actively used but no longer actively developed is dead-like-a-tree: it’s more or less safe but it has no capacity for regeneration or new growth, and if you make a hole in it, that hole is permanent. Once the termites come (once it ceases to fit current requirements or a major vulnerability is discovered) it becomes dead-like-a-duck: useless at best and probably also a liability.

                              1. 7

                                The other minor frustration I have with Factor is the fact that any file that does much work tends to accrete quite a few imports in its USING: line (the calculator I wrote has 23 imports across 4 lines, even though it’s only 100 lines of code). This is mostly due to a lot of various Factor systems being split into quite a few vocabularies. I could see this being helpful with compilation

                                Chatting with @yumaikas about this, we ended up working on a little Vim keyboard macro that lets us type out a module name anywhere in a file and move it into the USING: block at the top. The version I ended up with:

                                " add word at cursor to final line of imports
                                noremap <buffer> <Leader>i diWmz?^USING:<CR>/^;/-1<CR>$a<Space><Esc>p'z
                                " add word at cursor to new line of imports (while preserving existing indentation; that's what the '%<Backspace>' is for)
                                noremap <buffer> <Leader>I diWmz?^USING:<CR>/^;/-1<CR>o%<Backspace><Esc>p'z
                                
                                1. 8

                                  Speaking as a C programmer, this is a great tour of all the worst parts of C. No destructors, no generics, the preprocessor, conditional compilation, check, check, check. It just needs a section on autoconf to round things out.

                                  It is often easier, and even more correct, to just create a macro which repeats the code for you.

                                  A macro can be more correct?! This is new to me.

                                  Perhaps the overhead of the abstract structure is also unacceptable..

                                  Number of times this is likely to happen to you: exactly zero.

                                  C function signatures are simple and easy to understand.

                                  It once took me 3 months of noodling on a simple http server to realize that bind() saves the pointer you pass into it, so makes certain lifetime expectations on it. Not one single piece of documentation I’ve seen in the last 5 years mentions this fact.

                                  1. 4

                                    It once took me 3 months of noodling on a simple http server to realize that bind() saves the pointer you pass into it

                                    Which system? I’m pretty sure OpenBSD doesn’t.

                                    https://github.com/openbsd/src/blob/4a4dc3ea4c4158dccd297c17b5ac5a6ff2af5515/sys/kern/uipc_syscalls.c#L200

                                    https://github.com/openbsd/src/blob/4a4dc3ea4c4158dccd297c17b5ac5a6ff2af5515/sys/kern/uipc_syscalls.c#L1156

                                    1. 2

                                      Linux (that’s the manpage I linked to above). This was before I discovered OpenBSD.

                                      Edit: I may be misremembering and maybe it was connect() that was the problem. It too seems fine on OpenBSD. Here’s my original eureka moment from 2011: https://github.com/akkartik/wart/commit/43366d75fbfe1. I know it’s not specific to that project because @smalina and I tried it again with a simple C program in 2016. Again on Linux.

                                        1. 1

                                          Notice that I didn’t implicate the kernel in my original comment, I responded to a statement about C signatures. We’d need to dig into libc for this, I think.

                                          I’ll dig up a simple test program later today.

                                          1. 2

                                            Notice that I didn’t implicate the kernel in my original comment, I responded to a statement about C signatures. We’d need to dig into libc for this, I think.

                                            bind and connect are syscalls, libc would only have a stub doing the syscall if anything at all since they are not part of the standard library.

                                    2. 2

                                      Perhaps the overhead of the abstract structure is also unacceptable..

                                      Number of times this is likely to happen to you: exactly zero.

                                      I have to worry about my embedded C code being too big for the stack as it is.

                                      1. 1

                                        Certainly. But is the author concerned with embedded programming? He seems to be speaking of “systems programming” in general.

                                        Also, I interpreted that section as being about time overhead (since he’s talking about the optimizer eliminating it). Even in embedded situations, have you lately found the time overheads concerning?

                                        1. 5

                                          I work with 8-bit AVR MCUs. I often found myself having to cut corners and avoid certain abstractions, because that would have resulted either in larger or slower binaries, or would have used significantly more RAM. On an Atmega32U4, resources are very limited.

                                      2. 1

                                        Perhaps the overhead of the abstract structure is also unacceptable..

                                        Number of times this is likely to happen to you: exactly zero.

                                        Many times, actually. I see FSM_TIME. Hmm … seconds? Milliseconds? No indication of the unit. And what is FSM_TIME? Oh … it’s SYS_TIME. How cute. How is that defined? Oh, it depends upon operating system and the program being compiled. Lovely abstraction there. And I’m still trying to figure out the whole FSM abstraction (which stands for “Finite State Machine”). It’s bad enough to see a function written as:

                                        static FSM_STATE(state_foobar)
                                        {
                                        ...
                                        }
                                        

                                        and then wondering where the hell the variable context is defined! (a clue—it’s in the FSM_STATE() macro).

                                        And that bind() issue is really puzzling, since that haven’t been my experience at all, and I work with Linux, Solaris, and Mac OS-X currently.

                                        1. 1

                                          I agree that excessive abstractions can hinder understanding. I’ve said this before myself: https://news.ycombinator.com/item?id=13570092. But OP is talking about performance overhead.

                                          I’m still trying to reproduce the bind() issue. Of course when I want it to fail it doesn’t.

                                      1. 1

                                        @PuercoPop you got me to try to play with vc-annotate-file, but when I try to hit something simple like C-x v = it says “File ___ is not under version control” Strange that it doesn’t prompt me to configure it. Any idea where it may be caching this stuff? I have no .emacs (normally a *Vim user).

                                        1. 1

                                          With no configuration, you should go the file in question, then enter C-x v g

                                          C-x v g Display an annotated version of the current file: for each line, show the latest revision in which it was modified (vc-annotate).

                                          From there you can navigate the history with ease using the single letter actions listed later in the manual

                                          1. 1

                                            Thanks. My stock emacs on Mac was staler than I thought. Worked out of the box after an upgrade. (Folks on #lobsters helped me figure it out.)

                                          1. 6

                                            Also Sortix.

                                          1. 15

                                            The author wants to use the tool for tasks it is not designed for, or does not know how to use the tool correctly.

                                            Passing on “Distributed version control sucks for distributing software” which is just non-sense.

                                            1. Distributed version control sucks for distributed development

                                              The problem shows up when I’m sitting in my hotel room and need to re-create the local repository over the poor connection. Now I’m not just downloading the one revision I want to work on; I’m downloading every revision ever.

                                              Nothing forces you to do that in git. Just download the one revision you want to work on. This point reinforces also the idea that the author is certainly not working in the industry (academic setting) and seems to have no idea of necessary more advanced features used in developping complex systems collaboratively (with several products / features, in stable branches in which new features have to be backported).

                                            2. Distributed version control sucks for long-lived projects

                                              The history continues to grow; a single version doesn’t. This may be a smooth progression rather than a sudden state change: over time it becomes more the case that the history grows faster than the current version. And so a system that forces every copy to contain all of history will eventually, inevitably, have bigger copies than a system that only stores current versions.

                                              And then the author rants about DVCS sucking for archiving. And sees absolutely no contradiction in those two positions. If you forget your history because you only keep current versions, you are nor archiving anything. It is impossible to replicate a past version of a system, for historical purpose, exploration or just to help a user stuck with an old system.

                                            3. Distributed version control sucks for archiving

                                              Use a database.

                                            The author is just closed off in his own environment and has a poor grasp of the tools he is using on top of it. This rant is useless, and his peers were right to shut him off.

                                            1. 2

                                              Some times it’s easier to rant than to learn new things :p

                                              1. 1

                                                I didn’t like it either, but you’re strawmanning one criticism. I think OP’s claim is that a centralized repo is easier to archive because everything stays on a primary copy, with people subsetting into secondary copies. So it’s clear what to back up. There’s no contradiction there.

                                              1. 4

                                                Another flaw in addition to what other commenters have pointed out.

                                                Although these issues could be mitigated in theory, that is not done in practice.

                                                But then you’re just criticizing git and how it’s used in practice, right? Why over-generalize to all of distributed version control?


                                                The GitHub thing also makes no sense. Git makes no assumption about the master repo, but nobody claims you don’t need one. GitHub filling the gap is precisely what the system was designed to enable: separation of concerns.

                                                1. 4

                                                  The comments are great too:

                                                  “That second paragraph is labeled as a “Note” which means that it is non-normative (informational) and do not contain requirements so they are not binding on the implementation.”

                                                  “Interesting it looks like C89 did not have notes, but a lot of content was moved to notes in C99.”

                                                  1. 16

                                                    Thanks for reporting this. There is a bug tracking this https://bugzilla.mozilla.org/show_bug.cgi?id=1472948

                                                    Update: The offending extension has now been removed! Thanks to Mozilla for the speedy response.

                                                    1. 2

                                                      Hopefully they’re also hardening their review policies.

                                                      1. 2

                                                        I found some posts from around the time the “analytics” code was originally introduced, mentioning that it only applied to the Chrome version and not the Firefox one. I’d be surprised if this did actually make it through addons.mozilla.org’s review process.

                                                    1. 3

                                                      It was always my favorite FTP client. Good job on the fork.

                                                      1. 1

                                                        So that’s what it is. @rain1: can you add a sentence to the top of the Readme saying that it’s an FTP client? The description should also say, “A fresh and clean fork of the FTP client filezilla”.

                                                        1. 2

                                                          excellent suggestion. Done.

                                                      1. 6

                                                        I loved QBasic and it’s where I started too… but I don’t see how it is any easier than, say, ruby or python for the same tasks being done in this post. No need to introduce advanced concepts just because a language has them.

                                                        1. 9

                                                          He double clicked the icon on his desktop and in a split second, we were in the IDE..

                                                          Ruby and Python can’t do that.

                                                          Also, OP doesn’t mention it, but: graphics. In Ruby or Python if you want graphics you end up having to deal with gem and rvm and pip and virtualenv and on and on and on and fucking on. In QBasic you type CIRCLE and hit F5.

                                                          I’ve written about these issues before. You have to try teaching programming for yourself to see the tiny things that trip noobs up.

                                                          1. 3

                                                            I expected graphics to be the reason OP thought QBasic was the way to go, but then it was never mentioned so it seemed like a much less compelling argument.

                                                            1. 3

                                                              you end up having to deal with gem and rvm and pip and virtualenv and on and on and on and fucking on. In QBasic you type CIRCLE and hit F5.

                                                              Racket can do just that.

                                                              You have to try teaching programming for yourself to see the tiny things that trip noobs up.

                                                              Racket is also made specifically for teaching.

                                                              1. 2

                                                                True. The drawback of Racket: much as I hate people harping on lisp parentheses, they do hinder noobs. Also mentioned in my post linked above.

                                                                But Racket also has Pyret. Which seems pretty nice, though I haven’t tried it.

                                                              2. 2

                                                                And then VB6 made GUI’s about as easy. And like you said about QBasic, I’d click VB6, IDE loaded in a second, start project, type some code for the console thing if I wanted, press run, wait one second, results. Rinse repeat. The concept that mattered aside from speed is flow: the BASIC’s have a development flow that maximizes mental flow to keep people constantly moving. Pascal’s can do it, too, since they compile fast. Smalltalks and LISP on extreme end of it.

                                                                The other advantage of BASIC’s are that they look like pseudocode people write down before actually coding. BASIC is so close to pseudocode that they can do the pseudocode in BASIC itself or barely do a translation step. In the Slashdot and other comments, I see the “it looks just like pseudocode!” response show up constantly among people that started with BASIC. Something that shouldn’t be ignored in language design at least for beginners. Probably also DSL or HLL designers, too, trying to keep things closer to the problem statement.

                                                            1. 2

                                                              I have several tabs open on Wittgenstein (check this out) and I got so confused thinking I was in the wrong one haha

                                                              1. 1

                                                                Very interesting. This whole idea seems to be in the zeitgeist. Here’s a thread about Munchausen’s Trilemma: https://news.ycombinator.com/item?id=17043954. And I commented in it about Hofstadter, and Lewis Carroll’s “What the Tortoise said to Achilles.”

                                                                To my layman’s eye all these sources spanning a century seem to be saying the same thing. Without reference to reach other, for the most part?

                                                                1. 2

                                                                  The whole thing is great, but one idea that seems particularly useful in arbitrary languages without regard to how it fits with other features is to specify the list of globals used by a function. In Python-like syntax, imagine this:

                                                                  def draw_quad(origin, left, up) [m]:
                                                                      m.Position3fv(origin - left - up)
                                                                      m.Position3fv(origin + left - up)
                                                                      m.Position3fv(origin + left + up)
                                                                      m.Position3fv(origin - left + up)
                                                                  

                                                                  Now you get a guarantee that the function uses zero globals besides m.

                                                                  1. 4

                                                                    In PHP you have something like that, global variables are not accesible from inside functions unless you specifically allow each one you want

                                                                    $m = new M();
                                                                    function draw_quad($orgin, $left, $up){
                                                                        global $m; // or $m = $_GLOBALS['m'];
                                                                        $m->Position3fv($origin - $left -$up);
                                                                        $m->Position3fv($origin + $left - $up);
                                                                        $m->Position3fv($origin + $left + $up);
                                                                        $m->Position3fv($origin - $left + $up);
                                                                    

                                                                    in practice, I haven’t found useful global variables other then the contextual ones ($_POST. $_GET, $_SESSION), which are superglobal and always defined

                                                                    1. 2

                                                                      I’d like to see something similar but generalised to “contextual” environmental bindings, rather than traditional global vars. And a compiler that ensures that somewhere in all call chains the binding exists. But you might want a global in some cases, or a “threadlocal”, or an “import” of some sort, or something like the context in react, etc.

                                                                      Some mechanism in which the compiler makes sure the environmental dependencies are fulfilled, without necessarily requiring that value be propagated explicitly through each owner/container between provider and consumer.

                                                                      1. 4

                                                                        I can’t find it but Scala has an extra context var that is passed with function invocation.

                                                                        And early Lisps had dynamic scope, meaning that a var bound to the next occurrence up the call stack.

                                                                        Both of these mechanisms supply the building blocks for AoP, so that a programmer can mixin orthogonal properties.

                                                                        1. 3

                                                                          And early Lisps had dynamic scope, meaning that a var bound to the next occurrence up the call stack.

                                                                          Today they still have it - see DEFVAR and DEFPARAMETER in Common Lisp.

                                                                          1. 2

                                                                            I can’t find it but Scala has an extra context var that is passed with function invocation.

                                                                            In Scala you can use implicit parameters for this:

                                                                            def foo(origin: Vec3, left: Vec3, up: Vec3)(implicit m: Context) {
                                                                                m.Position3fv(origin - left - up)
                                                                                m.Position3fv(origin + left - up)
                                                                                m.Position3fv(origin + left + up)
                                                                                m.Position3fv(origin - left + up)
                                                                            }
                                                                            

                                                                            In Haskell you could use a reader/writer/state monad thingy. In Koka or Eff you could use effects.

                                                                            1. 2

                                                                              Yeah, Scala’s context is probably closest to what I’m thinking of, from what I know of it.

                                                                            2. 4

                                                                              You can kinda get this with effect types. Effect types let you label certain functions as using resource A or B, and then you can have a documentation mechanism for what dependencies are used, without passing stuff around.

                                                                              It can still get a bit heavy (at least it is in Purescript), but less so than dependency injection

                                                                            3. 1

                                                                              A compiler or analyzer should be able to tell you that just from what variables or expressions go into the function. A previously-declared global would be one of the arguments. Why do we need to declare it again in the function definition?

                                                                              1. 1

                                                                                See my final sentence. “Now you get a guarantee that the function uses zero globals besides m.” The program documents/communicates what it uses. The compiler ensures the documentation is always up to date.

                                                                                In my example, m is not one of the arguments. Because m is a global, lexically accessible anyway in the body of the function. There’s no redundancy here.

                                                                                1. 0

                                                                                  I’m saying a compiler pass should be able to do the same thing without a language feature. I think it won’t be important to that many people. So, it will probably be optional. If optional, better as a compiler pass or static analysis than a language feature. It might also be an easy analysis.

                                                                                  1. 3

                                                                                    You’re missing the point. It’s a list of variables that the code can access anyway. What would a compiler gain by analyzing what globals the function accesses?

                                                                                    There are many language features that help the compiler do its job. This isn’t one of them. The whole point is documentation.

                                                                                    (Yes, you could support disabling the feature, using say syntax like [*]. C++ has this. Just bear in mind that compilers also don’t require code comments, and yet comments are often a good idea. SImilarly, even languages with type inference encourage documenting types in function headers.)

                                                                              2. 1

                                                                                What if the Position3fv method uses global variable n? You also need to specify that for draw_quad. This quickly blows up like checked exceptions in Java and people want shortcuts.

                                                                                1. 2

                                                                                  The problem with checked exceptions is that they discourage people from using exceptions. But there’s no problem in discouraging people from using global variables.

                                                                                  I don’t mean to imply that I want all code to state what it needs all the time. In general I’m a pretty liberal programmer. It just seems like a good idea to give people the option to create “checkable documentation” about what globals a piece of code requires.

                                                                              1. 2

                                                                                I know JB wants nothing to do with interacting with a needy bike-shedding community, but I sure wish he’d at least have a write-only dump of this for people to test-drive if they’re willing to go it alone :-/

                                                                                1. 3

                                                                                  Having seen what happened with Paul Graham’s Arc, my sympathies are entirely with Jonathan Blow. Particularly if the author already has a reputation to lose, a write-only dump is far more of a liability than an asset.

                                                                                  1. 1

                                                                                    Yeah I totally get it, I’m just bummed.

                                                                                1. 2

                                                                                  How does one properly back up a SQLite based application like this? Regular DUMP to text files and then put it in S3 or somesuch?

                                                                                  1. 12

                                                                                    There are two options - a shared lock, or the online backup API

                                                                                    https://sqlite.org/backup.html describes both.

                                                                                    1. 4

                                                                                      Much better answer than mine. I’m going to downvote myself.

                                                                                      1. 1

                                                                                        Thanks for sharing this link. I have been using the “copy” method described by @akkartik for years with no issues, but I can understand why that is risky. I’ll have to look into implementing this in the NimForum.

                                                                                      2. 1

                                                                                        You can literally just copy the .sqlite3 file(s).

                                                                                        “A complete database is stored in a single cross-platform disk file. Great for use as an application file format.” (https://www.sqlite.org/features.html)

                                                                                        1. 1

                                                                                          How does that work? As in, how do you guarantee that the DB is in a consistent state when you do the copy? Or for a large DB how do you guarantee that the state won’t change DURING a copy?

                                                                                          1. 2

                                                                                            Oh yes you have to bring it down to ensure consistency. But that would also be true for the options you listed above.

                                                                                            1. 2

                                                                                              I didn’t see any options listed by @feoh, but you probably already know this but I’ll say it for others: DBs like PostgreSQL, Cassandra, Riak, etc provides mechanisms to do backups without stopping your application. At an administrative cost, though.

                                                                                              1. 1

                                                                                                It’s a nonissue, lvm volumes can do live snapshots of ext4 filesystems, so can zfs and btrfs and others. Very easy to do live backups of sqlite with no downtime. Sqlite itself has no problem with snapshots as it is designed to be resilient to power failure, which is what that would look like.

                                                                                                1. 1

                                                                                                  I was referring to “Regular DUMP to text files and then put it in S3 or somesuch?”

                                                                                        1. 3

                                                                                          It seems like these “X implemented in Y” and “Z in N bytes” types of posts/articles have become increasing common the past few years. These things can be great learning experiences I suppose, and the “wow” factor can vary. But it makes me wonder if it’s a symptom of something larger, like are people not doing (as much) original stuff now?

                                                                                          1. 5

                                                                                            Also that we take bloat for granted in the tools we use.

                                                                                            1. 4

                                                                                              original stuff now?

                                                                                              It’s interesting. There was certainly a lot of low hanging fruit to discover and invent in the early days of computing. That’s not to say it was easy, but as that low hanging fruit has fallen, the difficulty level has increased to creating something truly original and new. You can peel existing fruit in a new way (which so many people do), and you can combine multiple pieces in new ways, but it’s pretty hard to go beyond the lower branches, and most people don’t have the time, patience, or need to do so.

                                                                                              Keep in mind that PhD programs last years, and yet, very rarely do they surface with research that has a lasting effect on industry, or, it’s so cutting edge that it’s not practical for many years later.

                                                                                              So what’s an average person to do for fun? Well, you can reinvent stuff you already know! Maybe you rewrite it smaller, faster, stripped of “bloat,” or with new features. Maybe you apply the ideas of an existing tool like, say, AWK, to a new data type, say, JSON, and invent jq. Maybe, instead, you make JSON work with the tools you already know by writing an adapter to make it more greppable. All these things are just new peels, or new cuts of the low hanging fruit though.

                                                                                              And maybe, just maybe, you’re just up for a challenge that sounds ridiculous. “Is it even possible?” The average Docker image, even with the nesting (there’s a better term which I can’t think of), is still large. It’s an absurd, but challenging idea, to fit an entire docker image in a tweet (which hasn’t been done, mind you. But holy crap, how cool would that be?). But, if you manage to do it, and even if not, you’ve probably learned a new way to peel existing fruit, and that might be applied to a the construction of a reach extender that gets you closer to the top of the tree.

                                                                                              1. 2

                                                                                                I’d also push back on the idea that such articles aren’t original/novel/innovative. There’s two distinct kinds of novelty here: getting something working that does something new, and packaging things up better so they can be used by everyone rather than just insiders. Both are equally important, and the latter is what it took to turn Roman-era cataphracts into medieval knights.

                                                                                                See also Carlota Perez’s notions of installation and deployment phases for a new technology.

                                                                                                1. 1

                                                                                                  I’m not sure if you’re pushing back on me, or the OP that I responded to. I’m completely in favor of these types of experiments as I believe them to be fun, interesting, and useful in the generation of new places to explore.

                                                                                                  We may have different ideas of what “new” is though, but that’s OK. :)

                                                                                                  1. 3

                                                                                                    Yes, the ‘also’ was intended to convey that I thought we were mostly in agreement. What words we choose for the categories is less important.

                                                                                                    I responded to you in hopes that both you and @markt would see my comment.

                                                                                                    1. 3

                                                                                                      Thanks for the clarification. I thought that might be the case, but whether it’s exhaustion, or something else, I couldn’t tell for sure.

                                                                                                      1. 1

                                                                                                        For my part, I’m often too terse when tapping out comments on my phone.

                                                                                              2. 2

                                                                                                Bit of a counterpoint: I find the “Z in N bytes” stuff to be pretty informative about learning about Z

                                                                                                Loads of these tiny docker experiments have really helped to clarify (at least for me) what Docker is and what it isn’t (not a VM). Some valuable stuff to be learned in there I think.

                                                                                                X implemented in Y is a bit less of this, but it can also be helpful if someone understands Y more than X.