1. 6

    I really liked this article. Having gotten in functional programming with Elm for the last 2 years, the nonEmpty type is brilliant, and I’m going to re-implement it in Elm. The tie in of language theoretic security was a nice touch. I’ve been promoting that at work for a while.

    it’s extremely easy to forget.

    Anything that can be forgotten by a developer, will be forgotten.

    A better solution is to choose a data structure that disallows duplicate keys by construction

    “Making Impossible States Impossible” by Richard Feldman is a talk on effectively the same concept.

    1. 8

      However, sometimes it is quite annoying to conflate the type and structure of the list with the fact that it is nonempty. For example the functions from Data.List don’t work with the NonEmpty type. I think the paper on “departed proofs” linked near the bottom points to a different approach where various claims about a value are represented as separate proof objects.

      1. 3

        In this instance, the fact that both [] (lists) and NonEmpty are instances of Foldable will help: http://hackage.haskell.org/package/base-4.12.0.0/docs/Data-Foldable.html

      2. 2

        I ran across a case of the nonempty approach in File.Select.files the other day:

        Notice that the function that turns the resulting files into a message takes two arguments: the first file selected and then a list of the other selected files. This guarantees that one file (or more) is available. This way you do not have to handle “no files loaded” in your code. That can never happen!

        1. 1

          Nice find! I’ve actually used that before but hadn’t made the connection, haha.

      1. 13

        First, let’s stipulate that lots of people don’t know what they’re doing or why in technology development. Unless you’re coding, it doesn’t really feel as if something is going on, i.e., it’s a waste of time. In most cases, it is. Your instincts are correct.

        Second, I did not finish reading the article. I did not finish because the author doesn’t know what they’re talking about, or rather he is responding to the way he’s been taught and observed stand-ups happening, not how they actually work.

        ”…The majority of meetings are a waste of time. And in my opinion, one flavor of meeting that tops the charts in uselessness is the “status update” meeting. You know this meeting— the meeting where everyone gets together to share what they’ve been doing…”

        Yes. Shoot for meeting-free work areas. The way you do that is dynamically get together and talk about stuff as needed. The way you do that? A stand-ups. Stand-ups are the (in my mind) only fixed time and place where everybody gets together and asks for help. You don’t give status, you don’t report to anybody, you don’t ask or answer questions unless you can’t make out what the person is saying. You just take a minute and verbally review where you are and ask for help if you need it. Then we get to work. Maybe somebody has a problem that is going to be huge, so we hang out for an hour or two trying to solve it. Maybe nothing’s going on. Great! Two minutes later we’re all working on our own stuff. Works either way. It’s dynamic.

        The problem here is 1) people are used to status reports so that’s what they gravitate towards doing, 2) there’s pressure to build-up your work and deny having any problems, and 3) when it’s working right there is no positive feedback. It’s like brushing your teeth. You do it, it’s quick, and if you’re doing it right you never think about it. In fact, the more you think about it, probably the worse you’re doing it.

        1. 4

          In my experience, unless time limits for people talking are heavily enforced, they are largely a waste of time. If no one is willing/able to enforce hard limits for the amount of time any one person has in the stand up to talk, you almost always end up with senior people on the team who enjoy listening to themselves speak taking up 95% of the time, with the remaining 5% of the time given to those who need real help.

          1. 9

            Yeah they can go wrong in a lot of ways. Turns out having people talk to one another isn’t as simple as writing a for-next loop (grin).

            One of the fun things I used to do when teaching standups is a game where a team has to do a standup, but one person is the “ringer” – they’re given a dysfunction to display and the rest of the group has to deal with it. I found it was much easier to teach dysfunctions when people were only playing as opposed to directly addressing them.

            There’s also the guy that has to question everything, the one who never needs help, the one talking about nothing to do with work, and so on.

            1. 1

              That’s a fascinating approach. Thanks for sharing it.

        1. 23

          For some spooky Halloween times, take a midnight stroll through Google’s graveyard!

          There’s a lot of hidden terrors in there that time has forgotten.

          1. 4

            This list is a really neat blast from the past. It’d be cool to see a category for companies that were literally killed by google (e.g. Kiko, a calendar app made just before Google Calendar came out, which Google squashed like a bug).

            1. 8

              I don’t think even Google can get away with literally killing competitors. Yet.

              1. 4

                Depends on the country and if they use third parties that distance their brand from the act. See Betchel Corp vs Bolivian citizens that wanted drinking water as an example. Maybe Coca Cola in Colombia vs union people.

                If anything, I’m surprised at how civil things normally are with rich companies. Probably just because they can use lobbyists and lawyers to get away with most stuff. The failures are usually a drop in their bucket of profit.

                1. 4

                  Perhaps not competitors, but certainly people who get in the way of profits get killed, eg see the case of Shell in Nigeria: http://news.bbc.co.uk/2/hi/africa/8090493.stm

                  Hundreds of activists are killed every year, we just don’t hear about it much.

              2. 1

                You joke but I recall there was (is?) a “storage graveyard” in their Chicago office filled with CDs, casette tapes, floppies, and other physical media.

              1. 3

                I clicked through to https://gather.wtf and clicked on an event, then “Attend”. I got an endless spinner and this error in the console:

                Error: submitAndWatchExtrinsic (extrinsic: Extrinsic): ExtrinsicStatus:: 1010: Invalid Transaction: Payment

                1. 2

                  Yeah, it’s a hackathon project and though the backend/blockchain is complete, the UI is far from that…

                  1. 2

                    Not just an UI has to be added, there also have to be policies about privacy and who gets to see what. Not everyone wants their regular visits to a fetish club recorded on a public, immutable blockchain.

                1. 21

                  The thing is, in 1996 almost everyone on the Internet knew how to type in a URL… Back then, virtually everyone dutifully typed http://www.pepsi.com/ into Mosaic or Netscape

                  Is that really true? I remember posters for The Matrix that had “AOL Keyword: Matrix” on them instead of a URL.

                  1. 6

                    I think what the author of that quote is missing is that back in 1996 pretty much everyone on the internet was professionally competent in computers or a hobbiest; in either case they would take pride in knowing how things work.

                    By the turn of the Millennium when the Matrix came out thanks in part due to companies like Compaq, Gateway and Packard Bell there were millions of novices with no real interest in the details of how a computer worked (or why) who were connected to the internet and around that time search engines had begun to become how people found information on the internet.

                    Therefore it makes sense that a poster would have an AOL Keyword circa 2000 rather than a web address because the lowest common denominator won out.

                    1. 4

                      That was 1999

                    1. 4

                      A full accounting of a web minimalist’s digital pollution footprint must include the self-congratulatory blog post we invariably emit as a byproduct.

                      1. 24

                        I didn’t submit the link but I did write the blog post, so AMA.

                        1. 3

                          Thank you for stepping in! Your involvement with community, presentations and just general hard work are worthy of envy.

                          Three questions:

                          In one of the recent talks, where Andrei and Walter was asked what are the ‘3 top thing’, Andrei mentioned full, unambiguous language specification. Where does it stand now, and where do you see it fit on the overeall scale of things.

                          Second, the mobile platform. Is there community/sponsorship interest in having D being first-class language for Android, IOS (and may be the librem)

                          Third, is in terms industry domain focus, are there specific domains/industries you would like to see more interest/sponsorship from?

                          Overall, I am glad to see that memory safety (including compile time) and multi-language interoperability are high on your list/vision. Given D’s maturity, previous investments, current capabilities and market positions – those are right things, to focus on.

                          1. 4

                            Second, the mobile platform. Is there community/sponsorship interest in having D being first-class language for Android, IOS

                            It depends on what exactly you mean by first-class, but there is sponsorship on it. I’ve been working on android last weekend and D with the NDK already works, just it is a little clunky. But the end result will be D works just as well as C++… which isn’t really first class there - only Java and Kotlin have that and tbh I don’t expect that to change given the android VM.

                            I also toyed with ios, but am not officially sponsored on that yet. Actually, I think D has better chances there of working just the same as objc and swift.. but xcode doesn’t appear to be expandable so even compiling to the same code with the same access to the runtime might not count as first class.

                            1. 2

                              Xcode is not very customizable, but at least supports external build commands. It’s relatively easy to generate an Xcode project file with all the tweaks needed to make Build/Run “just work”, even for submission to the Mac AppStore. I’ve done that for Rust/Cargo: https://gitlab.com/kornelski/cargo-xcode

                              1. 1

                                Indeed, I’ll have to look at that, thanks! What I did for proof of concept on ios was just manually add the D static library. Worked very well in the simulator - the dmd compiler speaks objective-c abi and runtime, so even defining the child class just worked. But it only does x86 codegen… the arm compilers don’t speak obj-c. Yet, I am sure I can port it over in another weekend or two.

                              2. 2

                                D with the NDK already works, just it is a little clunky.

                                Thank you Adam.

                                Yes, I should not have used ‘first class’ moniker, as, clearly, for Android platform at least, first class can only be a JVM language.

                                In the larger context, what I meant more was ‘easier’ business logic sharing among Android, iOS and backend. This is a challenge that seems to fit well with D’s multi-language interoperability vision. And it is a challenge that yearning to be solved. [1], [2].

                                For many small-budget teams, developing Android + iOS (with a common backend), is quite difficult.

                                So I was asking more around this angle, of integrating D into IDE/toolchains of the dominant and upcoming mobile platforms, to provide for this multi-mobile-platform+backend code sharing.

                                JS/Typescript seems to be the choice, for the common engine run-time for code sharing across mobile (but, in my view, JS has costs in terms of: compile-time error detection, interlanguage data passing, memory and battery utilization, plus it is not a prevalent language for backends). There is also .NET Xamarin (that makes different tradeoffs than common JS approaches)

                                [1] https://medium.com/ubique-innovation/sharing-code-between-ios-and-android-using-c-d5f6e361aa98 [2] https://news.ycombinator.com/item?id=20695806

                                1. 6

                                  There’s a number of annoying problems to solve here (like Apple accepting LLVM bitcode instead of native code, which means you have to generate exactly the bitcode that the current Apple toolchain emits, and the the bitcode isn’t stable). Still, native languages are good choice there and having a multitude of native languages would be great.

                                  1. 2

                                    generate exactly the bitcode

                                    whoa, how strict are the checks? (i have never done mobile development before, so I am not a great choice to be doing these projects… just it seemed i was the only one with compiler hacking experience with some free time so it kinda fell on me by default)

                                    I read the website and go the impression that they basically did end-user acceptance tests… so I thought if it ran the same way you’d prolly be OK… do they actually scan the code for such strict patterns too? I wouldn’t put it above Apple - I hate them - but it seems a bit crazy.

                                    1. 3

                                      They will actually compile the code and ship it to your clients. https://www.infoq.com/articles/ios-9-bitcode/

                                      So, when I’m saying “exactly”, I mean it must be legal bitcode for the compiler toolchain you are using. This is a major nuisance, as the LLVM Apple ships with XCode is some internal branch. So, basically the only option is building custom compiler against XCode.

                                      For an effort in Rust to do this, check here. https://github.com/getditto/rust-bitcode

                                      I’m not well-versed in D, I assume the compiler is not based on LLVM?

                                      1. 2

                                        D has 3 backends

                                        gcc, its own, and LLVM (experimental) [1]

                                        I actually think D fits well into this problem domain of ‘sharing business logic (non-UI)’ code across multiple languages and toolchains of the mobile dev world.

                                        Because D’s team invested big effort into multi-backend architectures, and into C++ abi compatibility across non-standard ABI of the C++ compilers

                                        [1] https://dlang.org/download.html

                                        1. 3

                                          I wouldn’t call the llvm one experimental, it is in excellent condition and has been for a long time now. But yeah the llvm one is what would surely do the prod builds for ios… I guess it just needs to be built against the xcode version then hopefully it will work.

                                          1. 1

                                            ok, thank you. I had an old understanding of D’s llvm backend. sorry about that.

                                        2. 2

                                          FWIW, bitcode submission is optional and doesn’t seem to have compelling benefits. I’m a full-time iOS developer and have disabled bitcode in all of my recent projects.

                                          1. 2

                                            Yes, but forcing individual decisions of that kind is not a good habit if you want adoption.

                                2. 3

                                  Thanks for the kind words!

                                  unambiguous language specification. Where does it stand now

                                  I think we’re inching towards it.

                                  are there specific domains/industries you would like to see more interest/sponsorship from?

                                  All of them? :P

                                3. 3

                                  I’m watching Zig’s progress, and it seems like it’s more minimalistic and modern (as in: type declarations, expression-based rather than statement based, quasi sum types with tagged unions) than D while competing in the “crazy compile time magic” department. Do you have an opinion on whether D could learn from Zig as well?

                                  1. 1

                                    I don’t have an opinion on that because I know next to nothing about Zig other than they don’t like operator overloading. Which dismisses it as a language I’d like to actually use.

                                    1. 2

                                      that’s how I feel about the lack of proper sum types + pattern matching :)

                                  2. 2

                                    I don’t understand the first point. Are we finally gonna have a good answer for all of the “but the GC…” protestors? Or are you just saying that the GC isn’t enough to ensure memory safety?

                                    1. 4

                                      The GC is enough for memory safety for heap allocated memory, but not for the stack.

                                      As for “but the GC…” protestors, it’s a hard issue since it involves changing the current psychological frame that believes the GC is magically slow.

                                      1. 3

                                        Random pre-coffee thoughts on this sort of stuff… In my experience it also involves changing the current psychological frame of GC implementors (and users) that believes speed is the problem. I write video games and robotics stuff, both of which are soft-real-time applications. Making them faster can just be a matter of throwing better algorithms or beefier hardware at them, but even a 10ms pause at some random time for some reason I can’t control is not acceptable.

                                        I would love to use a GC’ed language for these tasks but what I need is control. So if I’m learning a new language for it I need a more powerful API for talking to the GC than “do major collection” and “do minor collection” which seems sufficient for most GC writers. (Rust has made me stop much paying attention to GC’ed languages, so more powerful API’s seem to be a bit more common than last time I checked a few years ago though.) I also need documentation on how to write critical code that will not call the GC. Actually, now that I look at D’s GC API it looks a lot better than most for this task; you can globally enable/disable the darn thing, and API docs both describe the algorithm and how it’s triggered. So, writing something like a fast-paced video game in D without erratic framerates due to GC stalls seems like it shouldn’t actually be too hard.

                                        So, changing the current psychological frame of the “but the GC…” people might be started by demonstrating how you write effective code that uses the GC only where convenient. That way the people who actually need to solve a problem have an easy roadmap, and the people who complain on philosophical ground look silly when someone with more experience then them says “oh I did what you say is infeasible, it was pretty easy and works well”.

                                        I dunno, changing people’s minds is hard.

                                        1. 2

                                          I would love to use a GC’ed language for these tasks but what I need is control.

                                          As you wrote later, there are API calls to control when to collect. And there’s always the option to not allocate on the GC heap at all and to use custom allocators.

                                          I dunno, changing people’s minds is hard.

                                          Yep. “GC is slow” is so ingrained I don’t know what to do about it. It’s similar to how a lot of people believe that code written in C is magically faster despite that defying logic, history, or benchmarks.

                                    2. 1

                                      One can write the production code in D and have libraries automagically make that code callable from other languages.

                                      I think it can be big for Python. Given that Python is used in stats, are there any libraries in D that to stats?

                                      1. 4

                                        I think the mir libraries cover that to a certain degree.

                                        1. 2

                                          just as Atila mentioned, here are referneces

                                          https://github.com/libmir

                                          https://code.dlang.org/search?q=linear

                                      1. 1

                                        This was published some time ago, but I’ve been looking at it again because the authors just published a writeup about the “mnemonic medium” format they used for the document: How can we develop transformative tools for thought?

                                        1. 4

                                          I saw the Strange Loop demo, and the biggest unanswered question was “how do you refactor an existing function?” This wasn’t answered and the edit docs aren’t covering that case. I think the answer is supposed to be “the tooling takes care of it”, but that sounds risky to me.

                                          1. 2

                                            My understanding from the demo is that the refactored function would get a new hash and the name associated with the previous function’s hash would get updated. The speaker noted that the name association is stored separately, so a dependency/refactor update is trivial for this reason. Dependent functions can update that reference and that is it (assuming a true refactor of maintaining the same type signature). Although I may not be understanding some subtly of your question.

                                            1. 1

                                              It’s the “Dependent functions can update that reference and that is it” that I’m hung up on. One of the selling points is that you can have two versions of the same function, which eliminates dependency conflicts. Consider the following case:

                                              A -> B -> C
                                              A' -> B -> C
                                              

                                              I discover a bug in C’s implementation and refactor it to C'. The tooling automatically updates B, which calls C, to B', which calls C'. Do we transitively update A? What about A'? What happens when the call chain is now 20 functions deep? Case two:

                                              A'' -> B' -> C'
                                              A' -> B -> C
                                              

                                              Turns out there was a second bug in C, and I have not yet pulled C'. I release C'' off C. How do we merge the change with C'? What if there are merge conflicts? Do we end up with two a fragmented ecosystem? Case three:

                                              A -> B -> C -> D -> E -> F
                                              

                                              C and F are in separate libraries. I see a bug in C and make C', somebody else at the same time sees a bug in F and pushes F'. What happens to A?

                                              1. 1

                                                Here is the applicable part of the StrangeLoop talk: https://youtu.be/gCWtkvDQ2ZI?t=1395

                                                The speaker’s example relies on/assumes different namespaces (at 26:16), but maybe the suggestion is that if you want to maintain two different versions, then they must ultimately be named differently. So a refactor of an existing type would not actually differentiate itself as a separate version unless you name it something different.

                                                That said, since all types are content addressable, you can still give each type a different name. It may be a matter of whether you choose to do that in your source, or you simply keep the one name and therefore the new version implicitly replaces the previous versions (similar to git, but at type level rather than file).

                                                Do we transitively update A?

                                                Correct, this is not answered in the talk. I can only speculate that the IR of hashes are updated to reflect the change unless you give it a new name in the textual/source representation. My guess is that if a fix to C or F is pushed, references will be implicitly updates (from the name C or F to the new hash). The Merkle tree will update accordingly. Of course if the name of C’ or F’ are changed and pushed, then the existing types will not implicitly update.

                                                Again this is speculation, but I am enjoying the conversation.

                                                1. 3

                                                  Some details about propagation: https://twitter.com/unisonweb/status/1173942969726054401

                                                  The way update propagation works is this: first we visit immediate dependents of the old and update them to point to the new hash. This alters their hash. We repeat for their dependents, and so on…

                                                  …if the update isn’t type preserving, the ‘todo’ command walks you through a structured refactoring process where the programmer specifies how to update dependents of old hashes.

                                                  Dependency chains in codebases written by humans tend to be pretty small. If it were even 100 that would be a lot.

                                                  Once this manual process of updating reaching a “type preserving frontier”, the rest of the way can be propagated automatically.

                                                  Also, these mappings from old hash to new hash are recorded in a Unison “patch”. A patch can be applied to any Unison namespace

                                                  Important asterisk: for changes to type declarations, right now all we support is manual propagation. Which can be quite tedious. We are working on fixing this!

                                          1. 2

                                            When the dimensions and settings of the medium for your visual design are indeterminate, even something simple like putting things next to other things is a quandary. Will there be enough horizontal space? And, even if there is, will the layout make the most of the vertical space?

                                            This raises the question, should web pages in 2019 still be putting things next to each other?

                                            Every site I can think of that becomes unsuable on my smartphone or in my half-width tiled browser windows is one that attempts a 2- or 3-column layout. When I reorganized my own personal site from multiple columns to just one, I was able to delete half of my CSS.

                                            1. 3

                                              Isn’t this what media queries are for? Not trolling, genuinely curious.

                                              1. 3

                                                Check out the other articles on the linked site for the case against media queries. TL;DR kinda yes, but media queries make it hard to build reusable components, because they’re inherently global and thus hardly compose (while you can nest the linked pattern, and it would work seamlessly)

                                                1. 1

                                                  I believe so, but it seems many sites don’t implement them flawlessly.

                                              1. 5

                                                Configuring static site generation for tombrow.com, then using what I learn to set up a homepage for my fiancé. Anyone know if Google Domains would be a nicer place to keep my domains than 1and1 is?

                                                Documenting the code I use for keyboard remapping in macOS. I might write a short post to try to persuade people of the benefit of mapping Ctrl-[ to Escape and Fn-hjkl to arrow keys.

                                                Cutting some more drawer organizers using the laser at the maker space.