1. 8

    In my opinion, an obligatory reference to the subject is the chapter 5, “Textuality”, of Eric Raymond ’s “The Art of UNIX Programming”: it goes in the details of several formats and comes up with a series of recommendations for plain-text formats.

    1. 18

      I use Dash on macOS for offline programming language and other programming related documentation searching and browsing (see Zeal for Windows, BSD, Linux). There are lots of docsets available for download.

      1. 4

        This is what I was going to put, I use Zeal on a daily basis. I have it mapped to a key-binding so I can search documentation quickly. Once you get used to it it’s hard to go back to just regular search engines!

        1. 2

          I also use Dash here, without even working offline.

          I find it to be like man pages but for libraries and frameworks. If I want the doc from a Flask method, I write the name and I have it, like I would with syscalls on man pages.

          1. 2

            Since we are recommending docsets’ applications, it is worth to tell about another one: Dasht.

            I went from Zeal to Dasht because I also wanted a full experience in the terminal.

            It still uses the Dash docsets and w3m to open the docsets.

          1. 1

            I believe that all of the technical problems will get solved within next 10-20 years or so. The difficult problems stem from the society. And those are hard to solve, because people don’t like to change their habits. Often, it’s easier to have completely new people with new habits, than re-educating existing people from their current ones. Therefore, I would not make elections digital until average lifetime has passed after a full working implementation of digital voting. Or, so to say, only over my dead body.

            1. 4

              Often, it’s easier to have completely new people with new habits, than re-educating existing people from their current ones.

              In the (Brazilian) Navy, it is called “the ghost of the ship” (“espírito do navio”, if you are curious how they call it in Portuguese).

              The idea is that there is a ghost in the ship that settles people into certain ways of doing things.

              The real explanation is the following:

              • a new ship is inaugurated and a whole new crew (let us assume of 100 people) takes over the ship;
              • after some time, some people from the original crew has to leave it for any reason (e.g., retirement);
              • let us say there is a 10% rotation;
              • the other 90% set the habit to those 10% that just arrived.

              Since I heard this story, I got fascinated by this idea.

              It is not correlated to e-voting, but I vouch your sentence I quoted.

              1. 2

                One of the hard problems of a national election is how to bootstrap a democracy while being able to have little to no trust in the sitting government that has to organize it. One way to solve the threat of a coordinated attack that would result in a distribution of power that does not reflect the will of the people, is to empower each member of the electorate with the ability to verify independently that all ballots in a polling station are casted and counted correctly and fair, meaning:

                • each ballot box in the polling station is empty before the election starts
                • they’re all sealed during the day when votes are being cast
                • each ballot is casted by a single individual that has stuffed only one ballot in the box
                • no other ballots are stuffed in the box
                • once the ballot box is opened at night, all ballots are tallied correctly to the right party and exactly once

                As soon as you introduce microchips into this process it becomes opaque to most if not all of the electorate. This is not solved by introducing more complex technology.

                A unique requirement for a general election is voter privacy in order to avoid coercion. In the process outlined above this is taken care of by letting each individual be able to verify their vote is counted correctly and exactly once, without being able to prove to anyone what they have voted for.

                1. 1

                  As soon as you introduce microchips into this process it becomes opaque to most if not all of the electorate. This is not solved by introducing more complex technology.

                  This is exactly what I mean when talking about societal problems. This is solvable. But this is also very hard to solve, since as of right now, maybe only 1% of population could actually look into how it works. With education and real digital revolution, I believe that number could go up to 100%. But that is very hard to solve. It will take entirely new people. I believe that neither me, nor you will see a verifiable, fair election. But I hope our great-grandsons do.

                  1. 1

                    But this is also very hard to solve, since as of right now, maybe only 1% of population could actually look into how it works. With education and real digital revolution, I believe that number could go up to 100%.

                    Then the question becomes, this microchip that you’re inspecting, is it the one used in the actual election and has it not been tampered with before, during or after the election? It’s the complete operation from casting to tallying that you have to secure and that people have to legitimately trust.

                    I believe that neither me, nor you will see a verifiable, fair election.

                    Here in the Netherlands we have a decentralized process of paper ballots that are readable for humans, and a manual public tallying process. This way everybody can verify storage and counting for themselves in their polling station. I’m very happy to say that I can trust what I’ve seen in previous elections, and have faith these were fair because of the small chunk I could completely and independently verify myself, plus the fact there was no news nor rumors about significant trouble in any of the other polling stations that had the same public transparant procedure.

                    1. 3

                      I believe that neither me, nor you will see a verifiable, fair election.

                      Sorry, I meant to add a digital qualifier before the election. I do believe that some of the regular elections are fair, and some of those are verifiable.

                      Then the question becomes, this microchip that you’re inspecting, is it the one used in the actual election and has it not been tampered with before, during or after the election?

                      You should not trust “the microchip”. You should trust the algorithm, and the ability to change on which chip it runs. Trustable hardware is very hard, so if you can find ways to not trust it, you should do that. There are of course ways to verify the hardware you are running on, even ones that should be fairly accessible for everyone, but this makes many sacrifices. I’d recommend to watch this talk on this topic.

              1. 1

                I have a big soft spot for Python-based scripting (used here as the “slow” benchmark), and like… when you can proficiently do your one-time filtering the fact that it takes 5 seconds instead of 0.5 is not really a big deal. But thinking about this a bit more, when you’re iterating and trying to “tweak” stuff, your single-line awk command starts being nice (much quicker to iterate).

                Though I do wish that it was easier in a shell to, like, jump around arguments and edit multiline arguments without being deathly afraid of hitting enter or whatnot, without having to just resort to working inside of a shell script.

                Kinda surprises me that there’s no shell that leans into how args work to provide a nicer interface for them (something like “enter puts you onto the next arg, shift-enter runs the command” or w/e, so you don’t need to worry about escaping).

                1. 3

                  Though I do wish that it was easier in a shell to, like, jump around arguments and edit multiline arguments without being deathly afraid of hitting enter or whatnot, without having to just resort to working inside of a shell script.

                  I will assume you are not aware that one can edit a command-line in your $EDITOR.

                  edit-and-execute-command (C-xC-e)

                  Invoke an editor on the current command line, and execute the result as shell commands. Bash attempts to invoke $VISUAL, $EDITOR, and emacs as the editor, in that order.

                  References:

                  1. https://linux.die.net/man/1/bash
                  2. http://shellhaters.org/deck/#39
                  3. https://www.youtube.com/watch?v=olH-9b3VJfs&t=1264
                  1. 2

                    I was thinking of some slightly different mechanisms but this is very interesting and seems useful! Thank you for the tip

                  2. 1

                    Something like PowerShell’s ISE (Integrated Scripting Environment) would be really cool.

                  1. 6

                    Set is one of the most basic (mathematical) concepts one must have in order to abstractly reason.

                    Then, types, which are a refinement over sets.

                    To those who want to open their eyes about the power of using types in programming, Cardelli’s “Typeful Programming” is a strongly recommended reading. :)

                    1. -1

                      I love the look of haskell, but damned if I can ever use it for more than a week.

                      1. 3

                        I’ve generally found that practically minded Haskell-inspired languages and/or frameworks hit a really good balance for my sanity. On the .NET side, for example, F# can be excellent (and its trivial escape valve to C# is perfect when you need a more typical way to reason about a problem). And even in pure C#, there’s always language-ext to give you ad hoc Haskell-like purism. On the JVM side, it’s a bit trickier: Kotlin would fill in nicely for C#, but I don’t know a good F# equivalent, and the Kotlin variant of language-ext is Arrow, which I absolutely loathe. But I’m sure there’s something equivalent you could do there, too. And I could point to similar libs for things like Ruby (the dry libraries), JavaScript (Immutable.js and the like), and so on.

                        I’m otherwise with you, though: I’ve tired to use Haskell in anger many, many times, and the closest I ever get is being angry I ever tried to use Haskell.

                        1. 2

                          Care to elaborate on why you loathe Arrow?

                          1. 2

                            Docs are poor, upgrades have been rough, performance impact has been disproportionately high compared to something like language-ext, the way they use Kotlin destructuring for bind borders on syntax abuse…it basically feels like someone tried to staple-gun Haskell onto Kotlin and ended up with something that’s alien to both. (The recent push towards using the IO monad everywhere also makes it comparatively harder to use Arrow for only parts of our app, IMHO.)

                            1. 1

                              Thanks for elaborating! I haven’t used Kotlin, but based on what I know about the language it does seem a bit odd to pair it with Haskell.

                          2. 2

                            On the JVM side, it’s a bit trickier:

                            A baby-step is to use the Atlassian’s library Fugue.

                            A “head-dive” is to start using the Frege programming language.

                            1. 1

                              JVM has Scala

                          1. 1

                            Is it good for a junior developer that’s just starting studying computer science?

                            1. 1

                              Skimming through the PDF, I would say that is exactly the target audience that might benefit a lot.

                            1. 58

                              my partner submitted a patch to OpenBSD a few weeks ago, and he had to set up an entirely new mail client which didn’t mangle his email message to HTML-ise or do other things to it, so he could even make that one patch. That’s a barrier to entry that’s pretty high for somebody who may want to be a first-time contributor.

                              I think it was actually Gmail that was a barrier. And he also couldn’t do it from Apple Mail. It is just that the modern mail client has intentionally moved towards HTML

                              I am flabbergasted someone is able to send a patch to OpenBSD but is not able to set the web interface of GMail to sent plain-text emails. Or install Thunderbird, which might have been the solution, in that particular case.

                              I also never used git send-email, but I don’t think it is the barrier to become a kernel maintainer.

                              Actually, that might work as an efficient sieve to select the ones who want to be active contributors from those who are just superficial or ephemeral contributors.

                              In my opinion, although Github supposedly decreases the barrier of first-time contribution, it increases the load on the maintainers, which has to interact with a lot of low-quality implementation, reckless hacks and a torrent of issues which might not even be. That is my experience in the repositories I visit or contributed.

                              1. 41

                                Patching some component or other of OpenBSD is not a skill that transfers well to making some random application do what you want.

                                1. 40

                                  I agree with you.

                                  On the other hand, if someone knows how to install OpenBSD, use cvs (or git), program in C and navigate the kernel’s souce-code, I supposed they are capable of going to any search engine and find the answer on how to send plain-text email via the GMail interface.

                                  1. 16

                                    GMail mangles your “plain-text” messages with hard-wraps and by playing with your indentation. You’d have to install and configure thunderbird or something.

                                    1. 3

                                      One of the many reasons why I use Mutt.

                                  2. 14

                                    Note that this is anecdotal hearsay. This person is saying their partner had to set things up… they may have misunderstood their partner or not realized their partner was exaggerating.

                                    Also, one might expect the amount of patience and general debugging skill necessary to transfer rather well to the domain of email configuration.

                                    It’s also possible that guiraldelli is assuming it was an excepted OpenBSD kernel patch, wheras we don’t know if the patch was accepted and we don’t know if it was a userland patch. It doesn’t take much skill to get a userland patch rejected.

                                  3. 30

                                    I am flabbergasted someone is able to send a patch to OpenBSD but is not able to set the web interface of GMail to sent plain-text emails.

                                    You can’t send patches, or indeed any formatted plain text emails through the gmail web interface. If you set gmail to plain text, gmail will mangle your emails. It will remove tabs and hardwrap the text. It’s hopeless.

                                    1. 26

                                      Think about impediments in terms of probabilities and ease of access.

                                      You wouldn’t believe how many people stop contributing because of tiny papercuts. There is a non-trivial amount of people who have the skills to make meaningful contributions, but lack the time.

                                      1. 18

                                        Lobsters requires an invite. That’s a barrier to entry, so those who make it are more likely to make good contributions, and have already extended effort to comply with the social norms.

                                        1. 8

                                          You may be willing to jump a barrier of entry for entertainment (that is lobsters) but not for free work for the benefit of others (because you have already done that work for yourself).

                                          1. 4

                                            If you want to save yourself compiling and patching your kernel every time there’s an update, you might want to submit it to the project maintainer.

                                            1. 18

                                              If the project wants to have contributors in the future it might want to consider using modern, user friendly technologies for contribution.

                                              Linux is considering it, a discussion is started, which is positive (for the future of the project) in my opinion. It is a sign or responsive project management, where its conservatism does not hinder progress, only slows it to not jump for quickly fading fads.

                                              Other communities are closing their microverse on themselves, where it is not enough to format your contribution in N<80 column plain text email without attachments with your contribution added to it via come custom non-standard inline encoding (like pasting the patch to the end of the line), but you may even need to be ceremonially accepted for contribution by the elders. Also some such projects still don’t use CI, or automated QA. These communities will die soon, actually are already dead, especially as they don’t have large corporations backing them, as someone getting paid usually accepts quite a few papercuts a job demands. This is why Linux could actually allow itself to be more retrograde than the BSD projects for example, which I think are even more contributor-unfriendly (especially ergonomically).

                                              1. 2

                                                I tend to agree, however that discussion was started by someone with a very striking conflict of interest and therefore their opinion should be questioned and considered to be insincere at best and maleficent at worst.

                                                1. 5

                                                  That doesn’t matter, the discussion can be done despite that. I think a forge-style solution is the key.

                                                  Despite Microsoft having 2 “forge” type solutions in its offering (both quite usable in my experience, github being a de-facto standard) I still cannot see a conflict of interest in this topic. There are other software forges available. The current process is simply outdated.A custom solution could also be developed, if deemed necessary, as it was the case with git.

                                        2. 14

                                          Pay attention my comment talks about maintainers, active contributors and superficial or ephemeral contributors.

                                          From the article:

                                          a problem recently raised by Linux kernel creator Linus Torvalds, that “it’s really hard to find maintainers.” Maintainers are the gatekeepers who determine what code ends up in the widely used open-source kernel, and who ensure its quality. It is part of a wider discussion about who will oversee Linux when the current team moves on.

                                          And later on…

                                          “We need to set up a better or a different or an additional way to view tools and the work that’s being done in the Linux project as we’re trying to bring in new contributors and maintain and sustain Linux in the future,” she told us.

                                          Picking her words carefully, she said work is being done towards “moving from a more text-based, email-based, or not even moving from, but having a text-based, email-based patch system that can then also be represented in a way that developers who have grown up in the last five or ten years are more familiar with.

                                          “Having that ability and that perspective into Linux is one of the ways we hope we can help bring newer developers into the kernel track.”

                                          So I understood Sarah Novotny is addressing the problem of new contributors, not the one Linus Torvalds see, of new maintainers.

                                          So, your comment that

                                          how many people stop contributing because of tiny papercuts. There is a non-trivial amount of people who have the skills to make meaningful contributions, but lack the time

                                          is not the problem the Linux Foundation has, but the one that Microsoft’s Sarah Novotny wants to solve. Those are two different problems, with two different solutions. On the surface, they might seem the same, but they are not. They might be correlated, but the solution for one problem does not necessarily mean it is the solution for the other.

                                          Therefore, my argument still stands:

                                          [having a plain-text email list as central communication and collaboration to the Linux’s kernel] might work as an efficient sieve to select the ones who want to be active contributors [i.e., maintainers] from those who are just superficial or ephemeral contributors.

                                          If we are going to address, though, that it might hinder new contributors, then I tend to agree with you. :)

                                          1. 21

                                            Let’s not let Microsoft decide how Linux is developed.

                                            The waning popularity of their own, proprietary kernel is no excuse for telling other projects how they need to be run.

                                            1. 5

                                              This is just my opinion but I think that while she’s totally missing the mark on finding Linux kernel module maintainers having anything at all to do with plain text email patch submission systems, the general issue she’s speaking to is one that has generated a lot of discussion recently and should probably not be ignored.

                                              Also, in the spirit of the open source meritocracy, I’d prefer to let people’s actions and track records speak more loudly than which company they happen to work for, but then, lots of people consider my employer to be the new evil empire, so my objectivity in this matter could be suspect :)

                                            2. 8

                                              So I understood Sarah Novotny is addressing the problem of new contributors, not the one Linus Torvalds see, of new maintainers.

                                              Bingo!

                                              My first thought after reading this was “Does this person ACTUALLY think that having to use plaintext E-mail is even statistically relevant to the problem of finding module maintainers for the Linux kernel?”

                                              In a general sense I believe that the open source community’s reliance on venerable tools that are widely rejected by younger potential contributors is a huge problem.

                                              Martin Wimpress of Ubuntu Desktop fame has spoken about this a lot recently, and has been advocating a new perspective for open source to increase engagement by embracing the communications technologies where the people are not where we would like them to be.

                                              So he streams his project sessions on Youtube and runs a Discord, despite the fact that these platforms are inherently proprietary, and has reported substantial success at attracting an entirely new audience that would otherwise never have engaged.

                                              1. 5

                                                is not the problem the Linux Foundation has, but the one that Microsoft’s Sarah Novotny wants to solve. Those are two different problems, with two different solutions. On the surface, they might seem the same, but they are not. They might be correlated, but the solution for one problem does not necessarily mean it is the solution for the other.

                                                GKH even said that there are more than enough contributors in his last ama, so having contributors is “a priori” not a problem right now.

                                                1. 2

                                                  So I understood Sarah Novotny is addressing the problem of new contributors, not the one Linus Torvalds see, of new maintainers.

                                                  Every maintainer was a new contributor at a point! Also better tooling would be beneficial for everyone.

                                                  1. 1

                                                    Every maintainer was a new contributor at a point!

                                                    That is true, but it is not the current problem: see /u/rmpr’s reply and his link to the Reddit’s AMA to verify that.

                                                    Also better tooling would be beneficial for everyone.

                                                    That is not necessarily true: the introduction of a tool requires a change of mindset and workflow of every single person already involved in the current process, as well as update of the current instructions and creation of new references.

                                                    I saw projects that took months to change simply a continuous integration tool (I have GHC in mind, except the ones in the companies I worked for). Here, we are talking about the workflow of many (hundreds for sure, but I estimate even thousands) maintainers and contributors.

                                                    As I already told before, RTFM [1] [2] does not take long for a single individual that wants to become a new contributor; in [1], there is even a session specially about the GMail’s Web GUI problem.

                                                    If the problem is retrievability of the manual or specific information, than I think that should be addressed first. But that topic is not brought up in the article.

                                              2. 20

                                                I am able to deal with email patches, but I hate doing it. I would not enjoying maintaining a project which accepts only email patches.

                                                Actually, that might work as an efficient sieve to select the ones who want to be active contributors from those who are just superficial or ephemeral contributors.

                                                Ephemeral contributors evolve to maintainers, but if that initial step is never made this doesn’t happen. I don’t know if this will increase the number of maintainers by 1%, 10%, or more, but I’m reasonably sure there will be some increase down the line.

                                                Finding reliable maintainers is always hard by the way, for pretty much any project. I did some git author stats on various popular large open source projects, and almost all of them have quite a small group of regular maintainers and a long tail of ephemeral contributors. There’s nothing wrong with that as such, but if you’re really strapped for maintainers I think it’s a good idea to treat every contributor as a potential maintainer.

                                                But like I said, just because you can deal with email patches doesn’t mean you like it.

                                                1. 14

                                                  GMail, even in plain-text mode, tends to mangle inline patches since it has no way of only auto-wrapping some lines and not others.

                                                  Not a major issue as you can attach a diff, but from a review-perspective I’ve personally found folks more inclined to even look at my patches if they’re small enough to be inlined into the message. I say this as someone having both submitted patches to OpenBSD for userland components in base as well as having had those patches reviewed and accepted.

                                                  I personally gave up fighting the oddities of GMail and shifted to using Emacs for sending/receiving to the OpenBSD lists. I agree with Novotny’s statement that “GMail [is] the barrier.” The whole point of inlining patches like this is the email body or eml file or whatever can be direct input to patch(1)…if GMail wraps lines of the diff, it’s broken the patch. Text mode or not.

                                                  Obviously, this doesn’t mean if the Linux kernel maintainers want to change their process that I don’t think they shouldn’t. (Especially if they take a lot of funding from the Foundation…and as a result, Microsoft/GitHub.) OpenBSD is probably always going to take the stance that contributions need to be accessible to those using just the base system…which means even users of mail(1) in my interpretation.

                                                  1. 5

                                                    You can’t attach a diff – nearly all mailing lists remove attachments!

                                                    OpenBSD is probably always going to take the stance that contributions need to be accessible to those using just the base system

                                                    Heh, if you add arc to the base system, you can adopt Phabricator without violating that principle :)

                                                    1. 2

                                                      Good point…so basically GMail (the client) doesn’t really work with an email-only contribution system. It’s Gmail SMTP via mutt/emacs/thunderbird/etc. or bust.

                                                  2. 5

                                                    I have found several Linux subtle kernel bugs related to PCIe/sysfs/vfio/NVMe hotplug. I fixed them locally in our builds, which will ultimately get published somewhere. I don’t know where, but it’s unlikely to ever get pushed out to the real maintainers.

                                                    The reason I don’t try to push them out properly? The damn email process.

                                                    I did jump through the hoops many years ago to configure everything. I tried it with gmail, and eventually got some Linux email program working well enough that I was able to complete some tutorial. It took me some non-negligible amount of time and frustration. But that was on an older system and I don’t have things set up properly anymore.

                                                    I don’t want to go through that again. I have too many things on my plate to figure out how to reconfigure everything and relearn the process. And then I won’t use it again for several months to a year and I’ll have to go through it all again. Sometimes I can get a coworker to push things out for me - and those have been accepted into the kernel successfully. But that means getting him to jump through the hoops for me and takes time away from what he should be doing.

                                                    So for now, the patches/fixes get pulled along with our local branch until they’re no longer needed.

                                                    1. 4

                                                      I have no idea how dense they need to be to not be able to send text-only email from Apple Mail. It must be anecdotal, because I cannot believe that someone is smart enough to code anything, but dumb enough to be able to click Format > Change to text in the menu bar.

                                                    1. 21

                                                      Corporate email is often based on an Outlook server, and it is becoming increasingly difficult to setup a regular email client that is relying on IMAP and SMTP to work with the corporate outlook server.

                                                      getting two factor authentication to work is a problem, and for Thunderbird to work with Outlook you need to either:

                                                      So yes, getting a plain text email client to work as a corporate developer is a problem, but you might as well blame Microsoft for putting up these barriers in their email server.

                                                      1. 11

                                                        I work in a company where the email infrastructure is Office 365. After many interactions with the IT team, I made them whitelist DavMail, which is connected to my Thunderbird, in which I use exteditor to write my emails using, in my case, Neovim.

                                                        A friend of mine, who has a day-to-day job as contributor of a few FLOSS projects, had problems sending email from his company’s infrastructure (also Office 365) and decided to send patches with his private email. Last time we spoke about it, he was about to buy an Owl’s license.

                                                        Thus, I agree with you: Microsoft is the problem in here. And the article even touches that point:

                                                        We assumed that Outlook was to blame. Could Microsoft fix that instead? “The question always is fix it to whose standards, because we are focused much more on business and enterprise models of clients and customers. For them we fixed it to a more HTML-based model so it really depends on who your audience is and who your target is.”

                                                        It turned out, though, that this time Outlook was not guilty. “I think it was actually Gmail that was a barrier.[…]”

                                                        At last, I expect people contributing to the kernel to RTFM: there is a kernel.org’s page on email clients (for collaboration on the Linux’s kernel), describing problematic MUAs and even given basic configuration for some of them. And it is not the unique reference on the subject.

                                                        So much fuzz for something that does not even address the problem of lack of good maintainers for the kernel. 🤦

                                                      1. 5

                                                        My technological dream: laws are written in a restricted, runnable language (let us say, Prolog) and validated whether they conflict with other laws before they get ratified.

                                                        And looking to the predicates in the predicate.pl file, it seems a (minimalist) vocabulary of validations (well, predicates…) was developed, which is a great effort per se, in my opinion. :)

                                                        1. 4

                                                          Assuming laws will never be written in anything but words with their own legal formalities I think it’s more plausible that there will be nlp “burden detection” on entities that are extracted from existing law, then reviewed and tagged by humans. As I understand it existing work in this area bumps up against the fact that there is a lot of manual work reviewing the output of a tagged legal document for determining accuracy of what is binding upon which people in which situations.

                                                          However, once past a critical mass of tagged and reviewed documents I can see how things like “validated” and “in conflict” can be done in a more automated fashion. American law ends up being that which is passed, then of course the text of the judicial rulings and precedent. If only the full text of constitution to the first bill passed by congress, all the way through to today’s explosion of daily judicial decisions were all available in a single place for that sort of nlp to work against.

                                                          Neat links, thought about this too much. Of course the tools lawyers use probably already have approximations of what I’m describing but they’re not at all free. :)

                                                          https://en.wikipedia.org/wiki/An_act_to_regulate_the_time_and_manner_of_administering_certain_oaths

                                                          ^^ first act passed by congress

                                                          https://www.thestrangeloop.com/2019/improving-law-interpretability-using-nlp.html

                                                          ^^ really good presentation on this subject

                                                          1. 3

                                                            Someone did codify French tax law to find discontinuities. We should do this sort of thing as a matter of course for mathematical laws like those for taxes.

                                                            https://blog.merigoux.fr/en/2019/12/20/taxes-formal-proofs.html

                                                          1. 4

                                                            Who would say no besides people who think that ‘engineer’ is a protected word that only applies to special people (themselves included of course) in their special club?

                                                            You use some solidified math to solve some problem? That’s engineering.

                                                            Fixing your neighbour’s bike is engineering. But some people would only call you a mechanic because you got your hands dirty.

                                                            This whole thing is just a semantic and status game. Not really worth your time, unless you enjoy it of course.

                                                            1. 5

                                                              Who would say no besides people who think that ‘engineer’ is a protected word that only applies to special people (themselves included of course) in their special club?

                                                              Among other things, it is the law of the land in Canada that “engineer is a protected word that only applies to special people.”

                                                              1. 4

                                                                You use some solidified math to solve some problem? That’s engineering.

                                                                My parents are mathematicians and physicists. I am an engineer. All of us use mathematics to solve (practical) problems. However, we think so differently that I can ensure you they are not engineers.

                                                                Fixing your neighbour’s bike is engineering. But some people would only call you a mechanic because you got your hands dirty.

                                                                I don’t believe it is. And that is why a brick layer is called a brick layer, not a civil engineer.

                                                                I find very easy to recognise an “engineer attitude”, but very difficult to define it.

                                                                I would say that engineers design efficient solutions using pre-existing scientific and mathematical theories, limited by certain constraints (usually the triplet quality–price–time).

                                                                That is the closest definition I can give to engineers.

                                                                1. -1

                                                                  I am an engineer.

                                                                  And that is why a brick layer is called a brick layer,

                                                                  Seems like a standard case of a special member of the special member club gatekeeping his specialness to me.

                                                                  1. 7

                                                                    It’s a standard case of trying to let a word keep its meaning as opposed to redefining it to be applicable to so many things that it becomes useless and a new word needs to be invented to describe the things a civil engineer does that a brick layer doesn’t.

                                                                    Otherwise a bricklayer is also a scientist, an educator, an artist, a manager, a leader, a <insert other general word people use to describe aspects specific to their kind of job>.

                                                                    1. 7

                                                                      I am disappointed that you had to take two of my sentences, take them out of context to defend your standpoint.

                                                                      So I will tell you why a brick layer is different from an engineer, and why on engineering course we had to layer bricks.

                                                                      Let’s take the civil engineering example. An engineer computes the theoretical forces over every part of the structure, evaluates which materials are able to sustain such stress and make sure that even additional and unexpected stress won’t tear down the structure (using the famous “security factor” in the computation). It is a knowledge work and has certain responsibilities attach to it: for example, if a bridge falls down and a single person dies, the responsible engineer is prosecuted for manslaughter (back in my country, at least).

                                                                      The brick layers, on the other hand, execute a skill work, in which their abilities comes less from acquired formal knowledge and much more from experience, and they are required to provide different guarantees, such as straight walls, proportion of sand and cement, properly spacing steel beams and so on. However, if the bridge falls, as a consequence or not of their job, they are not prosecuted for manslaughter; in fact, they are protected by law by a “shield” called engineer.

                                                                      This difference was engrained at us in university years so we would deeply understand the responsibilities of our profession.

                                                                      And, curiously, we also had classes where we would layer bricks and, afterwards, go to the lab to stress our little walls. From that particular class, I remember the professor tested our walls against the ones made by professional brick layers: all of ours collapsed easily, while the professional ones standed for the stress test. In the end, we got a lesson on trusting and respecting experienced brick layers and to stick to our expertise, but to understand our peers’ work.

                                                                      Therefore, it is fallacious to say an engineer is simply a title and there is no difference between an engineer and a bricklayer. It is as silly as saying as a pilot and a flight assistant are no different because both work at a flying plane.

                                                                      If your intention is to be politically correct, then let’s continue being correct and do not change meaning of words just to fix social injustices: let’s, instead, do as my aforementioned professor and show that we should respect the different types of jobs and, above it all, the symbiosis of them that makes a final product every body involved is proud of.

                                                                      There is no reason to call a mouse a cat so you can protect the mouse.


                                                                      My final remark: I felt unnecessarily disrespected by your suggestion that I belong to some sort of elite and trying to defend my privilege, especially because we never exchanged communications and because your quoted me in a convenient order to support your prejudice of me.

                                                                      Please, I ask you to stop for a minute next time you feel this urge to attack someone with different ideas from you and evaluate the person’s ideas instead of drawing and stating premature conclusions that might spoil the person’s day: you seem like someone that cares about equality and respect among people.

                                                                      1. 2

                                                                        Your arguments are basically 2 points. 1. Engineers use “formal knowledge”. 2. Engineers are liable for damage.

                                                                        For the first point, bricklayers have knowledge too. As stated by you. There’s no reason the knowledge of how to calculate forces should be privileged over the knowledge of how to lay bricks. For point 2, that is a legal issue. I don’t think words change their meaning based on how a legal system assigns liability.

                                                                        So I don’t see how any of these would qualify an ‘engineer’ as special.

                                                                        1. 2

                                                                          I have to disagree with you, again.

                                                                          For the first point, bricklayers have knowledge too. As stated by you. There’s no reason the knowledge of how to calculate forces should be privileged over the knowledge of how to lay bricks.

                                                                          Physicists use the same formal knowledge as civil engineers: mechanics and mathematics. Still, they have different professional names because they address problems differently.

                                                                          But my first answer to you was

                                                                          I would say that engineers design efficient solutions using pre-existing scientific and mathematical theories, limited by certain constraints (usually the triplet quality–price–time).

                                                                          And that is what differs the work done by an engineer from a bricklayer: the focus (i.e. spent most of its professional time) of the former is design using formal knowledge, while the latter focus on building a given design using acquired skill.

                                                                          (It doesn’t mean a bricklayer is forbid to design, but his design is most likely to lack the formal methodology applied in an engineer’s design.)

                                                                          So, in my perspective, what people call software architect is, actually, closer to a software engineer. And most people tend to call software engineer is simply a software developer.

                                                                          For point 2, that is a legal issue. I don’t think words change their meaning based on how a legal system assigns liability.

                                                                          I have to disagree with you: murder seems different from manslaughter even though in both cases a citizen killed the other. But the legal system names, judges and sentence people differently on name of the crime.

                                                                          So I don’t see how any of these would qualify an ‘engineer’ as special.

                                                                          It is so because of internal values. But if we compare “physician” to “nurse” (or, even stretchier, a “shaman”), or “pilot” to “steward”, then I think your internal values tend to disagree with your own statements.

                                                                          1. 1

                                                                            the focus (i.e. spent most of its professional time) of the former is design using formal knowledge

                                                                            An engineer once was asked to design a circuit. he looked up the reference design from the chip vendor, and copy and pasted.

                                                                            Was he engineering here? What formal knowledge and technique did he use?

                                                                            murder seems different from manslaughter

                                                                            This argument is basically “people in legal professions treat legally distinct catergories distinctly”. It doesnt prove much. Manslaughter is a legal term. People don’t use them generally.

                                                                            It is so because of internal values. But if we compare “physician” to “nurse” (or, even stretchier, a “shaman”), or “pilot” to “steward”, then I think your internal values tend to disagree with your own statements.

                                                                            You need to improve your mindreading skill. Pilots fly the plane, stewards don’t. Physicians and nurses are much more similar.

                                                                            1. 4

                                                                              Firstly, I would like to say that I like this discussion with you (when there is no personal attack): we have different points-of-view, and we keep pushing the discussion further.

                                                                              An engineer once was asked to design a circuit. he looked up the reference design from the chip vendor, and copy and pasted.

                                                                              Was he engineering here? What formal knowledge and technique did he use?

                                                                              By your statement, I will take a wild guess and assume you are not a hardware or electrical engineer.

                                                                              Hardware design is not simply putting elements in a board. Hardware design involves, among so many things:

                                                                              • choosing the correct components based on the constraints of the project, both technical, spatial, financial and time;
                                                                              • impedance matching among components;
                                                                              • electro-magnetic compatibility on the wiring and components;
                                                                              • thermal and power analysis of the design; and so on…

                                                                              Of the four tasks above, I would say the first one is that with the least amount of formal knowledge and relies mostly on skills. The other three heavily rely on formal knowledge (Physics).

                                                                              But back to your example, that is an attitude I could expect from an amateur hardware designer, a university student or, even, a junior engineer under supervision. Not from a professional engineer, in a professional environment: that is not what an engineer is expect to do, as I showed you by the small list of tasks when designing hardware.

                                                                              Pilots fly the plane, stewards don’t.

                                                                              That is the point I am trying to make, but on engineering: engineers design; builders build. And those are distinct activities.

                                                                              Physicians and nurses are much more similar.

                                                                              OK, we have a concept we converge.

                                                                              So, in your opinion, does it make sense to have a separate word for physicians and nurses? Does it make sense to you that physician is a protect word, associated with an union and have certain legal responsibilities? Do you see people calling nurses, midwives, physicians and surgeons all by the same word, “physician”? (Technically surgeons are physicians, but that is fine.)

                                                                              Clearly there are overlaps among all these professions but, to me, the core function of their job is different. And I would say that is clearer when comparing midwives to obstetrician: both deeply understand about pregnancy and are able to handle most cases of pregnancy, from the conception to the birth; however, that certain cases, formal knowledge (acquired in medicine school) is necessary to do the job properly.

                                                                              That is what I have been taught and daily observe about (software, but also other) engineering: frequently there is an overlap between programmers, architects and engineers but, at (a good amount of) times, more specialised and formal knowledge (and mindset) is necessary to address some of the technical challenges of the project.

                                                                              And, to me, that justifies the existence of the special university degree (engineering) and profession (engineer).

                                                                              1. 1

                                                                                So, in your opinion, does it make sense to have a separate word for physicians and nurses?

                                                                                Sure.

                                                                                Does it make sense to you that physician is a protect word, associated with an union and have certain legal responsibilities?

                                                                                no

                                                                                Do you see people calling nurses, midwives, physicians and surgeons all by the same word, “physician”?

                                                                                I go by the humpty dumpty rule of language usage. Words mean what you want them to mean. For communication, you simply have to make sure the other party knows your definition.

                                                                                By your statement, I will take a wild guess and assume you are not a hardware or electrical engineer.

                                                                                You are deflecting here. You are not addressing the scenario I presented, and instead restated your definition.

                                                                  2. 3

                                                                    people who think that ‘engineer’ is a protected word that only applies to special people (themselves included of course) in their special club?

                                                                    That’s the legal and universally acknowledged definition of the word.

                                                                    You also can’t go around calling yourself a lawyer without being in the special club. I don’t imagine you have a problem with that.

                                                                    You use some solidified math to solve some problem? That’s engineering.

                                                                    Not what it means or has ever meant.

                                                                  1. 2

                                                                    I have been willing to write about (middle or high) school mathematics on programming for a while.

                                                                    If one thinks in terms of (middle or high) school’s set theory and functional analysis, most of the problem I face in my day-to-day job would be avoided.

                                                                    When one learn about function on the 7th grade (that’s when I learned about it, I guess), one learns that all the outputs (image of the function) must depend on the input to (domai ln of) the function. And when exposed to function composition and other functional (mathematically speaking) operations, it makes eve more sense.

                                                                    The article explains it nicely, but I think this intuition can be simpler developed with a reminder of our 7th-grade math classes. In my point of view, as a side effect, it also teaches the power of types and (custom) data structure (as in Rob Pike’s rule 5 and programming with data) because of the set theoretical talk (domain, co-domain, image).

                                                                    1. 21

                                                                      Yeah, 72 is much more reasonable. We need hard limits, or at least ‘annnoying’ conventions to keep the horrors at bay. The human eye scans lines best at around 72 characters wide, and we should put human readability of our code before other concerns. I have worked on projects that had huge long lines and there is no excuse. If a language or tool or whatever can’t deal with human limits, find or make another tool. Linus’ current workstation should not be the standard.

                                                                      That being said, I think Racket has made a reasonable compromise:

                                                                      A line in a Racket file is at most 102 characters wide.

                                                                      If you prefer a narrower width than 102, and if you stick to this width “religiously,” add a note to the top of the file—right below the purpose statement—that nobody should violate your file-local rule.

                                                                      This number is a compromise. People used to recommend a line width of 80 or 72 column. The number is a historical artifact. It is also a good number for several different reasons: printing code in text mode, displaying code at reasonable font sizes, comparing several different pieces of code on a monitor, and possibly more. So age doesn’t make it incorrect. We regularly read code on monitors that accommodate close to 250 columns, and on occasion, our monitors are even wider. It is time to allow for somewhat more width in exchange for meaningful identifiers.

                                                                      https://docs.racket-lang.org/style/Textual_Matters.html

                                                                      1. 25

                                                                        The human eye scans lines best at around 72 characters wide

                                                                        I would like to have 72 chars wide line but with ignored indentation. It would make nested block readable on its own.

                                                                        Example with 40 chars width ignoring indentation white space

                                                                        Lorem ipsum dolor sit amet, consectetur
                                                                        adipiscing elit. Donec sit amet augue
                                                                        felis. Suspendisse a ipsum et sem auctor
                                                                        porttitor in ac lacus. 
                                                                        
                                                                            Curabitur condimentum augue diam, ut
                                                                            molestie nibh faucibus nec. Aliquam
                                                                            lacinia volutpat tellus, non
                                                                            sollicitudin nulla luctus sit amet.
                                                                        
                                                                                Aenean consequat ipsum sem, ac rutrum
                                                                                leo dictum at. Suspendisse purus dolor,
                                                                                condimentum in ultrices vel, egestas vel
                                                                                ipsum.
                                                                        

                                                                        Versus 40 chars width including indentation

                                                                        Lorem ipsum dolor sit amet, consectetur
                                                                        adipiscing elit. Donec sit amet augue
                                                                        felis. Suspendisse a ipsum et sem auctor
                                                                        porttitor in ac lacus. 
                                                                        
                                                                            Curabitur condimentum augue diam, ut
                                                                            molestie nibh faucibus nec. Aliquam
                                                                            lacinia volutpat tellus, non
                                                                            sollicitudin nulla luctus sit amet.
                                                                        
                                                                                Aenean consequat ipsum sem, ac
                                                                                rutrum leo dictum at.
                                                                                Suspendisse purus dolor,
                                                                                condimentum in ultrices vel,
                                                                                egestas vel ipsum.
                                                                        
                                                                        1. 18

                                                                          The human eye scans lines best at around 72 characters wide

                                                                          With monospace fonts? Or proportional ones? With large text or small?

                                                                          With English prose, poetry, or with C code? With hyphenation? Indentation?

                                                                          I’ve found that recommendation is pretty good for English text with a middle size proportional font. I do not find it works as well for code.

                                                                          1. 5

                                                                            100% agreed. As I argued in the comments above, people don’t read code the same way that they read prose, and so I would not try to generalize a heuristic meant for prose to code.

                                                                            1. 3

                                                                              I agree. Reading written text involves repeatedly shifting your focus to the line below. A consistent and short line length in that case is very important. Code is not the same. It’s far more common reading code to study a single line or small block, and in that case, I find that arbitrarily wrapping a line to stay within 80 characters usually breaks consistency and harms readability. I used to subscribe to the 80 character limit until I realised this difference. We don’t read code like we read written text.

                                                                              Terminal/editor windows side by side is a fine point, but in general the vast majority of lines of code are short anyway, often well under 80 characters. If a few lines happen to wrap on your display, I hardly think that’s going to completely kill readability, and it’s certainly a trade-off I’m willing to make. If many lines are wrapping then yes, you probably have a problem with your code formatting (or your code in general). It’s the hard limit that I take issue with. Back when I wrote my own code like this, all too often I would find myself renaming identifiers (usually for the worse) among other arbitrary and unhelpful things, just to fit some code within a line without wrapping. I wouldn’t be surprised if more often than not this is the outcome for many others who attempt this, and it’s almost certainly a net negative for readability. Dropping the idea entirely has been a huge relief. One less thing to think about. Most of my code still consists of short lines, as it always did, and as most code naturally does. But when I need to, and it makes sense to write a longer line, I don’t spend a second agonising over whether it fits within some special number of characters, and instead focus entirely on whether it in itself is clear and understandable.

                                                                            2. 10

                                                                              I want to reinforce your comment that

                                                                              The human eye scans lines best at around 72 characters wide, and we should put human readability of our code before other concerns.

                                                                              Recently, I have been trying to optimise my on-screen experience and I found a series of peer-reviewed articles with recommendations that improved my experience.

                                                                              In one of those, it is claimed, indeed, that more than 72 and less than 80 characters (precisely, 77) is the optimal number for clear readability.

                                                                              The study is for dyslexic people, and I was never diagnosed as so. But it works for me, and I tend to believe it works for most people as well.

                                                                              1. 1

                                                                                Yeah what I’ve read confirms this, I think the width of the text column can vary based on the character width. For example in CSS I typically set something like:

                                                                                 p { max-width: 32em; }
                                                                                
                                                                                1. 4

                                                                                  You can also use 72ch to set it based on width of the 0 character (which will approximate it)

                                                                            1. 6

                                                                              I see lot of haters here which makes me a bit sad. So I want to thank you for your article and express, that there are also people who like ASN.1. It is very powerful (meta)format.

                                                                              1. 6

                                                                                there are also people who like ASN.1

                                                                                I am one of them. I am in a project using a protocol specified using (a small variation of) ASN.1 and it has been an interesting experience, which made me wonder why people are so crazy about JSON everywhere.

                                                                                In fact, a couple of weeks ago, when I saw a post about MessagePack in here, I wondered why the authors decided to re-invent the wheel.

                                                                                But, well, there are so many serialisation formats, and different people seem to like the different flavors.

                                                                                If I can, I will keep using it. :)

                                                                                1. 0

                                                                                  Add two more consecutive optional fields with an identical type to one of your structs and you’ll understand.

                                                                              1. 9

                                                                                Here’s some that I had my eye on:

                                                                                • Chapel: a programming language designed for parallel computing. A lot of data locality constructs as part of the core language, and I like how to they do configuration.
                                                                                • P: A language with first class state machines! Might not satisfy the “beginner documentation” requirement though.
                                                                                • Esterel: real niche, but the only free, battle-tested, synchronous programming language I know about.
                                                                                1. 1

                                                                                  This P language seems really nice! I will give it a try!

                                                                                  Thank you!

                                                                                1. 3

                                                                                  I’ll try to give a sketch of an Emacs-centered workflow. My main tools are (surprisingly) GNU Emacs and xterm+bash. I don’t need much more than that.

                                                                                  When working on something, I usually have one of two setups:

                                                                                  • For compiled languages, I split Emacs intro three windows (for non-Emacs users, what the window manager calls a “window” is a “frame” in Emacs-speak, while a frame in the Emacs window is a “window”). Usually a file buffer on one side of the screen, and a vertically split window with a compile buffer on the top and a terminal*/dired below. These can be rotated easily (using window-swap-states). But I would usually order than so that rotating through the buffers makes sense. Binding recompile to a handy key is very useful, in my case I use the F2 key.
                                                                                  • For interpreted languages, assuming there is proper Emacs support, I would have mostly the same setup, except that the compile buffer would be replaced by a REPL, and I would tend to not have a terminal open.

                                                                                  Regarding Emacs extensions, projectile is very useful, but I’m not an advanced user. My main commands are projectile-find-file and projectile-kill-buffer. Sometimes I forget to use the latter, and then I end up with 700 opened buffers, like a few weeks ago. Other noteworthy packages are avy, for jumping to symbols, but also copying and moving them around, ivy/swiper, for faster completion and perhaps dumb-jump for looking up definitions without having to set anything up. Any other tips would be language specific.

                                                                                  This is my configuration, in case anyone cares, but I’m in the process of re-writing and shrinking it, so it’s not as tidy as it used to be.

                                                                                  * In my case Eshell.

                                                                                  1. 1

                                                                                    It’s interesting how different our setups are considering we both use Emacs; it fascinates me every time I come across one how varied the users of Emacs are.

                                                                                    Thank you for your configuration, by the way. I can’t remember how I first came across it, but I’ve found a few nice settings in there, and like your list of inspirational configurations which I’ve also found a few nice things in. When you switched to Rmail I got quite excited, I barely know anyone else who uses it!

                                                                                    1. 2

                                                                                      Considering how “low-level” Emacs primitives are (buffer, window, frame, …) it doesn’t even surprise me. Most people in this thread use a window manager, and look at all the variation there!

                                                                                      Thank you for your configuration, by the way

                                                                                      It means a lot that people find what I do helpful! A lot of knowledge, methods and tricks about Emacs is lost in old configuration files or blog posts, so trying to dig this up for others is kind of interesting, especially because workflows have changed so much over time.

                                                                                      1. 1

                                                                                        Considering how “low-level” Emacs primitives are… Most people in this thread use a window manager

                                                                                        Considering I spend a lot of time proclaiming that Emacs is nothing more than an interface, I’m surprised I never made this comparison myself!

                                                                                        Yeah, maybe it’s quite sad but I do like to print off people’s init files and just read through them. There’s a lot of good stuff in a lot of them.

                                                                                    2. 1

                                                                                      Out of curiosity: do you use xterm so you can use Alt + B and Alt + F to navigate readline?

                                                                                      At least in my case, that’s mostly the reason I use it over the other existing options.

                                                                                      1. 2

                                                                                        No, there’s no real reason. Sometimes I get bored and switch back to MATE’s terminal (or when i need to resize my terminal for an audience to recognize anything). But I just tried Alt-B and Alt-F in mate-terminal, and it worked, so I’m not sure what you’re talking about. Have you disabled the menu bar?

                                                                                        1. 1

                                                                                          But I just tried Alt-B and Alt-F in mate-terminal, and it worked, so I’m not sure what you’re talking about. Have you disabled the menu bar?

                                                                                          I am a bit embarrassed now, because I just tested it on gnome-terminal (on i3) and it has worked as well.

                                                                                          I had this memory I changed to xterm for that reason, though. Perhaps my memories is playing tricks on me.

                                                                                          Any how, I learned it works on gnome-terminal as well—and possibly everywhere else. :)

                                                                                          1. 1

                                                                                            The behaviour is totally unintuitive, and I remember just ignoring it for ages, so there’s nothing to be ashamed of :)

                                                                                    1. 10

                                                                                      My development environment is kinda like the UNIX philosophy version of an IDE. I use:

                                                                                      • Fish as my shell
                                                                                      • Kakoune as my text editor
                                                                                      • tmux for windowing and persistent session stuff
                                                                                      • fzf for fuzzily changing directories and picking files
                                                                                      • ripgrep and fd for searching
                                                                                      • kitty as my terminal emulator

                                                                                      I’m probably forgetting other things, but those are the important ones. My personal laptop runs macOS, but all other machines run NixOS.

                                                                                      I work almost entirely with Haskell and Nix, so language specific tools include stuff like Cabal, ghcid, ormolu, and HLint. I also use home-manager for declarative package management, as opposed to the more imperative nix-env style.

                                                                                      1. 2

                                                                                        I have almost the same environment, except I couldn’t completely switch to Kakoune so I went back to the comfort of Neovim.

                                                                                        Great setup ;)

                                                                                        1. 2

                                                                                          As @damantisshrimp said, I also have almost the same configuration:

                                                                                          • s/fish/bash/
                                                                                          • s/Kakoune/Neovim/
                                                                                          • s/kitty/uxterm/

                                                                                          Some other things that I think it is worth to mention:

                                                                                          • i3 as window manager;
                                                                                          • Zeal for offline documentation;
                                                                                          • w3m for quick internet surfing (mostly StackOverflow and online documentation);
                                                                                          • it might sound crazy, but the amount of time I use find (application of operations on set of files), awk (querying) , sed (simple modifications), and ed (more complex modifications) daily makes them deserve a special entry in this list.
                                                                                        1. 4

                                                                                          Anyone knows examples of conservative static analysis tools that check for termination in general purpose languages?

                                                                                          Isn’t it exactly the Halting Problem?

                                                                                          For trivial examples (e.g., while(true)) grep can find that. The problem is exactly the non-trivial cases, and that is what I think the author is asking advice for.

                                                                                          I still think Dhall is the best philosophical road in configuration files.

                                                                                          1. 1

                                                                                            Hey, I’m the author!

                                                                                            Yep, if it wasn’t for “conservative”, it would be halting problem. “Conservative” means it’s allowed to reject a valid terminating program (because it’s not smart enough to figure out why it’s guaranteed to terminate). But if you program does pass the check, it’s 100% guaranteed to terminate.

                                                                                            Some examples would be:

                                                                                            • a simple example of a conservative subset of language would be setting a timeout for a program. So if your program takes a millisecond longer than a timeout, it would be rejected as invalid

                                                                                            • a more sophisticated example is a language that doesn’t support loops, but uses something like structural recursion

                                                                                              Or you could just not allow recursion or control flow in the first place, which is what Dhall does.

                                                                                            So what I meant by a ‘conservative subset’ was – you can restrict your existing language (i.e. Python) to a subset that is provably terminating. For example if you forbid using for/while loops, eval/exec, imports and standard library you might get a terminating subset of the language (of course you have to analyse it thoroughly). That way:

                                                                                            • your config is guaranteed to terminate in finite time
                                                                                            • you don’t have to reinvent the syntax for your config – you benefit from the existing tools for your programming language

                                                                                            Not sure, maybe “conservative” is not the right word for that, but I think it’s what is usually used when referring to static analysis tools, e.g. here

                                                                                            1. 1

                                                                                              Dhall has control flow and recursion. Your own post addresses this so your comment could probably just omit the Dhall mention.

                                                                                              I’ve considered making a config language out of PureScript which would disable recursion and import a custom content-addressable package set, which would expose only those functions that terminate (map, fold, etc). Rather than creating anything new, it would restrict what is already there and maintained. PureScript is better than Haskell at talking natively to JSON, with its record system, which is why I’d choose it.

                                                                                              You could perform “modifications” by replacing/updating top-level definitions of normal forms. But only normal forms can be modified directly without worry, i.e. pretty much JSON. Anything else and you would have to wrap things with setters and adders, which obscures the structure of the config. But one could explore normalization tools to “inline” code with its results to recover normal form structure.

                                                                                              I think something like this is deserves more research.

                                                                                              1. 1

                                                                                                Dhall has control flow and recursion

                                                                                                Ah, I meant it doesn’t support general recursion. In my understanding it’s got folds/maps, but no for/while analogues which makes it total, right?

                                                                                                I’ve considered making a config language out of PureScript which would disable recursion and import a custom content-addressable package set.

                                                                                                Rather than creating anything new, it would restrict what is already there and maintained.

                                                                                                Yep, that’s exactly what I had in mind by a “subset of a language” ! Sounds really cool, did you get far with this?

                                                                                                1. 1

                                                                                                  Sorry, wrong assumption on my part. It doesn’t have recursion, not even primitive recursion or structural recursion.

                                                                                                  I assumed it had some kind of iteration to achieve Ackermann; it achieves it instead with a Natural/fold which takes an arbitrary Natural for how many iterations to perform. That’s sadly enough to define a pernicious Ackermann-like function. I’m not sure that Gabriel was aware of this possibility when adding Natural/fold to Dhall; I’m sure he wouldn’t have, as the main promise of Dhall is termination, which really comes with an implicit “in short time” qualification, at least it did in my mind; otherwise you always have to add a “in n steps” or “in n milliseconds” sandbox to your configurations which is unaccaptable: what do you do when you hit this limit?

                                                                                                  1. 2

                                                                                                    No problem!

                                                                                                    This is exactly why I’m somewhat sceptical about termination as a necessary property, because termination in theory (i.e. in 100 years) means non-termination for all practical purposes. Ackermann is a contrived example, but once you have anything resembling functions (even withouth recursion!), you’re doomed anyway, e.g.

                                                                                                    function f1(x) { return concat(x     , x); }
                                                                                                    function f2(x) { return concat(f1(x), f1(x)); }
                                                                                                    function f3(x) { return concat(f2(x), f2(x)); }
                                                                                                    function f4(x) { return concat(f3(x), f3(x)); }
                                                                                                    ...
                                                                                                    function fN(x) { return concat(...)
                                                                                                    

                                                                                                    (not Dhall, but I believe this is expressible in Dhall)

                                                                                                    As N grows, this will take exponential time to evaluate (and also exponential memory), while the code itself grows linearly with N. Linear growth means it’s something that can be written and managed by a human, so here you go, you have something that doesn’t terminate in practice. Again, this is something contrived and unlikely to occur unless you’re being malicious, but if we’re discussing language design, that’s something to keep in mind.

                                                                                                    You’d get this blowup behaviour from jinja templates, or YAML, or anything that supports string interpolation or helper functions.

                                                                                          1. 4

                                                                                            Anyone here running NetBSD as their primary desktop? I’d love to hear your stories :-) Can you share some of what you like about it? The small moments where you stop and think, that’s why I run it!

                                                                                            1. 11

                                                                                              I use it (have for a few years). I really enjoy how quickly I can go from “name of a binary I use” to the source code that created it. Applies to both base and packaging.

                                                                                              It’s also a really nice simple system that I understand fully, which is always fun. It brings me a lot of confidence in doing insane things like live-swapping libc to test out a patch.

                                                                                              My use case has been very FOSS-heavy for many years, so I don’t miss much. I did quit some video games in my transition, but it felt like a good decision (the particular way I was playing had negative effects on me).

                                                                                              During a few days I felt like I want to work from my NetBSD machine, I was using it as a SSH terminal to a remote Linux box, and using my Android phone for video calls.

                                                                                              My graphical environment is actually harder to reproduce on the user-friendly linuxes, since I use things like dwm, which are configured by patching code & rebuilding.

                                                                                              I’ve been a developer for NetBSD for the past few years and it has encouraged me to do crazy things I would never have otherwise attempted, like a lot of toolchain and driver work. It has given me justified self-confidence on the professional front. It’s a nice community and I recommend it.

                                                                                              1. 3

                                                                                                I’ve been a developer for NetBSD for the past few years

                                                                                                Get a hat! https://lobste.rs/hats

                                                                                              2. 8

                                                                                                I don’t anymore (it simply doesn’t support things that I need for my job), but I did for a long time years ago.

                                                                                                • pkgsrc is great.
                                                                                                • The whole rc system is really nice.
                                                                                                • The work that went into making it very portable also resulted in a clean and understandable code base for the code system components.

                                                                                                NetBSD also seems to be doing the most moving-the-ball-forward of the BSDs of late. OpenBSD is trying to be the most secure which is great, but that encourages not doing things like putting Lua in kernelspace. :) The rump kernel project and various other bits of neat stuff is great.

                                                                                                1. 5

                                                                                                  NetBSD also seems to be doing the most moving-the-ball-forward of the BSDs of late

                                                                                                  well.. jmcneill@ is doing incredible development with all the things Arm and embedded (RPi4 Ethernet most recently, AWS a1.metal, display output on lots of SoCs…), for sure.

                                                                                                  But in general, FreeBSD is rolling lots of balls forward, I would say more than the others, but I’m biased of course :)

                                                                                                  The rump kernel project

                                                                                                  unfortunately rumprun doesn’t seem to be actively developed anymore..

                                                                                                  1. 4

                                                                                                    Sorry, I didn’t mean to discount others’ hard work. I meant something more along the lines of “willing to do more researchy/experimental things.”

                                                                                                    Then again, I may be wrong on that front too.

                                                                                                    1. 1

                                                                                                      That HID work looks promising. It would be good if it enabled N-key rollover in keyboards to allow things like Plover and my unreleased stenography engine to work on FreeBSD.

                                                                                                      1. 1

                                                                                                        N-key rollover in keyboards

                                                                                                        It does, I just checked — my USB keyboard went from 6-key to >20-key rollover.

                                                                                                        I’m actually kinda surprised it didn’t work with the stock ukbd — I thought the keyboard pretended to be a hub with multiple keyboards, but no, it’s multiple HID endpoints on one device.

                                                                                                        1. 1

                                                                                                          Excellent. Thanks for checking.

                                                                                                    2. 1

                                                                                                      What is good about putting Lua in kernelspace?

                                                                                                      1. 6

                                                                                                        So far they’ve used it for scriptable CPU scaling and packet filtering, which is cool. The paper where they discuss the implementation points out that their packet filtering does not introduce significant performance overhead and does filtering stuff that would be impossible with existing solutions.

                                                                                                        The idea of having a memory-safe scripting in the kernel instead of more C seems like it could be a good thing for when things need to be more dynamically configured. If they had gone with userspace controllers, they’d need to poke more holes into the userspace-kernelspace barrier. This way, a lot of functionality can be exposed through the single “run a Lua program” thing.

                                                                                                        Most importantly, though (and IMHO), it doesn’t matter whether it’s good or not. We can’t know if it’s good or if it’s useful until we try it, and I’m glad that the NetBSD folks were willing to give it a try. If they fail, no harm no foul, but if they succeed, they’ve pushed the state of the art a little bit forward.

                                                                                                        1. 2

                                                                                                          Yeah, I didn’t know about this either. Found slides on it. Looks pretty cool. One motivation, prototyping or debugging drivers, is similar to Rump kernel.

                                                                                                      2. 6

                                                                                                        Anyone here running NetBSD as their primary desktop?

                                                                                                        Yes, I am.

                                                                                                        I had an old netbook idle at home and decided to make that my primary computer (opposed to the family computer). Have in mind, though, I primarily use my computer to write code and I am a quite new NetBSD user.

                                                                                                        In a nutshell:

                                                                                                        Pros:

                                                                                                        • it is fast (faster than my previously installed Arch Linux in that same machine);
                                                                                                        • it is “clutter free”—it has (almost) zero default services, and I know and understand all the process running in the operating system;
                                                                                                        • it is documentation (both the “The Guide” and the man pages) is the most complete and “human friendly” I have ever seen—take a look on the man afterboot to understand what I mean;
                                                                                                        • there is a level of symbiosis between the kernel and userland is incredible (for a person used to Linux);
                                                                                                        • pkgsrc, although I just use the binary distribution (pkg_add and pkgin) so far;
                                                                                                        • it is the first *nix system I feel comfortable to not have a window manager (I have i3 for the rare occasions I need to use Firefox, though);
                                                                                                        • it seems (by what I see in their official blog) to be actively improving security (e.g., kernel fuzzing efforts) and compatibility with LLVM, which I find interesting.

                                                                                                        Cons:

                                                                                                        (I sincerely cannot say: everything seems to be working—I haven’t tested the Bluetooth—and I am very glad with it! Let’s try something for the sake of argument.)

                                                                                                        • it requires some experience with *nix to install and configure it, although not much—I doubt my parents would use it instead of Windows;
                                                                                                        • it forces you to read more documentation;
                                                                                                        • pkgsrc binaries are updated less frequently (every quarter of the year) than in the apt repository;
                                                                                                          • I have yet to learn how to use the pkgsrc properly, and it requires some documentation reading;
                                                                                                          • even when I learn to use ir properly, I will need a lot of luck, patience, time and electricity compiling Firefox in a netbook.
                                                                                                        • sailor is not there yet, while FreeBSD has Jails.

                                                                                                        Why NetBSD?

                                                                                                        All in all, I thought: why not?

                                                                                                        1. 2

                                                                                                          @guiraldelli, thanks a lot for your detailed reply and links! I’m going over them all. :-)

                                                                                                        2. 4

                                                                                                          Not as primary, but I’m running it on two oldish computers, an Amiga 1200 (with a 030 and fpu) and a PC with one of the first Athlon CPUs (Slot A).

                                                                                                          I love it. The kernel and userspace are non-bloated (relative to Linux), the manpages are excellent and the source code is well-structured and pleasant to read.

                                                                                                        1. 27

                                                                                                          I think if you’re considering Gtk or Qt for it’s cross-platformness, you should probably also consider Tcl/Tk. It’s a lot smaller and faster than the others, and if one of them is good enough, Tcl/Tk almost certainly is better.

                                                                                                          And if Tcl/Tk isn’t good enough? You know, sometimes that higher standard of quality is required for consumers, and if it is, you’ll waste so much time trying to get that quality out of a “cross-platform GUI framework” that you might’ve just as well used a “native” framework and written your code twice, because your program will always be bigger than your competitors, and slower than them, and it’ll always feel a little bit off even if you do everything else right.

                                                                                                          For me, I’ve completely written off this kind of “cross-platformness” because that kind of hassle just isn’t worth it.

                                                                                                          1. 10

                                                                                                            I come here to say about Tcl/Tk and FLTK: both are way lighter options.

                                                                                                            1. 10

                                                                                                              Accessibility is a quality that is arguably even more important for business applications than it is for consumers, and Tk doesn’t have it, at all. That should be a deal-killer, unless you’re developing an application for a task that’s inherently visual (e.g. working with graphics).

                                                                                                              1. 2

                                                                                                                Do you know if command line tools are inherently accessible to screen readers, or does something additional have to be done?

                                                                                                                1. 2

                                                                                                                  Yes, command-line tools are inherently accessible.

                                                                                                                  1. 5

                                                                                                                    Although I’ve always had trouble with the ones which add pseudo-gui elements.

                                                                                                                2. 2

                                                                                                                  To the person who downvoted my comment as a troll, do you have any suggestions on how I could have written it better? I’m not trolling; I’m genuinely advocating for accessibility (check out my profile). If it came off as too harsh, that’s just because I feel strongly about this subject.

                                                                                                                  1. 1

                                                                                                                    I’ve also been getting a bunch of frivolous “troll” flags on comments I made in good faith. Perhaps someone is abusing the comment downvoting system? I don’t think you should have to back down from what you said, it was a good point and not harsh at all.

                                                                                                                  2. 1

                                                                                                                    This is also one of the reasons why Electron is awesome(ish): you get all the web platform accessibility tools and APIs. And there is tons of content about how to make accessible applications with web technologies, which IIRC was not the case with QT/GTK.

                                                                                                                    1. 1

                                                                                                                      But (and you may have anticipated this point) is a framework really all that accessible if every application written with it is ginormous and requires a whole bunch of CPU and RAM just to get up & running?

                                                                                                                  3. 2

                                                                                                                    Agreed, particularly when there are good choices for writing your business logic that will run and interoperate more or less cleanly no matter where you are. You technically don’t even have to write (most of) your code “twice”, just the UI bits, which are probably going to be quite different anyway because of the different UI metaphors prevalent on different platforms.

                                                                                                                    1. 3

                                                                                                                      going to be quite different anyway because of the different UI metaphors prevalent on different platforms.

                                                                                                                      Count on it!

                                                                                                                      And it’s hard to be fluent in those metaphors when they’re so different from system to system unless you force yourself to use those other systems often enough that you wouldn’t put up with a Qt or Gtk build of your Mac or Windows app anyway.

                                                                                                                    2. 2

                                                                                                                      To paraphrase a common refrain in Functional Programming circles, “islands of backend logic in a sea of GUI code”.

                                                                                                                      1. 0

                                                                                                                        I have been thinking electron/react native as cheap way (in time and money) to get cross platform applications. And as money<->time<->quality dependency chain dictates, you will lose certain amount of fit and finish when you take that approach. Lot of times it is correct call to do (I rather take non-native application than no application at all) but it is always a trade-off which needs to made, not just defaulted to.