1. 12

    I would say if Twitter isn’t good for you, just quit it. I deleted Twitter some time ago and I honestly don’t miss it. I really wonder why people keep complaining but don’t take real action a.k.a deleting their account.

    1. 6

      Author here - I’m glad you did. I use Twitter to stay in touch with some friends and professional contacts (I’ve deleted FB, IG, LI etc). Twitter is a toxic cesspool for many people but I’ve curated it for my needs to a point where my use of it is very intentional (I have 3k+ blocked accounts for example).

      Some might think that I’m in a bubble (and you might be right to some extent), but I do not consume news through Twitter. I still read “real” news and get a print newspaper.

      1. -1

        Just delete it and email you friends and professional contacts. A curated cesspool is still a cesspool.

        1. 2

          Email? Who emails their friends or even reads personal email. Email is 99% junk, way worse signal to noise ratio than even something like Twitter.

          1. 4

            If you do even a modicum of curation/filtering, email is 80% signal. Letting everyone with your address deliver to your inbox is a recipe for a mess on any platform.

            1. 2

              I do, a lot.

              1. 1

                I dunno. Try fastmail and watch who you hand your email out to?

              2. 1

                Why do you care what I do with my life?

            2. 11

              Same reason people say they should start exercising but don’t or quitting smoking etc.

              talking is easier than doing

              1. 3

                That’s true. Isn’t there a phrase “Scrolling is the new smoking”?

                1. 1

                  Author here - your comment seems to assume a lot about me.

                  What in my post proposes that others should delete their twitter?

                  1. 2

                    My comment is about the general behaviour of people as reported by jlelse in the parent comment i.e. a lot of people seem to talk about twitter being bad but not quitting it.

                2. 1

                  If you’re a content creator it’s useful to have a feed for your releases. In the old world it was RSS but now we live in this fucked up iOS-app-store-dominated world so Twitter is the only option. Post your ad and gtfo.

                1. 10

                  There is a prompt that I saw here on lobste.rs a couple of months ago but have been unable to find again: A Bash prompt which added a timestamp to the row when the user presses enter and the command is executed, as opposed to when the prompt appears and starts accepting user input. Does anyone happen to have a link to that blog post lying around?

                    1. 1

                      That’s really cool. Wonder if this method lets you update the prompt at any time?

                      1. 1


                      2. 1

                        What kind of latency does that add?

                        Having (\t) in PS1 was a game changer for me. Most of the time I’m quick enough that it doesn’t matter, but every once in a while the time delay causes a headache.

                        1. 1

                          the latency is probably unnoticeable. Do you notice e.g. the rsync progress bar updating? It’s the same process.

                          1. 1

                            Should be trivial.

                            Presumedly, the shell is doing a function call to a shared library to get the time which should be fast.

                            Much faster than invoking date on every instance I would think.

                        2. 4

                          One thing I’ve been doing for years is put the timestamp on the right side of the screen; I don’t know how to do this in bash off-hand, but in zsh you can set it with RPROMPT='%T'.

                          I actually have a slightly more advanced version which also shows the hostname, but only on ssh connections:

                          set_rprompt() {
                              [[ -n "${SSH_CLIENT:-}${SSH2_CLIENT:-}${SSH_CONNECTION:-}" ]] && host="%F{red}%U%B%m%b%u%f:"
                              print "${host}%T"

                          Putting it on the right moves it “out of the way” of the more important directory and git branch, but it’s still there when I want it.

                          1. 1

                            You could do it with some terminal movement commands.

                            For me though, because I frequently toss together multiple commands in the shell before making a script, the date would either get overwritten, or the logic to prevent that would be absurd.

                        1. 2

                          I’m getting a 404 on the first link.

                          1. 1

                            Thanks for the heads up, fixed

                          1. 7
                            • Finally added invisible resize borders. No more struggling to find a border to grab with your mouse!

                            My biggest gripe with Gnome 2’s default window manager fixed after all these years.

                            1. 4

                              Normally window resize was pretty convinient when using Alt+middle mouse button. Then the only thing that mattered is that the cursor should be within the bounds of the whole window.

                              (same with moving windows around; instead of aiming for the title bar, user could use alt+left mouse button)

                              1. 2

                                Absolutely, and I as a computer enthusiasts knew that. But my family did not.

                            1. 3

                              Is there some tmux trigger key that doesn’t interfere with readline? Maybe this is a bad habit on my part, but I frequently use C-a to go to the beginning of the line. This is mostly why I’ve been hesitant to use tmux. Similarly with C-b to go back a single character, though I use that much less frequently.

                              1. 3

                                I use the backtick (`) character. I unbind C-b, bind backtick, and then set a double-backtick to produce a literal one. The character comes up infrequently for me, and double-tapping it to make a literal one isn’t much of a challenge when it happens. The key position is close to the escape key, which I enjoy as a vim regular. (I also rebind most movement keys to vim-like as well)

                                Here’s the code that sets my leader

                                1. 2

                                  I’ve been using screen and then tmux with the same keybindings, and typing C-a a to go to the start of a line is now second nature to me. So much so that I get tripped up outside tmux

                                  1. 2

                                    I’ve been using ctrl-v in both screen and tmux for as long as I can remember for exactly this reason. Ctrl-v is only rarely used (it’s for inserting a literal control character).

                                    1. 2

                                      I use C-o but it could be that it only makes sense with Dvorak as keyboard layout. On the other hand I tend to always have both hands on the keyboard.

                                      1. 2

                                        I use C-z.

                                        There’s a huge discussion of that in this superuser question.

                                        1. 2

                                          This SU question may be related: https://superuser.com/q/74492/18192

                                          1. 2

                                            You’ll get a ton of different answers here, but I like M-a

                                          1. 2

                                            Looks cool but I’m too risk adverse to invest in something like this.

                                            1. 1

                                              Risk adverse?

                                              1. 2

                                                This project could die at any moment. I try to avoid filling my head with stuff I won’t use in the future.

                                                1. 1
                                                  1. 4

                                                    I more meant “what about this is so risky you shan’t use it?”, it didn’t occur to me that verbal cues are lost through text like that, I’m tired.

                                                2. 0

                                                  I can understand, but note that IMO using Vimium, Tridactyl and friends is more risky. Similar projects that were tied to a single platform all died in the past (Vimperator, Conkeror,…). Next’s core is an independent Lisp program (and Lisp is, by the way, known for its stability).

                                                  1. 5

                                                    I’m not sure that’s fair. Qutebrowser has a nice list of similar projects - http://qutebrowser.org/#_inactive - and you can see that the graveyard is equally littered with “independent programs” and browser extensions : )

                                                    1. 2

                                                      Vimium exists for a very long time and is very unlikely to die. Port also exists on Firefox. I use both ATM and didn’t have any problems whatsoever.

                                                      1. 1

                                                        I don’t use those either. I tried Qutebrowser briefly but, again, too high risk. Browsers at this point are a closed platform

                                                    1. 2

                                                      Following the pattern:


                                                      For example:


                                                      Defined here.

                                                      1. 5

                                                        I’m maybe 80% de-googled (and de-Facebooked), with:

                                                        • Firefox
                                                        • DDG
                                                        • Zoho (mail with my domain, and contacts)
                                                        • Android without a Google account (I know this is flawed, but didn’t have much luck with microG)
                                                          • Aurora and F-Droid to sideload apps
                                                          • DAVx to sync calendars and contacts
                                                          • Newpipe and podsync+podcast republic to watch youtube
                                                        • Signal (chat)
                                                        • Mega (cloud storage)
                                                        • Site passwords rather than Google or FB OpenId, stored in pass
                                                        • Quarterly family email newsletter (to share things with family and friends I don’t chat with often)

                                                        I still use Google for:

                                                        • Docs. I have a few spreadsheets that are heavily scripted that I can’t be bothered migrating, and TBH zoho docs is rather lacking. I plan to move back to the “good old days” of local files + cloud storage
                                                        • Maps. OSM didn’t really work out that well, though it was OK
                                                        • Calendar. Maybe once I migrate my wife to Zoho for mail we can switch our calendar over, but we have a lot of time invested in it currently.
                                                        1. 5

                                                          Try the maps.me app. It uses osm data and has offline support

                                                          1. 1

                                                            There’s also this fork available on F-Droid, sans the binary blobs in the regular Maps.me app. I’m using OsmAnd - still early days but it seems pretty good (available for Android and iOS, open source).

                                                          2. 3

                                                            I think when in comes to a very specific tech, Google Maps cannot be matched. Actually, I would straight up pay for the service Google Maps provides if they asked for it.

                                                            1. 1

                                                              What specifically is it that you’re missing from, I’m assuming, OsmAnd?

                                                              1. 2

                                                                Personally, navigating to a street number and routing around traffic were the big ones.

                                                                1. 1

                                                                  Routing around traffic is absolutely something OsmAnd won’t do today. It would imply data gathering and privacy infringement I assume they’re not comfortable with.

                                                                  Navigating by street number though works well where I live. Though that will vary across the world and time.

                                                                  1. 2

                                                                    I believe Apple Maps do traffic routing with anonymized data gathering. I would that that you’d only need to know what the average speed of a given section of road is, which doesn’t require knowledge of individual location data.

                                                            2. 2

                                                              Maps. OSM didn’t really work out that well, though it was OK

                                                              I’ve been happily using Here Maps instead of Google Maps, as OSM is not quite good enough when it comes to car navigation.

                                                              1. 1

                                                                WRT. Google Docs you mighty want to give Collabora/Libreoffice Online a try by getting access to or installing a Nextcloud or Owncloud instance and installing the app. It is coming along nicely and is now able to run a complex spreadsheet which it børked at only a few months ago.

                                                                [1] https://apps.nextcloud.com/apps/richdocuments

                                                              1. 7

                                                                I find it slightly disappointing that the author ended up with Apache 2 as the software license for his new project without any further justification. Even though the author clearly outlined problems with Eric Raymond style open source he doesn’t draw upon these reflections when deciding the license for his new decentralised project. He remains in the status quo and makes himself and his project vulnerable to all the issues he made the reader aware of.

                                                                1. 6

                                                                  The tangent about copyleft is not the most important part. GPL would not have improved the npm situation in any way. The central problem discussed in the article is the VC-backed private control of the npm registry (which runs proprietary software, not permissively licensed software). Entropic is designed for people running their own registries, the registry software is designed for federation/mirroring.

                                                                  1. 2

                                                                    I trust you already know this but BSD-licensed distributed systems always devolve into SaaS businesses that give little back to the creators of the tech they are based on, e.g. most of AWS. With GPL, the Entropic team has a lot more leverage on the ecosystem.

                                                                    It’s an interesting idea: BSD, VC-backed vs GPL, Community-driven.

                                                                    1. 2

                                                                      SaaS providers don’t need the original software all that much, they can reimplement APIs just fine.

                                                                      If the whole idea from the beginning is a federated replication protocol (like here),

                                                                      • SaaS can just implement it from scratch anyway; and
                                                                      • community members just have to resist the SaaS temptation individually, fairly, without licensing tricks.

                                                                      Even legally forcing hosting companies to release their modifications (which I’m not sure even AGPL does, isn’t that only achieved by the Commons Clause type crap?) doesn’t necessarily prevent SaaS expansion. It reduces the risk of embrace-extend-extinguish, but a lot of times people don’t use SaaS because of exclusive modifications and features, just the convenience of someone else taking care of the servers.

                                                                  2. 3

                                                                    Why is Apache bad for her project? Which license should she have chosen?

                                                                    1. 2

                                                                      It looks to me that the comment pretty much answers your first question already. Although I appreciate the comment never stated that the Apache-2.0 license is bad for the project. Honestly I too was initially struck by the fact that despite “the author clearly outlined problems with Eric Raymond style open source he [sic] doesn’t draw upon these reflections”. On the other hand, the author of the article also comments that she thinks “it’s good for us as humans to give things to each other, and I think I’m at peace with the idea that some corporations will make money from it.” I guess it’s not a matter of justification but rather of acceptance, from what I can draw from this reading.

                                                                      Regarding the second question, I would say that choosing the GPL would have felt more inclined towards the spirit of the comparison between open source and free software (what the author originally refers to as ESR- and RMS-style open source). On the other hand, given the remark I quoted from the article, choosing a license has also to do with your objectives. If you are “at peace with the idea that some corporations will make money from it” and you may want enterprise customers to be attracted by the product, the GPL can be quite a hurdle, as the General Public License is sometimes treated as poison, as the article itself recognizes.

                                                                      Within the context of also introducing a possible replacement for NPM, as the article ultimately does, I believe choosing a permissive license is a smart choice, especially as the aim of the project, from what I read from the article, is to offer a way to put the control of the commons into the hands of the community, rather than one private entity.

                                                                      1. 1

                                                                        Yes, I’m not saying Apache-2.0 is bad for the project; I just felt that this new project remains susceptible to a lot of the issues the author raises with NPM. (And I’m sorry for using the wrong pronoun for the author in my original comment.) A license which forces sharing of derivative source code could help if for example the author of the article in the end goes the same route as the author of NPM and gives authority over the registry comes to a VC held firm.

                                                                        Note that I never mentioned GPL in my original comment and never suggested it to be the solution. Though I do want to point out that the GPL and AGPL does “allow for corporations to make money from it”. But they do scare corporations; perhaps because it makes it a little harder for a private entity to do what the original author opposes in her article.

                                                                        I don’t know which license she should have chosen. I guess I just wanted the argument to end up in a solution and not in the status quo. The solution could be anything. Perhaps I am missing the point and the implementation of her repository prevents corporate capture.

                                                                    2. 2

                                                                      I think this paragraph is the reasoning?

                                                                      The other confession I’ll make is that I believe in the potlatch economy despite everything. I think it’s good for us as humans to give things to each other, and I think I’m at peace with the idea that some corporations will make money from it.

                                                                    1. 2

                                                                      I haven’t adapted an old codebase to use TypeScript, but have used it from the start. You should be aware that it adds another layer of dependencies on an already complicated dependency story and the issues it can lead to.

                                                                      We ran into issues of compile times and version incompatibility; that if I were to upgrade a library, immutable.js to be specific, from 3.8 to 4.0 the compile times increased from an already slow 2s to 10s. After having worked in ClojureScript with Figwheel, which allows the developer to mutate the program while it’s running without destroying its state, working with such a slow feedback loop was viscerally painful.

                                                                      Another thing you have to be prepared for is to write your own type definitions for the libraries you depend on and to correct existing ones. Sometimes you won’t be able to express the extremely dynamic ways some JavaScript behaves, but that’s okay.

                                                                      I have no idea about how working with TypeScript contrasts to working with plain JavaScript, I’ve not worked on a large scale JS project recently enough. But I know that it’s a world of hurt compared to ClojureScript.

                                                                      1. 1

                                                                        Another thing you have to be prepared for is to write your own type definitions for the libraries you depend on and to correct existing ones.

                                                                        This is one of my biggest concerns. We’ll be on a learning curve writing definitions just for the code we’ve built and know inside out, and I’d be worried about trying to do that for external libraries. I’m hoping we won’t run into too many cases where that’s necessary.

                                                                        We also make heavy use of lodash (who doesn’t?) but it seems like there are types for that, hopefully it works for us.

                                                                        1. 2

                                                                          You can always just start out having it typed any and then refine it from there. The worst part really is when a type declaration is preventing you from using a library the way it’s meant to be used. Objectively it’s no worse than there being no type declarations really, it just feels more frustrating.

                                                                          But honestly it’s no biggie. It will just force you and your team to actually learn the type system and not just flounder around. I wouldn’t be worried about that up front cost; unless you’re afraid that your team will be demoralized by it, in which case you should spend some time thinking about how to prevent that.

                                                                      1. 22

                                                                        I think being a developer in a blooming sector can actually mean that one has less protection. The tech industry has pretty much no established union, as far as I am aware.

                                                                        1. 14

                                                                          Tech Worker Coalition. Check them, they are great

                                                                          1. 7

                                                                            Seconding this - tech workers must organize to protect our own labour rights, to help and stand in solidarity with less privileged labour groups that don’t have the same level of bargaining power, and to provide a desperately needed ethical check on an industry run amok.

                                                                            The Tech Worker’s Coalition is a great group for learning how to do so and connecting with others who are also interested. I’ve been going to local meetings for a couple months and it’s been incredibly refreshing to meet other tech workers who feel similarly. There is an online Slack community as well as locals in a number of US cities. Note that while the Tech Worker’s Coalition is an explicitly pro-labour and pro-union group, it is not itself a union, and has very little formal structure. You can find out more or join at https://techworkerscoalition.org/

                                                                          2. 8

                                                                            One US exception I know of has recently been kickstarter (somewhat ironically, I guess).

                                                                            1. 12

                                                                              I live in Sweden, where nearly every job has a collective agreement with a union and most are members of a union.

                                                                              Except in tech. In tech, you can only count on having collective agreement if you work at a non-tech company such as a bank.

                                                                              1. 3

                                                                                Several of my former colleagues in Sweden were programmers in unions.

                                                                                1. 3

                                                                                  I’ve never been part of a union/unionised agreement in the Netherlands either, but on the other hand I never felt it was particularly necessary as the worker protections under law are already pretty good (too good if anything, as it’s almost impossible to fire people). Additionally, firing a programmer (even if you could at a whim) comes with real costs to your company. A lot of knowledge gets lost, and training a new person is an investment.

                                                                                  1. 2

                                                                                    I agree that you can only count on it if you are on a non-tech company. In tech you have to make an active choice whether you want to work in a workplace connected to the union or not.

                                                                                    I’m sitting right next to a union representative right now at a product company in tech. Among consultancies there both those which have a collective agreement, those who don’t and a third category who don’t but who claim to have equivalent agreements and protections as those which are.

                                                                                    1. 4

                                                                                      This third category is the most hurtful. When you have a collective agreement, you get rights and protections and benefits, and you know about them. When you don’t have one, you don’t get those rights and protections and benefits, and this is obvious.

                                                                                      But when an employer says “oh, we don’t have a collective agreement, but we follow what’s written in this one” you get some of the benefits, but none of the rights and protections, and you’re not really sure which you get and which you don’t and it’s very vague and hand waivey.

                                                                                  2. -3

                                                                                    Your protection from what?

                                                                                    From agreeing voluntarily to exchange your time and labour for money?

                                                                                    1. 11

                                                                                      Protection from abusive management practices, get us benefits that management always gets, and a bit of an equalizer in power. Due process is my favorite union benefit. Management can’t fire us if we’re doing our jobs the way they say. If they do, there’s a sizeable amount of unemployment to cover our time seeking a job. That small detail has kept them from firing workers in majority of cases companies would lay people off. They cut back pay/hours, transfer people, etc to meet their goals. Those people still have a job with health and dental. Two benefits that are uncommon for lots of production workers down here but that their management always have.

                                                                                      1. 2

                                                                                        get us benefits that management always gets,

                                                                                        This is envy. If we lived in an alternate timeline where management doesn’t get these benefits, you would be content?

                                                                                        Due process is my favorite union benefit.

                                                                                        Due process? How is that applicable here? The argument is that if i gave you money last month I need to keep giving you money in perpetuity unless I prove I should not have to?

                                                                                        Due process for criminal law makes sense, because it involves violating a person’s natural (negative) rights.

                                                                                        In employment it makes no sense, because an employment is a mutually beneficial arrangement. The idea that one side (the employer) has to continue this arrangement indefinitely even if the circumstance changes is clearly unfair to him. Also, employee always has to power to terminate because he can plausible-deniably do a terrible job, which the employer cannot plasible-deniably pay less than the agreed amount.

                                                                                        If they do, there’s a sizeable amount of unemployment to cover our time seeking a job.

                                                                                        A person should be responsible for his own risk management, including the risk of not being continously employed. This should not be pushed onto the employer.

                                                                                        Those people still have a job with health and dental.

                                                                                        While it’s good to have, I don’t thing healthcare and dental care are not human rights because provision of these things require the labour of others and it would be an injustice to force those labourers to work for free or to take money from another third party to compensate them.

                                                                                        1. 4

                                                                                          I don’t thing healthcare and dental care are not human rights

                                                                                          Perhaps not human rights, but it’s downright dumb for a society not to give these basic forms of health care for free for everyone. Because fixing the ensuing problems is way more expensive.

                                                                                          1. -2

                                                                                            give us money, or you will have to give us more money later

                                                                                            You can see why game-theoretically, giving in to these demands is not advantageous.

                                                                                            1. 1

                                                                                              Theoretically speaking, I see your point, but it doesn’t seem to work quite like that in the scale of societies in real life. We’re clearly saving money when we remove health/mental/other problems when they’re just burgeoning. People who get basic health care are not demanding “more basic health care”, whatever that means. They don’t generally like to go to doctors, or especially dentists.

                                                                                              I could expand this to other things you hate (presuming from your nick): public schools, speed limits, mandatory seat belt laws, tobacco prohibition…

                                                                                      2. 9

                                                                                        Collective bargaining makes it possible to negotiate for desired changes to the treatment of workers which would otherwise be impossible as a powerless individual.

                                                                                        Your reply seems to pretend that

                                                                                        A: companies never treat workers unfairly

                                                                                        B: there are no economic pressures that may cause someone to require to remain in a job, even if they are being treated unfairly

                                                                                        It really does not take a great deal of critical thought to see that neither of these are true.

                                                                                    1. 1

                                                                                      I have never used Elixir or Phoenix myself but have used Clojure and Elixir looks like an alternative to it. About two weeks ago I posted a question in here asking how Phoenix.LiveView related to an Elixir library called Texas, unfortunately I pasted in the wrong link in the comment which made it look like a spam made by a bot.

                                                                                      Either way I’ll try to ask again now: Have you seen Texas and if so, how would you compare the two?

                                                                                      1. 1

                                                                                        Just saw this. I have heard of Texas, but don’t know enough to compare it with LiveView. My understanding is that Texas was announced at the same conference where LiveView was announced. LiveView being the creation of Chris McCord (creator of Phoenix), I think it’s the more likely of the two to see wide adoption. But possibly there will be cross-pollination.

                                                                                        1. 1

                                                                                          Huh, what a coincidence. Thanks!

                                                                                      1. 14

                                                                                        Rich has been railing on types for the last few keynotes, but it looks to me like he’s only tried Haskell and Kotlin and that he hasn’t used them a whole lot, because some of his complaints look like complete strawmen if you have a good understanding and experience with a type system as sophisticated as Haskell’s, and others are better addressed in languages with different type systems than Haskell, such as TypeScript.

                                                                                        I think he makes lots of good points, I’m just puzzled as to why he’s seemingly ignoring a lot of research in type theory while designing his own type system (clojure.spec), and if he’s not, why he thinks other models don’t work either.

                                                                                        1. 15

                                                                                          One nit: spec is a contract system, not a type system. The former is often used to patch up a lack of the latter, but it’s a distinct concept you can do very different things with.

                                                                                          EDIT: to see how they can diverge, you’re probably better off looking at what Racket does than what Clojure does. Racket is the main “research language” for contracts and does some pretty fun stuff with them.

                                                                                          1. 4

                                                                                            It’s all fuzzy to me. They’re both formal specifications. They get overlapped in a lot of ways. Many types people are describing could be pre/post conditions and invariants in contract form for specific data or functions on them. Then, a contract system extended to handle all kinds of things past Boolean will use enough logic to be able to do what advanced type systems do.

                                                                                            Past Pierce or someone formally defining it, I don’t know as a formal, methods non-expert that contract and type systems in general form are fundamentally that different since they’re used the same in a lot of ways. Interchangeably, it would appear, if each uses equally powerful and/or automated logics.

                                                                                            1. 14

                                                                                              It’s fuzzy but there are differences in practice. I’m going to assume we’re using non-FM-level type systems, so no refinement types or dependent types for full proofs, because once you get there all of our intuition about types and contracts breaks down. Also, I’m coming from a contract background, not a type background. So take everything I say about type systems with a grain of salt.

                                                                                              In general, static types verify a program’s structure, while contracts verify its properties. Like, super roughly, static types are whether a program is sense or nonsense, while contracts are whether its correct or incorrect. Consider how we normally think of tail in Haskell vs, like, Dafny:

                                                                                              tail :: [a] -> [a]
                                                                                              method tail(s: seq<T>) returns (o: seq<T>)
                                                                                              requires s.Len > 0
                                                                                              ensures s[0] + o = s

                                                                                              The tradeoff is that verifying structure automatically is a lot easier than verifying semantics. That’s why historically static typing has been compile-time while contracts have been runtime. Often advances in typechecking subsumed use cases for contracts. See, for example, how Eiffel used contracts to ensure “void-free programming” (no nulls), which is subsumed by optionals. However, there are still a lot of places where they don’t overlap, such as in loop invariants, separation logic, (possibly existential contracts?), arguably smart-fuzzing, etc.

                                                                                              Another overlap is refinement types, but I’d argue that refinement types are “types that act like contracts” versus contracts being “runtime refinement types”, as most successful uses of refinement types came out of research in contracts (like SPARK) and/or are more ‘contracty’ in their formulations.

                                                                                              1. 3

                                                                                                Is there anything contacts do that dependent types cannot?

                                                                                                1. 2

                                                                                                  Fundamentally? Not really, nor vice versa. Both let you say arbitrary things about a function.

                                                                                                  In practice contracts are more popular for industrial work because they so far seem to map better to imperative languages than dependent types do.

                                                                                                  1. 1

                                                                                                    That makes sense, thanks! I’ve never heard of them. I mean I’ve probably seen people throw the concept around but I never took it for an actual thing

                                                                                            2. 1

                                                                                              I see the distinction when we talk about pure values, sum and product types. I wonder if the IO monad for example isn’t kind of more on the contract side of things. Sure it works as a type, type inference algorithms work with it, but the sife-effect thing makes it seem more like a pattern.

                                                                                            3. 20

                                                                                              I’m just puzzled as to why he’s seemingly ignoring a lot of research in type theory

                                                                                              Isn’t that his thing? He’s made proud statements about his disinterest in theory. And it shows. His jubilation about transducers overlooked that they are just a less generic form of ad-hoc polymorphism, invented to abstract over operations on collections.

                                                                                              1. 1

                                                                                                wow, thanks for that, never really saw it that way but it totally makes sense. not a regular clojure user, but love lisp, and love the ML family of languages.

                                                                                                1. 1

                                                                                                  So? Theory is useless without usable and easy implementation

                                                                                                2. 7

                                                                                                  I don’t see anything of substance in this comment other than “Haskell has a great type system”.

                                                                                                  I just watched the talk. Rich took a lot of time to explain his thoughts carefully, and I’m convinced by many of his points. I’m not convinced by anything in this comment because there’s barely anything there. What are you referring to specifically?

                                                                                                  edit: See my perspective here: https://lobste.rs/s/zdvg9y/maybe_not_rich_hickey#c_povjwe

                                                                                                  1. 3

                                                                                                    That wasn’t my point at all. I agree with what Rich says about Maybes in this talk, but it’s obvious from his bad Haskell examples that he hasn’t spent enough time with the language to justify criticizing its type system so harshly.

                                                                                                    Also, what he said about representing the idea of a car with information that might or might not be there in different parts of a program might be correct in Haskell’s type system, but in languages with structural subtyping (like TypeScript) or row polymorphism (like Ur/Web) you can easily have a function that takes a car record which may be missing some fields, fills some of them out and returns an object which has a bit more fields than the other one, like Rich described at some point in the talk.

                                                                                                    I’m interested to see where he’s gonna end up with this, but I don’t think he’s doing himself any favors by ignoring existing research in the same fields he’s thinking about.

                                                                                                    1. 7

                                                                                                      But if you say that you need to go to TypeScript to express something, that doesn’t help me as a Haskell user. I don’t start writing a program in a language with one type system and then switch into a language with a different one.

                                                                                                      Anyway, my point is not to have a debate on types. My point is that I would rather read or watch an opinion backed up by real-world experience.

                                                                                                      I don’t like the phrase “ignoring existing research”. It sounds too much like “somebody told me this type system was good and I’m repeating it”. Just because someone published a paper on it, doesn’t mean it’s good. Plenty of researchers disagree on types, and admit that there are open problems.

                                                                                                      There was just one here the other day!


                                                                                                      I’ve found that the applicability of types is quite domain-specific. Rich Hickey is very clear about what domains he’s talking about. If someone makes general statements about type systems without qualifying what they’re talking about, then I won’t take them very seriously.

                                                                                                  2. 6

                                                                                                    seemingly ignoring a lot of research in type theory

                                                                                                    I’ve come to translate this utterance as “it’s not Haskell”. Are there languages that have been hurt by “ignoring type theory research”? Some (Go, for instance) have clearly benefited from it.

                                                                                                    1. 13

                                                                                                      I don’t think rich is nearly as ignorant of Haskell’s type system as everyone seems to think. You can understand this stuff and not find it valuable and it seems pretty clear to me that this is the case. He’s obviously a skilled programmer who’s perspective warrants real consideration, people who are enamored with type systems shouldnt be quick to write him off even if they disagree.

                                                                                                      I don’t like dynamic languages fwiw.

                                                                                                      1. 3

                                                                                                        I dont think we can assume anything about what he knows. Even Haskellers here are always learning about its type system or new uses. He spends most of his time in a LISP. It’s safe to assume he knows more LISP benefits than Haskell benefits until we see otherwise in examples he gives.

                                                                                                        Best thing tl do is probably come up with lot of examples to run by him at various times/places. See what says for/against them.

                                                                                                        1. 10

                                                                                                          I guess I would want hear what people think he’s ignorant of because he clearly knows the basics of the type system, sum types, typeclasses, etc. The clojure reducers docs mention requiring associative monoids. I would be extremely surprised if he didn’t know what monads were. I don’t know how far he has to go for people to believe he really doesn’t think it’s worthwhile. I heard edward kmett say he didn’t think dependent types were worth the overhead, saying that the power to weight ratio simply wasn’t there. I believe the same about haskell as a whole. I don’t think it’s insane to believe that about most type systems and I don’t think hickey’s position stems from ignorance.

                                                                                                          1. 2

                                                                                                            Good examples supporting he might know the stuff. Now, we just need more detail to further test the claims on each aspect of languge design.

                                                                                                            1. 3

                                                                                                              From the discussions I see, it’s pretty clear to me that Rich has a better understanding of static typing and its trade offs than most Haskell fans.

                                                                                                      2. 11

                                                                                                        I’d love to hear in a detailed fashion how Go has clearly benefited from “ignoring type theory research”.

                                                                                                        1. 5

                                                                                                          Rust dropped GC by following that research. Several languages had race freedom with theirs. A few had contracts or type systems with similar benefits. Go’s developers ignored that to do a simpler, Oberon-2- and C-like language.

                                                                                                          There were two reasons. dmpk2k already said first, which Rob Pike said, that it was designed for anyone from any background to pick up easily right after Google hired them. Also, simplicity and consistency making it easy for them to immediately go to work on codebases they’ve never seen. This fits both Google’s needs and companies that want developers to be replaceable cogs.

                                                                                                          The other is that the three developers had to agree on every feature. One came from C. One liked stuff like Oberon-2. I dont recall the other. Their consensus is unlikely to be an Ocaml, Haskell, Rust, Pony, and so on. It was something closer to what they liked and understood well.

                                                                                                          If anything, I thought at the time they shouldve done something like Julia with a mix of productivity features, high C/Python integration, a usable subset people stick to, and macros for just when needed. Much better. I think a Noogler could probably handle a slighty-more-advanced language than Go. That team wanted otherwise…

                                                                                                          1. 2

                                                                                                            I have a hard time with a number of these statements:

                                                                                                            “Rust dropped GC by following that research”? So did C++ also follow research to “drop GC”? What about “C”? I’ve been plenty of type system conversation related to Rust but nothing that I would attribute directly to “dropping GC”. That seems like a bit of a simplification.

                                                                                                            Is there documentation that Go developers ignored type research? Has the Go team stated that? Or that they never cared? I’ve seen Rob Pike talk about wanting to appeal to C and C++ programmers but nothing about ignorning type research. I’d be interested in hearing about that being done and what they thought the benefits were.

                                                                                                            It sounds like you are saying that the benefit is something familiar and approachable. Is that a benefit to the users of a language or to the language itself? Actually I guess that is more like, is the benefit that it made Go approachable and familiar to a broad swath of programmers and that allowed it to gain broad adoption?

                                                                                                            If yes, is there anything other than anecdotes (which I would tend to believe) to support that assertion?

                                                                                                            1. 10

                                                                                                              “That seems like a bit of a simplification.”

                                                                                                              It was. Topic is enormously complex. Gets worse when you consider I barely knew C++ before I lost my memory. I did learn about memory pools and reference counting from game developers who used C++. I know it keeps getting updated in ways that improve its safety. The folks that understand C++ and Rust keep arguing about how safe C++ is with hardly any argument over Rust since its safety model is baked thoroughly into the language rather than an option in a sea of options. You could say I’m talking about Rust’s ability to be as safe as a GC in most of an apps code without runtime checks on memory accesses.

                                                                                                              “Is there documentation that Go developers ignored type research? Has the Go team stated that? Or that they never cared?”

                                                                                                              Like with the Rich Hickey replies, this burden of proof is backwards asking us to prove a negative. If assessing what people knew or did, we should assume nothing until we see evidence in their actions and/or informed opinions that they did these things. Only then do we believe they did. I start by comparing what I’ve read of Go to Common LISP, ML’s, Haskell, Ada/SPARK, Racket/Ometa/Rascal on metaprogramming side, Rust, Julia, Nim, and so on. Go has almost nothing in it compared to these. Looks like a mix of C, Wirth’s stuff, CSP like old stuff in 1970’s-1980’s, and maybe some other things. Not much past the 1980’s. I wasn’t the first to notice either. Article gets point across despite its problems the author apologized for.

                                                                                                              Now, that’s the hypothesis from observation of Go’s features vs other languages. Lets test it on intent first. What was the goal? Rob Pike tells us here with Moray Taylor having a nicer interpretation. The quote:

                                                                                                              The key point here is our programmers are Googlers, they’re not researchers. They’re typically, fairly young, fresh out of school, probably learned Java, maybe learned C or C++, probably learned Python. They’re not capable of understanding a brilliant language but we want to use them to build good software. So, the language that we give them has to be easy for them to understand and easy to adopt.

                                                                                                              It must be familiar, roughly C-like. Programmers working at Google are early in their careers and are most familiar with procedural languages, particularly from the C family. The need to get programmers productive quickly in a new language means that the language cannot be too radical.

                                                                                                              So, they’re intentionally dumbing the language down as much as they can while making it practically useful. They’re doing this so smart people from many backgrounds can pick it up easily and go right to being productive for their new employer. It’s also gotta be C-like for the same reason.

                                                                                                              Now, let’s look at its prior inspirations. In the FAQ, they tell you the ancestors: “Go is mostly in the C family (basic syntax), with significant input from the Pascal/Modula/Oberon family (declarations, packages), plus some ideas from languages inspired by Tony Hoare’s CSP, such as Newsqueak and Limbo (concurrency).” They then make an unsubstantiated claim, in that section at least, that it’s a new language across the board to make programming better and more fun. In reality, it seems really close to a C-like version of the Oberon-2 experience one developer (can’t recall) wanted to recreate with concurrency and tooling for aiding large projects. I covered the concurrency angle in other comment. You don’t see a lot of advanced or far out stuff here: decades old tech that’s behind current capabilities. LISP’ers, metaprogrammers and REBOL’s might say behind old tech, too. ;)

                                                                                                              Now, let’s look at execution of these C, Wirth-like, and specific concurrency ideas into practice. I actually can’t find this part. I did stumble upon its in-depth history of design decisions. The thing I’m missing, if it was correct, is a reference to the claim that the three developers had to agree on each feature. If that’s true, it automatically would hold the language back from advanced stuff.

                                                                                                              In summary, we have a language designed by people who mostly didn’t use cutting-edge work in type systems, employed nothing of the sort, looked like languages from the 1970’s-1980’s, considered them ancestors, is admittedly dumbed-down as much as possible so anyone from any background can use it, and maybe involved consensus from people who didn’t use cutting-edge stuff (or even much cutting-edge at 90’s onward). They actually appear to be detractors to a lot of that stuff if we consider the languages they pushed as reflecting their views on what people should use. Meanwhile, the languages I mentioned above used stuff from 1990’s-2000’s giving them capabilities Go doesn’t have. I think the evidence weighs strongly in favor of that being because designers didn’t look at it, were opposed to it for technical and/or industrial reasons, couldn’t reach a consensus, or some combo.

                                                                                                              That’s what I think of Go’s history for now. People more knowledgeable feel free to throw any resources I might be missing. It just looks to be a highly-practical, learn/use-quickly, C/Oberon-like language made to improve onboarding and productivity of random developers coming into big companies like Google. Rob Pike even says that was the goal. Seems open and shut to me. I thank the developers of languages like Julia and Nim believing we were smart enough to learn a more modern language, even if we have to subset them for inexperienced people.

                                                                                                          2. 4

                                                                                                            It’s easy for non-LtU programmers to pick up, which happens to be the vast majority.

                                                                                                            1. 3

                                                                                                              Sorry, that isn’t detailed. Is there evidence that its easy for these programmers to pick up? What does “easy to pick up” mean? To get something to compile? To create error-free programs? “Clearly benefited” is a really loaded term that can mean pretty much anything to anyone. I’m looking for what the stated benefits are for Go. Is the benefit to go that it is “approachable” and “familiar”?

                                                                                                              There seems to be an idea in your statement then that using any sort of type theory research will inherintly make something hard to pick up. I have a hard time accepting that. I would, without evidence, be willing to accept that many type system ideas (like a number of them in Pony) are hard to pick up, but the idea that you have to ignore type theory research to be easy to pick up is hard for me to accept.

                                                                                                              Could I create a language that ignores type system theory but using a non-familiar syntax and not be easy to pick up?

                                                                                                              1. 5

                                                                                                                I already gave you the quote from Pike saying it was specifically designed for this. Far as the how, I think one of its designers explains it well in those slides. The Guiding Principles section puts simplicity above everything else. Next, a slide says Pascal was a minimalist language designed for teaching non-programmers to code. Oberon was similarly simple. Oberon-2 added methods on records (think simpler OOP). The designer shows Oberon-2 and Go code saying it’s C’s syntax with Oberon-2’s structure. I’ll add benefits like automatic, memory management.

                                                                                                                Then, the design link said they chose CSP because (a) they understood it enough to implement and (b) it was the easiest thing to implement throughout the language. Like Go itself, it was the simplest option rather than the best along many attributes. There were lots of people who picked up SCOOP (super-easy but with overhead) with probably even more picking up Rust’s method grounded in affine types. Pony is itself doing clever stuff using advances in language. Go language would ignore those since (a) Go designers didn’t know them well from way back when and (b) would’ve been more work than their intent/budget could take.

                                                                                                                They’re at least consistent about simplicity for easy implementation and learning. I’ll give them that.

                                                                                                            2. 3

                                                                                                              It seems to me that Go was clearly designed to have a well-known, well-understood set of primitives, and that design angle translated into not incorporating anything fundamentally new or adventurous (unlike Pony and it’s impressive use of object capabilities). It looked already old at birth, but it feels impressively smooth, in the beginning at least.

                                                                                                              1. 3

                                                                                                                I find it hard to believe that CSP and Goroutines were “well-understood set of primitives”. Given the lack of usage of CSP as a mainstream concurrency mechanism, I think that saying that Go incorporates nothing fundamentally new or adventurous is selling it short.

                                                                                                                1. 5

                                                                                                                  CSP is one of oldest ways people modeled concurrency. I think it was built on Hoare’s monitor concept from years before which Per Brinch Hansen turned into Concurrent Pascal. Built Solo OS with mix of it and regular Pascal. It was also typical in high-assurance to use something like Z or VDM for specifying main system with concurrency done in CSP and/or some temporal logic. Then, SPIN became dominant way to analyze CSP-like stuff automatically with a lot of industrial use for a formal method. Lots of other tools and formalisms existed, though, under banner of process algebras.

                                                                                                                  Outside of verification, the introductory text that taught me about high-performance, parallel computing mentioned CSP as one of basic models of parallel programming. I was experimenting with it in maybe 2000-2001 based on what those HPC/supercomputing texts taught me. It also tied into Agent-Oriented Programming I was looking into then given they were also concurrent, sequential processes distributed across machines and networks. A quick DuckDuckGo shows a summary article on Wikipedia mentions it, too.

                                                                                                                  There were so many courses teaching and folks using it that experts in language design and/or concurrency should’ve noticed it a long time ago trying to improve on it for their languages. Many did, some doing better. Eiffel SCOOP, ML variants like Concurrent ML, Chapel, Clay with Wittie’s extensions, Rust, and Pony are examples. Then you have Go doing something CSP-like (circa 1970’s) in the 2000’s still getting race conditions and stuff. What did they learn? (shrugs) I don’t know…

                                                                                                                  1. 12


                                                                                                                    I’m going to take the 3 different threads of conversation we have going and try to pull them all together in this one reply. I want to thank you for the time you put into each answer. So much of what appears on Reddit, HN, and elsewhere is throw away short things that often feel lazy or like communication wasn’t really the goal. For a long time, I have appreciated your contributions to lobste.rs because there is a thoughtfulness to them and an attempt to convey information and thinking that is often absent in this medium. Your replies earlier today are no exception.

                                                                                                                    Language is funny.

                                                                                                                    You have a very different interpretation of the words “well-understood primitives” than I do. Perhaps it has something to do with anchoring when I was writing my response. I would rephrase my statement this way (and I would still be imprecise):

                                                                                                                    While CSP has been around for a long time, I don’t that prior to Go, that is was a well known or familiar concurrency model for most programmers. From that, I would say it isn’t “well-understood”. But I’m reading quite a bit, based on context into what “well-understood” means here. I’m taking it to me, “widely understood by a large body of programmers”.

                                                                                                                    And I think that your response Nick, I think it actually makes me believe that more. The languages you mention aren’t ones that I would consider familiar or mainstream to most programmers.

                                                                                                                    Language is fun like that. I could be anchoring myself again. I rarely ask questions on lobste.rs or comment. I decided to on this occasion because I was really curious about a number of things from an earlier statement:

                                                                                                                    “Go has clearly benefited from “ignoring type theory research”.

                                                                                                                    Some things that came to mind when I read that and I wondered “what does this mean?”

                                                                                                                    “clearly benefited”

                                                                                                                    Hmmm, what does benefit mean? Especially in reference to a language. My reading of benefit is that “doing X helped the language designers achieve one or more goals in a way that had acceptable tradeoffs”. However, it was far from clear to me, that is what people meant.

                                                                                                                    “ignoring type theory research”

                                                                                                                    ignoring is an interesting term. This could mean many things and I think it has profound implications for the statement. Does ignoring mean ignorance? Does it mean willfully not caring? Or does it mean considered but decided not to use?

                                                                                                                    I’m familiar with some of the Rob Pike and Go early history comments that you referenced in the other threads. In particular related to the goal of Go being designed for:

                                                                                                                    The key point here is our programmers are Googlers, they’re not researchers. They’re typically, fairly young, fresh out of school, probably learned Java, maybe learned C or C++, probably learned Python. They’re not capable of understanding a brilliant language but we want to use them to build good software. So, the language that we give them has to be easy for them to understand and easy to adopt.

                                                                                                                    It must be familiar, roughly C-like. Programmers working at Google are early in their careers and are most familiar with procedural languages, particularly from the C family. The need to get programmers productive quickly in a new language means that the language cannot be too radical.

                                                                                                                    I haven’t found anything though that shows there was a willful disregard of type theory. I wasn’t attempting to get you to prove a negative, more I’m curious. Has the Go team ever said something that would fall under the heading of “type system theory, bah we don’t need it”. Perhaps they have. And if they have, is there anything that shows a benefit from that.

                                                                                                                    There’s so much that is loaded into those questions though. So, I’m going to make some statements that are possibly open to being misconstrued about what from your responses, I’m hearing.

                                                                                                                    “Benefit” here means “helped make popular” because Go on its surface, presents a number of familiar concepts for the programmer to work with. There’s no individual primitive that feels novel or new to most programmers except perhaps the concurrency model. However, upon the first approach that concurrency model is fairly straightforward in what it asks the programmer to grasp when first encountering it. Given Go’s stated goals from the quote above. It allows the programmers to feel productive and “build good software”.

                                                                                                                    Even as I’m writing that though, I start to take issue with a number of the assumptions that are built into the Pike quote. But that is fine. I think most of it comes down to for me what “good software” is and what “simple” is. And those are further loaded words that can radically change the meaning of a comment based on the reader.

                                                                                                                    So let me try again:

                                                                                                                    When people say “Go has clearly benefited from “ignoring type theory research” what they are saying is:

                                                                                                                    Go’s level of popularity is based, in part, on it providing a set of ideas that should be mostly familiar to programmers who have some experience with the Algol family of languages such as C, C++, Python, Ruby etc. We can further refine that to say that from the Algol family of languages that we are really talking about ones that have type systems that make few if any guarantees (like C). That Go put this familiarity as its primary goal and because of that, is popular.

                                                                                                                    Would you say that is a reasonable summation?

                                                                                                                    When I asked:

                                                                                                                    “Is there documentation that Go developers ignored type research? Has the Go team stated that? Or that they never cared?”

                                                                                                                    I wasn’t asking you for to prove a negative. I was very curious if any such statements existed. I’ve never seen any. I’ve drawn a number of conclusions about Go based mostly on the Rob Pike quote you provided earlier. I was really looking for “has everyone else as well” or do they know things that I don’t know.

                                                                                                                    It sounds like we are both mostly operating on the same set of information. That’s fine. We can draw conclusions from that. But I feel at least good in now saying that both you and I are inferring things based on what appears to be mostly shared set of knowledge here and not that I am ignorant of statements made by Go team members.

                                                                                                                    I wasn’t looking for proof. I was looking for information that might help clear up my ignorance in the area. Related to my ignorance.

                                                                                                                    1. 3

                                                                                                                      I appreciate that you saw I was trying to put effort into it being productive and civil. Those posts took a while. I appreciate your introspective and kind reply, too. Now, let’s see where we’re at with this.

                                                                                                                      Yeah, it looks like we were using words with a different meaning. I was focused on well-understood by PLT types that design languages and folks studying parallelism. Rob Pike at the least should be in both categories following that research. Most programmers don’t know about it. You’re right that Go could’ve been first time it went mainstream.

                                                                                                                      You also made a good point that it’s probably overstating it to say they never considered. I have good evidence they avoided almost all of it. Other designers didn’t. Yet, they may have considered it (how much we don’t know), assessed it against their objectives, and decided against all of it. The simplest approach would be to just ask them in a non-confrontational way. The other possibility is to look at each’s work to see if it showed any indication they were considering or using such techniques in other work. If they were absent, saying they didn’t consider it in their next work would be reasonable. Another angle would be to look at, like with C’s developers, whether they had a personal preference for simpler or barely any typing consistently avoiding developments in type systems. Since that’s lots of work, I’ll leave it at “Unknown” for now.

                                                                                                                      Regarding its popularity, I’ll start by saying I agree its simple design reusing existing concepts was a huge element of that. It was Wirth’s philosophy to do same thing for educating programmers. Go adopted that philosophy to modern situation. Smart move. I think you shouldn’t underestimate the fact that Google backed it, though.

                                                                                                                      There were a lot of interesting languages over the decades with all kinds of good tradeoffs. The ones with major, corporate backing and/or on top of advantageous foundations/ecosystems (eg hardware or OS’s) usually became big in a lasting way. That included COBOL on mainframes, C on cheap hardware spreading with UNIX, Java getting there almost entirely through marketing given its technical failures, .NET/C# forced by Microsoft on its huge ecosystem, Apple pushing Swift, and some smaller ones. Notice the language design is all across the board here in complexity, often more complex than existing languages. The ecosystem drivers, esp marketing or dominant companies, are the consistent thread driving at least these languages’ mass adoption.

                                                                                                                      Now, mighty Google claims they’re backing for their massive ecosystem a new language. It’s also designed by celebrity researchers/programmers, including one many in C community respect. It might also be a factor in whether developers get a six digit job. These are two, major pulls plus a minor one that each in isolation can draw in developers. Two, esp employment, will automatically make a large number of users if they think Google is serious. Both also have ripple effects where other companies will copy what big company is doing to not get left behind. Makes the pull larger.

                                                                                                                      So, as I think of your question, I have that in the back of my mind. I mean, those effects pull so hard that Google’s language could be a total piece of garbage and still have 50,000-100,000 developers just going for a gold rush. I think that they simplified the design to make it super-easy to learn and maintain existing code just turbocharges that effect. Yes, I think the design and its designers could lead to significant community without Google. I’m just leaning toward it being a major employer with celebrity designers and fanfare causing most of it.

                                                                                                                      And then those other languages start getting uptake despite advanced features or learning troubles (esp Rust). Shows they Go team could’ve done better on typing using such techniques if they wanted to and/or knew about those techniques. I said that’s unknown. Go might be the best they could do in their background, constraints, goals, or whatever. Good that at least four, different groups made languages to push programming further into the 90’s and 2000’s instead of just 70’s to early 80’s. There’s at least three creating languages closer to C generating a lot of excitement. C++ is also getting updates making it more like Ada. Non-mainstream languages like Ada/SPARK and Pony are still getting uptake even though smaller.

                                                                                                                      If anything, the choices of systems-type languages is exploding right now with something for everyone. The decisions of Go’s language authors aren’t even worth worrying about since that time can be put into more appropriate tools. I’m still going to point out that Rob Pike quote to people to show they had very, very specific goals which made a language design that may or may not be ideal for a given task. It’s good for perspective. I don’t know designers’ studies, their tradeoffs, and (given alternatives) they barely matter past personal curiosity and PLT history. That also means I’ll remain too willfully ignorant about it to clear up anyone’s ignorance. At least till I see some submissions with them talking about it. :)

                                                                                                                      1. 2

                                                                                                                        Thanks for the time you put into this @nickpsecurity.

                                                                                                                        1. 1

                                                                                                                          Sure thing. I appreciate you patiently putting time into helping me be more accurate and fair describing Go designers’ work.

                                                                                                                          1. 2

                                                                                                                            And thank you, I have a different perspective on Go now than I did before. Or rather, I have a better understanding of other perspectives.

                                                                                                          3. 4

                                                                                                            I don’t have a good understanding of type systems. What is it that Rich misses about Haskells Maybe? Does changing the return type of a function from Maybe T to T not mean that you have to change code which uses the return value of that function?

                                                                                                            1. 25

                                                                                                              Does changing the return type of a function from Maybe T to T not mean that you have to change code which uses the return value of that function?

                                                                                                              It does in a way, but I think people sometimes over-estimate the amount of changes that are required. It depends on whether or not really really care about the returned value. Let’s look at a couple of examples:

                                                                                                              First, let’s look at an example. Let’s say that we had a function that was going to get the first element out of a list, so we start out with something like:

                                                                                                              getFirstElem :: [a] -> a
                                                                                                              getFirstElem = head

                                                                                                              Now, we’ll write a couple of functions that make use of this function. Afterwards, I’ll change my getFirstElem function to return a Maybe a so you can see when, why, and how these specific functions need to change.

                                                                                                              First, let’s imagine that I have some list of lists, and I’d like to just return a single list that has the first element; for example I might have something like ["foo","bar","baz"] and I want to get back "fbb". I can do this by calling map over my list of lists with my getFirstElem function:

                                                                                                              getFirsts :: [[a]] -> [a]
                                                                                                              getFirsts = map getFirstElem

                                                                                                              Next, say we wanted to get an idea of how many elements we were removing from our list of lists. For example, in our case of ["foo","bar","baz"] -> "fbb", we’re going from a total of 9 elements down to 3, so we’ve eliminated 6 elements. We can write a function to help us figure out how many elements we’ve dropped pretty easily by looking at the sum of the lengths of the lists in the input lists, and the overall length of the output list.

                                                                                                              countDropped :: [[a]] -> [b] -> Int
                                                                                                              countDropped a b =
                                                                                                                let a' = sum $ map length a
                                                                                                                    b' = length b
                                                                                                                in a' - b'

                                                                                                              Finally, we probably want to print out our string, so we’ll use print:

                                                                                                              printFirsts =
                                                                                                                let l = ["foo","bar","baz"]
                                                                                                                    r = getFirsts l
                                                                                                                    d = countDropped l r
                                                                                                                in print l >> print r >> print d

                                                                                                              Later, if we decide that we want to change our program to look at ["foo","","bar","","baz"]. We’ll see our program crashes! Oh no! the problem is that head doesn’t work with an empty list, so we better go and update it. We’ll have it return a Maybe a so that we can capture the case where we actually got an empty list.

                                                                                                              getFirstElem :: [a] -> Maybe a
                                                                                                              getFirstElem = listToMaybe

                                                                                                              Now we’ve changed our program so that the type system will explicitly tell us whether we tried to take the head of an empty list or not- and it won’t crash if we pass one in. So what refactoring do we have to do to our program?

                                                                                                              Let’s walk back through our functions one-by-one. Our getFirsts function had the type [[a]] -> [a] and we’ll need to change that to [[a]] -> [Maybe a] now. What about the code?

                                                                                                              If we look at the type of map we’ll see that it has the type: map :: (c -> d) -> [c] -> [d]. Since both [[a]] -> [a] and [[a]] -> [Maybe a] satisfy the constraint [a] -> [b], (in both cases, c ~ [a], in the first case, d ~ a and in the second d ~ Maybe a). In short, we had to fix our type signature, but nothing in our code has to change at all.

                                                                                                              What about countDropped? Even though our types changed, we don’t have to change anything in countDropped at all! Why? Because countDropped is never looking at any values inside of the list- it only cares about the structure of the lists (in this case, how many elements they have).

                                                                                                              Finally, we’ll need to update printFirsts. The type signature here doesn’t need to change, but we might want to change the way that we’re printing out our values. Technically we can print a Maybe value, but we’d end up with something like: [Maybe 'f',Nothing,Maybe 'b',Nothing,Maybe 'b'], which isn’t particularly readable. Let’s update it to replace Nothing values with spaces:

                                                                                                              printFirsts :: IO ()
                                                                                                              printFirsts =
                                                                                                                let l = ["foo","","bar","","baz"]
                                                                                                                    r = map (fromMaybe ' ') $ getFirsts' l
                                                                                                                    d = countDropped l r
                                                                                                                in print l >> print r >> print d

                                                                                                              In short, from this example, you can see that we can refactor our code to change the type, and in most cases the only code that needs to change is code that cares about the value that we’ve changed. In an untyped language you’d expect to still have to change the code that cares about the values you’re passing around, so the only additional changes that we’ve had to do here was a very small update to the type signature (but not the implementation) of one function. In fact, if I’d let the type be inferred (or written a much more general function) I wouldn’t have had to even do that.

                                                                                                              There’s an impression that the types in Haskell require you to do a lot of extra work when refactoring, but in practice the changes you are making aren’t materially more or different than the ones you’d make in an untyped language- it’s just that the compiler will tell you about the changes you need to make, so you don’t need to find them through unit tests or program crashes.

                                                                                                              1. 3

                                                                                                                countDropped should be changed. To what will depend on your specification but as a simple inspection, countDropped ["", "", "", ""] [None, None, None, None] will return -4, which isn’t likely to be what you want.

                                                                                                                1. 4

                                                                                                                  That’s correct in a manner of speaking, since we’re essentially computing the difference between the number of characters in all of the substrings minutes the length of the printed items. Since [""] = [[]], but is printed " ", we print one extra character (the space) compared to the total length of the string, so a negative “dropped” value is sensible.

                                                                                                                  Of course the entire thing was a completely contrived example I came up with while I was sitting at work trying to get through my morning coffee, and really only served to show “sometimes we don’t need to change the types at all”, so I’m not terribly worried about the semantics of the specification. You’re welcome to propose any other more sensible alternative you’d like.

                                                                                                                  1. -3

                                                                                                                    That’s correct in a manner of speaking, since …

                                                                                                                    This is an impressive contortion, on par with corporate legalese, but your post-hoc justification is undermined by the fact that you didn’t know this was the behavior of your function until I pointed it out.

                                                                                                                    Of course the entire thing was a completely contrived example …

                                                                                                                    On this, we can agree. You created a function whose definition would still typecheck after the change, without addressing the changed behavior, nor refuting that in the general case, Maybe T is not a supertype of T.

                                                                                                                    You’re welcome to propose any other more sensible alternative you’d like.

                                                                                                                    Alternative to what, Maybe? The hour long talk linked here is pretty good. Nullable types are more advantageous, too, like C#’s int?. The point is that if you have a function and call it as f(0) when the function requires its first argument, but later, the requirement is “relaxed”, all the places where you wrote f(0) will still work and behave in exactly the same way.

                                                                                                                    Getting back to the original question, which was (1) “what is it that Rich Hickey doesn’t understand about types?” and, (2) “does changing the return type from Maybe T to T cause calling code to break?”. The answer to (2) is yes. The answer to (1), given (2), is nothing.

                                                                                                                    1. 10

                                                                                                                      I was actually perfectly aware of the behavior, and I didn’t care because it was just a small toy example. I was just trying to show some examples of when and how you need to change code and/or type signatures, not write some amazing production quality code to drop some things from a list. No idea why you’re trying to be such an ass about it.

                                                                                                                      1. 3

                                                                                                                        She did not address question (1) at all. You are reading her response to question (2) as implying something about (1) that makes your response needlessly adverse.

                                                                                                                  2. 2

                                                                                                                    This is a great example. To further reinforce your point, I feel like the one place Haskell really shows it’s strength in these refactors. It’s often a pain to figure out what the correct types should be parts of your programs, but when you know this and make a change, the Haskell compiler becomes this real guiding light when working through a re-factor.

                                                                                                                  3. 10

                                                                                                                    He explicitly makes the point that “strengthening a promise”, that is from “I might give you a T” to “I’ll definitely give you a T” shouldn’t necessarily be a breaking change, but is in the absence of union types.

                                                                                                                    1. 2

                                                                                                                      Half baked thought here that I’m just airing to ask for an opinion on:

                                                                                                                      Say as an alternative, the producer produces Either (forall a. a) T instead of Maybe T, and the consumer consumes Either x T. Then the producer’s author changes it to make a stronger promise by changing it to produce Either Void T instead.

                                                                                                                      I think this does what I would want? This change hasn’t broken the consumer because x would match either alternative. The producer has strengthened the promise it makes because now it promises not to produce a Left constructor.

                                                                                                                      1. 5

                                                                                                                        When the problem is “I can’t change my mind after I had insufficient forethought”, requiring additional forethought is not a solution.

                                                                                                                        1. 2

                                                                                                                          So we’d need a way to automatically rewrite Maybe t to Either (forall a. a) t everywhere - after the fact. ;)

                                                                                                                  4. 2

                                                                                                                    Likewise, I wonder what he thinks about Rust’s type system to ensure temporal safety without a GC. Is safe, no-GC operation in general or for performance-critical modules desirable for Clojure practitioners? Would they like a compile to native option that integrates that safe, optimized code with the rest of their app? And if not affine types, what’s his solution that doesn’t involve runtime checks that degrade performance?

                                                                                                                    1. 7

                                                                                                                      I’d argue that GC is a perfectly fine solution in vast majority of cases. The overhead from advanced GC systems like the one on the JVM is becoming incredibly small. So, the scenarios where you can’t afford GC are niche in my opinion. If you are in such a situation, then types do seem like a reasonable way to approach the problem.

                                                                                                                      1. 3

                                                                                                                        I have worked professionally in Clojure but I have never had to make a performance critical application with it. The high performance code I have written has been in C and CUDA. I have been learning Rust in my spare time.

                                                                                                                        I argue that both Clojure and Rust both have thread safe memory abstractions, but Clojure’s solution has more (theoretical) overhead. This is because while Rust uses ownership and affine types, Clojure uses immutable data structures.

                                                                                                                        In particular, get/insert/remove for a Rust HashMap is O(1) amortized while Clojure’s corresponding hash-map’s complexity is O(log_32(n)) for those operations.

                                                                                                                        I haven’t made careful benchmarks to see how this scaling difference plays out in the real world, however.

                                                                                                                        1. 4

                                                                                                                          Having used clojure’s various “thread safe memory abstractions” I would say that the overhead is actual not theoretical.

                                                                                                                    2. 2

                                                                                                                      Disclaimer: I <3 types a lot, Purescript is lovely and whatnot

                                                                                                                      I dunno, I kinda disagree about this. Even in the research languages, people are opting for nominal ADTs. Typescript is the exception, not the rule.

                                                                                                                      His wants in this space almost require “everything is a dictionary/hashmap”, and I don’t think the research in type theory is tackling his complaints (the whole “place-oriented programming” stuff and positional argument difficulties ring extremely true). M…aybe row types, but row types are not easy to use compared to the transparent and simple Typescript model in my opinion.

                                                                                                                      Row types help o solve issues generated in the ADT universe, but you still have the nominal typing problem which is his other thing.

                                                                                                                      His last keynote was very agressive and I think people wrote it off because it felt almost ignorant, but I think this keynote is extremely on point once he gets beyond the maybe railing in the intro

                                                                                                                    1. 2

                                                                                                                      pico < nano < micro

                                                                                                                      1. 5

                                                                                                                        mili < vim < kilo < mega < giga < emacs

                                                                                                                        1. 2

                                                                                                                          it’s just a static binary


                                                                                                                          $ file micro-1.4.1/micro 
                                                                                                                          micro-1.4.1/micro: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, Go BuildID=5a83ed8300296d2d29c7c21b668bda0a1db5fa7ba, stripped

                                                                                                                          (This seems to be a common misunderstanding these days.)

                                                                                                                          1. 3

                                                                                                                            I think a lot of people use “static binary” to mean “doesn’t link against anything other than libc” now. Not that that’s correct, but it’s certainly how the Go world tends to use it, which is unfortunate.

                                                                                                                          2. -1

                                                                                                                            Not sure I want an editor to be written in Go, to be honest.

                                                                                                                            1. 3

                                                                                                                              Why not? As with the parent comment you replied to I would very much like to know why you think so. The reasoning behind a claim is often more interesting than the claim itself.

                                                                                                                              1. 1

                                                                                                                                Some languages just come with a smell of lower quality. If something is written in a language like JavaScript, PHP or Go, I just immediately assume that the engineering standards are lower then some alternative written in e. g. Rust, F#, Haskell – or even C and C++.

                                                                                                                                I guess some languages are just more attractive to the “worse is better” crowd, and I have become wary of the resulting software.

                                                                                                                              2. 2

                                                                                                                                Lets be honest here, on a single user system 35kb of ram vs 1 meg of ram doesn’t change much… But given the choice one is better.

                                                                                                                                1. 1

                                                                                                                                  Any specific reason why?

                                                                                                                              1. 3

                                                                                                                                After reading that, I wonder why no one started a fork yet. Perhaps if someone does, people will quickly join.

                                                                                                                                1. 8

                                                                                                                                  Most people who could & would implement a fork, use PureScript instead.

                                                                                                                                  1. 2

                                                                                                                                    Because it is very hard and takes a lot of time I’d wager. Few have the time, money or drive to do such a thing.

                                                                                                                                    1. 2

                                                                                                                                      Because the whole reason people use something like this is that they don’t want to develop and maintain it themselves.

                                                                                                                                      1. 1

                                                                                                                                        There’s not a substantial amount of money in maintaining a language like this, so it would pretty much have to be a labour of love.

                                                                                                                                        Under those circumstances how many people would chose to fork an existing language and maintain it rather than create their own?

                                                                                                                                      1. 2

                                                                                                                                        Yes, I use Clojure Spec and the Python library Hypothesis.

                                                                                                                                        One thing that I really miss from Spec when using Hypothesis is that the data models are only useful when testing unlike Spec’s which can also be used for data conformation and transformation in the running program. So if you want to do something in the Python world you could explore the possibility of using Marshmallow schemas as data models for Hypothesis.

                                                                                                                                        1. 1

                                                                                                                                          I were unable to view the site due to the cookie warning covering half the screen and a chat button covering the close button of that warning.

                                                                                                                                          1. 4

                                                                                                                                            Why does your site ask for permission to send me notifications when I visit it?

                                                                                                                                            1. 1

                                                                                                                                              There’s a weird JS/chat widget.

                                                                                                                                              1. 1

                                                                                                                                                The “chat me” button in the bottom right has the ability to notify. I may look into a way to disable that.

                                                                                                                                              1. 3

                                                                                                                                                Having worked with TypeScript for little under a month now I’m not so convinced. I’m meeting a lot of friction where there either are no types for a library, which isn’t all that bad, or they’re incorrect and actually preventing you from using the library as its intended to be used. That combined with JavaScripts incredibly weak dynamic types ends up with the result that even though TypeScript thinks your typing is sound some library may take your array and silently make it in to an object without any errors being raised. During this month TypeScript has helped me once, when I mistyped a name to some existing but very similar name (project -> product). Other than that the errors have turned up at run time where TS holds no power.

                                                                                                                                                Thus far I much prefers ClojureScripts much better dynamic types to TypeScripts static and somewhat ineffective static proofs. But that could of course change as I get further in.

                                                                                                                                                1. 6

                                                                                                                                                  very surprising that the BSDs weren’t given heads up from the researchers. Feels like would be a list at this point of people who could rely on this kind of heads up.

                                                                                                                                                  1. 13

                                                                                                                                                    The more information and statements that come out, the more it looks like Intel gave the details to nobody beyond Apple, Microsoft and the Linux Foundation.

                                                                                                                                                    Admittedly, macOS, Windows, and Linux covers almost all of the user and server space. Still a bit of a dick move; this is what CERT is for.

                                                                                                                                                    1. 5

                                                                                                                                                      Plus, the various BSD projects have security officers and secure, confidential ways to communicate. It’s not significantly more effort.

                                                                                                                                                      1. 7


                                                                                                                                                        And it’s worse than that when looking at the bigger picture: it seems the exploits and their details were released publicly before most server farms were given any head’s up. You simply can’t reboot whole datacenters overnight, even if the patches are available and you completely skip over the vetting part. Unfortunately, Meltdown is significant enough that it might be necessary, which is just brutal; there have to be a lot of pissed ops out there, not just OS devs.

                                                                                                                                                        To add insult to injury, you can see Intel PR trying to spin Meltdown as some minor thing. They seem to be trying to conflate Meltdown (the most impactful Intel bug ever, well beyond f00f) with Spectre (a new category of vulnerability) so they can say that everybody else has the same problem. Even their docs say everything is working as designed, which is totally missing the point…

                                                                                                                                                    2. 7

                                                                                                                                                      Wasn’t there a post on here not long ago about Theo breaking embargos?


                                                                                                                                                      1. 12

                                                                                                                                                        Note that I wrote and included a suggested diff for OpenBSD already, and that at the time the tentative disclosure deadline was around the end of August. As a compromise, I allowed them to silently patch the vulnerability.

                                                                                                                                                        He agreed to the patch on an already extended embargo date. He may regret that but there was no embargo date actually broken.

                                                                                                                                                        @stsp explained that in detail here on lobste.rs.

                                                                                                                                                        1. 10

                                                                                                                                                          So I assume Linux developers will no longer receive any advance notice since they were posting patches before the meltdown embargo was over?

                                                                                                                                                          1. 3

                                                                                                                                                            I expect there’s some kind of risk/benefit assessment. Linux has lots of users so I suspect it would take some pretty overt embargo breaking to harm their access to this kind of information.

                                                                                                                                                            OpenBSD has (relatively) few users and a history of disrespect for embargoes. One might imagine that Intel et al thought that the risk to the majority of their users (not on OpenBSD) of OpenBSD leaking such a vulnerability wasn’t worth it.

                                                                                                                                                            1. 5

                                                                                                                                                              Even if, institutionally, Linux were not being included in embargos, I imagine they’d have been included here: this was discovered by Google Project Zero, and Google has a large investment in Linux.

                                                                                                                                                        2. 2

                                                                                                                                                          Actually, it looks like FreeBSD was notified last year: https://www.freebsd.org/news/newsflash.html#event20180104:01

                                                                                                                                                          1. 3

                                                                                                                                                            By late last year you mean “late December 2017” - I’m going to guess this is much later than the other parties were notified.

                                                                                                                                                            macOS 10.13.2 had some related fixes to meltdown and was released on December 6th. My guess is vendors with tighter business relationships (Apple, ms) to Intel started getting info on it around October or November. Possibly earlier considering the bug was initially found by Google back in the summer.

                                                                                                                                                            1. 2

                                                                                                                                                              Windows had a fix for it in November according to this: https://twitter.com/aionescu/status/930412525111296000

                                                                                                                                                          2. 1

                                                                                                                                                            A sincere but hopefully not too rude question: Are there any large-scale non-hobbyist uses of the BSDs that are impacted by these bugs? The immediate concern is for situations where an attacker can run untrusted code like in an end user’s web browser or in a shared hosting service that hosts custom applications. Are any of the BSDs widely deployed like that?

                                                                                                                                                            Of course given application bugs these attacks could be used to escalate privileges, but that’s less of a sudden shock.

                                                                                                                                                            1. 1

                                                                                                                                                              there are/were some large scale deployments of BSDs/derived code. apple airport extreme, dell force10, junos, etc.

                                                                                                                                                              people don’t always keep track of them but sometimes a company shows up then uses it for a very large number of devices.

                                                                                                                                                              1. 1

                                                                                                                                                                Presumably these don’t all have a cron job doing cvsup; make world; reboot against upstream *BSD. I think I understand how the Linux kernel updates end up on customer devices but I guess I don’t know how a patch in the FreeBSD or OpenBSD kernel would make it to customers with derived products. As a (sophisticated) customer I can update the Linux kernel on my OpenWRT based wireless router but I imagine Apple doesn’t distribute the Airport Extreme firmware under a BSD license.

                                                                                                                                                              2. 1

                                                                                                                                                                DigitalOcean and AWS both offer FreeBSD images.