1.  

    I think I first read about Icon via Laurence Tratt’s Converge, which borrowed the idea of goal directed execution: http://tratt.net/laurie/research/pubs/html/tratt__experiences_with_an_icon_like_expression_evaluation_system/.

    Correctly or incorrectly, Tratt concluded that backtracking in Icon was more difficult to use than one might hope, and reduced its scope in his language.

    1.  

      It’s a very clearly written article, I did not know about the goal directed execution, and the description is very approachable. It’s an interesting variant on handling control flow.

    1. 11

      You’re not a full-stack developer until you design your own instruction architecture and written a compiler for it.

      1. 5

        This is why I hate the meme: it turns a web developer into a “full-stack” developer when former made sense but later conflicts with previous meaning of software stack. It was the whole setup. They watered the term down much like crypto is cryptocurrencies instead of cryptography.

        True full-stack developers include Chuck Moore, Niklaus Wirth, and the folks that did NAND2Tetris.

        1. 4

          I think taking “full-stack” to mean “well-versed in all relevant technologies the engineering team will be customizing” is a lot less prone to strawman attacks.

          1. 3

            I don’t think it even needs to include “well-versed”. “Okay at using them” is good enough for me.

            1. 2

              There are plenty of ways to convey that idea without the whole “denying the existence of over half the levels of abstraction you build upon” part.

            2. 3

              With all due respect to Wirth and Moore, who have both done amazing work, have either of them spent time in the last decade building with modern web technologies? Otherwise we can’t call them full stack developers ;)

              1. 1

                Damnit, you got me! Lmao. Ok, pre-Web, full-stack developers. (pauses) That should be OK.

                Now, we need some full-stack developers with Web. I’d start with people who have done hardware and at least RTOS projects. Then, look to see if they’ve done the web stuff.

          1. 1

            By coincidence, I just today saw that CentOS does almost exactly what I was going to propose here: use a version that mixes a standard version number with a date:

            7.1.1503 indicates major version 7, minor version 1, released in 2015-03.

            https://en.wikipedia.org/wiki/CentOS#Versioning_and_releases

            1. 3

              Just a small note: the script could be writen more consisley (and maybe in a more understandable way) by doing:

              /baz
              t
              s/baz/elephants
              wq
              

              Writing .t. is like running vi ./file instead of vi file in a shell. And ed allows you to write and quit in the same command, just like :wq does in vi.

              While I would have personally chosed emacs to do this task (using dired + keyboads marcos would be quite straightforward), I do agree that ed(1) is a quite helpfull and underestimated tool, especially when you embed it into a shell script with a here-doc. And despite apperances, it really isn’t that complicated, especially when you have a good man page (eg. OpenBSD’s) or have GNU Info + the ed manual installed, in case one needs to do something more esoteric.

              1. 5

                And despite apperances, it really isn’t that complicated

                UNIX V7 actually shipped interactive tutorials to learn ed(1) as part of learn. It’s unfortunate that there’s no convenient way to actually make use of those. You’d actually have to set up a PDP-11 emulator with V7 (though prebuilt images exist) and work with that, an environment where backspace doesn’t really work out of the box.

                1. 1

                  I’m a pretty mediocre emacs user, and poking around at the manual, I wasn’t qutie sure how to use dired to apply a macro to multiple files. I guess if you had a dired buffer with just the files you wanted, you could write the macro to open the file, do the operation, return to the dired buffer, then go on. Is that the idea?

                  1. 1

                    While I’m no expert, that would have been what I would was thinking about. And despite first appearances, I don’t even think there’s anything too wrong about it either. I guess if you really wanted to be “save” you could write a script that processes all buffers on a stack by applying a function or a marco within them, but I don’t see the practical advantage. Whenever I did “start a macro in dired, open a file, edit it, close, move to next line (manually or via C-s)”, I didn’t have any problems with the method.

                1. 19

                  I’m sad after reading these comments.

                  I understand and respect his decision, and these comments themselves are the very evidence why he is right. How about having OpenSource simply about openness and source? Why do politics and ideologies have to always appear?

                  Maybe a new manifesto is needed, much like the Agile manifesto:

                  • Individuals and interactions over group identities and categories of people
                  • Working software over ideologies and codes of conduct
                  • Respecting each other regardless anything
                  1. 21

                    Why do politics and ideologies have to always appear?

                    Ideologies are always there. You only notice them when they’re different from your own.

                    1. 20

                      Perhaps the point is that some people would like a safe space for focusing on technical matters rather than every single open source and free software community getting politically co-opted into a culture war.

                      Wanting a community focused on technical work and otherwise treating people equitably isn’t “apolitical”, you’re right, but that doesn’t make it invalid.

                      I choose to focus on helping people who came from a similarly disadvantaged background as myself but that’s something I do on my own time and money. I don’t impose it on the software communities I participate in.

                      I think we need the diversity of participants in free software represented in the communities and organizations. Were that the case, I think I would see more diversity in organizational structures, conduct standards, explicit goals, etc. What I perceive is a corporate-funded monoculture that is getting a bit creepy in the demands placed on others that don’t want to participate.

                      I’m also starting to notice a social intelligence / neurotypical punching-down in these threads where someone who is less adept at adopting the politically convenient argot of the day gets excoriated for trying to express their discomfort in their own words. It makes me deeply uncomfortable how the members of this community conduct themselves in these threads.

                      Some of my favorite communities are very engaged with the issues of access in ways that are in keeping with the zeitgeist (e.g. Rust) and do great work in part because of that. Some of my other favorite communities have a different emphasis or approach. I’d like them to co-exist peaceably and for people to do what they are most passionate about, whatever form that takes.

                      1. 8

                        You may be right. But what I wanted to express is: I have my ideologies, just like anybody else does, but I believe that open source should only have one ideology, which is about software, collaboration, and not people, or other ideologies. For my taste even the GNU project is too political in many aspects, but on the other hand they have some great pieces of software and those are often governed and built in a great atmosphere. (I can recall a single notable “scandal” that reached me, but the community was generally welcoming, as it is for most software projects.)

                        Edit: Or to rephrase it even more: ideology is a system of thought covering most aspects of (human) life. I beleive everyone has a personal world view, that is closer to some pre-canned ideology than to others. Yet software projects should have ideologies of software lifecycle, not of human lifecycle, and those can be very well separated, as my personal life and life at my work can also be separated.

                        The etiquette of the global human civilization should be enough to cover the human-human interaction part of the collaboration, as it is for professional interaction in my experience with colleagues from all over the world. We share our vision about software, quality, and work together, while we may disagree on plenty of things, which have no place in the discussion about a software project.

                        1. 1

                          Ideologies are always there. You only notice them when they’re different from your own.

                          This is a really interesting claim that I’m seeing more and more! I’d love to find some sources that explain the justification for it.

                        2. 6

                          I’m genuinely sorry about that. :(

                          Unfortunately, some topics always bring out discussion that highlights the leaky abstraction of other lobsters as purely technical beings.

                          It’s the strongest argument against certain forms of content here.

                          1. 3

                            One of the goals of open source movements is bringing in new people. I don’t think that’s a particularly contentious goal.

                            Outreachy is one organization that embodies particular ideas about how best to do that. It’s true those ideas are politically charged, but they’re in service of a goal that is agreed upon. So you can’t effectively pursue the goal of getting new people into open source without taking some kind of stance on the political questions.

                            Some political questions (what is the optimal US tax policy) are more or less irrelevant to open source. But others are so pervasive that they can’t be ignored, except by creating a tacit consensus. Even the idea that we should respect each other creates conflicts where people have sufficiently different ideas about what respect means.

                            1. 2

                              These goals promote the production of “high quality programs” as well as “working cooperatively with other similarly minded people” to improve open-source technology.

                              source: https://en.wikipedia.org/wiki/Open-source_software_movement

                              Bringing a specific political agenda to an open source project violates the similarly minded people, or can have the effect of pushing away differently minded people. This is not what respect means in my opinion. I have worked a lot wit differently minded people, and we got along, as we were focusing on the goals. The goals were creating software, not changing society or a community. This moving goalposts is what is bad for OpenSource in my opinion.

                              1. 10

                                “Apolitical” open source has turned out to be overwhelmingly white and male - significantly more than even the broader software industry. Reference.

                                I don’t think there’s any evidence that this demographic skew is deliberate. However once a group is dominated by a certain demographic then it’s easy for people to get the message that this is “not for them”, even if noone says this (and especially if some “bad apples” do).

                                I believe that there’s nothing about being white and male that makes the best possible open source software developers, so this demographic skew is a bug not a feature. I believe that the best possible open source community is the one with the biggest group of committed (to creating open source) people involved.

                                With this in mind, what can be done to encourage more diversity and bring more people in? There’s no evidence that the status quo (“focus on tech”, etc) will change by itself.

                                pushing away differently minded people

                                The only people the LLVM CoC will push out is people who repeatedly violate it (and by doing so that person is pushing out other people). Outreachy is bringing people in, it doesn’t push anyone out.

                                Someone decided to leave because aspects of the project no longer meshed with their political world view. You see this as “pushed out”, but I don’t really see who is pushing them here (unless there are some CoC violations we don’t know about or something, but AFAIK there aren’t).

                                1. 1

                                  Open source is an explicitly political idea to start.

                            1. 16

                              TLDR;

                              • In 2004 Apple, Mozilla and Opera were becoming increasingly concerned about the W3C’s direction with XHTML, lack of interest in HTML, and apparent disregard for the needs of real-world web developers and created WHATWG as a way to get control over the web standards
                              • they throw away a whole stack of powerful web technologies (XHTML, XSLT…) whose purpose was to make the web both machine readable and useful to humans
                              • they invented Live Standards that are a sort of ex-post standards: always evolving documents, unstable by design, designed by their hands-on committee, that no one else can really implement fully, to establish a dynamic oligopoly
                              • in 2017, Google and Microsoft joined the WHATWG to form a Steering Group for “improving web standards”
                              • meanwhile the W3C realized that their core business is not to help lobbies spread broken DRM technologies, and started working to a new version of the DOM API.
                              • in 2018, after months of political negotiations, they proposed to move the working draft to recommendation
                              • in 2018, Google, Microsoft, Apple and Mozilla felt offended by this lack of lip service.

                              It’s worth noticing that both these groups have their center in the USA but their decisions affects the whole world.

                              So we could further summarize that we have two groups, one controlled by USA lobbies and the other controlled by the most powerful companies in the world, fighting for the control of the most important infrastructure of the planet.

                              Under Trump’s Presidency.

                              Take this, science fiction! :-D

                              1. 27

                                This is somewhat disingenuous. Web browser’s HTML parser needs to be compatible with existing web, but W3C’s HTML4 specification couldn’t be used to build a web-compatible HTML parser, so reverse engineering was required for independent implementation. With WHATWG’s HTML5 specification, for the first time in history, a web-compatible HTML parsing got specified, with its adoption agency algorithm and all. This was a great achievement in standard writing.

                                Servo is a beneficiary of this work. Servo’s HTML parser was written directly from the specification without any reverse engineering, and it worked! To the contrary to your implication, WHATWG lowered barrier to entry for independent implementation of web. Servo is struggling with CSS because CSS is still ill-specified in the manner of HTML4. For example, only reasonable specification of table layout is an unofficial draft: https://dbaron.org/css/intrinsic/ For a laugh, count the number of times “does not specify” appear in CSS2’s table chapter.

                                1. 4

                                  You say Backwards compatibility is necessary, and yet Google managed to get all major sites to adopt AMP in a matter of months. AMP has even stricter validation rules than even XHTML.

                                  XHTML could have easily been successful, if it hadn’t been torpedoed by the WHATWG.

                                  1. 15

                                    That’s nothing to do with the amp technology, but with google providing CDN and preloading (I.e., IMHO abusing their market position)

                                    1. -1

                                      abusing their market position

                                      Who? Google? The web AI champion?

                                      No… they do no evil… they just want to protect their web!

                                  2. 2

                                    Disingenuous? Me? Really? :-D

                                    Who was in the working group that wrote CSS2 specification?

                                    I bet a coffee that each of those “does not specify” was the outcome of a political compromise.

                                    But again, beyond the technical stuffs, don’t you see a huge geopolitical issue?

                                  3. 15

                                    This is an interesting interpretation, but I’d call it incorrect.

                                    • the reason to create whatwg wasn’t about control
                                    • XHTML had little traction, because of developers
                                    • html5 (a whatwg standard fwiw) was the first meaningful HTML spec because it actually finally explained how to parse it
                                    • w3c didn’t “start working on a new Dom”. They copy/backport changes from whatwg hoping to provide stable releases for living standards
                                    • this has nothing to do with DRM (or EME). These after completely different people!
                                    • this isn’t about lobby groups, neither is this avout influencing politics in the US or anywhere.

                                    I’m not speaking on behalf of my function in the w3c working group I’m in, nor for Mozilla. But those positions provided me with the understanding and background information to post this comment.

                                    1. 8

                                      XHTML had little traction, because of developers

                                      I remember that in early 2000s everyone started to write <br/> instead of <br> and it was considered cool and modern. There were 80x15 badges everywhere saying website is in xhtml. My Motorola C380 phone supported wap and some xhtml websites, but not regular html in builtin browser. So I had impression that xhtml was very popular.

                                      1. 6

                                        xhtml made testing much easier. For me it changed many tests from using regexps (qr#<title>foo</title>#) to using any old XML parser and XPATH.

                                        1. 3

                                          Agreed. Worth noting that, after the html5 parsing algorithm was fully specified and libraries like html5lib became available, it became possible to apply exactly the same approach with html5 parsers outputting a DOM structure and then querying it with xpath expressions.

                                      2. -1

                                        This is an interesting interpretation, but I’d call it incorrect.

                                        You are welcome. But given your arguments, I still stand with my political interpretation.

                                        the reason to create whatwg wasn’t about control

                                        I was 24 back then, and my reaction was “What? Why?”.

                                        My boss commented: “wrong question. You should ask: who?”

                                        XHTML had little traction, because of developers

                                        Are you sure?

                                        I wrote several web site back then using XML, XSLT and XInclude serverside to produce XHTML and CSS.

                                        It was a great technological stack for distributing contents over the web.

                                        w3c didn’t “start working on a new Dom”. They copy/backport changes from whatwg hoping to provide stable releases for living standards

                                        Well, had I wrote a technical document about an alternative DOM for the whole planet, without anyone asking me to, I would be glad if W3C had take my work into account!

                                        In what other way they can NOT waste WHATWG’s hard work?
                                        Wel, except saying: “guys, from now on do whatever Google, Apple, Microsoft and few other companies from the Silicon Valley tell you to do”.

                                        But I do not want to take part for W3C: to me, they lost their technical authority with EME (different group, but same organisation).

                                        The technical point is that we need stable, well thought, standards. What you call live standard, are… working draft?

                                        The political point is that no oligopoly should be in condition to dictate the architecture of the web to the world.

                                        And you know, in a state where strong cryptography is qualified as munitions and is subject to export restrictions.

                                        I’m not speaking on behalf of my function in the w3c working group I’m in, nor for Mozilla. But those positions provided me with the understanding and background information to post this comment.

                                        I have no doubt about your good faith.

                                        But probably your idealism is fooling you.

                                        As you try to see these facts from a wider perspective, you will see the problem I describe.

                                      3. 4

                                        XHTML was fairly clearly a mistake and unworkable in the real world, as shown by how many nominally XHTML sites weren’t, and didn’t validate as XHTML if you forced them to be treated as such. In an ideal world where everyone used tools that always created 100% correct XHTML, maybe it would have worked out, but in this one it didn’t; there are too many people generating too much content in too many sloppy ways for draconian error handling to work well. The whole situation was not helped by the content-type issue, where if you served your ‘XHTML’ as anything other than application/xhtml+xml it wasn’t interpreted as XHTML by browsers (instead it was HTML tag soup). One result was that you could have non-validating ‘XHTML’ that still displayed in browsers because they weren’t interpreting it as XHTML and thus weren’t using strict error handling.

                                        (This fact is vividly illustrated through syndication feeds and syndication feed handlers. In theory all syndication feed formats are strict and one of them is strongly XML based, so all syndication feeds should validate and you should be able to consume them with a strictly validating parser. In practice plenty of syndication feeds do not validate and anyone who wants to write a widely usable syndication feed parser that people will like cannot insist on strict error handling.)

                                        1. 2

                                          there are too many people generating too much content in too many sloppy ways for draconian error handling to work well.

                                          I do remember this argument was pretty popular back then, but I have never understood why.

                                          I had no issue in generating xhtml strict pages from user contents. This real world company had a couple handred of customers with pretty various needs (from ecommerce, to online magazines or institutional web sites) and thousands of daily visitors.

                                          We used XHTML and CSS to distribute highly accessible contents, and we had pretty good results with a prototype based on XLS-FO.

                                          To me back then the call to real world issues seemed pretestuous. We literally had no issue. The issues I remember were all from IE.

                                          You are right that many mediocre software were unable to produce proper XHTML. But is this an argument?

                                          Do not fix the software, let’s break the specifications!

                                          It seems a little childish!

                                          XHTML was not perfect, but it was the right direction.

                                          Look at what we have now instead: unparsable contents, hundreds of incompatible javascript frameworks, subtle bugs, bootstrap everywhere (aka much less creativity) and so on.

                                          Who gain most from this unstructured complexity?

                                          The same who now propose the final solution lock-in: web assembly.

                                          Seeing linux running inside the browser is not funny anymore.

                                          Going after incompetent developers was not democratization of the web, it was technological populism.

                                          1. 2

                                            What is possible does not matter; what matters is what actually happens in the real world. With XHTML, the answer is clear. Quite a lot of people spent years pushing XHTML as the way of the future on the web, enough people listened to them to generate a fair amount of ‘XHTML’, and almost none of it was valid and most of it was not being served as XHTML (which conveniently hid this invalidity).

                                            Pragmatically, you can still write XHTML today. What you can’t do is force other people to write XHTML. The collective browser world has decided that one of the ways that people can’t force XHTML is by freezing the development of all other HTML standards, so XHTML is the only way forward and desirable new features appear only in XHTML. The philosophical reason for this decision is pretty clear; browsers ultimately serve users, and in the real world users are clearly not well served by a focus on fully valid XHTML only.

                                            (Users don’t care about validation, they care about seeing web pages, because seeing web pages is their goal. Preventing them from seeing web pages is not serving them well, and draconian XHTML error handling was thus always an unstable situation.)

                                            That the W3C has stopped developing XHTML and related standards is simply acknowledging this reality. There always have been and always will be a great deal of tag soup web pages and far fewer pages that validate, especially reliably (in XHTML or anything else). Handling these tag soup web pages is the reality of the web.

                                            (HTML5 is a step forward for handling tag soup because for the first time it standardizes how to handle errors, so that browsers will theoretically be consistent in the face of them. XHTML could never be this step forward because its entire premise was that invalid web pages wouldn’t exist and if they did exist, browsers would refuse to show them.)

                                            1. 0

                                              Users don’t care about validation, they care about seeing web pages, because seeing web pages is their goal.

                                              Users do not care about the quality of concrete because having a home is their goal.
                                              There will always be incompetent architects, thus let them work their way so that people get what they want.

                                              Users do not care about car safety because what they want is to move from point A to point B.
                                              There will always be incompetent manufacturers, thus let them work their way so that people get what they want.

                                              That’s not how engineering (should) work.

                                              Was XHTML flawless? No.
                                              Was it properly understood by the average web developers that most companies like to hire? No.

                                              Was it possible to improve it? Yes. Was it better tha the current javascript driven mess? Yes!

                                              The collective browser world has decided…

                                              Collective browser world? ROTFL!

                                              There’s a huge number of browsers’ implementors that nobody consulted.

                                              Among others, in 2004, the most widely used browser, IE, did not join WHATWG.

                                              Why WHATWG did not used the IE design if the goal was to liberate developers from the burden of well designed tools?

                                              Why we have faced for years incompatibilities between browsers?

                                              WHATWG was turned into one of the weapons in a commercial war for the control of the web.

                                              Microsoft lost such war.

                                              As always, the winner write the history that everybody know and celebrate.

                                              But who is old enough to remember the fact, can see the hypocrisy of these manoeuvres pretty well.

                                              There was no technical reason to throw away XHTML. The reasons were political and economical.

                                              How can you sell Ads if a tool can easily remove them from the XHTML code? How can you sell API access to data, if a program can easily consume the same XHTML that users consume? How can you lock users, if they can consume the web without a browser? Or with a custom one?

                                              The WHATWG did not served users’ interests, whatever were the Mozilla’s intentions in 2004.

                                              They served some businesses at the expense of the users and of all the high quality web companies that didn’t have much issues with XHTML.

                                              Back then it was possible to disable Javascript without loosing access to the web functionalities.

                                              Try it now.

                                              Back then people were exploring the concept of semantic web with the passion people now talk about the last JS framework.

                                              I remember experiments with web readers for blind people that could never work with the modern js polluted web.

                                              You are right, W3C abandoned its leadership in the engineering of the web back then.

                                              But you can’t sell to a web developer bullshit about HTML5.

                                              Beyond few new elements and a slightly more structured page (that could have been done in XHTML too) all its exciting innovations were… more Javascript.

                                              Users did not gain anything good from this, just less control over contents, more ads, and a huge security hole worldwide.

                                              Because, you know, when you run a javascript in Spain that was served to you from a server in the USA, who is responsible for such javascript running on your computer? Under which law?

                                              Do you really think that such legal issues were not taken into account from the browser vendors that flued this involution of the web?

                                              I cannot believe they were so incompetent.

                                              They knew what they were doing, and did it on purpose.

                                              Not to serve their users. To use those who trusted them.

                                        2. 0

                                          The mention of Trump is pure trolling—as you yourself point out, the dispute predates Trump.

                                          1. 6

                                            I think it’s more about all of this sounding like a science fiction plot than just taking a jab at the Trump presidency; just a few years ago nobody would have predicted that would have happened. So, no, not pure trolling.

                                            1. 2

                                              Fair enough. I’m sorry for the accusation.

                                              Since the author is critical of Apple/Google/Mozilla here, I took it as a sort of guilt by association attack on them (I don’t mind jabs at Trump), but I see that it probably wasn’t that.

                                              1. 2

                                                No problem.

                                                I didn’t saw such possible interpretation or I wouldn’t have written that line. Sorry.

                                            2. 3

                                              After 20 years of Berlusconi and with our current empasse with the Government, no Italian could ever troll an American about his current President.

                                              It was not my intention in any way.

                                              As @olivier said, I was pointing to this surreal situation from an international perspective.

                                              USA control most of internet: most root DNS, the most powerful web companies, the standards of the web and so on.

                                              Whatever effect Cambridge Analitica had to the election of Trump, it has shown the world that internet is a common infrastructure that we have to control and protect together. Just like we should control the production of oxigen and global warming.

                                              If Cambridge Analitica was able to manipulate USA elections (by manipulating Americans), what could do Facebook itself in Italy? Or in German?
                                              Or what could Google do in France?

                                              The Internet was a DARPA project. We can see it is a military success beyond any expectation.

                                              I tried to summarize the debacle between W3C and WHATWG with a bit of irony because, in itself, it shows a pretty scary aspect of this infrastructure.

                                              The fact that a group of companies dares to challenge W3C (that, at least in theory, is an international organisation) is an evidence that they do not feel the need to pretend they are working for everybody.

                                              They have too much power, to care.

                                              1. 4

                                                The last point is the crux of the issue: are technologists willing to do the leg work of decentralizing power?

                                                Because regular people won’t do this. They don’t care. This, they should have less say in the issue, though still some, as they are deeply affected by it too.

                                                1. 0

                                                  No. Most won’t.

                                                  Technologist are a wide category, that etymologically includes everyone that feel entitled to speak about how to do things.

                                                  So we have technologists that mislead people to invest in the “blockchain revolution”, technologists that mislead politicians to allow barely tested AI to kill people on the roads, technologists teaching in the Universities that neural networks computations cannot be explained and thus must be trusted as superhuman oracles… and technologists that classify as troll any criticism of mainstream wisdom.

                                                  My hope is in hackers: all over the world they have a better understanding of their political role.

                                                2. 2

                                                  If anyone wonders about Berlusconi, Cracked has a great article on him that had me calling Trump a pale imitation of Berlusconi and his exploits. Well, until Trump got into US Presidency which is a bigger achievement than Berlusconi. He did that somewhat by accident, though. Can’t last 20 years either. I still think Berlusconi has him beat at biggest scumbag of that type.

                                                  1. 2

                                                    Yeah, the article is funny, but Berlusconi was not. Not for Italians.

                                                    His problems with women did not impress much us. But for when it became clear most of them were underage.

                                                    But the demage he did to our laws and (worse) to our public ethics will last for decades.
                                                    He did not just changed the law to help himself: he destroyed most legal tools to fight the organized crime and to fight bribes and corruption.
                                                    Worse he helped a whole generation of younger people like him to be bold about their smartness with law workarounds.

                                                    I pray for the US and the whole world that Trump is not like him.

                                            1. 2

                                              I think this article contradicts itself, by saying that bug fixes are not backwards compatible, saying you should have a field for bug fixes, and that library authors should release a new library when they make backwards incompatible changes.

                                              Am I missing something?

                                              1. 1

                                                The distinction between x and z is that z is about bug fixes, and x is about API changes, removing deprecated functionality, ground-up rewrites in swift/kotlin/elixir/whatever. You can easily see different semantics in that z is interpreted as “this still does the thing you think it does, but in a new way that we think is better” (I have to decide whether I agree with the maintainers) and x is interpreted as “this thing now does a possibly different thing in a certainly different way” (I have to decide whether that’s something I want, and whether that supplied by new-x is worth porting to).

                                                1. 1

                                                  I would think that as you describe it, ground up rewrites could potentially be y. As for z changes, you’re right that they’re typically smaller than an x change, but that’s the original rationale for putting z last.

                                                  The changelog featured a nice discussion with Rhys Arkins (transcript included, search for semver) that made it clear to me that you have multiple competing concerns in versioning. As a library consumer, you care about the work a change will entail for you and the risk that it carries. Those two factors can come apart sharply, and none of semver’s values map clearly to either consideration.

                                              1. 2

                                                Great post; this is one of my pet peeves.

                                                One minor point: ‘This interactivity is usually missing in “compiled” languages’ <- I would say it’s true that this is missing from several mainstream compiled languages, (to their great detriment) but the majority of compiled languages do support it.

                                                Edit: I guess the scare quotes around “compiled” might indicate it’s not meant to apply to most compiled languages, just the ones that are typically thought of as compiled?

                                                1. -1

                                                  Great post; this is one of my pet peeves.

                                                  Mine as well. Even the local safe languages guru tends to conflate programming languages with their implementations.

                                                  1. 13

                                                    That’s unlikely. What’s more likely is that humans don’t need to be 100% unambiguously precise in every form of communication, and instead can usually rely on other humans to know what they mean.

                                                    1. 4

                                                      In addition to what burntsushi said, while it’s true that languages and their implementations are separable, it’s often not an accident that languages have their particular implementations. Bytecode interpreters and/or JIT compilers fit with Java, Python, etc in a way they just don’t for C. You can write them for C, but it’s typically less valuable.

                                                  1. 1

                                                    Since Cloudflare serves an inordinate amount of Internet traffic, I’m not sure this changes much.

                                                    1. 1

                                                      If I understood correctly, this sends all hostnames to Cloudflare, not just those served by Cloudflare. I think it is a significant change.

                                                      1. 3

                                                        Not many DoH servers out there. Somebody has to host them.

                                                        1. 1

                                                          It seems like it should be possible to find a DNS provider that already exists to host them, and then only test on users who already use that DNS provider.

                                                          1. 6

                                                            Let me amend what I said: There are no DoH servers out there except for the one Mozilla set up. DoH isn’t even a standard yet. It’s a draft proposal to the IETF.

                                                            1. 2

                                                              Google has a DoH server, not sure how compliant with the draft though.

                                                              Meanwhile Yandex has a DNSCrypt server (and client in their browser).

                                                              1. 1

                                                                That doesn’t change what I said. Instead of partering with cloudflare to have them implement this/run servers providing it, partner with someone who already provides DNS to a substantial number of users. Either way you are requring someone to implement new technology, this is just changing who that someone is.

                                                          2. 1

                                                            It’s a change, but it would only matter if you trust Cloudflare to see a significant fraction of your traffic, but are not ok with them seeing all your DNS queries. I can’t fathom how that makes sense.

                                                        1. 6

                                                          I wonder how much of this is about issues in domain modeling. In the example of a square and a rectangle, why do you have a set method? Geometrical objects don’t have setters. The fact that you want that operation tells me that you’re not really interested in geometrical objects, you’re interested in a different type of thing.

                                                          Suppose you’re working with a GUI toolkit, or maybe a geometric puzzle game. You’re not using squares and rectangles there, you’re using SquarePanel and RectangularPanel or whatnot. That avoids the confusion. You can have a resizable panel that temporarily happens to be square, but it’s not a SquarePanel, because it obeys different rules.

                                                          I am tempted to summarize my thinking with “good ontological modeling obeys the LSP”.

                                                          1. 2

                                                            consider a taxonomy of graphs then; like other collections read operations are covariant (if I can read a Graph then I can read a DirectedGraph) and writes are contravariant (if I can add an edge to a DirectedGraph then I can add an edge to a Graph).

                                                          1. 10

                                                            All good reasons, IMO. But it fails to mention any of the well-known problems with C, which would have prevented many vulnerabilities in SQLite. So it reads like they’re just trying to justify their choice, rather than an honest assessment of C. I don’t know what the intention or purpose of this page is, though. And to be fair, I would probably have made the same choice in 2000.

                                                            1. 40

                                                              I don’t know what the intention or purpose of this page is

                                                              Probably to stop people asking why it’s not written in Rust.

                                                              1. 14

                                                                Since it mentions Java but not Go or Rust, I suspect it’s an older page.

                                                                1. 25

                                                                  That’s the beauty of C, it refutes all future languages without having to be recompiled.

                                                                  1. 1

                                                                    It mentions Swift, too.

                                                                      1. 1

                                                                        Yeah, looking at the parent page, it appears it showed up sometime in 2017. I was mislead by the mention of Java as an alternative, because I think it’s rather obviously unsuited for this job.

                                                                  2. 4

                                                                    I tried finding a list of vulnerabilities in SQLite and only this page gave current info. Now, I’m unfamiliar with CVE stats so I don’t know if 15 CVE’s in 8 years is more than average for a project with the codebase and use of SQLite.

                                                                    1. 7

                                                                      […] I don’t know if 15 CVE’s in 8 years is more than average for a project with the codebase and use of SQLite.

                                                                      I don’t know either! I looked at the same page before writing my comment, and found plenty of things that don’t happen in memory-safe languages. There were fewer entries than I expected, but also some of them have descriptions like “Multiple buffer overflows […],” so the number of severe bugs seems to be higher than the number of CVEs.

                                                                      1. 7

                                                                        The 4 in 2009 appear to have been in some web app that used SQLite, not SQLite itself.

                                                                        1. 4

                                                                          The security community generally considers CVE counts a bad mechanism to argue about the security of a project, for the following reasons:

                                                                          Security research (and thus vulnerability discovery) are driven by incentives like popularity, impact and monetary gain. This makes some software more attractive to attack, which increases the amount of bugs discovered, regardless of the security properties of the codebase. It’s also hard to find another project to compare with.

                                                                          (But if I were to join this game, I’d say 15 in 8 years is not a lot ;))

                                                                        2. 1

                                                                          15 vulnerabilities of various levels in the past 10 years.

                                                                          https://www.cvedetails.com/vendor/9237/Sqlite.html

                                                                          How does that compare to other products or even similar complicated libraries?

                                                                        1. 7

                                                                          It would be a fine page if titled “why we picked C to base SQLite on in 2000”.

                                                                          1. 11

                                                                            If you mean it would be written in Rust in 2018, nope. Most platforms of interest to SQLite are still tier-2/tier-3 support by Rust at best.

                                                                            1. 3

                                                                              I believe it. But what platforms are at issue? Edit: yikes, the tier 1 list is way more limited than I thought. Never mind this question.

                                                                              Also, for projects starting in 2018, the question isn’t what Rust supports today, but what platforms you’re willing to bet Rust will support in 5-10 years. Hopefully that list is bigger.

                                                                              1. 8

                                                                                We’ve been talking about re-vamping the tier system, because it doesn’t do a great job of recognizing actual support. For example, ARM is a Tier 1 platform for Firefox, so stuff gets checked out and handled quite a bit, but given the current rules of how we clarify support, it appears like it’s a lot less than it actually is.

                                                                                in 5-10 years. Hopefully that list is bigger.

                                                                                We recently put together a working group to work on ease of porting rust to other platforms, so yeah, we expect it to grow. The hardest part is CI, honestly. Getting it going is one thing, but having someone who’s willing to commit to fixing breakage in a timely manner without bringing all development to a halt is tough for smaller/older platforms.

                                                                            2. 2

                                                                              Depends on whether they had access to Pascal, Ada, Scheme, or Smalltalk. ;)

                                                                            1. 2

                                                                              Here’s one take that this is serious research and the vulnerabilities matter, regardless of the other questions about how CTS has acted https://twitter.com/dguido/status/973628511515750400?s=21

                                                                              1. 2

                                                                                One more thread. Mixture of yawns and “it’s a real but overhyped vulnerability”: https://twitter.com/taviso/status/973622044200919040

                                                                                1. 1

                                                                                  If you read that whole thread, @dguido admits that he was paid by CTS labs to provide his opinion on these flaws.

                                                                                  It’s a big problematic to cite someone when they have an incentive to lie.

                                                                                  1. 6

                                                                                    If your job is to review security findings, you’re probably going to get paid for it. That’s how jobs work.

                                                                                    1. 1

                                                                                      He preemptively states that he billed them for reviewing their work in private, not for making any public statement. Now, technically, there is money on the line: he stands to gain one week of his paid rate, and he stands to lose major credibility if he’s known to lend his name to unsound research.

                                                                                  1. 8

                                                                                    It’s unfortunate that the post doesn’t say anything about why these tricks perform better, and whether that’s the case in multiple implementations. You can get some of that from the (http://www.rexegg.com/regex-best-trick.html)[older post he references].

                                                                                    1. 5

                                                                                      A 10x engineer isn’t someone who is 10x better than those around them, but someone who makes those around them 10x better.

                                                                                      So how do you call someone who is 10x better than those around them then?

                                                                                      1. 7

                                                                                        Someone who works at a place where most the staff browses the internet all day :V.

                                                                                        1. 6

                                                                                          I once worked at a place with over 500 staff developers, where people like that were fired with little hesitation. Still there were some developers that would run circles around anyone else. They’d do a week worth of mere mortal’s work in a day, and it’ll be tidy, well designed and commented throughout.

                                                                                          Guess you can deny people of superior skill and talent exist until your first very humbling encounter with one.

                                                                                          1. 4

                                                                                            “a week worth of mere mortal’s work in a day”

                                                                                            Those of us who doubt the existence of 10x developers don’t deny the existence of 5x developers, of course!

                                                                                            (I’m kidding, but I do think there’s something weird about the numbers used. No one thinks every dev is equally productive, how many people think they can precisely measure 10x?).

                                                                                            1. 4

                                                                                              Thing is, if you distribute their work to a team of 5 people, it’ll take several days due to communication overhead. So easily that or even more.

                                                                                            2. 1

                                                                                              Or maybe you could be one of them if you applied yourself. (i’m teasing)

                                                                                              Of course highly capable people exist, frequently though what I’ve observed people calling 10x developers are actually 1x developers in an environment of 1/10x developers. I think the biggest thing that separates the highly effective individuals is actually the fact that they don’t allow themselves to spin their wheels. They defend their focus. They spend time understanding the problem before getting started. A really really good guide on like how to think effectively in this way is in G. Polya’s “How to solve it”. He talks about general problem solving strategies. Pure mathematics is like lifting weights for programmers. Get swole.

                                                                                              1. 4

                                                                                                There’s some hubris assuming you’re the only one on Lobsters familiar with mathematics :)

                                                                                                Thanks, but after couple decades programming professionally, am pretty certain I know my limits.

                                                                                                1. 1

                                                                                                  What made you think that I think that?

                                                                                                  It’s always healthy to doubt your limits, a lot of people have imagined barriers after which they no longer try. Especially when it’s incorrect base strategies. A lot of people assume its that they just aren’t working hard enough, when really they just aren’t applying their effort in a constructive way. They try working harder and they hit a wall, instead they should be reevaluating their base strategies.

                                                                                                  1. 3

                                                                                                    I don’t doubt my limits, just happen to know them. My average productivity, my burst/deathmarch productivity, how much work it takes me to burn out and how long to recover. Short of using stimulants, doubt there is much untapped cognitive potential left.

                                                                                                    1. 1

                                                                                                      Your problem is that you view cognitive ability and effort as a primary determinants in productivity. To paint an extreme picture, the smartest mind applied to the dumbest strategy, or the hardest worker on the dumbest strategy will both still be much less successful than the dumbest laziest mind applied to the smartest strategy. In this way strategy is much more important than ability, especially if you are already mundane in your abilities.

                                                                                                      Brilliance, blood, sweat, and tears only matter if they’re working in the right direction. Or in other words, mediocrity well applied will outpace brilliance every time.

                                                                                                      1. 6

                                                                                                        Without addressing the content of this discussion between you and @varjag, I find your tone and implications disrespectful and condescending: “Get swole”, “It’s always healthy to doubt your limits”, “Your problem is that”. I believe this deserves to be pointed out.

                                                                                                        1. 2

                                                                                                          Quite contrary, I think your problem is you axiomatically accept that baseline mental capabilities are roughly equal across population. Working form there, and knowing nothing about me really, you arrive that my problem-solving approaches must be lacking to account for the stark difference in productivity I claim.

                                                                                                          So speaking of problem solving, this does not look like a productive approach.

                                                                                                          1. 5

                                                                                                            Sorry for being a dick. I was trying to be playful but I think I was being an ass. I was admittedly trying to address things I viewed as trends but I was talking to you an individual. My view is really about how I’ve seen really really capable people faceplant, and maybe not the brightest push through. That doesn’t mean everyone can, or should try to beat the best and hardest working. Sorry for being weird and pushy I guess I’m just going through some shit I wasn’t aware I was going through.

                                                                                                            1. 1

                                                                                                              No problem, happens to the best of us :)

                                                                                          1. 8

                                                                                            Sort of an aside discussion, but the author’s choice to distribute the code as a Docker image: is that becoming a thing now?

                                                                                            I’m notorious among my peers for installing and trying everything under the sun, and usually having to blow out and reinstall my computer about once a year (usually coinciding with Apple’s release of an updated MacOS). Maybe I’m late to the party, but Docker images are a much cleaner way of distributing projects in a working environment, are they not?

                                                                                            1. 13

                                                                                              This feels like the kind of thing I’d be grumpy about if I were any older; software distribution is one of our oldest and therefore most-studied problems. Java tried to solve it with a universal runtime. Package managers try to solve it with an army of maintainers who manage dependencies. Giving up on all that and bundling the entirety of latex and all its dependencies (one of the intermediate images is 3 point 23 fucking gigs!) just to distribute a 279 line style file and make it easier to use feels… kind of excessive?

                                                                                              That said, I’m not old and grumpy and this is awesome. I kind of hope that this becomes a thing, it’s easy to install and easy to remove (and know that you’ve left no traces on your system) and this image will presumably be usable for a very long time.

                                                                                              EDIT: I wrote the above comment while I was waiting for the image to finish downloading. It’s now finished and the final image takes up 5.63GB of my disk space. I don’t mind for this one-off package but would certainly mind if this method of distribution started catching on. Maybe we should just all use nix?

                                                                                              1. 3

                                                                                                I wrote the above comment while I was waiting for the image to finish downloading. It’s now finished and the final image takes up 5.63GB of my disk space. I don’t mind for this one-off package but would certainly mind if this method of distribution started catching on. Maybe we should just all use nix?

                                                                                                Docker has some mechanisms for sharing significant parts of those images… at least if they’re created from the same base. The problem obviously is that people are free to do whatever, so that sharing is far from optimal.

                                                                                                1. 1

                                                                                                  Agreed, I assumed this was going to be something like a 200 python script with maybe 2 or 3 dependencies.

                                                                                                2. 4

                                                                                                  A docker image is the new curl|sh install method.

                                                                                                  Basically ignore any concerns about security, updates, ‘I want this shit now Ma.’

                                                                                                  1. 4

                                                                                                    A random docker image is less likely to fuck up your home dir, though.

                                                                                                    1. 2

                                                                                                      I’ve spent a lot more time working with the shell than Docker. I find this Docker image a lot easier to understand and verify than various things I’ve been told to curl | sh.

                                                                                                      1. 1

                                                                                                        Couldn’t you just download and verify a script with curl -o filename.sh http://domain.name/filename.sh? How does a random Docker image end up being easier to verify? With a script you can just read through it, and verify what it does. With a Docker image you basically have to trust an image from 2014 of an entire operating system.

                                                                                                        This honestly looks like one of the worst candidates for a Docker image. You have a tiny plaintext file which is all this is installing, and you are being told to download a multi gigabyte blob. I can understand why some people recommend using Docker for development, and running things and places you might not have control of the entire system, it here just seems unnecessary here.

                                                                                                        1. 1

                                                                                                          I don’t see how it’s installing just a style. It’s installing TeX, which is a big hairy package.

                                                                                                          When I pull down the install for rustup, I end up with a 360 line shell script, which isn’t super easy to verify. For haskell’s stack, it’s 720. I swear I’ve seen 1500 before.

                                                                                                      2. 1

                                                                                                        Agree re security (you could get hacked) but at least it won’t accidentally wipe your hard drive while trying to uninstall (as has happened a few timed I’m aware of).

                                                                                                      3. 3

                                                                                                        In this case especially, as the instructions to install and configure are pretty painful:

                                                                                                        https://github.com/Jubobs/gitdags

                                                                                                        Oh, there are none. But there is this:

                                                                                                        http://chrisfreeman.github.io/gitdags_install.html

                                                                                                        As an aside, the Docker image has a couple of features I’m quite proud of (in a small way).

                                                                                                        1. The default command of the container outputs help text.

                                                                                                        2. If the convert_images.sh script spots a Makefile, it runs it, eg:

                                                                                                        https://github.com/ianmiell/gitdags/blob/master/examples/Makefile

                                                                                                        which reduces build time significantly if you have a lot of images.

                                                                                                        1. 4

                                                                                                          Just scrolling through that second link gives me anxiety; oh my god this is going to go wrong in fifty different ways. Getting it all together in a configured package (docker image) was pretty smart.

                                                                                                          1. 3

                                                                                                            I don’t know… Looking at the second link, the install instructions are actually fairly simple if you have TeX and the dependencies installed. Even if you don’t, like it’s just a LaTeX distribution, the tikz package, and the xcolor-solarized package.

                                                                                                            In which case the instructions are only:

                                                                                                            $ cd ${LATEX_ROOT}/texmf/tex/latex && git clone https://github.com/Jubobs/gitdags.git
                                                                                                            $ kpsewhich gitdags.sty   # Check to see if gitdags.sty can be seen by TeX
                                                                                                            

                                                                                                            I feel like an entire Docker container is a little overkill. Might be an OK way to try the software, especially if you don’t have a TeX distribution installed, but it wouldn’t be a good way to actually use it.

                                                                                                            1. 1

                                                                                                              From the link:

                                                                                                              ‘First, do NOT use apt-get to install. The best is to install TexLive from the Tex Users Groug (TUG).’

                                                                                                              1. 1

                                                                                                                Yeah like I said, the instructions are fairly simple if you have a TeX distribution Installed. If that version does happened to be from a distribution, I’m sure it works anyways - he did say the best way.

                                                                                                                If you don’t happen to have TeX installed, it’s not that complicated to install it from manually from TUG anyways.

                                                                                                              2. 1

                                                                                                                Looking at the second link, the install instructions are actually fairly simple if you have TeX and the dependencies installed

                                                                                                                Yeah, I already have TeX on my system, so I don’t really see what the problem is.

                                                                                                              3. 1

                                                                                                                The default command of the container outputs help text.

                                                                                                                I haven’t seen that before; for a “packaging” container (rather than an “app deployment” container) it’s a nice touch I’ll be copying, thanks :-)

                                                                                                              4. 2

                                                                                                                I’ve used this very package with nix on OS X, I think a docker image is… a bit over the top personally. It wasn’t that bad to install and setup compared to any other latex package.

                                                                                                              1. 13

                                                                                                                Both managers are at fault here. A managers’ responsibility is communication, not sneaking around looking for culprits and cracking the whip.

                                                                                                                What’s wrong with correcting the issue up front and talking openly about it? (Question for both the author and their manager).

                                                                                                                1. 6

                                                                                                                  Yeah. It sounds like the manager does not communicate to the team that little fixes are appreciated, and does not recognize team members that do it. So how would anyone else on the team know that it’s something they should be doing, too?

                                                                                                                  I’m not sure what the author could have done in the situation when management isn’t communicating that, though.

                                                                                                                  1. 9

                                                                                                                    Leave.

                                                                                                                    Patrick McKenzie had a nice thread about the topic. You have a limited ability to make change, and might want to spend it somewhere you think will be more receptive.

                                                                                                                    And to forestall one question: this does assume you can easily leave and find someplace good to go. I suspect that’s true of Rachel at this point in her career, and has been for awhile. But it is possible it wasn’t when the story happened. In that case, you’re in a rough spot.

                                                                                                                    1. 2

                                                                                                                      It sounds like the manager does not communicate to the team that little fixes are appreciated,

                                                                                                                      To me that’s my job, to fix things when they break. I don’t understand why someone would expect their manager to tell them they need to fix things when it’s probably part of their job description / duties anyways.

                                                                                                                      1. 2

                                                                                                                        Not everyone is as conscientious as you. There are plenty of “not my problem” people in this world.

                                                                                                                        If “it’s probably part of their job description / duties anyways”, why is the author the only one doing it? And why is the boss not criticizing the rest of the team for not fixing things?

                                                                                                                        1. 2

                                                                                                                          Is it author the only one doing it or is that just how they feel? Maybe there is other duties the author isn’t covering as much as other workers. The main problem I see here is that the author doesn’t see the team’s objective, only their own.

                                                                                                                      2. 1

                                                                                                                        Communicated it themselves!

                                                                                                                        1. 11

                                                                                                                          It sounds like her team was really into the idea of just silently letting her do all the work:

                                                                                                                          Next, I asked an honest question: even then, why was it automatically up to me to get these things to work? There was no division of duties on the team. Everyone was responsible for the system as a whole. Even when you weren’t on call, there were things to check on and adjust from time to time. This was one of them.

                                                                                                                          Basically, I asked why he didn’t take care of it. His response floored me.

                                                                                                                          “Oh, well, you always take care of it.”

                                                                                                                          Eventually, she got fed up and left, which is the right thing to do if it’s possible.

                                                                                                                          1. 4

                                                                                                                            But that “Next, …” happened after this “experiment.”

                                                                                                                            From the information given, it’s possible that nobody else on the team even knew this task bothered her because she had never communicated it before.

                                                                                                                            1. 2

                                                                                                                              This article would be heavily biased in the authors favor.

                                                                                                                              1. 1

                                                                                                                                Do you need to point out that someone’s account of their own experience is “biased” in their own favor? Why?

                                                                                                                                1. 1

                                                                                                                                  Because of your comments:

                                                                                                                                  It sounds like her team was really into the idea of just silently letting her do all the work. Eventually, she got fed up and left, which is the right thing to do if it’s possible.

                                                                                                                                  I don’t find those conclusions as self evident as you did, the team is made up of people who might see the situation completely differently, and her article is smearing them in a way where they can’t defend themselves.

                                                                                                                                  1. 1

                                                                                                                                    Every single tale of a toxic work environment is amenable to the same obvious objection. I find her perspective credible, given that her manager fully knew of her experiment, and then used that against her in her review.

                                                                                                                                    But regardless, the whole thesis of the article is that you shouldn’t try this unless you have rock solid cover from your manager or lead. “The story is biased toward its author,” is a non-sequitur, and contributes nothing constructive.

                                                                                                                                    What is your point, and why do you think the genius of your voice needs to be heard making it?

                                                                                                                                    1. 1

                                                                                                                                      Excuse me while I go write a blog post about how nebkor hurt my feelings … I am a genius and my voice needs to be heard, I need the support of all those bleeding hearts too.

                                                                                                                      1. 15

                                                                                                                        I was hoping for something else from this.

                                                                                                                        Given the title, I was hoping for a deep insight into the tradeoffs of macros and why those tradeoffs are worthwhile in Rust. Instead, its more of a listing of “things you can do with Rust macros”. There’s nothing wrong with that.

                                                                                                                        I’d really love to see a deep pros/cons of macros in Rust. There probably aren’t many people who could write what I’d like to see though. You’d need a deep understanding of macros across a variety of languages, a strong grounding in programming language theory, and a strong grounding in Rust.

                                                                                                                        1. 10

                                                                                                                          Rust’s macros currently don’t really work nicely with the module system - they all live in a global namespace and you have to use the odd #[macro_use] and #[macro_export] attributes to import and export them. It’s quite ugly. This will be fixed in Macros 2.0 though - from what I understand they are learning from Racket - I think it might be called ‘staged macro compilation’ or something… it is a non-trivial problem to solve though. Also, macros at the top level are not hygenic, I think this will also be fixed in Macros 2.0.

                                                                                                                          Another annoyance is the APIs surrounding procedural macros - it’s not as nice as working with Racket-style reader macros. You’re more working with a token stream, rather than an AST. Also, the API does not enforce hygiene as far as I know. Again, this should also be fixed in Macros 2.0.

                                                                                                                          Another frustration is that they don’t work nicely with rustfmt - because rustfmt doesn’t really know how the original macro author wanted to format them.

                                                                                                                          Other issue is that they have a restricted syntax that doesn’t allow you to create really nice looking language extensions. So a match! replacement would have to look like:

                                                                                                                          my_match!{ expr;
                                                                                                                              pattern1 => expr1,
                                                                                                                              pattern2 => expr2,
                                                                                                                          }
                                                                                                                          

                                                                                                                          Rather than:

                                                                                                                          my_match! expr {
                                                                                                                              pattern1 => expr1,
                                                                                                                              pattern2 => expr2,
                                                                                                                          }
                                                                                                                          

                                                                                                                          This is because we want tooling to have to understand macros in order to parse Rust code. I don’t think there is any solution for this.

                                                                                                                          All in all, I think macros a a nice addition to Rust, but they still feel a little ‘bolted on’ to the language, and could do with some improvement in the future. The Rust team knows this, and they are working hard to make those improvements!

                                                                                                                          1. 1

                                                                                                                            Thanks @brendan!

                                                                                                                            1. 5

                                                                                                                              No worries! I’m not super up-to-speed with macro theory, alas. But here are some RFCs (alas no prior art or references to the literature are given):

                                                                                                                          2. 5

                                                                                                                            This comment is a pretty good rundown of issues with the current macro approach.

                                                                                                                            The list is pretty good, I’d only add the call-site syntax (!) to the list of problems.

                                                                                                                            1. 2

                                                                                                                              Just something I’ve observed, some of the popular languages are either strongly typed but have macros, or loosly typed and don’t have macros. ie. C/C++ vs Javascript. However, Java is strongly typed but doesn’t have macros, so take my observation with a grain of salt :)

                                                                                                                              1. 7

                                                                                                                                My intuition is that everybody hates boiler-plate, but static languages tend to the problem with macros, while dynamic languages address the problem with reflection and runtime meta-programming.

                                                                                                                                Java is a notable outlier in that it addresses the boiler-plate problem with IDEs.

                                                                                                                                1. 1

                                                                                                                                  “Java is a notable outlier in that it addresses the boiler-plate problem with IDEs.”

                                                                                                                                  Smalltalk partly solved boilerplate with the IDE and live coding. In Java ecosystem, boilerplate was the solution to C/C++‘s problems. The IDE’s then ensure that various modules have correct amounts and types of boilerplate. Or something like that.

                                                                                                                                2. 1

                                                                                                                                  Haskell has no macros but Scheme does. Anyway, strong typing prohibits runtime type inspection and this leads to some repetitive boilerplate code, for example to derive serialisation code from type declarations. Macros can make this simpler. In the case of type-driven code, type classes (Haskell) are powerful enough to not require macros. Another case for macros is code instrumentation and here I believe type classes would not be enough.

                                                                                                                                  1. 5

                                                                                                                                    Haskell does have macros - they’re called (somewhat confusingly) ‘Template Haskell’. I prefer type-directed code generation using type classes, but this is often at the expense of compilation time, when compared to Template Haskell. Hopefully this will be improved at some stage…

                                                                                                                                    1. 1

                                                                                                                                      Where are you putting TemplateHaskell in this categorization? I believe it’s the recommended way to handle lenses, and is also used in the Yesod ecosystem.

                                                                                                                                1. 3

                                                                                                                                  At work, I’ll mostly be fixing some issues from pen tests (last words: there is no way this can take up an entire sprint).

                                                                                                                                  At home, I’ve been working on a personal project for organizing ideas. It’s a weird project in that straddles being a static site generator, and read it later service. I’m wrote it in Haskell, which has meant learning the language at the same time. That has slowed me down a lot, but I wanted to use pandoc because I write in org-mode.

                                                                                                                                  I also started sketching out a datetime library for Haskell based on the Java 8 java.time.* libraries. I’m not aware of anything for Haskell that works well in that area.

                                                                                                                                  1. 59

                                                                                                                                    This is why we can’t have good software. This program could literally have been an empty file, a nothing at all, a name capturing the essence perfectly.

                                                                                                                                    I’m not sure I could disagree more strongly. An empty file only has the true behavior because of a bunch of incredibly non-obvious specific Unix behaviors. It would be equally reasonable for execution of this file to fail (like false) since there’s no hashbang or distinguishable executable format to decide how to handle it. At a somewhat higher level of non-obviousness, it’s really weird that true need be a command at all (and indeed, in almost all shells, it’s nottrue is a builtin nearly everywhere).

                                                                                                                                    true being implementable in Unix as an empty file isn’t elegant—it’s coincidental and implicit.

                                                                                                                                    1. 15

                                                                                                                                      I mean, it’s POSIX specified behavior that any file that is executed that isn’t a loadable binary is passed to /bin/sh (”#!” as the first two bytes results in “implementation-defined” behavior), and it’s POSIX specified behavior that absent anything else, a shell script exits true.

                                                                                                                                      It’s no more coincidental and implicit than “read(100)” advances the file pointer 100 bytes, or any other piece of standard behavior. Sure, it’s Unix(-like)-specific, but, well, it’s on a Unix(-like) operating system. :)

                                                                                                                                      1. 25

                                                                                                                                        It’s precisely specified, yes, but it’s totally coincidental that the specification says what it does. A perfectly-reasonable and nearly-equivalent specification in an alternate universe where Thomson and Ritchie sneezed five seconds earlier while deciding how executables should be handled would have precisely the opposite behavior.

                                                                                                                                        On the other hand, if read(100) did anything other than read 100 bytes, that would be extremely surprising and would not have come about from an errant sneeze.

                                                                                                                                        1. 35

                                                                                                                                          Black Mirror Episode: The year is 2100 and the world is ravaged by global warming. The extra energy aggregated over decades because non executables went through /bin/sh caused the environment to enter the tipping point where the feedback loops turned on. A time machine is invented, where one brave soul goes back in time with a feather, finds Thomson and makes him sneeze, saving humanity from the brink of extinction. But then finds himself going back to 2100 with the world still ravaged. Learns that it was fruitless because of npm and left-pad.

                                                                                                                                          1. 12

                                                                                                                                            it’s totally coincidental that the specification says what it does.

                                                                                                                                            This is true of literally all software specifications, in my experience.

                                                                                                                                            1. 8

                                                                                                                                              Surely we can agree that it is far more coincidental that an empty executable returns success immediately than that e.g. read(100) reads 100 bytes?

                                                                                                                                              1. 7

                                                                                                                                                Why isn’t 100 an octal (or a hex or binary) constant? Why is it bytes instead of machine words? Why is read bound to a file descriptor instead of having a record size from an ioctl, and then reading in 100 records?

                                                                                                                                                Just some examples. :)

                                                                                                                                                1. 5

                                                                                                                                                  Obviously, minor variations are possible. However, in no reasonable (or even moderately unreasonable) world, would read(100) write 100 bytes.

                                                                                                                                                  1. 12

                                                                                                                                                    Pass a mmap’ed pointer to read, and it shall write. :)

                                                                                                                                            2. 12

                                                                                                                                              The current (POSIX) specification is the product of historical evolution caused in part by /bin/true itself. You see, in V7 Unix, the kernel did not execute an empty file (or shell scripts); it executed only real binaries. It was up to the shell to run shell scripts, including empty ones. Through a series of generalizations (starting in 4BSD with the introduction of csh), this led to the creation of #! and kernel support for it, and then POSIX requiring that the empty file trick be broadly supported.

                                                                                                                                              This historical evolution could have gone another way, but the current status is not the way it is because people rolled out of bed one day and made a decision; it is because a series of choices turned out to be useful enough to be widely supported, eventually in POSIX, and some choices to the contrary wound up being discarded.

                                                                                                                                              (There was a time when kernel support for #! was a dividing line between BSD and System V Unix. The lack of it in the latter meant that, for example, you could not make a shell script be someone’s login shell; it had to be a real executable.)

                                                                                                                                              1. 10

                                                                                                                                                The opposite isn’t reasonable though. That would mean every shell script would have to explicitly exit 0 or it will fail.

                                                                                                                                                Every. Shell. Script.

                                                                                                                                                And aside from annoying everyone, that wouldn’t even change anything. It would just make the implementation of true be exit 0, instead of the implementation of false be exit 1.

                                                                                                                                                And read(100) does do something besides read 100 bytes. It reads up to 100 bytes, and isn’t guaranteed to read the full 100 bytes. You must check the return value and use only the amount of bytes read.

                                                                                                                                                1. 7

                                                                                                                                                  It’s not obvious to me that an empty file should count as a valid shell script. It makes code generation marginally easier, I suppose. But I also find something intuitive to the idea that a program should be one or more statements/expressions (or functions if you need main), not zero or more.

                                                                                                                                                  1. 3

                                                                                                                                                    So if you run an empty file with sh, you would prefer it exits failure. And when you run an empty file with python, ruby, perl, et al., also failures?

                                                                                                                                                    Why should a program have one or more statements / expressions? A function need not have one or more statements / expressions. Isn’t top level code in a script just a de facto main function?

                                                                                                                                                    It’s intuitive to me that a script, as a sequence of statements to run sequentially, could have zero length. A program with an entry point needs to have at least a main function, which can be empty. But a script is a program where the entry point is the top of the file. It “has a main function” if the file exists.

                                                                                                                                                    1. 3

                                                                                                                                                      I think whatever the answer is, it makes equal sense for Perl, Python, Ruby, shell, any language that doesn’t require main().

                                                                                                                                                      In my opinion, your last argument begs the question. If an empty program is considered valid, then existing is equivalent to having an empty main. If not, then it isn’t.

                                                                                                                                                      In any case, I don’t mean to claim that it’s obvious or I’m certain that an empty program should be an error, just that it seems like a live option.

                                                                                                                                                    2. 2

                                                                                                                                                      Exactly. It sounds like arbitrary hackery common in UNIX development. Just imagine writing a semi-formal spec that defines a program as “zero characters” which you pass onto peer review. They’d say it was an empty file, not a program.

                                                                                                                                                      1. 2

                                                                                                                                                        I guess true shouldn’t be considered a program. It is definitely tied to the shell it runs in, as you wouldn’t call execv("true", {"/bin/true", NULL}) to exit a program correctly. for example. true has no use outside of the shell, so it makes sense to have it use the shell’s features. That is why now it tends to be a builtin. But having it a builtin is not specified by POSIX. Executing file on the other end, is, and the spec says the default exit code it 0 or “true”. By executing an empty file, you’re then asking the shell to do nothing, and then return true. So I guess it is perfectly fine for true to jist be an empty file. Now I do agree that such a simple behavior has (loke often with unix) way too many ways to be executed, ans people are gonna fight about it for quite some time! What about these?

                                                                                                                                                        alias true=(exit)
                                                                                                                                                        alias true='/bin/sh /dev/null'
                                                                                                                                                        alias true='sh -c "exit $(expr `false;echo $? - $?`)"'
                                                                                                                                                        

                                                                                                                                                        The one true true !

                                                                                                                                                        1. 1

                                                                                                                                                          It depends upon the system. There is IEFBR14, a program IBM produced to help make files in JCL which is similar to /bin/true. So there could be uses for such a program.

                                                                                                                                                          It also has the distinction of being a program that was one instruction long and still have a bug in it.

                                                                                                                                                          1. 1

                                                                                                                                                            “That is why now it tends to be a builtin.”

                                                                                                                                                            Makes sense. If tied to the shell and unusual, I’d probably put something like this into the interpreter of the shell as an extra condition or for error handling. Part of parsing would identify an empty program. Then, either drop or log it. This is how such things are almost always handled.

                                                                                                                                                      2. 1

                                                                                                                                                        That would mean every shell script would have to explicitly exit 0 or it will fail.

                                                                                                                                                        I don’t see how that follows.

                                                                                                                                                        Once the file is actually passed to the shell, it is free to interpret it as it wishes. No reasonable shell language would force users to specify successful exit. But what the shell does is not in question here; it’s what the OS does with an empty or unroutable executable, for which I am contending there is not an obvious behavior. (In fact, I think the behavior of running it unconditionally with the shell is counterintuitive.)

                                                                                                                                                        And read(100) does do something besides read 100 bytes.

                                                                                                                                                        You’re being pedantic. Obviously, under some circumstances it will set error codes, as well. It very clearly reads some amount of data, subject to the limitations and exceptions of the system; zero knowledge of Unix is required to intuit that behavior.

                                                                                                                                                        1. 7

                                                                                                                                                          I don’t see how that follows.

                                                                                                                                                          You claim the exact opposite behavior would have been equally reasonable. That is, the opposite of an empty shell script exiting true. The precise opposite would be an empty shell script—i.e. a script without an explicit exit—exiting false. This would affect all shell scripts.

                                                                                                                                                          Unless you meant the opposite of executing a file not loadable as an executable binary by passing it to /bin/sh, in which case I really would like to know what the “precise opposite” of passing a file to /bin/sh would be.

                                                                                                                                                          You’re being pedantic. Obviously, under some circumstances it will set error codes, as well. It very clearly reads some amount of data, subject to the limitations and exceptions of the system; zero knowledge of Unix is required to intuit that behavior.

                                                                                                                                                          No. Many people assume read will fill the buffer size they provide unless they are reading the trailing bytes of the file. However, read is allowed to return any number of bytes within the buffer size at any time.

                                                                                                                                                          It also has multiple result codes that are not errors. Many people assume when read returns -1 that means error. Did you omit that detail for brevity, or was it not obvious to you?

                                                                                                                                                          1. 6

                                                                                                                                                            If a file is marked executable, I think it’s quite intuitive that the system attempt to execute. If it’s not a native executable, the next obvious alternative would be to interpret it, using the default system interpreter.

                                                                                                                                                        2. 3

                                                                                                                                                          Saying the behavior is totally (or even partially) coincidental is a bit strong. You’re ignoring the fundamental design constraints around shell language and giving the original designers more credit than they deserve.

                                                                                                                                                          Consider this experiment: you pick 100 random people (who have no previous experience to computer languages) and ask them to design a shell language for POSIX. How would all of these languages compare?

                                                                                                                                                          If the design constraints I’m talking about didn’t exist, then it would indeed be random and one would expect only ~50% of the experimental shell languages to have a zero exit status for an empty program.

                                                                                                                                                          I strongly doubt that is what you would see. I think you would see the vast majority of those languages specifying that an empty program have zero exit status. In that case, it can’t be random and there must something intentional or fundamental driving that decision.

                                                                                                                                                          1. 7

                                                                                                                                                            I don’t care about how the shell handles an empty file. (Returning successful in that case is basically reasonable, but not in my opinion altogether obvious.) I’m stating that the operating system handling empty executables by passing them to the shell is essentially arbitrary.

                                                                                                                                                            1. 4

                                                                                                                                                              The reason for the existence of human intelligence isn’t obvious either but that doesn’t make it random. A hostile environment naturally provides a strong incentive for an organism to evolve intelligence.

                                                                                                                                                              As far as the operating system executing non-binaries with “/bin/sh” being arbitrary, fair enough. Though I would argue that once the concepts of the shebang line and an interpreter exist, it’s not far off to imagine the concept of a “default interpreter.” Do you think the concept of a default is arbitrary?

                                                                                                                                                          2. 1

                                                                                                                                                            It’s precisely specified, yes, but it’s totally coincidental that the specification says what it does.

                                                                                                                                                            laughs That’s really taking an axe to the sum basis of knowledge, isn’t it?

                                                                                                                                                        3. 2

                                                                                                                                                          yes an empty file signifying true violates the principle of least astonishment.However if there were a way to have metadata comments about the file describing what it does, how it works, and what version it is without having any of that in the file we’d have the best of both worlds.

                                                                                                                                                          1. 2

                                                                                                                                                            true being implementable in Unix as an empty file isn’t elegant—it’s coincidental and implicit.

                                                                                                                                                            But isn’t this in some sense exactly living up to the “unix philosophy”?

                                                                                                                                                            1. 3

                                                                                                                                                              No.

                                                                                                                                                            2. 1

                                                                                                                                                              Why is it weird that true need be a command at all?

                                                                                                                                                              1. 0

                                                                                                                                                                To me, the issue is whether it is prone to error. If it is not, it is culture building because it is part of the lore.