1. 16

    I am a bit reassured that I am not the only one thinking that the numerous claims of “blazingly fast” Rust lib/apps can be a bit annoying. ^^

    1. 27

      93°C on all cores is certainly blazing.

      1. 2

        They might run fast, but compiling is painfully slow. My 2017 (I think) dual core XPS takes ages to compile anything with GUI elements or even moderately complicated. On my desktop machine (5900X) it’s bearable.

      1. 10

        Screen sharing has proven to be a bit more difficult than expected on Wayland-based setup.

        In addition to the setup described in this blogpost, I had to make the following modification:

        1. Thanks to systemctl --user status xdg-desktop-portal-wlr.service, I discovered slurp was a necessary dependency.
        2. I had to add export MOZ_ENABLE_WAYLAND=1 and export XDG_CURRENT_DESKTOP=sway to my .zshrc file
        3. The /etc/pipewire/media-session.d/media-session.conf file was outdated. Using pacdiff, I was able to replace it by its pacnew counterpart. The key difference between the two files is the metadata module. The following lines has to be uncommented.
        { name = libpipewire-module-metadata }
        

        And after all that, it finally worked on Firefox.

        1. 2

          I am intended to work on a PR for stgit that I have initiated to be able to use it as part of my dayjob workflow.

          I really love the tool.

          1. 16

            How is this related to GNU.org? It’s hard to tell from the front-page and introductory blog-post whether this is a break-off organisation, or something else entirely.

            This sent me off searching as to whether GNU is actually trademarked in any way, but apparently it’s not? Perhaps not surprising, given Richard Stallman’s stance on intellectual property in general, but it’s interesting to see how “ownership” of a name can be very contentious – do people who toil under a name have cause to co-opt it?

            1. 5

              but it’s interesting to see how “ownership” of a name can be very contentious – do people who toil under a name have cause to co-opt it?

              Ironically, a thread was circulating on Twitter the other day in which a former executive director of GNOME pointed out that GNOME is not a GNU project and they’ve asked the FSF to stop listing it as one – without success.

              1. 10

                Who would have thought that calling your project the GNU Network Object Model Environment would make people associate you with GNU.

                1. 9

                  GNOME has not been an acronym for at least a decade.

                  As far as I understood it from only sort of paying attention at the time, the split away from GNU happened for a lot of reasons, not least of which was Stallman’s loud public denunciations of GNOME’s leadership, and a Stallman-endorsed attempt to impose a code of ideological censorship on the GNOME project’s blog aggregator.

                  1. 5

                    The GNU project has a habit of refusing to let go projects when their maintainer wish it. I think I remember a similar issue with Libreboot. They of course live open the door for forking the project, but they basically say that if this happen, they will search for a new maintainer on their hand.

                    1. 1

                      The GNU project has a habit of refusing to let go projects when their maintainer wish it. I think I remember a similar issue with Libreboot.

                      I wouldn’t touch the toxic tarpit around that project with a ten mile pole, when the best defence you can come up with is “we were on drugs lol” [0] you know you’re in a special place. And the drama continues [1].

                      And people wonder why I want anonymity and privacy online.

                      [0] https://libreboot.org/news/unity.html

                      [1] https://libreboot.org/news/resignations.html

                      1. 2

                        I was not aware of that, tbh. Though, regarding the GNOME project, it looks like the same pattern arise (modulo the drama).

                        1. 3

                          I was not aware of that, tbh. Though, regarding the GNOME project, it looks like the same pattern arise (modulo the drama).

                          The people around gnome are smarter and present themselves as a lot more photogenic, but if you want to see how hostile they are try and get a patch accepted in gnome. You will be drowned in bureaucratic red tape. In GNU land you might want to tear your hair out over terrible decisions, like not exporting the parse tree from GCC, but at least you feel like someone is listening to you.

                2. 2

                  This is a “fork” of GNU, by people here.

                  1. 3

                    What are they referring to when they say “GNU Project”? The real thing or their fork? Nevermind, they updated the page since I open it the first time.

                    This post probably explains it better. Seems like a kind of union of GNU project maintainers, not a seperate project in itself, as they are still linking to gnu.org and not hosting their own code and project tools.

                    Edit: Here some more info: https://lists.gnu.tools/hyperkitty/list/assembly@lists.gnu.tools/message/RASDB353K5ONC654JDXBQCE7PFADYBSX/

                    1. 2

                      It was my understanding too: it’s not a fork, it’s mostly a group of maintainers aiming to coordinate their efforts within the wider umbrella of the GNU project (I guess they also hope to be able to steer the project in a direction more aligned with their values this way).

                      It sounds like a sane thing to do, but I fear like it won’t be welcomed well on the other hand of GNU.

                  2. 1

                    From r/freesoftware,

                    This is merely a resurgence of the “gnu-tools” initiative by the usual suspects.

                    Ostensibly it was an initiative to introduce more influence on the whole GNU project by maintainers (maintainers already have full control over their own GNU projects apart from redefining software freedom, which is where RMS has final say).

                    When asked the hard questions, it quickly became clear that this self-appointed shadow government was really about ousting RMS from the GNU project with hardly a though about how to continue after that.

                    Anyway, if you have several days, you can inform yourself. It’s all on display in the gnu-misc mailing list (from 2019-11 and onwards. Search for “social contract”)

                    In the end, most GNU maintainers weren’t on board and the discussion died down.

                  1. 5

                    This is fairly similar to the workflow that Stacked Git encourages, which I’ve used every day for the last several years. It’s really helped me in having focused commits, because I’ve already stated up front what will be in each individual patch.

                    You can create a new commit (at “patch” in Stacked Git terminology) by providing a name, and then filling out the commit message all the way here at the beginning.

                    $ stg new -- patch-name
                    

                    Then you can work on your changes like normal, and when you’ve got them, you can add to the staging area and then add the staging area to the patch at the top of the stack.

                    $ git add -p
                    $ stg refresh -i
                    

                    If you want to make a change not describe by your current patch, you can make a new one, and then use command to manipulate the stack.

                    $ stg pop
                    $ stg push
                    $ stg goto patch-name
                    

                    With a few project-specific exceptions, I only work off of the main branch, using the stack as the exclusive means of working on changes. To interact with systems expecting branches (like GitHub and Bitbucket) I manipulate the stack to reflect the desired branch (often, just a single patch) and use an alias that pushes the top patch by ID to a branch named after the top patch.

                    $ git push -f origin $(stg id):refs/heads/patches/$(stg top)
                    

                    Once changes are merged upstream, I can rebase patches on top and remove ones already merged.

                    $ stg pull -m
                    $ stg clean
                    

                    I haven’t done any scientific testing, but I feel I’m more productive with this system than I ever was trying tease commits apart and squashed together with git commands manually.

                    1. 1

                      I wanted to try Stacked Git for a while now, and installed it yesterday. I think I will give it a real try, as your comment really resonates with the workflow I have in mind. Thanks!

                      Is there a way to easily reorder patches in a stack? I see stg float and stg sink exist.

                      1. 1

                        AFAIK, there’s no interface for reorganizing the patches in a series like you might do in your editor with an interactive rebase. I’m very rarely working with a series large enough that working with stg push, stg pop and stg sink feels too limiting. If you are, I’m curious to learn more, and what solutions (if any) you come up with.

                    1. 1

                      I haven’t written a line of PureScript in 2 or 3 years I think, and I am glad this language is still moving forward!

                      1. 2

                        That was a really interesting, and insightful read. I use Emacs daily, but I never thought of it as analogous to bash and sort. The article provides a compelling argument that, in fact, it is. Thanks for sharing!

                        1. 3

                          After 6 years, I’ve left my now former employer and will start a new job on January 4th. During the next two weeks, I plan to clean-up my dotfiles to be as productive as possible. Right now, I have decided to heavily rework my Emacs configuration, to make it more consistent and predictable. I have already made some progress, in particular wrt. startup time (from almost 4s to 1s). I still have some work to do though.

                          And, of course, there is Christmas.

                          1. 1

                            I have a friend who was at a job for 6 years and left to start a new job on 1/4 who is ALSO a fan of Emacs… I’m suddenly suspicious.

                            1. 1

                              Does your friend happen to live in France? :p

                              1. 1

                                He does not. That’s a pretty good separator between you two. Haha

                            2. 1

                              Nice! Exciting to get out of your comfort zone! I wish you luck, health and progress to your new job! As my favorite poet wrote I hope your road is a long one, full of adventure, full of discovery :-)

                            1. 4

                              I am finally releasing a first (beta) version of coqffi, a tool for Coq I have been working on for quite some time now; and I need to write a tutorial prior to do a call of betatesters.

                              1. 2

                                Personally, I have been using BÉPO for 4 or 5 years now, and I have decided to use this opportunity to remap hjkl in vim to jkl: (as they are printed in qwerty layout, wich translates to tsrn in bépo). This right shift allows me not to move my end to move the cursor. I am pretty happy about this.

                                1. 1

                                  I’ve seen a few people mention that they made this change, and while it does initially seem like hjkl is misaligned by one key, I believe there is a reason for that. Down and up are pressed far more often, especially down, so they’re positioned under the two strongest fingers. Left and right, are less common because you can move by word, or using f,F,t,T.

                                  Not trying to criticise your change, I just thought that might be interesting for people to know.

                                1. 9

                                  Thanks for the in-depth explanations on what was going on @pmeunier, I can understand why it took you several days to write!

                                  1. 30

                                    Therefore, if after reading this post, you independently rediscover the algorithms presented here, that’s ok, but you must still license your “independent rediscovery” under the Gnu GPL-2.0 license, and cite the sources (for instance this post).

                                    This sounds legally void to me. GPL covers code, not algorithms. Algorithms aren’t copyrightable anywhere, and patentable only in some countries.

                                    1. 4

                                      It was even stranger this morning.

                                      Warning about licenses

                                      This blog post contains documentation about Pijul. Pijul is licensed under the Gnu GPL-2.0 or any later version at your convenience.

                                      Therefore, if after reading this post, you independently rediscover the algorithms presented here, that’s ok, but you must still license your “independent rediscovery” under the Gnu GPL-2.0 license, and cite the sources (for instance this post). This also applies if that rediscovery happens in the future, including in zero, one or more years.

                                      1. 3

                                        Seems this has been removed?

                                        1. 1

                                          That depends on the meaning of derived works. The algorithm is not described there independently of the code, it’s hosted on the same website, as documentation of the code.

                                          But nobody forces you to read that post.

                                          1. 10

                                            The GPL is only about code as @dmbaturin said. The blogpost itself is on GFDL which do not prevent me from reading article and implementing the same algorithms. AFAIK this wouldn’t be considered as a derivative work in any jurisdiction that I am aware of. So for me it also sounds void.

                                            1. 3

                                              I would personally tend to agree with @dmbaturin on this one, although I am far from being a legal expert and in any circumstances, the final world would be to the potential court that would review the case.

                                              Licensing is hard @_@

                                            2. 1

                                              While I agree with you as far as us law goes, are we really sure that the same is true about every countries copyright law?

                                              I think I’ll just stay away from this one.

                                              1. 1

                                                There’s a dispute in the European legal sciences about the copyrightability of algorithms, but indeed, most people here agree that algorithms are not copyrightable. Those who do not, usually also think that code and algorithm is the same. For those without any background in IT, this difference is difficult to grasp.

                                                (I studied Law in Germany)

                                              1. 6

                                                Awesome initiative; feel free to share your thoughts on the latest iteration of my website.

                                                1. 2

                                                  The font choice gives me LaTeX vibes. Very clean.

                                                  1. 2

                                                    I like it VERY much. I like how the code is colored, how smooth it is, like the concept of “News” section.

                                                    If it were up to me I would maybe just remove, or improve, the “Revisions” expandable - it doesn’t seem to contain anything useful for the reader. Also the bit where you introduce yourself is posted at the end of everything. I would probably move it to a separate section or leave it in home only.

                                                    And maybe, since Projects is currently empty, it should not be displayed.

                                                    1. 1

                                                      Reviewed on iPhone X

                                                      • the items in the nav bar are squished together for me
                                                      • some of the article summaries on the home page could use more vertical margin.
                                                      1. 1

                                                        Woww, your site is really great!!

                                                      1. 32

                                                        My site is at https://bernsteinbear.com. I get very polarized responses :)

                                                        1. 12

                                                          I think your site’s chill and classic!

                                                          1. 2

                                                            Thanks ^_^

                                                          2. 6

                                                            I love this! Its theme is very similar to the Oil shell site. Super clean.

                                                            1. 3

                                                              There’s a little comment in the CSS that says that the navbar was heavily “inspired” by oilshell :)

                                                            2. 3

                                                              Linux/Desktop (1920x1080, 16:9)/Chromium with uBlock

                                                              I really like this one. After reading a few of the “Compiling a Lisp” articles, I also copied a few design cues to my personal site. I’m sorry I cannot say more, it’s just easy to read and easy to navigate. If I had to try to say something it would be that the entire site is a bit too narrow, and that it might be better to use more semantic HTML5 tags instead of custom div classes?

                                                              1. 1

                                                                Is your current website the one everyone is complaining about? I think it’s great.

                                                                1. 2

                                                                  Everybody is exaggerated, it was just one comment that caught my attention. But other than that, I don’t think it’s to surprising considering it’s inspiration ^^.

                                                                2. 1

                                                                  Hm, interesting. Do you have any reading on this that you recommend? My HTML knowledge is at least 10, if not more, years out of date.

                                                                  1. 2

                                                                    I’m not expert either, I just check if I can use a semantic tag, when applicable. AFAIK the main advantage is that web readers /scrapers can properly parse what’s the site and what’s is just the header/footer (if you enable lobste.rs “article preview” feature, you’ll notice the difference).

                                                                    1. 1

                                                                      Oh, neat – thank you. I have some open graph data and some other metadata, but this might help.

                                                                3. 3

                                                                  Your site has no bells or whistles. It is a site. It has text. The text is the main focus. There is no fluff. It loads instantly. It is glorious.

                                                                  1. 1

                                                                    Glad you like it :)

                                                                  2. 2

                                                                    I like the nav bar, the contrast, and the no-frills aesthetic, and the style choice of serif font works.

                                                                    Despite broadly agreeing with high-contrast text, I think the background could be a touch lighter (maybe just going from lobste.rs to your site is hard, especially since I’m in a light environment right now).

                                                                    Mostly, though, some breathing room would really help, especially with the bullet points; the line spacing between one single-line bullet point to the next is identical to the line-spacing between lines in a single multi-line bullet point. Everything just blurs together and only a small dot on the side helps me distinguish between bullets.

                                                                    Increasing the font size could also be a big help for people with impaired vision.

                                                                    1. 2

                                                                      I added some list item spacing. Thanks for the tip off.

                                                                      I also reduced the text contrast a little bit with some not-quite-black and not-quite-white.

                                                                      1. 2

                                                                        Nice one. The bullet points are a lot easier to read now.

                                                                        The lightening of the background does help, too, but I’m also in a dark environment now (albeit with the same bright screen).

                                                                        I wasn’t even saying about darkening the text, but the muting there does help as well. I think overall you’ve struck a good balance between high contrast (light clashing with dark) and low contrast (words blending into the background).

                                                                    2. 2

                                                                      I love it! Looks great on both my desktop and phone, and it isn’t weighed down by big images or fonts.

                                                                      1. 1

                                                                        Oh, that is good to hear. I do not regularly check up on how it looks on a phone, despite half my visitors using phones.

                                                                      2. 2

                                                                        For me it’s missing only one thing, which is to support dark mode via a CSS media query. I’d love to see just how brief a dark mode implementation can be, and your site is the perfect test subject.

                                                                        1. 2

                                                                          I brought back dark mode, new and improved. Can you let me know what you think?

                                                                          Re: brevity: the longest part is the syntax highlighting.

                                                                          1. 2

                                                                            Functionally it looks nice and readable, and should be pleasant in a dark room. Warm fireplace colors were a good choice for syntax.

                                                                            You could stop there; it’s a nice upgrade! If you want more critique:

                                                                            If any of the colors are off, it’s the links in dark mode. In light mode visited links stand out a little less than unvisited, which is desirable. In dark mode, the unvisited links are diminished against black and the visited stand out. I might try brightening the blue and dimming the purple a bit.

                                                                            Finally, check the link colors on the same dark screen as the syntax colors. The syntax colors give a cozy character to the site, but the link colors establish a different kind of environment, such that when you first reach a syntax block, the warmth is a surprise. I think the link colors would need more saturation to fit in.

                                                                            1. 1

                                                                              Thanks for the in depth reply! When I next find the energy to CSS I’ll take a look.

                                                                          2. 1

                                                                            Someone made one but there was something slightly wrong about pre tags in headers that weren’t legible (?), so I reverted it. It was pretty simple so if you’re interested you’re welcome to revive that patch.

                                                                          3. 2

                                                                            Academic style - I like it. Loads in 106ms from Frankfurt which is pretty nice :)

                                                                            1. 1

                                                                              Grüße aus den Staaten!

                                                                              1. 2

                                                                                I don’t really live in Germany (or understand german for that matter), but when I run https://tools.pingdom.com/ , I use Frankfurt since it has the best ping to Norway :)

                                                                                1. 1

                                                                                  Oh, lol. That’s “greetings from the US”

                                                                                  1. 2

                                                                                    Greetings from Norway :D Or rather; Beste hilsener fra Norge :)

                                                                            2. 2

                                                                              Nothing wrong with your site. It is a perfect example of what the web was originally created for: Sharing information.

                                                                              1. 2

                                                                                I really like it. Text-heavy instead of the modern white peace overload with big images that everything leans towards now.

                                                                                1. 2

                                                                                  Kinda like your website, eh? And you are a cyclist too! :D

                                                                                2. 2

                                                                                  Clean, elegant styling, simple design, focus on the content (text). Clear links to different parts and an rss feed. Couldn’t make me happier.

                                                                                  1. 1

                                                                                    Glad you enjoy!

                                                                                  2. 2

                                                                                    The way you separated the series on the /blog is something I want to steal.

                                                                                    1. 2

                                                                                      Oh man the implementation is such a hack. If you use Jekyll, please don’t look! :P

                                                                                      1. 2

                                                                                        I am in Python land, so I could not get it even if I looked. :)

                                                                                        1. 1

                                                                                          What do you use to generate your blog? I am considering moving off Jekyll.

                                                                                          1. 2

                                                                                            I use Lektor. It is based on python, so slower to generate the pages locally, but my reasons are listed in this post - why I chose Lektor. See the Why Lektor section.

                                                                                    2. 2
                                                                                      1. 2

                                                                                        The bulleted list under “I like making things” is a little crowded, but otherwise, I love it!

                                                                                        1. 2

                                                                                          And to think I just removed some things :P Do you mean the length? Or the density of links? Or…?

                                                                                          1. 2

                                                                                            I should have mentioned that I’m on mobile. The density of the links is part of it. I think inserting an empty line between list entries would make a world of difference. You could take it further by increasing font size and line spacing. The bullets also make it look like the text is being physically squished into the right side of the screen so it may help to replace them with faux bullets (e.g. asterisks)?

                                                                                            I don’t know, this feels like such a small point, and it’s all about highly personal preferences. Your site is great!

                                                                                        2. 2

                                                                                          I really like this one; it’s clean and simple, and it works great with me.

                                                                                          1. 1

                                                                                            Glad you like it!

                                                                                        1. 1

                                                                                          This was a very pleasant read, with a clear picture of the path taken by the author, and the problem they solve; thanks for sharing!

                                                                                          1. 7

                                                                                            The rationale motivating this hack is good; I wonder if tree couldn’t be “fixed” upstream, though.

                                                                                            1. 2

                                                                                              I am writing the reference manual for a small software I have been working on for the past two weeks, so that I can then start talking a bit more about said small software.

                                                                                              1. 9

                                                                                                Great news! I am eager to try this!

                                                                                                Turn on -XLinearTypes, and the first thing you will notice, probably, is that the error messages are typically unhelpful: you will get typing errors saying that you promised to use a variable linearly, but didn’t. How hasn’t it been used linearly? Well, it’s for you to puzzle out. And while what went wrong is sometimes egregiously obvious, it can often be tricky to figure the mistake out.

                                                                                                So, basically, GHC just got its own “Syntax error” a la OCaml… just a bit more specialized :p.

                                                                                                1. 11

                                                                                                  Maybe it’s just me, but to me OCaml’s errors are terse and unhelpful and GHC’s errors are… verbose and unhelpful. ;)

                                                                                                  There are interesting papers that show working ways to improve both, but I wonder why none of those improvements are in the mainline compilers.

                                                                                                  1. 2

                                                                                                    Good error reporting is easiest if it’s built into the compiler front end from the start. If a new algorithm comes along to improve the error information it’s almost never going to be a simple job to drop it into an existing compiler.

                                                                                                    You need type information & parse information from code that’s potentially incorrect in both spaces, so any error algorithm usually has to be tightly integrated into both parts of the compiler front end. That tight integration usually means that improving compiler errors is a significant amount of work.

                                                                                                    1. 3

                                                                                                      It varies. What puzzles me is that a lot of time ready to use, mergeable patches take much longer to merge than they should.

                                                                                                      Like this talk: https://ocaml.org/meetings/ocaml/2014/chargueraud-slides.pdf

                                                                                                      1. 1

                                                                                                        Do you also have a link for a patch for the improved error messages?

                                                                                                        A lot of work has been going on to move OCaml to a new parser and improve error messages. Even though there is a lot still needed to be done, latest releases have started improving a lot. Maybe we can still extract some useful bits from that effort and try again

                                                                                                        1. 2

                                                                                                          Turns out it was even made into a pull request that isn’t merged yet: https://github.com/ocaml/ocaml/pull/102

                                                                                                          1. 1

                                                                                                            Thanks. It is quite an informative PR actually, and explains why the change is not there yet and once can infer why it is easier to add informative messages in new languages and complier but it may be quite hard to retrofit them to seasoned ones

                                                                                                  2. 7

                                                                                                    Would you be kind enough to give me an ELI5 about what linear types are and what you can do with them?

                                                                                                    1. 29

                                                                                                      In logic, normal implication like A implies B means whenever you have A, you can derive B. You have tautologies like “A implies (A and A)” meaning you can always infinitely duplicate your premises.

                                                                                                      Linear implication is a different notion where deriving B from A “consumes” A. So “A linearly implies B” is a rule that exchanges A for B. It’s not a tautology that “A linearly implies (A and A).”

                                                                                                      The classic example is you can’t say that “$3 implies a cup of coffee” but “$3 linearly implies a cup of coffee” makes sense. So it’s a logical form that reasons about resources that can be consumed and exchanged.

                                                                                                      Same in functional programming. A linear function from type A to type B is one that consumes an A value and produces a B value. If you use it once with an A value then you can’t use it again with the same A value.

                                                                                                      This is nice for some performance guarantees, but also for encoding safety properties like “a stream can only be read once” etc.

                                                                                                      1. 6

                                                                                                        Keynote: Linear Haskell: Practical Linearity in a Higher-Order Polymorphic Language https://skillsmatter.com/skillscasts/11067-keynote-linear-haskell-practical-linearity-in-a-higher-order-polymorphic-language

                                                                                                        1. 5

                                                                                                          It can be used to model protocols with type signatures. The following is in theory what you should be able to do.

                                                                                                          data ConsoleInput
                                                                                                              = Input String ConsoleOutput
                                                                                                              | ExitInput
                                                                                                          
                                                                                                          data ConsoleOutput
                                                                                                              = PrintLines ([String] ⊸ Console)
                                                                                                              & PrintLastLines ([String] ⊸ ())
                                                                                                          
                                                                                                          greet :: ConsoleOutput ⊸ ()
                                                                                                          greet console
                                                                                                              = let PrintLines f = console
                                                                                                                in step2 (f ["name?"])
                                                                                                          
                                                                                                          step2 :: ConsoleInput ⊸ ()
                                                                                                          step2 ExitInput = ()
                                                                                                          step2 (Input input console)
                                                                                                              = let PrintLastLines f = console
                                                                                                                in f ["hello " ++ input]
                                                                                                          

                                                                                                          If you combine it with continuation passing style, you get classical linear logic and it’s a bit more convenient to use.

                                                                                                          If you model user interfaces with types, they should be quite useful.

                                                                                                          I’m also examining and studying them: http://boxbase.org/entries/2020/jun/15/linear-continuations/

                                                                                                          1. 1

                                                                                                            Wikipedia gives a reasonable overview. The closest analogy would be something like move semantics – for example ownership in Rust can be considered as manifestation of linear types.

                                                                                                            1. 6

                                                                                                              Rust ownership is linear affine types. Linear types are similar but differ in the details. A shitty way of understanding it is affine types mimic ref counting and prevent you from having a ref count < 0. Linear types are more a way of acting like RAII in that you might create a resource but just “know” that someone later on in the chain does the cleanup.

                                                                                                              Which I’m sure sounds similar but affine types allow for things like resource leaks but linear types should guarantee overall behavior to prevent it.

                                                                                                              This all assumes my understanding and explanation is apt. I’m avoiding a ton of math and i’m sure the shitty analogy doesn’t hold up but behaviorally this is how I have it in my brain.

                                                                                                              1. 2

                                                                                                                Linearity Design Space: https://i.imgur.com/s0Mxhcr.png

                                                                                                                1. 2

                                                                                                                  I’m personally of the stance that the 2020 linear ghc stuff is more <= 1 usage, and kinda misses out on a lot of really fun expressivity that can fall out of making full classical linear logic first class. But that’s a long discussion in its own right , and I’ve yet to make the time to figure out the right educational exposition on that front

                                                                                                                  1. 1

                                                                                                                    it definitely seems more limited in scope/ambition compared to the effort ongoing for dependent types, for better or worse. Can’t say I know much about what first class linear logic would look like, but perhaps now there will be more discussion about such things.

                                                                                                                    1. 2

                                                                                                                      The really amazing thing about full linear logic is it’s really sortah a rich way to just do mathematical modelling where everything has a really nice duality. The whole thing about linearity isn’t the crown jewel (though wonderfully useful for many applications ), it’s that you get a fully symmetric bag of dualities for every type / thing you can model.

                                                                                                                      The paper that really made it click for me was mike shulmans linear logic for constructive mathematics paper. It’s just a fun meaty read even at a conceptual level. There’s a lot of other work by him and other folks that taken together just point to it being a nice setting for formal modelling and perhaps foundations of category theory style tools too!

                                                                                                                  2. 1

                                                                                                                    Not sure I can agree that Uniqueness types are the same as Linear types. Care to explain they’re similar sure but not the same thing and your… screenshot of a powerpoint? isn’t very illustrative of whatever point you’re trying to make here.

                                                                                                                    And from my experience with Idris, I’m not sure I’d call what Rust has Uniqueness types.

                                                                                                                    1. 1

                                                                                                                      They are different rows in the matrix because they are different, of course.

                                                                                                                      it’s from this presentation about progress on linear ghc a little over a year ago https://lobste.rs/s/lc20e3/linear_types_are_merged_ghc#c_2xp2dx skip to 56:00

                                                                                                                      What is meant by Uniqueness types here is “i can guarantee that this function gets the unique ptr to a piece of memory” https://i.imgur.com/oJpN4eN.png

                                                                                                            2. 2

                                                                                                              Am I the only one thinking this is not how you ship language features?

                                                                                                              If the compiler can’t even report errors correctly, the feature shouldn’t ship.

                                                                                                              1. 15

                                                                                                                If the compiler can’t even report errors correctly, the feature shouldn’t ship.

                                                                                                                Its more this is an opt-in feature with crappy error reporting for now using computer programming design features not in use in most programming languages. Its going to have rough edges. If we required everything to be perfect we’d never have anything improved. Linear types like this also might not have a great way to demonstrate errors, or the domain is new so why not ship the feature for use and figure out what kind of error reporting you want based on feedback.

                                                                                                                1. 13

                                                                                                                  Many people do not realize that haskell is a research language and GHC is one of the main compilers for it. This is an experimental feature in a research language. If it works out well, then it will be standardized.

                                                                                                                2. 5

                                                                                                                  Other people have sort-of said it, but not clearly enough I think. This is not a language feature being added. It is a feature-flagged experimental feature of a particular compiler. Most such compiler extensions never make it into real Haskell, and the ones that do take years after they are added to a compiler to make it to a language spec.

                                                                                                                  1. 4

                                                                                                                    for all practical purposes isn’t “real Haskell” defined by what ghc implements these days?

                                                                                                                    1. 2

                                                                                                                      Yes, all the other implementations are dead. They still work, but they won’t run most modern Haskell code, which usually uses a bunch of GHC extensions.

                                                                                                                      1. 1

                                                                                                                        You might say “isn’t it not popular to write standards-compliant Haskell these days?” and you’d be right. Of course it’s often trendy to write nonstandard C (using, say, GNU extensions) or nonstandard HTML/JavaScript. However, ignoring the standard being trendy doesn’t mean the standard doesn’t exist, or even that it isn’t useful. I always make sure my Haskell is Haskell2010, and I try to avoid dependencies that use egregious extensions.

                                                                                                                      2. 2

                                                                                                                        Honestly curious: are there any other Haskell compilers out there? Are they used in production?

                                                                                                                        Also, what is a definition of a true Haskell? I always thought it’s what’s in GHC.

                                                                                                                        1. 5

                                                                                                                          There’s a Haskell which runs on the JVM - Frege. But it makes no attempt to be compatible with the version of Haskell that GHC impements, for good reasons. Hugs is a Haskell interpreter (very out of date now, but still works fine for learning about Haskell.) There a bunch of other Haskell compilers, mostly research works that are now no longer in development - jhc, nhc98 etc etc.

                                                                                                                          But GHC is the dominant Haskell compiler by far. I don’t think there are any others in active development, apart from Frege, which isn’t interested in being compatible with GHC.

                                                                                                                          (“True Haskell” is the Haskell defined in the Haskell Report, but real world Haskell is the Haskell defined by what GHC + your choice of extensions accepts.)

                                                                                                                          1. 2

                                                                                                                            There are other compilers and interpreters. None of them is anywhere near as popular as GHC, and usually when one does something interesting GHC consumes the interesting parts.

                                                                                                                            There is definitely a standard, though: https://www.haskell.org/onlinereport/haskell2010/

                                                                                                                            The whole reason language extensions are called “extensions” and require a magic pragma to turn on is that they are not features of the core language (Haskell) but experimental features of the compiler in question.

                                                                                                                          2. 1

                                                                                                                            In short, GHC Haskell is a language designed by survival-of-the-fittest.

                                                                                                                          3. 3

                                                                                                                            Overly terse error messages are bad, but they are better than wrong error messages. Some things are much harder to give helpful error messages for than others.

                                                                                                                            I wish people spend more time improving error reporting, at least in cases when the way to do it is well understood. There is no reason for say TOML or JSON parsers to just say “Syntax error”. But, YAML parsers are pretty much doomed to give unhelpful errors just because the language syntax is ambiguous by design.

                                                                                                                            And then some errors are only helpful because we know what their mean. Consider a simple example:

                                                                                                                            Prelude> 42 + "hello world"
                                                                                                                            
                                                                                                                            <interactive>:1:1: error:
                                                                                                                                • No instance for (Num [Char]) arising from a use of ‘+’
                                                                                                                                • In the expression: 42 + "hello world"
                                                                                                                                  In an equation for ‘it’: it = 42 + "hello world"
                                                                                                                            

                                                                                                                            How helpful is it to a person not yet familiar with type classes? Well, it just isn’t. It’s not helping the reader to learn anything about type classes either.

                                                                                                                            1. 1

                                                                                                                              I’ve seen some good suggestions on r/haskell for improving the wording of these errors.

                                                                                                                            2. 2

                                                                                                                              The error they’re talking about is a kind of type error they’ve not worked with. It’s produced if you forget to construct or use a structure. I I’m guessing it’s technically “proper” but the produced error message may be difficult to interpret.

                                                                                                                              They’ve ensured it’s a feature you can entirely ignore if you want to. Everybody’s not convinced they need this.

                                                                                                                              I otherwise dunno what they’re doing and I’m scratching my head at the message. Something like “Oh cool you’ve done this… … … So where are the types?”

                                                                                                                              1. 2

                                                                                                                                So you never got a C++ template error in the good olden days? Seriously though, it just got merged. It’s not released or “shipped” in any means.

                                                                                                                                1. 0

                                                                                                                                  So you never got a C++ template error in the good olden days?

                                                                                                                                  No, because I looked at the language, figured out that the people involved completely lost their fucking mind, and moved on.

                                                                                                                                  Seriously though, it just got merged. It’s not released or “shipped” in any means.

                                                                                                                                  They took 4 years to arrive at the current state, which I’ll approximate at roughly 10% done (impl unfinished, spec has unresolved questions, documentation doesn’t really seem to exist, IDE support not even on the radar).

                                                                                                                                  So if you assume that there will be a Haskell version in the next 36 years, then this thing is going to end up in some Haskell release sooner or later.

                                                                                                                                  1. 2

                                                                                                                                    So if you assume that there will be a Haskell version in the next 36 years, then this thing is going to end up in some Haskell release sooner or later.

                                                                                                                                    Could you elaborate on this? If practical users of linear types will only use them if they have good error messages, and early testers want to work out the kinks now, what’s wrong with having a half-baked linear types feature with no error messages permanently enshrined in GHC 8.12?

                                                                                                                            1. 6

                                                                                                                              I love these discussions, because I feel there is no good answer here, and it really depends where you stand to think about that. Thanks for sharing!

                                                                                                                              1. 9

                                                                                                                                I read this whole article just waiting for the HTML Meter Element to be mentioned as a much simpler alternative, but it never was.

                                                                                                                                Semantic HTML is powerful, the wheel doesn’t always need to be re-invented with SVG.

                                                                                                                                1. 7

                                                                                                                                  Thanks to you, I know of HTML Meter Element now :).

                                                                                                                                  1. 3

                                                                                                                                    I love it - I don’t know why I always forget about . Thanks for the reminder!

                                                                                                                                    I definitely agree that reinventing the wheel for its own sake is wrong. I meant for this post to be more a teaching experience of “how would I go about creating a component like this”. There are lots of tidbits that I’ve had to learn on my own, and was hoping to share - like drawing with SVG in React and using d3 scales. I wonder what I could do to reinforce that point.