1. 16

    The diagramming support is one of the things I miss most after moving from gitlab to github.

    1. 8

      Interesting! Didn’t know GitLab flavored Markdown supported that (and more).

      https://docs.gitlab.com/ee/user/markdown.html#diagrams-and-flowcharts

      1. 10

        Gitea also supports mermaid diagrams.

      2. 5

        Curious… why bother moving forges from open-core to closed-source?

        1. 3

          GitHub has a lot more social features. I’ve had a clue of projects on GitHub get issues and pull request with no marketing. So people are finding and using things.

          I’ve considered if I should set up mirrors of my GitLab projects on GitHub for the marketing effects.

          1. 2

            The social features are one of my biggest turn-offs, but you’re not the first to voice that opinion.

            1. 5

              I pretend that I don’t care about the social features. I really like that you can follow releases and the reaction option is kinda nice (so people can voice their support on new releases, without any comment noise).

              I don’t follow anyone, because that’s just adding a ton of stuff into my feed. But honestly it makes me happy when somebody does give me a “star” and I think it’s ok to have this vague indicator of credibility for projects.

              But I do actually search on github first when I’m looking for some kind of software I don’t find directly by using DDG. So the network effect is definitely there. Same goes for inter-project linking of issues or commits. And I won’t be surprised if moving my crates.io source to gitlab would decrease the amount of interaction as much as moving it to my private gogs/gitea instance.

            2. 2

              I’m curious what the social features are? I’ve used GitHub since it came out, but have never specifically noticed this

              1. 2

                follows. watches. stars. networks. there might be more. Github has been on my radar since it came up and these have long annoyed me. I think one of their early slogans was “social coding” and it was irritating then. Some people really like it though.

            3. 3

              For me it was largely about switching of culture of my work, shortly followed by me switching companies.

              Personally if I were to start again I think I would utilize gitlab again. While occasionally their solutions lack the polish and simplicity of github, The “whole package” of their offerings is really nice. The only consistent downside is performance of certain UI elements.

          1. 1

            Felt. I have a 2012 Samsung Chromebook that I’ve used in emergencies when I had laptop issues now get stuck on an un-updatable version. I’ve not put in the time to slap Arch or whatever Arm+Mali-compatible distro I can find to keep it running, but it’s pretty much a paperweight now. The irony is that it’s now stuck on the last version of Chrome that uBlock worked correctly on with Manifest v3,

            1. 2

              I wish one of these split keyboards used electrocapacitive switches. I can’t go back to mechanical.

              1. 6

                For what it’s worth, I use nix-darwin to manage nearly my entire system, including Homebrew (plus DNS, cli tools & dotfiles, fonts, network services, macOS system settings, and more).

                If anything happens with a Homebrew package / application upgrade, I can just roll back to a prior generation, everything works again, and I can try again at my leisure.

                I personally wish I didn’t have to do some of these things (it’d be nice if macOS had its own solution), but it does let me set up a Mac with just a couple of commands.

                1. 2

                  What does macOS give you over NixOS at this rate?

                  1. 6

                    Nicer UI, non-developer tools like Affinity, UI developer tools like Dash/Proxyman. Even if some tools have equivalent on NixOS, these are often not as ergonomic as on macOS.

                    1. 2

                      I’ve been running this on an early 2013 MacBook Pro (retina), and it has been my only personal computer since 2013.

                      I’ve tried running NixOS in VMs, but I’ve always had a hard time with it (except for the demo). My latest effort was was to do something similar to the founder of Hashicorp (he’s big on Nix) where he has his dev environment in NixOS through a VM on macOS, but I couldn’t get it working well enough to be useful.

                      If I ever get a Framework laptop or anything that isn’t by Apple, I’ll try NixOS again in a heartbeat, but while I’m on macOS for personal and work, this is where I am.

                  1. 1

                    Coed looks interesting. Elm architecture, but in typescript.

                    1. 2

                      eeue56 did a lot in the Elm community. I will venture to guess one of two things happened here: 1) a new project or its lead decided on TypeScript and TEA is still one decent way to construct UI architectures and it was ported to TS to use a familiar, tested pattern or 2) a project hit the limitations of Elm and was forced to use something else with types (which currently usually involves migrating to TypeScript, ReScript, or PureScript). Seeing the dates of these projects leads me to believe the author misses the ergonomics of an ML language but needs to be inside the TypeScript ecosystem.

                      1. 1

                        Somewhat accurate - I find myself using TS a bunch for work, but find working with React frustrating and find the syntax of TS to be awkward for type-safe code.

                        1. 2

                          Did you look at Rescript (bucklescript) at all? What puts me off is the emphasis on React, it’s not clear there is a decent TEA implementation for it.

                          1. 2

                            Yep, I did. Not a fan of the OCaml styling, plus my experience with the toolchain has been pretty rough - though I know they’ve improved stuff a bunch since I last used it. In my eyes, Elm is near perfect syntax wise for my personal preferences. I just want a better way of working with TypeScript projects with it.

                          2. 1

                            Thanks for reaffirming my understanding of the state of these technologies. I can definitely understand the niche you’re filling. I can empathize being unhappy with TypeScript ergonomics as well specifically moving from a PureScript project to a new, different TypeScript project.

                      1. 1

                        I am curious what the goal is with this. Typescript is compiled to javascript before running in production anyway, so is this intended as a compatibility step for using Elm-like code in TS projects?

                        1. 10

                          I’m not a part of this project but having coded in Elm and PureScript for years and very recently touching TypeScript, TypeScript does not meet expectations for ergonomics for functional programming and is unreadable in comparison—even if the type system is sufficient with a few flags.

                          Elm really pulled some poor design decisions IMO, that sealed it’s future as niche-only, and it seems quite a few projects outgrew Elm’s limitations. PureScript, as powerful and pretty to write as it is and access to multiple back-ends, goes beyond the simplicity of Elm in what I experienced as a loss in productivity either in wrapping one’s head around some advanced types or needing to flesh out missing pieces in the ecosystem because the community is much smaller. TypeScript ecosystem is massive (albeit very hit-and-miss on quality and definitely leans imperative and OO). While they can consume the larger JavaScript ecosystem, neither Elm nor PureScript can easily consume TypeScript type definitons or general code without first compiling it. I assume this is derw’s niche, bootstrap on top of the TypeScript with ML-style ergonomics, migrate frustrating Elm apps, and leverage the TypeScript ecosystem which has in some senses outgrown JavaScript. Assuming derw has managed IO, it has a niche over ReScript as well.

                          1. 3

                            Elm really pulled some poor design decisions

                            I’d love to hear more about them (in a separate blogpost or similar).

                            1. 10

                              This blog entry echoes a lot of my same feelings–and also links out to some comments in threads I had left.

                              Summary of my own beefs:

                              • ports are limiting (can’t send files or other ‘useful’ types through them, and can’t be synchronous)
                              • necessary FFI code can no longer be written (need a browser API that’s synchronous? Tough luck)
                              • Web Components are a band-aid for stuff Elm just can’t do: can’t make it work in Elm, go stateful
                              • glacial update pace to the core and compiler with open merge requests dating years back with bug and security fixes
                              • no meaningful i18n or l10n story (would not recommend on this alone)
                              • community has pedestals and a select few get a lot of power
                              • overly beginner-friendly community, in a way that mentioning ‘monad’ can be considered bad and as such people end up writing their own, but less good version (e.g. bind without pure) and without the theory or understanding what andThen should do (type classes would be nice, but understandably bring baggage)
                              • Optics, despite simplicity, frowned upon leading to ugly nested update code or making your entire state flat which leads to naming issues and just isn’t well organized
                              • no good way to communicate between components leading to the one of the simplest solution (IME) being to pass the whole state into every component and use Optics to update the parts of state you need
                              • browser application API breaks a lot of tools and browser add-ons; community suggests mounting to an element and manually hooking up location listeners that the browser application was supposed to simplify and do for you
                              • packages cannot be consumed without publishing (say awaiting a merge request upstream) nor can they be in private repos; you see some people publish forks to get code out the door instead of wait and since there’s no unpublish, you can’t remove it once your merge is complete leading to package rot and confusion; vendoring is a bad idea and could go against the package license
                              • can’t reasonably publish updates for prior versions of Elm
                              • compiler strips license info
                              • identity and package system is tied to Microsoft’s GitHub accounts so all community members must create an account and agree to a closed-source, private company’s ToS as a bare minimum participate in an open source community
                              1. 1

                                Thank you so much ♥

                                1. 1
                                  1. 2

                                    There’s a place for both. The names can be goofy or confusing (or even ‘wrong’), but the ideas are sound and people miss out on shoulders of giants they could be standing on.

                            2. 2

                              Or vice-versa, if you want access to the typescript ecosystem from an elm-like language.

                              1. 1

                                I have a blog post in progress that will summarize the goals, but basically: I want a way to write ML-style code that works with TypeScript (and generates TS as an escape hatch), so that I can use it at work.

                              1. 16

                                Second paragraph and I’m already mad.

                                Rule 8: Flags represent nations, not languages – so don’t use flags.

                                Some obviously controversial flags: United Kingdom, Spain, France, Portugal. These examples have more speakers outside the origin country than within and is a very Euro-centric, colonial viewpoint of language to use any flag whatsoever. Not to mention, many countries have more than one language which further propagates stereotypes or belittlement of minority groups inside those countries.

                                Luckily the Steady site doesn’t break this rule, just the blog entry.

                                1. 12

                                  The reason flags are used is that if a website is in a language you do not understand you may not otherwise know where to click to change the language, or recognise the name of your language. The word for “English” in Russian is “английский”. Are you going to know to click on that unless there is a American or British flag next to it?

                                  Everyone knows that people get het up about flags. Flags are used despite this for usability reasons.

                                  1. 22

                                    That’s why the dropdown for language selection should list the name of each language in that language. Deutsch, English, Espanol, etc.

                                    1. 12

                                      My favorite “bug” I saw lately around this was a county drop-down that was translated to German but the sort order was still in English. So Germany (“Deutschland”) was not under “D”, but under “G” right after Gabun, where it is in the English sorting. Very confusing.

                                      1. 6

                                        This can also be fun for country names. Sending something to someone in France, I had to find the UK in a French-language drop-down. At school, I learned a few variations on how the country name is translated into French, this web site introduced me to a new one.

                                        1. 6

                                          Le Royaume Uni I suppose?

                                          The UK is a hard nut in these forms. I often try a number of options, but I can’t complain when even the Olympic team uses the wrong name (“Team GB” - the UK is not just Great Britain).

                                          1. 1

                                            A bit tangential, but UK government forms really threw me for a loop the first time I used one, as it’s the only place I’ve seen the adjective form of nationality used for the Citizenship/Nationality field. When listing my citizenship for visa/etc. purposes, on most countries’ forms it’s just a drop-down of country names. So usually you can find the USA under U somewhere (United States, USA, U.S.A., etc.). But for gov.uk it was under A for American instead (UK was likewise under B, for British). I’m not too knowledgeable about the details, but I assume this has something to do with the complexities of British nationality.

                                        2. 4

                                          Sure, you just need to find the “язык” dropdown. Should be easy as the currently selected value will be русскийрусский which is obviously wrong.

                                          1. 1

                                            Yes! Languages get closer to nationalities than most other pictograms. I couldn’t know to pick a picture of Spain’s boarders to change language, nor would I know to click on the alphabet (which doesn’t work for languages without alphabets). And flags help. Then, you say what the language actually is in the drop down so you can select it…

                                            Other rejected pictograms: Official bird View from the capitol Airport code Biggest company based there Slowly moving language names

                                        3. 8

                                          As sibling noted, obviously they should be in the native language spelling (or maybe put both). With Spanish being the US’s #2 most spoken language (no official language), should those Spanish speakers not count and find it odd they speak Spanish daily and click the US flag where they live and get English? Should they look for a flag of Spain? Or Mexico? Or their birth country (which is likely missing)? “español” + es is very clear (even if all dialects aren’t yet translated) and doesn’t have the same degree of political baggage as flags and countries do. When people migrate – and they do a lot in the 21st century – their languages come with them because languages belong to the people and flags belong to the nation.

                                          But do you really think people really know their flags? I don’t think this assertion is true. Which of these is Poland: 🇲🇨 🇵🇱 🇮🇩? Romania 🇦🇩 🇲🇩 🇷🇴? Ireland 🇨🇮 🇮🇪? Bolivia 🇧🇴 🇬🇭? Mali 🇸🇳 🇲🇱?


                                          But imagine if a user could send their preferred language through the user-agent and the server or browser could choose a ‘good’ default for them … Accept-Language sounds like a good name for this, maybe even navigator.languages. That would be better than what Google does: ignoring my request and mislabeling me based on IP instead.

                                          1. 3

                                            If you did user research on American Spanish speakers I wonder how many be confused by the American flag being used to denote English. Have you ever tested this?

                                            I think using Accept-Language by default would be a big improvement though it’s not a panacea. To some extent it just punts the issue to the browser. Changing your language in most browsers requires you download a language pack which you won’t have permission to do in internet cafes. Maybe that is no longer a problem now people have smart phones?

                                            1. 4

                                              Changing your language in most browsers requires you download a language pack

                                              changing the Accept-Language header does not require any downloads. It is just a string that gets send. The browser UI stay as is.

                                              1. 1

                                                your browser will use the language defined by the OS 99% of the time

                                                1. 4

                                                  Chrome and Firefox have easy to use setting to change the language header that you send to websites. There is nothing you have to install. You do not need admin rights for that. This has worked like this for the last 2 decades at least. That is what I am referring to.

                                                  If websites ignore the header, that is not a problem of the browser, but our industry.

                                          2. 5

                                            I live in India. We have at least 13 languages that have 10+ million speakers, and hundreds of minor languages in active use by smaller communities. Indian currency notes have text in 15 languages. From what I understand, there are several other countries with this kind of linguistic diversity (Nigeria, Pakistan, Indonesia, to name a few).

                                            Using flags to represent languages is a Western European notion. I personally find it both disrespectful and confusing.

                                            1. 6

                                              Using flags to represent languages is a Western European notion. I personally find it both disrespectful and confusing.

                                              It’s worse than that. It’s not just that it’s a Western European notion, the equivalence of language and country is one that has been specifically pushed by majority groups to marginalise minorities. Ask folks whose native language is Gaelic, Welsh, Breton, or Catalan, for example what they think of the equivalence and you’ll get a very different view.

                                          3. 6

                                            I think that is because they developed it for the European market, as their title suggests, and to illustrate their text with emoji/icons.

                                            1. 5

                                              for the record: the use of flags to signify languages has since been corrected in the article

                                              1. 2

                                                You love to see it :)

                                                1. 8

                                                  nah actually i hated to see it 🙃 but instead of whining here i asked the author to reconsider… and it got fixed

                                              2. 3

                                                The screenshot uses a flag for German/“Deutsch” which I’ve never seen before, and German is my first language :)

                                                1. 4

                                                  To quote the article:

                                                  First and foremost, and this is why this example has been used in this particular post, Revolve has bizarrely ended up with the flag of the United Arab Emirates for German

                                                2. 2

                                                  What’s controversial about the Union Jack representing English, a language born of and primary to that soverign country?

                                                  1. 20

                                                    The Union Flag is the flag of several distinct political entities that have different sets of official languages:

                                                    • England does not have an official language, though practically English is a de-facto standard.
                                                    • Wales has English and Welsh as official languages. All official communications are required to be bilingual and some (such as tax things from HMRC) are bilingual for the whole of the UK as a result.
                                                    • Scotland has recognised Scottish Gaelic as an official language since 2005 and has had English as an official language since before then, though this recognition does not require government communication to be delivered in Gaelic and so has little effect. Scots (derived from Northumbrian Old English) is also supported by the Scottish government.
                                                    • The story of Irish Gaelic is very complicated because the English made an effort to marginalise it for a long time (the history of Ireland is largely omitted in English schools, on the basis that it’s just too embarrassing for the English). It now has similar status in Northern Ireland to Gaelic in Scotland.

                                                    So the flag points to at least three distinct language families and several overlapping ones. Only Wales (which is covered by the flag, but whose flag is not represented, in spite of being the part of the UK with the best flag) has a notion of an official language that carries any significant legal weight and it places English and Welsh on the same level.

                                                    You could probably use the George Cross to represent en_GB, although both Cornish (Celtic-family) and Scots (mostly the same ancestry as modern English, i.e. a creole of every language spoken by folks who invaded England over a period of a thousand years or so) originated in the area represented by that flag. Either way, you’re marginalising speakers of minority languages.

                                                    1. 2

                                                      I didn’t say anything about official languages or political entities, which is almost exactly my point. Primarily, British English is spoken throughout the United Kingdom, the soverign country in which it developed to the standard of English which was then spread throughout the world. The flag points to multiple regions with different languages, none of them as immediately relevant as the English language - you don’t see the Union Jack and think of Cornish. If the language was Scots, use the Scottish flag. If the language is Gaelic, use the Irish flag (or Ulster Banner, lol). To feign shock and horror at the Union Flag representing the history and origin of the English Language is inane.

                                                      1. 6

                                                        If I clicked the Scottish flag, I could be wanting either Scots or Gaelic, as mentioned by david_chisnall. Likewise, if I scanned for the word Gaelic, I’d personally be expecting Gàidhlig, not Irish. When it comes to English, there’s like half a dozen different flags that may have been chosen that I have to scan for (I have seen UK, USA, Canada, England, and Australia, frequently, and probably others less often), and that’s ignoring any personal feelings I have towards any of those. Country flags and $current_language names for other languages just aren’t the best way to display these things for translation pickers, for multiple reasons.

                                                    2. 6

                                                      Two issues:

                                                      1. The UK is by number of speakers, has the sixth most number of speakers. The language may have come from England, but without a standards body, it’s anyone’s language. The other variants of English are still very much valid and a part of the English language. Picking any of the nations is the wrong call.
                                                      2. In the weeds, historically England is the kingdom speaking English so if you want to go on history, 🏴󠁧󠁢󠁥󠁮󠁧󠁿 is the flag you are looking for which isn’t nearly as recognizable. Is this the Georgian flag? 🇬🇪

                                                      How do we avoid this issue? Just say “English” or en.

                                                      1. 4

                                                        It doesn’t reflect all the other kinds of english spoken by the far majority of the world. We even call it “British English” to distinguish it from other flavours of English like American, where there’s a number of spelling and pronounciation differences (these distinctions even get taught in school in non-english speaking countries).

                                                        1. 1

                                                          hunspell lets you choose ‘-ise’ vs ‘-ize’ for British English, en-GB.

                                                          1. 1

                                                            There’s also words that differ between American and British English.

                                                            1. 3

                                                              That part is obvious but I think people forget how much diversity their is inside borders.

                                                              1. 1

                                                                Oh, absolutely. British English is pretty well-known for that since there is a wide variety of English spoken between Scotland and South England.

                                                                Similarly Danish has different amount of grammatical genders between the islands. It is all the same Denmark with the same flag.

                                                          2. 1

                                                            And for American English, a U.S. flag is oft used. Perhaps one should’ve been used in the article, but having not used Steady, I wouldn’t know.

                                                            1. 10

                                                              What language would you expect behind a Belgian flag? French or Flemish? Similar goes for Swiss flag. Or Indian flag.

                                                              1. 3

                                                                What language would you expect behind a Belgian flag? French or Flemish?

                                                                German of course! https://en.wikipedia.org/wiki/German_language#German_Sprachraum ;-)

                                                                BTW, Flemish is a dialect, the official language is Dutch.

                                                                1. 1

                                                                  The language most spoken in Belgium, obviously.

                                                                  1. 2

                                                                    It is a 55% vs 39% percent split, which part do you want to alienate by implying their language isn’t Belgian?

                                                                    1. 2

                                                                      That’s not the implication at all, it’s not making a comment on the validity of the non-majority language.

                                                        1. 2

                                                          Wide gamut and HDR displays are becoming more common and will be increasingly important, so wide gamut and HDR color picking is definitely a topic for further research and development, but it will not be considered here.

                                                          I personally don’t see much purpose in building any further upon sRGB instead of embracing that DCI-P3, et. al. are here now and should be added fromthe get-go. I believe soon enough P3’ll be standard gamut instead of ‘wide’, and HDR will be coming right with it so it feels short-sighted.

                                                          1. 1

                                                            Uninformed pipe dream.

                                                            sRGB is not going anywhere. In fact, scRGB, a “trivial” extension of it, is how HDR is and will be handled.

                                                            Moreover, there isn’t a singular P3. Apple uses Display P3, which uses the gamma curve from sRGB.

                                                            And then there’s the Rec. 2020 colour space, which will eventually make DCI-P3 obsolete. For how long do you want to keep making standards that are just about to become obsolete already?

                                                            scRGB does the wonderful thing of extending sRGB to contain all colours, including those that do not exist, while being compatible with the vast majority of content in existence, and being easy to process.

                                                            I’m not sure how this all relates to the article, though.

                                                            1. 1

                                                              I had not heard of scRGB. You’re right in that I’m not expert. The main complaint is not catering towards wider gamuts and/or HDR in the present regardless of Rec. 2020, et. al. and sticking with current sRGB which noticeably limits color.

                                                              I shoot photos in Adobe RGB and edit in DCI-P3 because this is what my camera and monitor cover, but then exporting to sRGB for ‘web’ means users lose detail they could otherwise see as P3, regardless of gamma, approaches ubiquity. I feel color pickers in general should be already starting to optimize this.

                                                              Aside: sRGB and ‘mixing’ colors is why so many blurs look awful; this is the standard CSS blur and how many CSS adjacent color libraries (like the built-ins for Sass) because of not un-squaring the channels. I may not be an expert in color, but a lot of people know very little.

                                                              1. 2

                                                                Understood. I remember being excited to have a sRGB-compliant display, after having owned awful TN panels.

                                                                Colour pickers… are an interesting problem. You can’t cover the CIE 1931 colour space with only three primaries, so you may need to include non-existing colours, like scRGB does. A fourth one would help (see how CMYK behaves). Also, when the primaries don’t align, your conversion equations will be complicated. And then there’s whitepoint. I must appreciate Apple’s decision to fork DCI-P3.

                                                                Gamma isn’t an “sRGB issue”. Unless you move to higher bit depths, in particular 16-bit, you’ll need that. And yes, most things seem to handle it wrong. Naïve filtered resizing is also wrong, for example. I’ll try to do it correctly in my current project, though it will need considerable effort.

                                                          1. 1

                                                            I’ve used himalaya a bit and have been generally happy with it’s simplicity. I’ve contributed a bit too. My biggest wish still is the ability to at least read and pipe PGP mail to something that can read it if not full decryption in the CLI output or Vim client.

                                                            1. 1

                                                              There is an open issue on that: https://github.com/soywod/himalaya/issues/54, it could be a great feature indeed!

                                                              1. 2

                                                                It’s the last hurdle to cross for my daily-driver use case. I opened a merge request to 0.5.1 in nixpkgs. Can’t wait to try out the new version–especially with the mailto: support!

                                                                1. 1

                                                                  opened an issue* to (I couldn’t figure out how to get the upgrade derivation)

                                                            1. 1

                                                              I hate #4. I don’t hate it because of what the author said, but I hate that most projects that aren’t using an autoformatter tend to have internally inconsistent styles inside files let alone across the project. It’s a) difficult to know which style is ‘correct’ and b) hard to resist to urge to get consistency in the project. It’s not about ‘my preferred style’ but getting consistency. Even something as seemingly innocuous as EditorConfig goes a long way. Am I supposed to leave the trailing whitespace on a single line in the file to keep the diff small, or is this a case where when walking through the forest you should pick up some trash and leave the space better than before you came?

                                                              1. 4

                                                                Anybody else thinks it’s a bit strange this is written in rust? also esbuild is written in go, I think. I mean.. should that not be kind of a red flag for javascript?

                                                                1. 14

                                                                  I mean Lua is written in C. CPython is written in C. Ruby… the list goes on.

                                                                  I heavily embrace writing compilers and parsing tools in languages that can let you eke out performance and are probably better suited for the task!

                                                                  Javascript has loads of advantages, but “every attribute access is a hash table lookup (until the JIT maybe fixes it for you)” seems like a silly cost to pay if you can avoid it for the thing that you really really really want to be fast.

                                                                  Honestly I think the “write stuff in the language it is meant for” has cost so much dev time in the long term. It’s definitely valuable for prototyping and early versions, but for example templating language rendering not being written in tooling that tries to minimize allocations and other things means that everything is probably 3-5x slower than it could be. I get a bunch of hits on a blog post because people just search “pylint slow” in Google so much.

                                                                  Meanwhile we have gotten many languages that are somewhat ergonomic but performant (Rust, to some extend Go or Java as well. Modern C++, kinda?). Obviously Pylint being Python means recruiting contributors is “easier” in theory, but in practice there’s a certain kind of person who works on these tools in general, and they’re probably not too uncomfortable with using many langauges IMO.

                                                                  1. 8

                                                                    Could you elaborate why this is strange?

                                                                    1. 1

                                                                      to me it’s a bit strange that javascript is such an old language but it’s either not so optimized/fast enough for people use it to build/compile javascript, or people don’t want to use it even though they are building a build tool for it?

                                                                      1. 17

                                                                        Javascript has been going through a lot of optimizations, feature additions etc but it’s still a high level interpreted language. Compiling Javascript itself (or anything else) efficiently isn’t really among the primary goals of the language. I see no problem at opting for compiled languages optimized for performance for such a task. This does not diminish the language in my eyes because this is not what the language is designed for. Javascript may be terrible for a lot of reasons but this is not really a red flag for me.

                                                                        1. 7

                                                                          See Why is esbuild fast? for some fundamental JavaScript flaws for this kind of workload.

                                                                          1. 1

                                                                            Thanks for that, it’s interesting, though that was kind of my point.

                                                                          2. 4

                                                                            Age of the language doesn’t make it fast or slow, neither make it more or less optimised. Rust and Go will be faster than JS mostly, because these do not need to have support for many of the JS features, that make it hard to compile to native code - runtime reflection on anything for example.

                                                                        2. 8

                                                                          Producing code that executes quickly is just one of a large number of possible goals for a language. It is especially a goal for rust, but it’s not a priority for javascript.

                                                                          This is perfectly normal. Languages that do prioritise speed of execution of the produced code make other trade-offs that would not be palatable to javascript use cases. The fact that someone is writing a bundler for javascript in another language is more a sign of the value that javascript brings, even to people familiar with other technologies.

                                                                          1. 3

                                                                            JS is pretty fast when you stay on the optimal path, which is very tricky to do for anything bigger than a single hot loop. You usually need to depend on implementation details of JIT engines, and shape your code to their preference, which often results in convoluted code (e.g. hit a sweet spot of JIT’s inlining and code caching heuristics, avoid confusing escape analysis, don’t use objects that create GC pressure).

                                                                            OTOH Rust is compiled ahead of time, and its language constructs are explicitly designed to be low-level and optimize in a predictable way. You don’t fight heuristics of GC and JIT optimization tiers. It’s easy to use stack instead of the heap, control inlining, indirections, dynamic dispatch. There’s tooling to inspect compiled code, so you can have a definitive answer whether some code is efficient or not.

                                                                            Rust is a more fitting tool for high-performance parsing.

                                                                            1. 3

                                                                              Is v8 being written in C++ a red flag too?

                                                                              1. 1

                                                                                Or SpiderMonkey in C, C++, and Rust

                                                                              2. 1

                                                                                Not really. Idiomatic JS code for this kind of workload will generate a lot of junk for the collector, and there’s also the matter of binding to various differing native APIs for file monitoring.

                                                                              1. 3

                                                                                I have to wonder if the issues the author describes (if I understand them correctly) are due to hype-chasing behavior more than Javascript or its ecosystem. I’ve been developing applications using the same runtimes and libraries since node 0.10 and React 0.8. I can think of two major breaking changes in that time (constructing Buffers in node, and the deprecation of React.createClass). Unless you’re constantly chasing the next great thing there just isn’t that much churn. Maybe the problem is more of a discoverability issue, finding the right libraries to rely on?

                                                                                1. 3

                                                                                  I sort of recognize the problem but at the same time not. Some projects are rock-solid like you said, with React being a shining example.

                                                                                  However, speaking of churn, there is a pattern in the JS ecosystem where older projects get abandoned as soon as someone comes up with a new way of doing things. For example, before people settled (for how long remains to be seen) on Webpack there was a lot of churn in the JS build system space.

                                                                                  On one hand, starting over might be the fastest way to get a new idea to market. On the other hand, this creates a lot of double work and bad experiences for users who have to learn a new system.

                                                                                  It’s been a while since I last looked into this, but this article lists five different Webpack alternatives: https://blog.logrocket.com/the-top-latest-build-tools-for-javascript/

                                                                                  Did we really need five? Couldn’t some of these have been contributions to Webpack instead?

                                                                                  1. 2

                                                                                    Yeah we do need Webpack alternatives because despite having sizeable buy-in, it’s

                                                                                    • littered with arcane config that isn’t declarative
                                                                                    • can’t handle the most basic front-end like CSS files (why at v5 do I still need a fork in my configuration to load MiniCssExtract plugin where it’s configured in one place and a ‘loader’ in another just to get a CSS file instead of a JS one in my build tool?)
                                                                                    • not their fault but a lot of the plugins are quite low quality with many dependencies including dowloading random, incompatible binaries from the internet
                                                                                    • and it’s slow because in its generation, all JavaScript tooling had to be built in JavaScript. While V8 (and the other engines not for Node) are highly optimized, it’s not great for massive text parsing

                                                                                    I’m happy to see the new generation of tooling built in faster options like Rust, Go, Zig, et. al.

                                                                                    1. 1

                                                                                      But did we really need five of them?

                                                                                      1. 2

                                                                                        Give it some time. There was 10^8 frameworks til React got standardized, then only a small number could compete with what it was doing. It would seem esbuild and those built atop it (e.g. Snowpack) may be poised to overthrow Webpack’s dominance in a new wave.

                                                                                        Prior to tools like Parcel made some parts easier and some harder making a switch a tossup. Parcel is faster, but not an order of magnitude like esbuild and Parcel comes with so many dependencies and requires the brittle node-gyp.

                                                                                1. 5

                                                                                  I get really concerned about the accessibility situation as browsers can go a great job if developers put in the time, but all of that effort will go down the drain if everything is tossed in a <canvas> tag.

                                                                                  1. 3

                                                                                    Yes, and then very big developers (like Google’s Docs team) will be able to implement accessibility within their canvas-based apps, but smaller developers won’t have the resources. This is already a problem with web apps that use JavaScript to re-implement browser functionality: they must also re-implement accessibility for that functionality, which only larger or more motivated teams actually do. But “drop the DOM and do everything by hand in <canvas>” takes everything to the next level.

                                                                                  1. 1

                                                                                    Comparing AVIF to PNG is funny, better to compare to a competitor like WebP

                                                                                    1. 1

                                                                                      This release note is specifically about image support in elements. AV1 support has already existed for a while.

                                                                                      1. 2

                                                                                        WebP is an image format. Are you thinking of WebM?

                                                                                        1. 1

                                                                                          Ahahahha, yeah. Thanks.

                                                                                    1. 104

                                                                                      I’m not a big fan of pure black backgrounds, it feels a bit too « high contrast mode » instead of « dark mode ». I think a very dark gray would feel better to the eye. n=1 though, that’s just a personal feeling.

                                                                                      Thanks for the theme, it’s still great!

                                                                                      1. 29

                                                                                        Agreed, background-color: #222 is better than #000.

                                                                                        1. 15

                                                                                          I’ll just put my +1 here. The pure black background with white text isn’t much better than the opposite to me (bright room, regular old monitor). I’ve been using a userstyle called “Neo Dark Lobsters” that overall ain’t perfect, but is background: #222, and I’ll probably continue to use it.

                                                                                          On my OLED phone, pure black probably looks great, but that’s the last place I’d use lobste.rs, personally.

                                                                                          1. 18

                                                                                            Well, while we’re bikeshedding: I do like true black (especially because I have machines with OLED displays, but it’s also a nice non-decision, the best kind of design decision), but the white foreground here is a bit too intense for my taste. I’m no designer, but I think it’s pretty standard to use significantly lower contrast foregrounds for light on dark to reduce the intensity. It’s a bit too eye-burney otherwise.

                                                                                            1. 7

                                                                                              You have put your finger on something I’ve seen a few times in this thread: The contrast between the black background and the lightest body text is too high. Some users’ wishes to lighten the background are about that, and others’ are about making the site look like other dark mode windows which do not use pure black, and therefore look at home on the same screen at the same time. (Both are valid.)

                                                                                              1. 10

                                                                                                For me pure white and pure black is accessibility nightmare: that high contrast triggers my dyslexia and text starts to jump around, which starts inducing migraine.

                                                                                                As I default to dark themes systemwide and I couldn’t find way to override detected theme, this site is basically unusable for me right now. Usually in these cases I just close the tab and never come back, for this site I decided type this comment before doing that. Maybe some style change happens, manual override is implemented or maybe I care enough to setup user stylesheet.. but otherwise my visits will stop

                                                                                                1. 1

                                                                                                  No need to be so radical, you still have several options. Not sure what browser you’re using, but Stylus is available for Chrome/FF:

                                                                                                  https://addons.mozilla.org/en-US/firefox/addon/styl-us/

                                                                                                  It allows to override the stylesheet for any website with just a few clicks (and few CSS declarations ;))

                                                                                                  1. 9

                                                                                                    I don’t mind the comment. There’s a difference between being radical because of a preference and having an earnest need. Access shouldn’t require certain people to go out of their way on a per-website basis.

                                                                                                    1. 6

                                                                                                      It’s not radical, it’s an accessibility problem.

                                                                                              2. 8

                                                                                                That’s great, thank you.

                                                                                                I wonder if I am an outlier in using the site on my phone at night frequently. Alternatively, maybe we could keep the black background only for the mobile style, where it’s more common to have an OLED screen and no other light sources in your environment.

                                                                                                1. 2

                                                                                                  I don’t use my phone much, especially not for reading long-form content, so I wouldn’t be surprised if I was the outlier. That sounds like a reasonable solution, but it’s not going to affect me (since I can keep using a userstyle), so I won’t push either way. I will +1 the lower-contrast comments that others have posted, if it remains #000 though - the blue links are intense.

                                                                                                  1. 1

                                                                                                    The blue link color brightness is a point that not many have made. I think the reason I didn’t expect it is that I usually use Night Shift on my devices, which makes blue light less harsh at night. Do you think we should aim to solve this problem regardless of whether users apply nighttime color adjustment? Another way to ask this question: What do you think about dark mode blue links in the daytime?

                                                                                                    1. 2

                                                                                                      Sorry if I’m misunderstanding, but to clarify, my above comment is in a bright room; I try to avoid looking at screens in dim light/darkness. The blue links just look kind of dark, and intensely blue. Just a wee reduction in saturation or something makes it easier to read.

                                                                                                      Thanks for your work on this btw. I looked into contributing something a while back, but was put off after it looked like the previous attempt stalled out from disagreement. I’d take this over the bright white any day (and it turns out this really is nice on my phone, dark blue links withstanding). The css variables also make it relatively easy for anyone here to make their own tweaks with a userstyle.

                                                                                                      I feel like I’ve taken up enough space complaining here, so I’ll leave a couple nitpicks then take my leave: the author name colour is a little dark (similar to links, it’s dark blue on black), and the byline could do with a brightness bump to make it more readable, especially when next to bright white comment text.

                                                                                                      1. 1

                                                                                                        I appreciate the clarification and other details :)

                                                                                                  2. 1

                                                                                                    My laptop is OLED and I’d still appreciate #000 there

                                                                                                    1. 1

                                                                                                      +1 to separate mobile style.

                                                                                                  3. 4

                                                                                                    I strongly agree.

                                                                                                    I can’t put my finger on why, but I find very dark gray easier.

                                                                                                    1. 1

                                                                                                      #222 is way better! thank you

                                                                                                    2. 14

                                                                                                      I strongly disagree, and this black background looks and feels great to me! No one can ever seem to agree on the exact shade or hue of grey in their dark themes, so if you have the general UI setting enabled, you end up with a mishmash of neutral, cooler, hotter, and brighter greys that don’t look cohesive at all. But black is always black!

                                                                                                      For lower contrast, I have my text color set to #ccc in the themes I have written.

                                                                                                      1. 6

                                                                                                        Another user pointed out that pure black is pretty rare in practice, which makes this site stand out in an environment with other dark mode apps:

                                                                                                        Here’s a desktop screenshot with lobste.rs visible - notice that it’s the only black background on the screen.

                                                                                                        Does that affect your opinion like it did mine? I do see value in pure black, but suppose we treated the too-high-contrast complaint as a separate issue: Darkening the text could make the browser window seem too dim among the other apps.

                                                                                                        1. 3

                                                                                                          I prefer the black even in that scenario. The contrast makes it easier to read imo.

                                                                                                          1. 2

                                                                                                            Not all. If it gets swapped out for grey I will simply go back to my custom css, which I have used to black out most of the sites I visit, so no hard feelings.

                                                                                                        2. 8

                                                                                                          Feedback is most welcome! Would you please include the type of screen you’re using (OLED phone, TFT laptop…) and the lighting environment you’re in (dark room, daytime indoors with a window, etc.)? And do you feel differently in different contexts?

                                                                                                          I’ve got some comments about how I selected the colors in the PR, if that helps anyone think through what they would prefer.

                                                                                                          1. 4

                                                                                                            Sure! I’m on my iPhone 12 so OLED phone. I tried in with dimmed lights and in the dark, but in both cases I think I’d prefer a lighter background color.

                                                                                                          2. 7

                                                                                                            I disagree. Black is black. These off-gray variants just looks dirty and wrong to me.

                                                                                                            I love this theme.

                                                                                                          1. 8

                                                                                                            A local font stack is all well and good, but Helvetica and Arial, et al are just…well…boring.

                                                                                                            This is my only disagreement with the article. I prefer to just use the user’s default font. Sure, that is boring but I personally don’t find much value in every site having their own “exciting” font. I just want to see my nice, readable default font almost everywhere. (Some things like games have a reasonable excuse to use their own.)

                                                                                                            So drop the font stack altogether and just leave the default. Or if you really must font: sans-serif (or serif). Or the newfangled ui-sans-serif (if I remember that correctly).

                                                                                                            Of course the downside is that a lot of browsers use garbage default fonts by default…

                                                                                                            1. 8

                                                                                                              Of course the downside is that a lot of browsers use garbage default fonts by default…

                                                                                                              This is the real underlying problem. The overwhelming vast majority of users don’t even know they can change the default font much less know how to.

                                                                                                              1. 6

                                                                                                                100%. Which is super disappointing because it would take browsers very little effort to fix.

                                                                                                                Firefox doesn’t even default to my system font by default (which is quite nice) so I need to teach it to follow my system font which ~0% of users will do.

                                                                                                              2. 7

                                                                                                                Helvetica and Arial, et al are just…well…boring.

                                                                                                                Boring is good! Most of the time, typography’s job is to get out of the way. Browser-default sans-serif is usually what you want, with a slight bump to the size.

                                                                                                                1. 4

                                                                                                                  If everyone needs to bump the size maybe we should petition browsers to make the default bigger…

                                                                                                                  1. 2

                                                                                                                    Agree! font-size: 16pt; is a much better default.

                                                                                                                2. 4

                                                                                                                  I just want to see my nice, readable default font almost everywhere.

                                                                                                                  This is why I disable custom fonts entirely i my browser. Makes me laugh when a bad website (looking at anything created by Google) uses idiotic icon fonts, but whatever, those sites aren’t worth using anyway.

                                                                                                                  1. 2

                                                                                                                    I’ve done this on-and-off but I’m not completely sold. Luckily icon fonts are somewhat falling out of style but I think there are legitimate uses for custom fonts, especially for things that are more wacky and fun. I think it is just a shame that they are abused (IMHO) on just about every website.

                                                                                                                    1. 4

                                                                                                                      Not somewhat. Fonts for icons have not been a recommended practice in since 2014 when the people shifted to SVG icons via symbols. Prevalence is likely devs that learned about icon fonts at one point, especially in the past when IE compatibility took away many options, and those people do not do enough front-end to bother keeping up with most trends.

                                                                                                                  2. 3

                                                                                                                    The people who think to change their browser’s default font are probably the same people who can figure out how to force websites to use the default font.

                                                                                                                    Shipping a font with a site is the same as any other styling: helpful for the average user, overridable by the power user.

                                                                                                                    1. 2

                                                                                                                      I’m kind of interested right now in both improving my website’s typography and getting rid of things like background images and web fonts. The page is already pretty light, but it can be lighter, and I’m questioning the value of the fonts I’m using. I do want to exercise some choice in fonts, though. The ui-sans-serif (etc) look like good options, but so far they’re only supported on Safari. I’m probably going to do some research on a local font stack that doesn’t include awful fonts like Helvetica and Times New Roman, has a reasonable chance of working cross-platform, and falls back to serif, sans-serif, and monospace.

                                                                                                                      1. 4

                                                                                                                        I don’t know that many people think Helvetica is “awful”.

                                                                                                                        Just cut things. Cut the background images entirely; replace with a nice single color. Start by cutting all the web fonts: specify serif and sans-serif and no more than four or five sizes of each. Make sure your margins are reasonable and text column widths are enjoyable. How many colors are you using? Is there enough contrast?

                                                                                                                        Once you’ve stripped everything back to a readable, comfortable page, see what you actually need to distinguish yourself rather that trying a bunch of trends. What image are you trying to project? Classic and authoritative? Modern? Comedic? Simple? Fashionable? Pick one approach and try to align things to that feel.

                                                                                                                        1. 1

                                                                                                                          Helvetica and Times New Roman are de facto standards for a reason. They’re solid, utilitarian typefaces. I wish more sites used them.

                                                                                                                      1. 2

                                                                                                                        Very happy with pure black. On OLED context looks ideal and while a very small difference to dark gray, pure black saves a little more power which saves battery and helps reduce general power usuage everywhere. +1 for the planet.

                                                                                                                        Now if Lobsters could get the bare minimum Web App Manifest file to get Android browsers to display an Install prompt. Save to homesceen isn’t the experience I want as the browser relaunches to the index instead of taking me back to the tab I had open.

                                                                                                                        1. 3

                                                                                                                          Really enjoyed this article:

                                                                                                                          The thing in the end is that the GNU project and the FSF strike to me as very cultish and immensely insecure. Hey, guys, if you’re still reading me over there in Massachussetts… You did a great job and were a key actor in us getting what we’ve got today… But know your place and write good software. And don’t give unsuspecting newcomers such a biased version of the story that only serves your interests… mmokay?

                                                                                                                          I mean, they ARE! They are, or at least were since I’ve lost touch over the last couple years, a cult of personality around RMS and the myth that the GPL is the ONLY way to actually protect free software from the evil seed Capitalism!

                                                                                                                          There’s actually some value I see in having the GPL around, but I am 1000% with the author in that the FLOSS community should be looking at ways to move away from GNU software and towards efforts with more permissive licenses and less problematic leadership.

                                                                                                                          1. 10

                                                                                                                            I mean, if you put words in the mouth of everyone who likes the GPL, then sure, it’s a cult of personality. I think a lot of people like GPL because of its strong copyleft, which till date seems to be the best way to keep OSS projects relatively free of corporate parasitism. We don’t actually care about FSF/RMS, they did their jobs, now we can carry on with Free Software.

                                                                                                                            1. 4

                                                                                                                              To be fair, feoh described the FSF as a cult of personality, not “all GPL fans”.

                                                                                                                              They didn’t even criticise the GPL or suggest we should stop using it (just “GNU software” - to which I agree, largely because it was almost all written in a cooperative-computing environment where malicious actors either did not exist or were the owners of the computer).

                                                                                                                            2. 5

                                                                                                                              There’s actually some value I see in having the GPL around, but I am 1000% with the author in that the FLOSS community should be looking at ways to move away from GNU software and towards efforts with more permissive licenses and less problematic leadership.

                                                                                                                              Given how only in the last years we had drama with big companies eating smaller companies lunch and the smaller company relicensing their code to some proprietary license, on the contrary, we should probably switch to licenses like AGPL to alleviate the situation. Massive companies profit from free work in permissive licenses and don’t have to give anything back and that’s just a distorted power relationship that’s getting more and more obvious.

                                                                                                                              1. 2

                                                                                                                                Still waiting for the not-to-be-used-in-closed-source-training-data clause.

                                                                                                                                1. 2

                                                                                                                                  Just my $.02 and full disclosure I’m an Amazon employee but don’t represent them in this post…

                                                                                                                                  I think the lesson here is that authors need to think VERY carefully about the licenses they use. The AGPL seems like a good solution if they want to avoid large companies adding value to the overall ecosystem in ways they see as hurting their bottom line.

                                                                                                                                  There’s something to be said for ultra-permissive licensing however, because that drives adoption in use cases that would be otherwise precluded, so it’s all about making good choices I think.

                                                                                                                                  1. 3

                                                                                                                                    The AGPL seems like a good solution if they want to avoid large companies adding value to the overall ecosystem in ways they see as hurting their bottom line.

                                                                                                                                    this is a hilariously uncharitable way to describe the AGPL. “know your place and write good software” is also a comical thing to say to free authors. they aren’t value machines that you can milk to appease $LARGE_EMPLOYER, they’re people with thoughts and feelings and maybe even political opinions, that they’re allowed to express.

                                                                                                                                    1. 1

                                                                                                                                      Hi. IANAL. I know very little about open source licensing and was replying to @yawaramin ’s post where he cited that as a desirable alternative.

                                                                                                                                      And I agree free software authors shouldn’t be “milked” but corporations are a-moral entities whose role is to generate profit for shareholders. The topic under discussion is how to protect authors from being treated in ways they see as undesirable. I’m not sure how to place your comment within the original context.

                                                                                                                                      1. 2

                                                                                                                                        right, so if your goal is not to be treated in an undesirable way by an entity that lacks morals by construction, wouldn’t you want a more restrictive license? not seeing where the AGPL/GNU fit in as wrongdoers here

                                                                                                                                        1. 1

                                                                                                                                          They’re not at all! AGPL is a somewhat restrictive license which some people might not prefer because of the ways it restricts the use of the code.

                                                                                                                                          1. 2

                                                                                                                                            ah, sorry. I read your original post as hostile towards people who prefer the AGPL over other licenses, totally my fault.

                                                                                                                              1. 2

                                                                                                                                Conditional compilation looks super cool. I wonder how messy it gets as the number of supported targets increases. PureScript has had to have had the entire package-sets forked to support Purerl (Erlang). It seems they keep the JS FFI code to mirror its implementation in Erlang, but a lot of libraries might be easier to maintain with these conditionals.

                                                                                                                                1. 4

                                                                                                                                  It’s already a bit messy in the standard library, but I’m hoping that most libraries won’t need to use conditional compilation at all. There’s no plans for other targets and there’s only to be one package repository so that’ll help.

                                                                                                                                  If it becomes an issue we’ll revisit this before v1.

                                                                                                                                1. 17

                                                                                                                                  Pattern matching has been available in functional programming languages for decades now, it was introduced in the 70s. (Logic programming languages expose even more expressive forms, at higher runtime cost.) It obviously improves readability of code manipulating symbolic expressions/trees, and there is a lot of code like this. I find it surprising that in the 2020s there are still people wondering whether “the feature provides enough value to justify its complexity”.

                                                                                                                                  (The fact that Python did without for so long was rather a sign of closed-mindedness of its designer subgroup. The same applies, in my opinion, to languages (including Python, Go, etc.) that still don’t have proper support for disjoint union types / variants / sums / sealed case classes.)

                                                                                                                                  1. 45

                                                                                                                                    Pretty much every feature that has ever been added to every language ever is useful in some way. You can leave a comment like this on almost any feature that a language may not want to implement for one reason or the other.

                                                                                                                                    1. 14

                                                                                                                                      I think it makes more sense in statically typed languages, especially functional ones. That said, languages make different choices. For me, Python has always been about simplicity and readability, and as I’ve tried to show in the article, at least in Python, structural pattern matching is only useful in a relatively few cases. But it’s also a question of taste: I really value the simplicity of the Go language (and C before it), and don’t mind a little bit of verbosity if it makes things clearer and simpler. I did some Scala for a while, and I can see how people like the “power” of it, but the learning curve of its type system was very steep, and there were so many different ways to do things (not to mention the compiler was very slow, partly because of the very complex type system).

                                                                                                                                      1. 22

                                                                                                                                        For the record, pattern-matching was developed mostly in dynamically-typed languages before being adopted in statically-typed languages, and it works just as well in a dynamically-typed world. (In the ML-family world, sum types and pattern-matching were introduced by Hope, an experimental dynamically-typed language; in the logic world, they are basic constructs of Prolog, which is also dynamically-typed – although some more-typed dialects exist.)

                                                                                                                                        as I’ve tried to show in the article, at least in Python, structural pattern matching is only useful in a relatively few cases

                                                                                                                                        Out of the 4 cases you describe in the tutorial, I believe your description of two of them is overly advantageous to if..elif:

                                                                                                                                        • In the match event.get() case, the example you show is a variation of the original example (the longer of the three such examples in the tutorial), and the change you made makes it easier to write an equivalent if..elif version, because you integrated a case (from another version) that ignores all other Click() events. Without this case (as in the original tutorial example), rewriting with if..elif is harder, you need to duplicate the failure case.
                                                                                                                                        • In the eval_expr example, you consider the two versions as readable, but the pattern-version is much easier to maintain. Consider, for example, supporting operations with 4 or 5 parameters, or adding an extra parameter to an existing operator; it’s an easy change with the pattern-matching version, and requires boilerplate-y, non-local transformations with if..elif. These may be uncommon needs for standard mathematical operations, but they are very common when working with other domain-specific languages.
                                                                                                                                        1. 1

                                                                                                                                          the change you made makes it easier to write an equivalent if..elif version

                                                                                                                                          Sorry if it appeared that way – that was certainly not my intention. I’m not quite sure what you mean, though. The first/original event example in the tutorial handles all click events with no filtering using the same code path, so it’s even simpler to convert. I added the Button.LEFT filtering from a subsequent example to give it a bit more interest so it wasn’t quite so simple. I might be missing something, though.

                                                                                                                                          In the eval_expr example, you consider the two versions as readable, but the pattern-version is much easier to maintain. Consider, for example, supporting operations with 4 or 5 parameters, or adding an extra parameter to an existing operator;

                                                                                                                                          I think those examples are very hypothetical – as you indicate, binary and unary operators aren’t suddenly going to support 4 or 5 parameters. A new operation might, but that’s okay. The only line that’s slightly repetitive is the “attribute unpacking”: w, x, y, z = expr.w, expr.x, expr.y, expr.z.

                                                                                                                                          These may be uncommon needs for standard mathematical operations, but they are very common when working with other domain-specific languages.

                                                                                                                                          You’re right, and that’s part of my point. Python isn’t used for implementing compilers or interpreters all that often. That’s where I’m coming from when I ask, “does the feature provide enough value to justify the complexity?” If 90% of Python developers will only rarely use this complex feature, does it make sense to add it to the language?

                                                                                                                                          1. 3

                                                                                                                                            that was certainly not my intention.

                                                                                                                                            To be clear, I’m not suggesting that the change was intentional or sneaky, I’m just pointing out that the translation would be more subtle.

                                                                                                                                            The first/original event example does not ignore “all other Click events” (there is no Click() case), and therefore an accurate if..elif translation would have to do things differently if there is no position field or if it’s not a pair, namely it would have to fall back to the ValueError case.

                                                                                                                                            You’re right, and that’s part of my point. Python isn’t used for implementing compilers or interpreters all that often.

                                                                                                                                            You don’t need to implement a compiler for C or Java, or anything people recognize as a programming language (or HTML or CSS, etc.), to be dealing with a domain-specific languages. Many problem domains contain pieces of data that are effectively expressions in some DSL, and recognizing this can very helpful to write programs in those domains – if the language supports the right features to make this convenient. For example:

                                                                                                                                            • to start with the obvious, many programs start by interpreting some configuration file to influence their behavior; many programs have simple needs well-served by linear formats, but many programs (eg. cron jobs, etc.) require more elaborate configurations that are DSL-like. Even if the configuration is written in some standard format (INI, Yaml, etc.) – so parsing can be delegated to a library – the programmer will still write code to interpret or analyze the configuration data.
                                                                                                                                            • more gnerally, “structured data formats” are often DSL-shaped; ingesting structured data is something we do super-often in programs
                                                                                                                                            • programs that offer a “query” capability typically provide a small language to express those queries
                                                                                                                                            • events in an event loop typically form a small language
                                                                                                                                        2. 14

                                                                                                                                          I think it makes more sense in statically typed languages, especially functional ones.

                                                                                                                                          In addition to the earlier ones gasche mentioned (it’s important to remember this history), it’s used to pervasively in Erlang, and later Elixir. Clojure has core.match, Racket has match, as does Guile. It’s now in Ruby as well!

                                                                                                                                          1. 3

                                                                                                                                            Thanks! I didn’t know that. I have used pattern matching in statically typed language (mostly Scala), and had seen it in the likes of Haskell and OCaml, so I’d incorrectly assumed it was mainly a statically-typed language thing.

                                                                                                                                            1. 1

                                                                                                                                              It is an important feature of OCaml.

                                                                                                                                              1. 3

                                                                                                                                                I am aware - was focusing on dynamically typed languages.

                                                                                                                                            2. 7

                                                                                                                                              For me, it is the combination of algebraic data types + pattern matching + compile time exhaustiveness checking that is the real game changer. With just 1 out of 3, pattern matching in Python is much less compelling.

                                                                                                                                              1. 1

                                                                                                                                                I agree. I wonder if they plan to add exhaustiveness checking to mypy. The way the PEP is so no hold barred makes it seem like the goal was featurefulness and not an attempt to support exhaustiveness checking.

                                                                                                                                                1. 2

                                                                                                                                                  I wonder if they plan to add exhaustiveness checking to mypy.

                                                                                                                                                  I don’t think that’s possible in the general case. If I understand the PEP correctly, __match_args__ may be a @property getter method, which could read the contents of a file, or perform a network request, etc.

                                                                                                                                            3. 11

                                                                                                                                              I find it surprising that in the 2020s there are still people wondering whether “the feature provides enough value to justify its complexity”.

                                                                                                                                              I find it surprising that people find this surprising.

                                                                                                                                              Adding features like pattern matching isn’t trivial, and adding it too hastily can backfire in the long term; especially for an established language like Python. As such I would prefer a language take their time, rather than slapping things on because somebody on the internet said it was a good idea.

                                                                                                                                              1. 3

                                                                                                                                                That’s always been the Scheme philosophy:

                                                                                                                                                Programming languages should be designed not by piling feature on top of feature, but by removing the weaknesses and restrictions that make additional features appear necessary.

                                                                                                                                                And indeed, this pays off: in the Scheme world, there’s been a match package floating around for a long time, implemented simply as a macro. No changes to the core language needed.

                                                                                                                                                1. 4

                                                                                                                                                  No changes to the core language needed.

                                                                                                                                                  I’m sure you recognize that this situation does not translate to other languages like in this case Python. Implementing it as a macro is just not feasible. And even in Scheme the usage of match macros is rather low. This can be because it is not that useful, but also might be because of the hurdle of adding dependencies is not worth the payoff. Once a feature is integrated in a language, its usage “costs” nothing, thus the value proposition when writing code can be quite different.

                                                                                                                                                  1. 7

                                                                                                                                                    This is rather unrelated to the overall discussion, but as a user of the match macros in Scheme, I must say that I find the lack of integration into the base forms slightly annoying. You cannot pattern-match on a let or lambda, you have to use match-let and match-lambda, define/match (the latter only in Racket I think), etc. This makes reaching for pattern-matching feel heavier, and it may be a partial cause to their comparatively lower usage. ML-family languages generalize all binding positions to accept patterns, which is very nice to decompose records for example (or other single-case data structures). I wish Scheme dialects would embrace this generalization, but they haven’t for now – at least not Racket or Clojure.

                                                                                                                                                    1. 2

                                                                                                                                                      In the case of Clojure while it doesn’t have pattern matching built-in, it does have quite comprehensive destructuring forms (like nested matching in maps, with rather elaborate mechanisms) that works in all binding positions.

                                                                                                                                                      1. 2

                                                                                                                                                        Nice! I suppose (from your post above) that pattern-matching is somehow “integrated” in the Clojure implementation, rather than just being part of the base macro layer that all users see.

                                                                                                                                                        1. 2

                                                                                                                                                          I think the case is that Clojure core special forms support it (I suppose the implementation itself is here and called “binding-forms”, which is then used by let, fn and loop which user defined macros often end up expanding to). Thus it is somewhat under the base layer that people use.

                                                                                                                                                          But bear in mind this is destructuring, in a more general manner than what Python 2.x already supported, not pattern matching. It also tends to get messy with deep destructuring, but the same can be said of deep pattern matches through multiple layers of constructors.

                                                                                                                                              2. 8

                                                                                                                                                I agree about pattern matching and Python in general. It’s depressing how many features have died in python-ideas because it takes more than a few seconds for an established programmer to grok them. Function composition comes to mind.

                                                                                                                                                But I think Python might be too complicated for pattern matching. The mechanism they’ve settled on is pretty gnarly. I wrote a thing for pattern matching regexps to see how it’d turn out (admittedly against an early version of the PEP; I haven’t checked it against the current state) and I think the results speak for themselves.

                                                                                                                                                1. 6

                                                                                                                                                  But I think Python might be too complicated for pattern matching. The mechanism they’ve settled on is pretty gnarly.

                                                                                                                                                  I mostly agree. I generally like pattern matching and have been excited about this feature, but am still feeling out exactly when I’ll use it and how it lines up with my intuition.

                                                                                                                                                  The part that does feel very Pythonic is that destructuring/unpacking is already pretty pervasive in Python. Not only for basic assignments, but also integrated into control flow constructs. For example, it’s idiomatic to do something like:

                                                                                                                                                  for key, val in some_dictionary.items():
                                                                                                                                                      # ...
                                                                                                                                                  

                                                                                                                                                  Rather than:

                                                                                                                                                  for item in some_dictionary.items():
                                                                                                                                                      key, val = item
                                                                                                                                                      # ...
                                                                                                                                                  

                                                                                                                                                  Or something even worse, like explicit item[0] and item[1]. So the lack of a conditional-with-destructuring, the way we already have foreach-with-destructuring, did seem like a real gap to me, making you have to write the moral equivalent of code that looks more like the 2nd case than the 1st. That hole is now filled by pattern matching. But I agree there are pitfalls around how all these features interact.

                                                                                                                                                2. 2
                                                                                                                                                  for i, (k, v) in enumerate(d.items(), 1): pass
                                                                                                                                                  

                                                                                                                                                  looks like pattern matching to me

                                                                                                                                                  1. 2

                                                                                                                                                    Go aims for simplicity of maintenance and deployment. It doesn’t “still don’t have those features”. The Go authors avoided them on purpose. If you want endless abstractions in Go, embedding Lisp is a possibilty: https://github.com/glycerine/zygomys

                                                                                                                                                    1. 5

                                                                                                                                                      Disjoint sums are a basic programming feature (it models data whose shape is “either this or that or that other thing”, which ubiquitous in the wild just like pairs/records/structs). It is not an “endless abstraction”, and it is perfectly compatible with maintenance and deployment. Go is a nice language in some respects, the runtime is excellent, the tooling is impressive, etc etc. But this is no rational excuse for the lack of some basic language features.

                                                                                                                                                      We are in the 2020s, there is no excuse for lacking support for sum types and/or pattern matching. Those features have been available for 30 years, their implementation is well-understood, they require no specific runtime support, and they are useful in basically all problem domains.

                                                                                                                                                      I’m not trying to bash a language and attract defensive reactions, but rather to discuss (with concrete examples) the fact that language designer’s mindsets can be influenced by some design cultures more than others, and as a result sometimes the design is held back by a lack of interest for things they are unfamiliar with. Not everyone is fortunate to be working with a deeply knowledgeable and curious language designer, such as Graydon Hoare; we need more such people in our language design teams. The default is for people to keep working on what they know; this sort of closed-ecosystem evolution can lead to beautiful ideas (some bits of Perl 6 for example are very nice!), but it can also hold back.

                                                                                                                                                      1. 3

                                                                                                                                                        But this is no rational excuse for the lack of some basic language features.

                                                                                                                                                        Yes there is. Everyone has a favorite feature, and if all of those are implemented, there would easily be feature bloat, long build times and projects with too many dependencies that depend on too many dependencies, like in C++.

                                                                                                                                                        In my opinion, the question is not if a language lacks a feature that someone wants or not, but if it’s usable for goals that people wish to achieve, and Go is clearly suitable for many goals.

                                                                                                                                                    2. 3

                                                                                                                                                      Ah yes, Python is famously closed-minded and hateful toward useful features. For example, they’d never adopt something like, say, list comprehensions. The language’s leaders are far too closed-minded, and dogmatically unwilling to ever consider superior ideas, to pick up something like that. Same for any sort of ability to work with lazy iterables, or do useful combinatoric work with them. That’s something that definitely will never be adopted into Python due to the closed-mindedness of its leaders. And don’t get me started on basic FP building blocks like map and folds. It’s well known that Guido hates them so much that they’re permanently forbidden from ever being in the language!

                                                                                                                                                      (the fact that Python is not Lisp was always unforgivable to many people; the fact that it is not Haskell has now apparently overtaken that on the list of irredeemable sins; yet somehow we Python programmers continue to get useful work done and shrug off the sneers and insults of our self-proclaimed betters much as we always have)

                                                                                                                                                      1. 25

                                                                                                                                                        It is well-documented that Guido Van Rossum planned to remove lambda from Python 3. (For the record, I agree that map and filter on lists are much less useful in presence of list comprehensions.) It is also well-documented that recursion is severely limited in Python, making many elegant definitions impractical.

                                                                                                                                                        Sure, Python adopted (in 2000 I believe?) list comprehensions from ABC (due to Guido working with the language in the 1980s), and a couple of library-definable iterators. I don’t think this contradicts my claim. New ideas came to the language since (generators, decorators), but it remains notable that the language seems to have resisted incorporating strong ideas from other languages. (More so than, say, Ruby, C#, Kotlin, etc.)

                                                                                                                                                        Meta: One aspect of your post that I find unpleasant is the tone. You speak of “sneers and insults”, but it is your post that is highly sarcastic and full of stray exagerations at this or that language community. I’m not interested in escalating in this direction.

                                                                                                                                                        1. 7

                                                                                                                                                          less useful in presence of list comprehension

                                                                                                                                                          I’m certainly biased, but I find Python’s list comprehension an abomination towards readability in comparison to higher-order pipelines or recursion. I’ve not personally coded Python in 8-9 years, but when I see examples, I feel like I need to put my head on upsidedown to understand it.

                                                                                                                                                          1. 6

                                                                                                                                                            It is also well-documented that recursion is severely limited in Python, making many elegant definitions impractical.

                                                                                                                                                            For a subjective definition of “elegant”. But this basically is just “Python is not Lisp” (or more specifically, “Python is not Scheme”). And that’s OK. Not every language has to have Scheme’s approach to programming, and Scheme’s history has shown that maybe it’s a good thing for other languages not to be Scheme, since Scheme has been badly held back by its community’s insistence that tail-recursive implementations of algorithms should be the only implementations of those algorithms.

                                                                                                                                                            You speak of “sneers and insults”, but it is your post that is highly sarcastic and full of stray exagerations at this or that language community.

                                                                                                                                                            Your original comment started from a place of assuming – and there really is no other way to read it! – that the programming patterns you care about are objectively superior to other patterns, that languages which do not adopt those patterns are inherently inferior, and that the only reason why a language would not adopt them is due to “closed-mindedness”. Nowhere in your comment is there room for the (ironically) open-minded possibility that someone else might look at patterns you personally subjectively love, evaluate them rationally, and come to a different conclusion than you did – rather, you assume that people who disagree with your stance must be doing so because of personal faults on their part.

                                                                                                                                                            And, well, like I said we’ve got decades of experience of people looking down their noses at Python and/or its core team + community for not becoming a copy of their preferred languages. Your comment really is just another instance of that.

                                                                                                                                                            1. 8

                                                                                                                                                              I’m not specifically pointing out the lack of tail-call optimization (TCO) in Python (which I think is unfortunate indeed; the main argument is that call stack matters, but it’s technically fully possible to preserve call stacks on the side with TC-optimizing implementations). Ignoring TCO for a minute, the main problem would be the fact that the CPython interpreter severely limits the call space (iirc it’s 1K calls by default; compare that to the 8Mb default on most Unix systems), making recursion mostly unusable in practice, except for logarithmic-space algorithms (balanced trees, etc.).

                                                                                                                                                              Scheme has been badly held back by its community’s insistence that tail-recursive implementations of algorithms should be the only implementations of those algorithms.

                                                                                                                                                              I’m not sure what you mean – that does not make any sense to me.

                                                                                                                                                              [you assume] that the programming patterns you care about are objectively superior to other patterns [..]

                                                                                                                                                              Well, I claimed

                                                                                                                                                              [pattern matching] obviously improves readability of code manipulating symbolic expressions/trees

                                                                                                                                                              and I stand by this rather modest claim, which I believe is an objective statement. In fact it is supported quite well by the blog post that this comment thread is about. (Pattern-matching combines very well with static typing, and it will be interesting to see what Python typers make of it; but its benefits are already evident in a dynamically-typed context.)

                                                                                                                                                              1. 4

                                                                                                                                                                and I stand by this rather modest claim, which I believe is an objective statement.

                                                                                                                                                                Nit: I don’t think you can have an objective statement of value.

                                                                                                                                                                1. 4

                                                                                                                                                                  Again: your original comment admits of no other interpretation than that you do not believe anyone could rationally look at the feature you like and come to a different conclusion about it. Thus you had to resort to trying to find personal fault in anyone who did.

                                                                                                                                                                  This does not indicate “closed-mindedness” on the part of others. They may prioritize things differently than you do. They may take different views of complexity and tradeoffs (which are the core of any new language-feature proposal) than you do. Or perhaps they simply do not like the feature as much as you do. But you were unwilling to allow for this — if someone didn’t agree with your stance it must be due to personal fault. You allowed for no other explanation.

                                                                                                                                                                  That is a problem. And from someone who’s used to seeing that sort of attitude it will get you a dismissive “here we go again”. Which is exactly what you got.

                                                                                                                                                              2. 4

                                                                                                                                                                This is perhaps more of a feeling, but saying that Rust isn’t adopting features as quickly as Ruby seems a bit off. Static type adoption in the Python community has been quicker. async/await has been painful, but is being attempted. Stuff like generalized unpacking (and this!) is also shipping out!

                                                                                                                                                                Maybe it can be faster, but honestly Python probably has one of the lowest “funding amount relative to impact” of the modern languages which makes the whole project not be able to just get things done as quickly IMO.

                                                                                                                                                                Python is truly in a funny place, where many people loudly complain about it not adopting enough features, and many other loudly complain about it loudly adopting too many! It’s of course “different people have different opinions” but still funny to see all on the same page.

                                                                                                                                                                1. 3

                                                                                                                                                                  It is well-documented that Guido Van Rossum planned to remove lambda from Python 3

                                                                                                                                                                  Thank you for sharing that document. I think Guido was right: it’s not pythonic to map, nor to use lambdas in most cases.

                                                                                                                                                                  Every feature is useful, but some ecosystems work better without certain features. I’m not sure where go’s generics fall on this spectrum, but I’m sure most proposed features for python move it away from it’s core competency, rather than augmenting a strong core.

                                                                                                                                                                  1. 1

                                                                                                                                                                    We have previously discussed their tone problem. It comes from their political position within the Python ecosystem and they’re relatively blind to it. Just try to stay cool, I suppose?

                                                                                                                                                                    1. 6

                                                                                                                                                                      I really do recommend clicking through to that link, and seeing just what an unbelievably awful thing I said that the user above called out as “emblematic” of the “contempt” I display to Python users. Or the horrific ulterior motive I was found to have further down.

                                                                                                                                                                      Please, though, before clicking through, shield the eyes of children and anyone else who might be affected by seeing such content.

                                                                                                                                                                  2. 5

                                                                                                                                                                    To pick one of my favorite examples, I talked to the author of PEP 498 after a presentation that they gave on f-strings, and asked why they did not add destructuring for f-strings, as well as whether they knew about customizeable template literals in ECMAScript, which trace their lineage through quasiliterals in E all the way back to quasiquotation in formal logic. The author knew of all of this history too, but told me that they were unable to convince CPython’s core developers to adopt any of the more advanced language features because they were not seen as useful.

                                                                                                                                                                    I think that this perspective is the one which might help you understand. Where you see one new feature in PEP 498, I see three missing subfeatures. Where you see itertools as a successful borrowing of many different ideas from many different languages, I see a failure to embrace the arrays and tacit programming of APL and K, and a lack of pattern-matching and custom operators compared to Haskell and SML.

                                                                                                                                                                  3. 1

                                                                                                                                                                    I think the issue is more about pattern matching being a late addition to Python, which means there will be lots of code floating around that isn’t using match expressions. Since it’s not realistic to expect this code to be ported, the old style if … elif will continue to live on. All of this adds up to a larger language surface area, which makes tool support, learning and consistency more difficult.

                                                                                                                                                                    I’m not really a big fan of this “pile of features” style of language design - if you add something I’d prefer if something got taken away as well. Otherwise you’ll end up with something like Perl 5