1. 9

    They could have quit 10 or 15 years ago and the world would have been no worse off. Let the historical linguists hash things out in their own private-use blocks, and let people send little vector graphics to each other in a way that doesn’t require assigning them as part of an international standard and then burdening every goddamn computing device for the rest of eternity.

    1. 15

      There is more than historical scripts being added. For example:

      Tangsa, a modern script used to write the Tangsa language, which is spoken in India and Myanmar

      There are a good number of other, still alive scripts that are yet to be added. There is no reason to burden the internet infrastructure with vector images, when all you need is a decision and a font update. If your application really cares, maybe the character data update as well.

      1. 3

        Imagine if they had added a Turkish delight emoji back in the 1940s. Everyone loves Turkish delight, right!? Except no, to contemporary tastes it is chalky and gross. Well, every food emoji is a bet that for the remainder of human civilization, we will want to be able to refer to a culturally specific food with a particular 32-bit number. It’s crazy. We already have as an historical accident a bunch of Japanese emoji that make no sense in an American context. Why would you deliberately add more culturally specific junk to humanity’s permanent record? In conclusion, 𓂺.

        1. 11

          What is in humanity’s permanent record, aside from culturally specific junk? Besides, so far there are only 144,697 characters, 1,404 emoji, and whatever else is in there. There’s still room for a few thousand more Turkish delights.

          1. 3

            In the interest of various parties I demand Greek delights, Parthian delights, Scythian delights and Armenian delights. Luckily Unicode can handle them all!

            1. 1

              I’d like to upvote the first sentence of this post 144,697*1404 times just for starters.

            2. 2

              Is that really the consensus on Turkish delight? :-)

              1. 1

                This. Emoji is a necessary part of Unicode since it must subsume earlier encodings, but emoji is a Japanese phenomenon. Any new emoji (if ever) should be left up to the Japanese, just like any new kanji.

              2. 1

                What are fonts? :)

                1. 1

                  turtle graphics on acid.

            1. 7

              And best of all, he’s documented it all in detailed blog posts and nearly 50 videos uploaded to YouTube, sharing what he’s learned for others who might follow in his footsteps.

              I actually worry about this. Andreas Kling (with Serenity), Handmade Hero, Bisqwit, etc. Lots of educational content that is in the hands of a single company.

              1. 1

                Did you also worry about blockbuster having all the movies??

                1. 3

                  It’s not common, but I have heard multiple accounts of YouTube terminating channels, without warning. One was this morning.

                  1. 2

                    I actually don’t get your point from that … unless you’re implying that failure of YouTube / Google in the same vain as Blockbuster could lead to the permanent loss of content not stored elsewhere?

                    1. 2

                      I think the kind of cataclysm that would produce a situation where YouTube suddenly and without warning got completely deleted along with all of its backups would be the kind where a few channels getting deleted is the least of our worries. Maybe I’m just not forward-thinking enough but I have a hard time imagining any of us here outliving Alphabet without something comparable to the apocalypse happening.

                      And to the top level comment, it’s not like YouTube owns the content in question. I seriously don’t understand the what the problem is supposed to be. YouTube is just a means of transmission for video content from creators to their viewers. It isn’t, uh, I don’t know, holding that content hostage or whatever is being implied. I’m not even sure what the alternative is supposed to be. Some sort of peer-to-peer decentralized thing where everyone holds some subset of the thousands of petabytes of content on YouTube and shares the load of streaming the exabytes of content people watch per year? There aren’t enough people with high speed internet (and who have the required storage) in the world for that to be feasible and if there were it’d experience incomparable downtimes and constant, massive data loss. Some kind of federated thing would require each instance to have funds that only Fortune 500 companies have, and massive amounts of content would be lost whenever one of these collapsed. I don’t get it.

                    2. 1

                      Blockbuster predates DMCA.

                  1. -5

                    Assuming I know what tac is. Assuming I have a problem of grepping through log files that are huge(!) in reverse order. Assuming the task is time critical. Assuming that the performance is limited by the tool and not IO.

                    Finally we arrived where a simd tool would be good. Too bad you lost me 3 assumptions sooner.

                    1. 10

                      It’s okay to simply not comment if an article isn’t relevant to you. The author made this tool for themselves, evidently satisfying all 3 of these assumptions, and was kind enough to share it. Moreover, even someone without a need for any version of tac would still find this article useful if they wanted runtime SIMD detection in Rust.

                      1. 5

                        This is rude and dismissive. Please do not post comments like this in future.

                      1. 26

                        You’ll be pleased to hear this concept has a name already: literate programming.

                        1. 7

                          That’s just the author’s particular take on this. I’ve seen other takes that are quite different from plain old literate programming.

                          1. 3

                            Yeah Knuth-style tangle/weave definitely shouldn’t be allowed a monopoly on the very good idea of interleaving prose and code. https://github.com/arrdem/source/tree/trunk/projects/lilith/ was my LangJam submission that went in that direction, partly inspired by my previous use of https://github.com/gdeer81/marginalia and various work frustrations at being unable to do eval() in the ReStructuredText files that constitute the majority of my recent writing.

                          2. 2

                            Technically, I think, it’d be “documentation generation” because it doesn’t involve any tangle or weave steps.

                            because these tools do not implement the “web of abstract concepts” hiding behind the system of natural-language macros, or provide an ability to change the order of the source code from a machine-imposed sequence to one convenient to the human mind, they cannot properly be called literate programming tools in the sense intended by Knuth.

                            [my emphasis]

                            1. 3

                              My view of this is:

                              A lot of Literate Programming systems are based on the idea of automatically copy-pasting pieces of code around. I think this is a terrible idea for many of the same reasons why building a program entirely out of C macros is a terrible idea. However, it’s a necessary evil due to the limitations of C; everything has to be in a particular order imposed by the C compiler. If you want your prose to describe an implementation of a function first, and then describe the struct which that function uses on later, the only solution in C is to do macro-like copy/paste to make the generated C code contain the struct definition before the function even though it’s implemented after the function.

                              Many modern languages don’t have this limitation. Many languages lets everything refer to everything else regardless of the order they appear in the file. Thanks to this, I think we can generally treat the function as the unit of code in literate programming systems, and we don’t need elaborate automatic copy/paste systems. As a bonus, all the interactions between code snippets follows simple, well-understood semantics, and you don’t have the common issues with invisible action at a distance you see in many literate programming systems.

                              That’s the basis for our submission at least, where we made a literate programming system (with LaTeX as the outer language) where all the interaction between different code snippets happens through function calls, not macro expansions.

                            2. 1

                              Literate programming was the inspiration for my team’s submission: https://github.com/mortie/lafun-language

                            1. 14

                              But why? Ain’t broken, do not fix it. Better cd? Seriously? Better cat? Seriously??? I wish I had the time to rewrite such trivial things in Rust for no good reason. Literally zero value is added by this.

                              1. 27

                                Literally zero value is added by this.

                                This is literally false. I use bat for its syntax highlighting, and it is a significant value add for me over cat.

                                1. 6

                                  But that is not what cat is for. cat is for concatenation, nothing else.

                                  1. 6

                                    I used to use cat to quickly view short files in the terminal. bat replaced cat for me:

                                    https://github.com/matklad/config/blob/f5a5a9db95b6e2123d2588fe51091fa53208c6e6/home/.config/fish/set_universals.fish#L28

                                    I am sure that this matches significant fraction of usages when people type cat. I’d even say that viewing files + “priming the pipe” (for which <in.txt prog is the “proper” tool) represent majority of cat usages in the wild.

                                    So, I don’t find “cat is for concatenation, nothing else” statement useful, as it doesn’t describe the reality.

                                    1. 3

                                      it does for me. I never use cat to view files, I either use less (sometimes more, if I am on a very restricted system) or vim. I think you could remove cat from my system an I would not even notice, that is how often I use it. Most cli heavy people I know tend to be similar.

                                      1. 1

                                        Then you were misused it as you should have been using less for viewing files. That is the purpose of pager.

                                        1. 9

                                          less is less convenient to me. I do not want to have to type q to close it, and I do want the file to be visible while I type further commands.

                                          On a meta level, I just don’t get these prescriptivist comments. I would understand “less is more convenient than cat” framing, but what is the value of “cat should be used only for concatenation” statement eludes me.

                                      2. 5

                                        cat(1) is also, depending on your platform, for line numbering, non-blank-line numbering, the removal of runs of multiple blank lines, the explicit display of end-of-lines, the explicit display of tabs and form feeds, converting all non-printables to a human-readable escaped form, and for line ending conversion.

                                        1983 called and wants its boring whinge back.

                                        1. 1

                                          Right, and now we have a program for bonbatenation. It replaces cat and less. I don’t see the problem here.

                                          1. 1

                                            To be clear, bat’s pager capabilities start and end at running an external pager if stdout is a tty. It supplements less, it doesn’t replace it.

                                            I wonder how much stuff would break if you taught cat to do the same thing. Nothing springs to mind.

                                      3. 14

                                        If humanity had followed the “if it ain’t broke, don’t fix it” maxim to the tee without exception, we would all still be living in the stone age.

                                        1. 8

                                          And we might actually be better off that way. At least, a lot less likely to drive half the planet to extinction, and probably not significantly less happy (hedonic treadmill, etc).

                                        2. 11
                                          • Bat is awesome. It’s not really a cat replacement, but a “terminal file viewer with syntax highlighting”. I would never use bat in, say, a script to concatenate files. Two tools for two different jobs.
                                          • I haven’t tried loc or tokei, but cloc is a giant ball of slightly buggy perl. Run cloc on a big enough project and you’re bound to encounter issues.
                                          • Cut can only split based on single-byte delimiters. Lots of tools try to do some form of alignment by using multiple space characters, or they use a syntax like key: value, so cut usually doesn’t cut it. Having to reach for awk just to get the third column of a thing is unfortunate, so a better cut seems like a good idea.
                                          • Sudo is security critical. Every now and then, there are new memory issues found in sudo which couldn’t have existed if sudo was written in a safer language.
                                          • People like writing system monitors. Htop, bashtop, bpytop, gotop, the list goes on. I’ve even written a few myself. It only makes sense that someone would eventually write system monitors in Rust.
                                          • Hyperfine isn’t really a replacement for time. Rather, hyperfine is a fairly complete benchmarking solution which does multiple timed runs, warmup runs, detects outliers, and can compare multiple commands against each other. It’s become my ad-hoc benchmarking tool of choice.
                                          • Zoxide is certainly not just a cd replacement. It’s a completely different way to navigate the filesystem, learning which paths you usually go to so that you can write part of a path and have zoxide take you to a frequently used directory which matches your pattern. If you’re gonna complain about zoxide, complain that it’s a reimplementaiton of something like autojump (Python) or z.lua (lua).

                                          I don’t have any experience with the rest of these projects, but I would bet that the same pattern holds for most of them. It seems like, actually, a lot of value is added by many of these projects.

                                          1. 5

                                            tokei replaced my use of sloccount, which is also a giant ball of Perl and assorted support programs.

                                            It’s slightly faster than either. On FreeBSD /usr/src:

                                            • cloc: 3 minutes 40 seconds
                                            • sloccount: 3 minutes 16 seconds
                                            • tokei: 2.1 seconds
                                          2. 9

                                            How sure are you that the existing pieces of software are in fact not broken (in the sense of having some memory-safety-related security vulnerability that might get discovered and exploited tomorrow and become the next Heartbleed)?

                                            1. 2

                                              I have been using broot instead of tree and it is quite a joy.

                                            1. 1

                                              What are some examples of REST APIs where the client isn’t some kind of user agent? What I can’t visualise is a situation where a programmer is able to develop against an API where the data layout and actions aren’t available until the queries are complete. And if there’s a schema available beforehand to make this possible, what’s the use of self-descriptive messages and hypermedia controls?

                                              1. 4

                                                from 13ms to under 1ms

                                                13ms means being over a frame behind, at 90Hz display refresh. For gamers, thas is a very measurable competitive handicap. Or at less than <1ms, advantage.

                                                I am hopeful for a world where “gaming keyboards” routinely get objectively reviewed for latency.

                                                1. 1

                                                  Is there any evidence that being 1 frame behind sometimes actually leads to losses in competitive gaming?

                                                  1. 2

                                                    Given the number of factors involved it’d be quite difficult to be certain, but I have little trouble believing it for twitchy reaction-centric games (eg classic shooters).

                                                    1. 2

                                                      I know for a fact if someone were speedrunning something it would be a massive issue. There are lots of things within speedrunning that need to be executed on a single specific frame.

                                                      1. 3

                                                        Wouldn’t most frame-perfect inputs have a decent lead-in time or at least be repeatable? In both cases you would know you need to press 13ms earlier and adjust accordingly - probably without even thinking about it.

                                                        Same with competitive games, anticipating your opponent is probably more important than having a sub-13ms reaction time(!).

                                                  1. 7

                                                    In addition to the author it seems like a couple of commenters have had similar inclinations. What influenced each of you to arrive at these ideas? I wonder if that is in common too?

                                                    1. 6

                                                      I would have to go back through a lot of brainstorming notes to identify when and how this notion of a multi-stack concatenative language came about, but I’ve been interested in concatenative languages for a while, despite their disadvantages. When I further realized that concatenative notation is a natural fit for linear types, I knew that it had to be the notation for the linear language I’ve been dreaming of.

                                                      1. 5

                                                        I’ve been rather obsessed with stack-based concatenative languages for a while, so recently I began experimenting with a toy language and various new syntaxes and language features. I fiddled with scoped variables for a while, but eventually realised that using them kind of defeated the point of having a stack in the first place. I then took a note from /bin/dc (which has about 256 alternate stacks, one for each byte value) and thought about using variables as mini stacks. I went a step further, and began experimenting with code blocks that switched from the main stack to variable stacks.

                                                        1. 2

                                                          My take slowly came about after reading Look Ma, No Garbage![1], then similarly realising stack-based languages also naturally fit with linear types.

                                                          I later veered off into more syntax-based metaprogramming after failing to reconcile my attempt at concatenative purism with the existence of parentheses.

                                                          [1] CHICKEN Scheme fans may recognise the author’s other work.

                                                        1. 17

                                                          TLDR:

                                                          1. Start with big IDs so you don’t enter in PHP weird behaviors.
                                                          2. Use UTF-8, always.
                                                          3. Allow-list system with deny by default for anything related to security.
                                                          4. Monitor your SQL queries.
                                                          1. 5

                                                            The one time I read the article before the comments…

                                                            1. 2

                                                              Monitor your SQL queries.

                                                              The idea that SQL queries are a special kind of error is really weird. You should be reporting all your errors that aren’t caused by bad user input or network hiccups.

                                                              The allow-list bit is a good call but the rest seems oddly language-specific. Starting with big IDs implies you’re using integers, which is not a great idea to begin with; stick with UUIDs and the whole problem isn’t even possible.

                                                              1. 3

                                                                The idea that SQL queries are a special kind of error is really weird.

                                                                Because SQL syntax errors indicate injection bugs, and SQL injection bugs can exploited to accomplish literally anything. The OP isn’t talking about queries that are supposed to return exactly one result returning more than one, which are also bugs, but probably not exploitable to completely pwn the database.

                                                                1. 1

                                                                  The OP isn’t talking about queries that are supposed to return exactly one result returning more than one, which are also bugs […]

                                                                  If it’s a bug … why are you ignoring it? You should … fix it instead?

                                                                  1. 2

                                                                    Because I need to fix the highest severity bugs first, and SQL injections are much higher severity.

                                                                    1. 2

                                                                      If a bug exists but nobody discovers it, is it truly a bug?

                                                                      1. 2

                                                                        If a bug exists and all your users find out about it before you do, are you really a professional?

                                                                        1. 1

                                                                          Precisely. I’m sure I don’t need to tell a fellow professional how this kind of disparate-parity bug can quietly develop over time.

                                                                  2. 2

                                                                    What’s wrong with using integers as keys? If you want to make sure that two integers with different semantic meanings are never confused for each other, you should be relying on a type system, not the improbability of UUID collisions. (Unless I’ve mistaken your point?)

                                                                    1. 2

                                                                      Integers are enumerable, while (some kinds of) UUIDs are not.

                                                                      1. 1

                                                                        What’s the problem with enumerability—that someone might be able to guess a valid ID?

                                                                        Which kinds of UUIDs aren’t enumerable?

                                                                        1. 3

                                                                          You can technically enumerate UUIDs, but considering how many there (quite a few) are and how they are generated (randomly for version 4 UUIDs), it may take you some time.

                                                                1. 16

                                                                  There are a lot of static site generators. There’s a lot of bike-shedding around them because everyone has different needs. Wanting it to be “easy” or “simple” is at odds with having flexibility to handle things other than your favorite workflow. Ultimately, you’re just looking to find a framework that saves you time and energy.

                                                                  I personally went in the complete opposite direction. I used to use a static site generator for a number of years but I don’t post all that often. Every time I’ve wanted to post something, I’d have to relearn the tool, and pray nothing broke since the last time I used it.

                                                                  As a result, once it broke, I didn’t post anything for four years.

                                                                  When I started writing fiction as a hobby, I tossed my old, dead website and made a new one. I’d made a few websites on Wordpress.com for friends by that point.

                                                                  So I ended up hosting Wordpress by myself and heavily modified one of the official themes. It doesn’t give me quite as much control but the plugins allowed me to build a website with far more functionality and in less time than doing the code myself.

                                                                  Writing and posting new articles is so much easier using rich text. I generally type up my post in Apple Notes first. Copying and posting to Wordpress saves most of the formatting. Inserting images is drag and drop.

                                                                  As far as security, my website has one api key to send mail. Everything else is isolated to the server it runs on. I put as much of the admin pages behind basic auth as I could. The login page is inaccessible without knowing those credentials. It’s not perfect but I have a defense in depth to mitigate damage. If it gets hacked, nothing of value is lost. I have complete, incremental backups of everything (configs, webroot, database) that’s pulled down via cron job every night.

                                                                  I say all this because… everyone ultimately looks for a tool that works for them. My goal is to write posts, not fiddle endlessly. Other people love the fiddling.

                                                                  If you’re looking to build and maintain a website, think about what’s important to you. What’s your skill set, interests, preferred workflow, and goals?

                                                                  For me, Wordpress fits. For a lot of programmers, they have very legitimate reasons to be horrified I used it. :)

                                                                  1. 9

                                                                    Every time I’ve wanted to post something, I’d have to relearn the tool, and pray nothing broke since the last time I used it.

                                                                    As a result, once it broke, I didn’t post anything for four years.

                                                                    I’m in the same situation with Hugo. It seems like every time I go to rebuild the site, something has broken. Given Hugo’s vast complexity, it is actually rather difficult and a huge time sink to figure out how to actually fix it.

                                                                    But my plan, assuming I ever summon the motivation, is to just write my own static site generator. I’ll publish the code for it, but it won’t be something I intend to share or maintain for others. It will be narrowly scoped for my specific use cases alone. I think with a narrow scope, it has the potential to be very simple and easy to maintain going forward.

                                                                    1. 3

                                                                      That sounds very familiar. After not updating my hugo binary for years in fear of breaking something, then doing it, thereby discovering I seem to use 0.7% of the features I rewrote only the parts I needed to reproduce my site. Turns out, 333 lines of code was enough - I never went live with my rewrite, but I haven’t posted a ton since.

                                                                      1. 3

                                                                        Oh interesting! I didn’t think of keeping most of the structure the same as what Hugo expects and then just writing a different tool to handle the things I need. I’ll probably just re-think it from first principles though, since I think I can get things to be a bit simpler. But I’ll probably need more than a few hundred lines. One of the things I do with my blog is ensure that all my code snippets compile without duplication. That’s been a pain to do with Hugo, so I’ll likely devise a better answer to that problem through coupling.

                                                                        1. 2

                                                                          Ah, yeah. I think I don’t even have any of the fancy oEmbed things I used to have in former iterations and I don’t do code snippets - except formatting them with <code> or <pre> :)

                                                                        2. 2

                                                                          My personal blog’s SSG is now a 63-lines bash 5 script, no argument, no config, and a pretty direct usage.

                                                                          Handles everything I want (RSS, categories, markdown, medias, templating with “smart tags” (ie custom tags)

                                                                          1. 1

                                                                            I’d be curious to see what this looks like if you wouldn’t mind sharing.

                                                                      2. 9

                                                                        I made a comic recently which may be relevant to what you said: https://rakhim.org/honestly-undefined/19/

                                                                        1. 2

                                                                          LOL this gave me a good laugh

                                                                        2. 4

                                                                          I coincidentally started using Zola myself just last week, and having a backlog and knowing I could have this exact relearn-the-tool-in-X-years problem, I created a little script that puts a skeleton file in the right place, opens it in a text editor, and then runs zola build. It took a couple of minutes to write, and it doubles as a tutorial for my future self. I suppose this reinforces your point: what are my goals and skills? Wordpress certainly isn’t either for me, but I wouldn’t recommend my own workflow to someone who just wants a blog.

                                                                          1. 4

                                                                            Articulate. Well, I 100% agree with you that no tool can satisfy every users. That’s exactly the reason why we have so many choices. However I’m of the opinion that so many choices is quite a nice thing as different people can find their version of perfect tool.

                                                                            Regarding WordPress, I like to write in markdown. I was able to port my old blog to a new one quite easily because they were all a bunch of markdown posts. Although yes WP is so popular that you’ll get exporters/importers for almost every mainstream choice, I still prefer to have these markdown posts committed to a .git repository.

                                                                            And the reason I ported to a simpler tool is because I wanted to fiddle less and focus more on writing. I consider this as a one time investment, but let’s see how it goes. :)

                                                                            1. 3

                                                                              Absolutely!

                                                                              I love the idea of markdown and use it frequently for documentation, but my brain can’t grasp the mismatch between presentation and formatting in real-time, which means I can’t do creative work in it. :)

                                                                              1. 1

                                                                                There are markdown editors, including one I use for Android, which bridge that gap for you. Just on case you wanted to know

                                                                                1. 2

                                                                                  Of course. Then I have to figure out how to manage markdown files and so on. :)

                                                                                  As I’ve said elsewhere, it’s really easy to solve one issue. Solving the majority of them is difficult.

                                                                            2. 6

                                                                              Hmm. This should be a post on my blog. scribbles notes

                                                                              Also, being able to post and edit articles on my phone or iPad using the official Wordpress app is one of the big selling points for me. By using Wordpress, I get offline editing on any device for free.

                                                                              1. 2

                                                                                Interesting! I love writing posts in markdown so there’s a difference, but you might find this approach interesting:

                                                                                I switched to Zola a while back, and set up CI to automatically publish new site versions with a static Zola binary. When I want to add something, I only edit markdown files. I just push these new changes in a git repository, and it automagically appears online. It takes very low effort to edit and update the website (given you’re used to using git and markdown). You don’t install Zola locally and can do this from anywhere in the world.

                                                                                It seems impossible to break Zola with just adding markdown files. The only real thing that can break here, is the server I’m hosting these static files on. The whole setup is actually super simple, if things ever go haywire it’s simple to debug or I just revert.

                                                                                Not trying to make you switch. Just thought you might find it interesting, as I assume this has minimum breakage, which you were having problems with.

                                                                                1. 3

                                                                                  Someone always mentions markdown and tries to solve one of the problems I mentioned. :)

                                                                                  There’s a long, long list of features I use and all of them reduce the immediate friction of writing or making changes. (The worst offender is using plain text with a markup language.) This is absolutely critical to my creative process. Everything else is secondary.

                                                                                2. 2

                                                                                  I already write my drafts in Notion as it is just restrictive enough to keep me focused, but flexible enough to embed any kind of media. That is why I’d probably lean towards something like https://super.so/ tor OSS alternative to make it a one-click thing.

                                                                                  1. 1

                                                                                    Not entirely sure what you’re getting at. Wordpress is open source under the GPLv2 license.

                                                                                1. 17

                                                                                  Rust has some nice quality-of-life improvements that make up for the toil of memory management. Even when I don’t strictly need a systems programming language, I still use Rust, because I like sum types, pattern matching, foolproof resource cleanup, and everything-is-an-expression so much.

                                                                                  So for glue code in GUI apps or CRUD webapps I’d love some Rustified TypeScript, Rustscript on the Golang runtime, or a Rust/Swift hybrid.

                                                                                  1. 10

                                                                                    Pretty much all of the ‘quality-of-life improvements’ you mention came to rust by way of ocaml, and are also present in other functional languages like haskell and scala. For webapps, try purescript or possibly elm.

                                                                                    1. 5

                                                                                      ocaml won’t be a “higher level rust” until multicore ocaml has matured.

                                                                                      1. 3

                                                                                        To any other readers: I wouldn’t ignore the language based solely on this, especially since multicore parallelism wasn’t one of the criteria in the top comment. Lwt and async give you concurrency if you want it.

                                                                                      2. 5

                                                                                        Pedantic nitpicking: resource cleanup (RAII) is a big one, and it‘s from C++. Everything else is indeed from ML.

                                                                                        1. 4

                                                                                          And traits are from haskell, and single ownership is from cyclone.

                                                                                          But a large part of rust was directly inspired by ocaml.

                                                                                          1. 5

                                                                                            I was specifically referring to the list in the top comment. For fuller list, I would consult the reference.

                                                                                            Cyclone doesn’t have single ownership/affine types. It has first-class support for arena-based memory management, which is a weaker form of rust‘s lifetimes, and is a different feature.

                                                                                            See http://venge.net/graydon/talks/rust-2012.pdf for list of influences for both ownership and borrowing parts.

                                                                                              1. 2

                                                                                                I stand corrected, thanks a lot!

                                                                                        2. 1

                                                                                          Or reasonml since it is a front end for ocaml. Or bucklescript since it is ocaml that targets Javascript.

                                                                                          Disclaimer: never used them myself.

                                                                                        3. 3

                                                                                          Rustified TypeScript

                                                                                          I write a lot of TypeScript but have only written a few hundred lines of Rust. I’m curious, which features of Rust do you miss when using TypeScript? The obvious one is traits, but I’m curious if there’s anything else.

                                                                                          1. 5

                                                                                            Not the person you replied to, but true sum types, especially Option. It’s much cleaner than undefined, even with all of the nice chaining operators. And not having to worry about exceptions thanks to Result.

                                                                                            1. 3

                                                                                              Ah, I see your point. TypeScript discriminated unions are used frequently to overcome this limitation, but I agree it would be preferable to have proper sum types with pattern-matching.

                                                                                              type Square {
                                                                                                  type: "square";
                                                                                                  width: number;
                                                                                                  height: number;
                                                                                              }
                                                                                              
                                                                                              type Circle {
                                                                                                  type: "circle";
                                                                                                  radius: number;
                                                                                              }
                                                                                              
                                                                                              type Shape = Square | Circle;
                                                                                              
                                                                                              1. 2

                                                                                                Oh god I miss TypeScript’s sum types so much when I’m writing Rust. When I context switch back to Rust after writing some TypeScript I with I could do

                                                                                                type Foo = Bar | Baz;
                                                                                                

                                                                                                Eventually I get over it but I find TypeScript so much nicer for describing the types of my programs.

                                                                                                1. 3

                                                                                                  Oh yes. I wish TypeScript had more Rust, but I also wish Rust had row-level polymorphism.

                                                                                                  1. 2

                                                                                                    Maybe someday https://github.com/tc39/proposal-pattern-matching will happen. That will be a great day.

                                                                                                  2. 1

                                                                                                    same here, but on the other hand, those cool union types without pattern matching makes the call site uglier, and almost removes the nicety of the union type declaration

                                                                                                    1. 1

                                                                                                      Yes, you can relax a function that returns Foo | undefined to return Foo only, but in most “maybe” systems you can’t return a naked Foo without the Maybe<Foo> box

                                                                                                2. 1

                                                                                                  In that Rust/Swift hybrid, what parts of Rust would you want added to Swift to make the hybrid? I read this article thinking Swift wouldn’t be a bad start.

                                                                                                  1. 6

                                                                                                    In Swift I miss “everything is an expression”. I have mixed feelings about Swift’s special-casing of nullability and exceptions. Terser syntax is nice, but OTOH it’s more magical and less flexible/generalizable than Rust’s enums. Swift inherited from ObjC multiple different ways of handling errors (boolean, **NSError, exceptions) — that’d be an obvious candidate for unification if it could start from scratch.

                                                                                                    And if it was a “smaller Swift”, then I’d prefer a mark-and-sweep GC. With memory management Swift is neither here nor there: you need to be careful about reference cycles and understand lifetimes for bridging with FFI, but it doesn’t have a borrow checker to help.

                                                                                                1. 1

                                                                                                  OP here: For an off-topic, behind-the-scenes mini freak-out I had, I couldn’t for the life of me decide if calling the post “how to make less” as opposed to “fewer” mistakes was itself a mistake. I went back and forth editing the title.

                                                                                                  Generally speaking, “fewer” would be the correct word, since the mistakes are countable. Yet somehow it sounded off to my native ears — stiff, cludgy. Perhaps the insertion of the adjective “dumb” in-between is the cause.

                                                                                                  What do you think?

                                                                                                  1. 3

                                                                                                    I think you’re right, the “dumb” turns it into a miniature garden path sentence - “less dumb” reads better than “fewer dumb”, but then it has to be re-parsed as “dumb mistakes”.

                                                                                                    I like the “less dumb” interpretation though - compare “how to make a smaller number of silly mistakes” with “how to make mistakes that are less silly but just as numerous”. Every dumb mistake wastes time you could have spent making a mistake that teaches you something.

                                                                                                    1. 1

                                                                                                      “Garden path sentences” is a great explanatory concept — thanks for bringing it to my world.

                                                                                                      Very much agree with the idea that if you’re gonna make a mistake, it might as well be a solid one :)

                                                                                                  1. 3

                                                                                                    This basically requires that the highlighter is also an interpreter (and, in this case, full trichromacy on the part of the reader).

                                                                                                    1. 3

                                                                                                      You could get away with italic/underline/bold/halftone.

                                                                                                      I’m not colorblind but I do have terrible vision (completely blind in one eye, bad but correctable vision in the other). I tend to prefer monochromatic syntax highlighting that uses textual features like bold/dim/italic for that reason; it increases contrast.

                                                                                                      1. 1

                                                                                                        Yeah, I think I use the different brightness of highlighted keywords as landmarks, rather than specific colors themselves. Thinking about it, I’m not sure I’d find chunks of blue (or italic, or…) code particularly helpful, at least compared to a highlighted if at the top of an indented section.

                                                                                                      2. 2

                                                                                                        Surely you could use static analysis on the source text? I don’t get why you’d have to interpret code to understand which scope is where.

                                                                                                        1. 3

                                                                                                          I think his point is that syntax coloring requires much heavier machinery than a DFA.

                                                                                                          Static analysis is a form of interpretation, after all. You have to understand the language itself, rather than stopping at lexemes.

                                                                                                          1. 2

                                                                                                            Ehhh… trivial syntax highlighting can be done with regex’s, kinda. I wish text editors would use proper parser for syntax highlighting though. Vim often gets confused with strings in some of the languages I work in (the worst case being embedded JavaScript in an HTML file, which is understandably difficult to parse with pure regular expressions).

                                                                                                            Certain nested structures (e.g. string interpolation) are better represented with a more formal language grammar anyway. Besides, it’s a bit silly that our text editors often parse the same source file multiple times – first, done poorly with buggy, monstrous regular expressions, then again by language plugins so you have functionality like Jump to Definition. You might as well just combine the functionality together and parse it properly from the start.

                                                                                                          2. 1

                                                                                                            Oh yeah, sorry, I meant “interpret” in the vaguest sense, i.e. “understand the semantics”, as @mattgreenrocks confirmed. Static analysis programs and compilers are just interpreters in funny hats.

                                                                                                        1. 3

                                                                                                          Optimizing stack frame lookups in my interpreter. Lookups currently take up at least 30% of total execution time, and I found that the stack can reach 260+ calls deep, most of them completely empty, so collapsing together chains of empty ones (moving the work into insertion rather than lookup) should speed things up.

                                                                                                          1. 5

                                                                                                            Hadn’t heard of Amulet, thanks for sharing! I feel compelled to mention I am, this very minute, working on making my language compile itself to Lua.

                                                                                                            1. 2

                                                                                                              Cool! A surprising amount of overlap with projects/ideas I’m currently working on. I really like the idea of extending the spreadsheet concept to include more software development concepts. And I really like the syntactic/semantic simplicity of concatenative languages. I’m slowly developing ideas for how to best leverage the benefits of concatenative syntax/semantics while having an escape hatch to variables/lambdas for when they are more expressive.

                                                                                                              1. 3

                                                                                                                Gilad Bracha has been doing a lot of experiments in the spreadsheet-as-ide space, they’re scattered in his blog posts: https://gbracha.blogspot.com/

                                                                                                                1. 1

                                                                                                                  I’d love to hear what you come up with for the escape hatch - I have solved this in my own specific way, so I’m curious as to how else it could be done!

                                                                                                                  1. 2

                                                                                                                    It’s all still very nascent concept stage, but I’m leaning towards S-expr based syntax, with essentially a special form for concatenative point-free terms. And then there could be a special form for infix, for when that is more natural.

                                                                                                                    I want to experiment with the IR being purely concatenative/combinatorial, though. None of this is at all my area of expertise, so I don’t know how much research there has been along those lines. But it seems like it could allow for really simple optimization semantics.

                                                                                                                1. 24

                                                                                                                  10 selling points, no downside, that’s fishy. No mention of the lack of static typing, for example. No mention of Kotlin or Scala. That sounds like someone who’s a bit too enthusiastic to acknowledge the shortcomings that any tool has.

                                                                                                                  1. 11

                                                                                                                    The lack of static typing as a downside is, and will always be, subjective. As Rich Hickey famously says, “What’s true of every bug? 1) it passed your unit tests 2) it passed the type checker.”

                                                                                                                    Spec, as a structural testing mechanism, is I believe generally understood to be a preferable alternative to static typing, not an afterthought bolted on to appease devs that demand static typing.

                                                                                                                    1. 10

                                                                                                                      I don’t understand what the quote is trying to say. “Every bug” is still fewer bugs if type bugs are ruled out by a type checker.

                                                                                                                      1. 3

                                                                                                                        My reading is that static typing isn’t a silver bullet. That’s an over simplification. See the video below for a bit more context surrounding that particular quote, and maybe some rationale behind clojure’s approach to typing and the role that Spec plays.

                                                                                                                        https://www.infoq.com/presentations/Simple-Made-Easy/

                                                                                                                      2. 5

                                                                                                                        It’s amusing to me that people accept this as a critique of static typing in general rather than a critique of certain hilariously-bad type systems like that of C or Java.

                                                                                                                        I am trying to think of the last time I encountered a bug in a piece of software written in a language with a not-terrible static type system, but … I can’t think of one.

                                                                                                                        1. 4

                                                                                                                          Awesome. I’ll take your word for it. What is a language with a not-terrible type system? Haskell?

                                                                                                                          1. 4

                                                                                                                            Right.

                                                                                                                            I mean obviously part of the reason I haven’t run into many bugs is that there just aren’t as many programs written using good type systems. Programs written in Haskell or OCaml or Elm still have bugs, but they only have certain classes of bugs. Just because you can’t get rid of every bug doesn’t mean it’s pointless to get rid of the ones you can, and Rich’s punchy quote seems to imply that this line of reasoning is invalid.

                                                                                                                            1. 2

                                                                                                                              I see what you’re saying. And I agree that, on the surface, that quote seems like it’s dumping on static typing entirely, but I don’t think that’s the case. In the talk in which Hickey drops that quote he expands a on it a bit, to a degree that my simply slapping it into a response doesn’t do justice. You’re the Leiningen guy, you know Clojure, you’re presumably familiar with the talk.

                                                                                                                              My takeaway was that static typing, like unit tests, catches bugs. Certain classes of bugs (as you mention above). However, in some complex and complicated systems, those classes of bugs aren’t the primary concern. I’ve never worked in that kind of system, but I like what I’ve seen of clojure and I haven’t found this particular line of reasoning disagreeable.

                                                                                                                              1. 4

                                                                                                                                You’re the Leiningen guy, you know Clojure, you’re presumably familiar with the talk.

                                                                                                                                Yep, I’ve seen the talk. It feels to me like he already decided he doesn’t like static typing because of bad experiences with Java and uses that experience to make straw-man arguments against all static type systems in general. I can imagine the existence of a system for which “bugs that no type system can catch” are the primary concern, but I’ve never encountered such a system myself. (I have worked with plenty of systems where the cost of the type system is higher than the benefit of squashing those bugs, but that’s a very different argument than Rich’s.)

                                                                                                                                1. 3

                                                                                                                                  Yep, I’ve seen the talk. It feels to me like he already decided he doesn’t like static typing because of bad experiences with Java and uses that experience to make straw-man arguments against all static type systems in general

                                                                                                                                  There seems be at least some evidence that he knows Haskell pretty well, he just doesn’t really publicize it.

                                                                                                                                  I think it’d be really funny if he keynoted ICFP with a talk on algebraic effects and never mentions the talk ever again. Will never happen, but a guy can dream.

                                                                                                                                  1. 3

                                                                                                                                    I’m pretty skeptical that anyone who “knows Haskell pretty well” would produce the “Maybe Not” talk. More generally, my experience is that anyone willing to invest the time and energy into learning Haskell tends to be more tuned-in to the actual tradeoffs one makes when using the language, and it’s clear that his emotionally-framed talking points overlap very little with what actual Haskell programmers care or think about. Of course, it could be the case that he does know the language pretty well and simply talks about it like a frustrated novice to frame emotional talking points to appeal to his Clojure true-believers, but this seems far-fetched.

                                                                                                                                    1. 3

                                                                                                                                      IMO the “Maybe Not” talk gets more flak than it deserves. Function subtyping is a valid data representation and Maybe Int -> Int can be represented as a subtype of Int -> Maybe Int. Haskell chooses not to allow that representation, and it is a way in which the type system is arguable incomplete (in the “excludes valid programs” sense.)

                                                                                                                                      1. 4

                                                                                                                                        You’ll have to work hard to convince me that Rich Hickey was arguing on the level of critiquing the “function sub-typing” capabilities of Haskell’s type system vs. the more prosaic “static typing bad!” bullshit he falls back on again and again. Stated straightforwardly, his argument is basically “Maybe is bad because it means you will break the expectations of the caller when you need to introduce it to account for optionality.” And, I suppose it is in fact terrible when you don’t have a type-checker and depend on convention and discipline instead. So, Rich Hickey 1, static typing 0, I guess?

                                                                                                                                        As to “Maybe Not” getting more flak than it deserves…yeah, we’ll have to agree to disagree. (And I’ll note here I’m really surprised that you in particular are taking this position considering how often I see you on here deeply engaging with such a broad variety of academic computer science topics, without needing to use strawmen or appeal to emotion to argue a position.)

                                                                                                                                        For example, “Maybe/Either are not type system’s or/union type.” Okay. How do you even argue with that? I don’t even really understand what he’s trying to assert. Does he not believe the Curry-Howard correspondence is valid? For that matter, which type system? Will I get lambasted by the apologists for not understanding his super subtle point, yet again? Meh.

                                                                                                                                        Someone who was honestly and deeply engaged with the ideas he spends so much time critiquing wouldn’t be babbling nonsense like “you would use logic to do that, you wouldn’t need some icky category language to talk about return types” or “type system gook getting into spec”…god forbid!

                                                                                                                                        I’ll give him this though: Rich Hickey is doing a great job of convincing the people who already agree with him that static typing is bad.

                                                                                                                                        (Edited to fix some links and a quote)

                                                                                                                                        1. 4

                                                                                                                                          As to “Maybe Not” getting more flak than it deserves…yeah, we’ll have to agree to disagree. (And I’ll note here I’m really surprised that you in particular are taking this position considering how often I see you on here deeply engaging with such a broad variety of academic computer science topics, without needing to use strawmen or appeal to emotion to argue a position.)

                                                                                                                                          Thank you! I should note that just because I deeply engage with a lot of different CS topics doesn’t mean I won’t flail around like an idiot occasionally, or even often.

                                                                                                                                          For example, “Maybe/Either are not type system’s or/union type.” Okay. How do you even argue with that? I don’t even really understand what he’s trying to assert. Does he not believe the Curry-Howard correspondence is valid? For that matter, which type system? Will I get lambasted by the apologists for not understanding his super subtle point, yet again? Meh.

                                                                                                                                          Let me see if I can explain this in a less condescending way than the talk. Let’s take the type Maybe Int, which I’ll write here as Maybe(ℤ). From a set theory perspective, this type is the set {Just x | x ∈ ℤ} ∪ {Nothing}. There is an isomorphism from of the maybe type to the union type ℤ ∪ {Nothing}. Let’s call this latter type Opt(ℤ). Opt(ℤ) is a union type in a way that Maybe(ℤ) is not, because we have ℤ ⊆ Opt(ℤ) but not ℤ ⊆ Maybe(ℤ). 3 ∈ ℤ, 3 ∉ Maybe(ℤ). Again, we have Just 3 ∈ Maybe(ℤ), and an isomorphism that maps Just 3 ↦ 3, so in theory this isn’t a problem.

                                                                                                                                          The problem is that Haskell’s type system makes design choices that makes that isomorphism not a valid substitution. In fact, I don’t think Haskell even has a way of represent Opt(ℤ), only its isomorphism. Which means that we can’t automatically translate between “functions that use Opt(ℤ)” and “functions that use Maybe(ℤ)”. Take the functions

                                                                                                                                          foo :: Maybe Int -> Int
                                                                                                                                          foo Nothing = 0
                                                                                                                                          foo (Just x) = x*x
                                                                                                                                          
                                                                                                                                          -- I don't think this is possible in Haskell, just bear with me
                                                                                                                                          bar :: Opt Int -> Int
                                                                                                                                          foo Nothing = 0
                                                                                                                                          foo x = x * x
                                                                                                                                          

                                                                                                                                          Is map foo [1..10] type-safe? Not in Haskell, because map foo has type [Maybe Int] -> [Int] and [1..10] has type [Int]. Is map bar [1..10] type-safe? In a type system that supported “proper” union types, arguably yes! ℤ ⊆ Opt(ℤ), so map bar is defined for all [Int]. So maybe types emulate useful aspects of union types but, in the Haskell type system, don’t have all the functionality you could encode in union types.

                                                                                                                                          Now there are two common objections to this:

                                                                                                                                          1. Haskell has very good reasons for doing things this way. This is 100% true. But it’s true because Haskell has a lot of goals with this type system and being able to encode this particular union type requires us to have proper function subtyping, which would absolutely be a nightmare to combine with everything else in Haskell. But nonetheless shows that Haskell is only exploring one part of the possible space of type systems, and there are valid things that it chooses not to represent. “Proper” union types are one of these things.
                                                                                                                                          2. You can easily write a shim function to make map foo type safe. This is usually people’s objection to this talk. And most of the time you can do this. But this is just a form of emulation, not reproducing the core idea. It’s similar to how in OOP you can “emulate” higher-order functions with the strategy pattern. But it’s not a perfect replacement. For any given emulation I can probably construct a example where your emulation breaks down and you have to try something slightly different. Maybe it doesn’t work if I’m trying to compose a bunch of fmaps.

                                                                                                                                          This is why I think the talk is underrated. There’s a lot of genuinely interesting ideas here, and I get the impression Rich Hickey has thought a lot of this stuff through, but I think it’s hampered him presenting this ideas to a general clojure audience and not a bunch of type-theory nerds.

                                                                                                                                          1. 1

                                                                                                                                            I don’t follow: map foo [1..10] wouldn’t even typecheck; it’s not even wrong to say it’s not typesafe (edit: and apologies if that’s what you meant, I don’t mean to beat you over the head with correct terminology, I just honestly didn’t get it). And while it’s well and fine that there’s an isomorphism between {Just x | x ∈ ℤ} and , it’s not clear to me what that buys you. You still have to check your values to ensure that you don’t have Nothing (or in the case of Clojure, nil), but in Haskell, because I have algebraic data types, I can build abstractions on top to eliminate boilerplate. Your Opt example doesn’t present as better or highlight the power of this isomorphism. Why do I even care that I can’t represent this isomorphism in Haskell? I’m afraid your post hasn’t clarified anything for me.

                                                                                                                                            As far as the talk, I think that if he had some really interesting ideas to share, he’d be able to explain them to type theory nerds in the same talk he gives to his “core constituency.”

                                                                                                                                            At this point, I have trouble considering the output of someone who, no matter how thoughtful they may be, has made it clear that they are hostile to certain ideas without justifying that hostility. There is plenty of criticism to be made of Haskell and type theory without taking on the stance he has taken, which is fundamentally “type theory and type systems and academic PLT is not worth your time to even consider, outside of this narrow range of topics.” If he was a random crank that’d be fine, but I think that because of his position, his presentations do real harm to Clojure programmers and anyone else who hears what he’s saying without having familiarity with the topics he dismisses, because it shuts them off to a world of ideas that has real utility even if it’s very much distinct from the approach he’s taken. It also poisons the well for those of us in the community who have spent serious time in these other worlds and who value them, which is a tremendous shame, because Rich Hickey does have a lot of great ideas and ways of presenting them intuitively. So regardless of how eloquently you may be able to translate from Rich Hickey-ese, what I object to fundamentally is his intellectual attitude, moreso than his ideas, many of which I agree with.

                                                                                                                                            Thank you! I should note that just because I deeply engage with a lot of different CS topics doesn’t mean I won’t flail around like an idiot occasionally, or even often.

                                                                                                                                            Well understood from personal experience. ;-)

                                                                                                                                            1. 3

                                                                                                                                              I don’t follow: map foo [1..10] wouldn’t even typecheck; it’s not even wrong to say it’s not typesafe (edit: and apologies if that’s what you meant, I don’t mean to beat you over the head with correct terminology, I just honestly didn’t get it).

                                                                                                                                              That’s what I meant, it wouldn’t typecheck. Brain fart on my part.

                                                                                                                                              And while it’s well and fine that there’s an isomorphism between {Just x | x ∈ ℤ} and ℤ, it’s not clear to me what that buys you. You still have to check your values to ensure that you don’t have Nothing (or in the case of Clojure, nil) … Your Opt example doesn’t present as better or highlight the power of this isomorphism.

                                                                                                                                              Let’s try a different tack. So far we have

                                                                                                                                              foo :: Maybe Int -> Int
                                                                                                                                              bar :: Opt Int -> Int
                                                                                                                                              

                                                                                                                                              Now I give you three black-box functions:

                                                                                                                                              aleph :: Int -> Maybe Int
                                                                                                                                              beis :: Int -> Opt Int
                                                                                                                                              gimmel :: Int -> Int
                                                                                                                                              

                                                                                                                                              foo aleph typechecks, as does bar beis. foo gimmel doesn’t typecheck. I think all three of those we can agree on. Here’s the question: what about bar gimmel? In Haskell that wouldn’t typecheck. However, we know that Int ⊆ Opt Int. gimmel’s codomain is a subset of bar’s domain. So bar must be defined for every possible output of gimmel, meaning that bar gimmel cannot cause a type error.

                                                                                                                                              This means that because Haskell cannot represent this isomorphism, there exists functions that mathematically compose with each other but cannot be composed in Haskell.

                                                                                                                                              Why do I even care that I can’t represent this isomorphism in Haskell?

                                                                                                                                              Mostly this is a special case of function subtyping, which I don’t think Haskell supports at all? So if function subtyping makes your problem domain more elegant, it’d require workarounds here.

                                                                                                                                              1. 2

                                                                                                                                                To be clear I understood your point initially about function subtyping being a thing that maybe Haskell can’t represent, and I apologize for making you come up with multiple creative examples to try to illustrate the idea (but I appreciate it)!

                                                                                                                                                So if function subtyping makes your problem domain more elegant, it’d require workarounds here.

                                                                                                                                                What remains unclear for me–if we’re treating this as a proxy for Rich Hickey’s argument–is how this demonstrates the practical insufficiency of Maybe, which is his main pitch. I am happy to acknowledge that there are all kinds of limitations to Haskell’s type system, this is no surprise. What I don’t yet understand is why this is a problem wrt Maybe!

                                                                                                                                                In any case, thank you for the thoughtful responses.

                                                                                                                        2. 3

                                                                                                                          Static typing, in my uninformed opinion, is less about catching bugs than it is about enforcing invariants that, as your application grows, become the bones that keep some sort of “tensegrity” in your program.

                                                                                                                          Without static typing your application is way more likely to collapse into a big ball of mud as it grows larger and none of the original engineers are working on it anymore. From this perspective I suppose the contract approach is largely similar in it’s anti-implosion effect.

                                                                                                                          However, type theory offers a whole new approach to not only programming but also mathematics and I think there is a lot of benefit we still haven’t seen from developing this perspective further (something like datafun could be an interesting protobuf-esque “overlay language” for example).

                                                                                                                          On the other hand, dynamic programming (I think) peaked with lisp, and clojure is a great example of that. A lightweight syntax that is good for small exploratory things has a lot of value and will always be useful for on the fly configuration. Doesn’t change that the underlying platform should probably be statically typed.

                                                                                                                        3. 6

                                                                                                                          Static typing is mentioned in section 8 in regards to the spec library, and Scala is named in the Epilogue as a mature alternative.

                                                                                                                          1. 3

                                                                                                                            “In this article we have listed a number of features that positively separates Clojure from the rest.” well, seems like the author thinks they address scala as well as java in the article, even though it’s only named in the previous sentence.

                                                                                                                            Spec is no alternative to static typing, as far as I know. Isn’t it just runtime checks, and possibly a test helper? Scala and kotlin both have decent (or even advanced) type systems. I think some of the points are also advantages over kotlin and scala (repl and simplicity/stability, respectively), but the choice is not as black and white as depicted in OP.

                                                                                                                            1. 2

                                                                                                                              Spec isn’t static, but it can provide much of the same functionality as a type system like Scala’s, just that it does so at runtime rather than compile time. In addition, it can be used to implement design-by-contract and dependent types and it can also generate samples of the specified data for use in testing. It’s not the same but it is an alternative.

                                                                                                                          2. 6

                                                                                                                            Yeah #8 and #9 (and arguably #7) really are just downsides that are framed as if they were upsides. “There’s no static typing, but here’s what you can do instead!” and “The startup time is really slow; here are some ways to work around that problem!”

                                                                                                                            1. 2

                                                                                                                              I read #9 as ‘by default, clojure is compiled, like java. But here’s a way to get instant(-ish) startup time, which is impossible with java.’

                                                                                                                              1. 2

                                                                                                                                Being compiled has nothing to do with how fast something starts; planck is compiled as well.

                                                                                                                                1. 1

                                                                                                                                  clojure is compiled, like java

                                                                                                                                  That is, clojure’s startup time characteristics are similar to java’s.

                                                                                                                                  1. 2

                                                                                                                                    uh … no?

                                                                                                                                    Clojure code can’t run without loading the Clojure runtime, which is implemented as an enormous pile of Java bytecode. A “hello world” in Java only has to load a single bytecode file, whereas a comparable Clojure program will have to almost all of clojure.jar before it can even begin to do anything.

                                                                                                                            2. 5

                                                                                                                              That sounds like someone who’s a bit too enthusiastic to acknowledge the shortcomings that any tool has.

                                                                                                                              Immediately after reading the article, I agreed with this comment. After re-reading it more critically, I think the issue isn’t that he is too enthusiastic, as much as that isn’t the point of this. Outside of the brief jab in the second to last sentence (“that positively separates Clojure from the rest”), to me this doesn’t read as a comparison between all the potential successors, just something aimed at getting people interested in trying Clojure.

                                                                                                                              As someone who hasn’t written Clojure before, but really enjoys Lisp-based languages, I found it to be a helpful overview of the language. The fact that there are no negatives listed doesn’t deter me from believing the positives any more than if I was looking for a new computer and the specifications didn’t list out other companies that make a better product. It just makes me want to carry out his last sentence and see for myself:

                                                                                                                              … the best way to learn Clojure is to actually use it.

                                                                                                                              1. 6

                                                                                                                                As a fan of static typing, I would not advertise Java’s implementation of it as a feature. More of an anti-feature. It doesn’t track whether or not a field or variable pointing at a reference type can be null or not. It doesn’t support algebraic data types.

                                                                                                                                For contrast, I would advertise the static type systems in Kotlin and Scala as features.

                                                                                                                                1. 2

                                                                                                                                  There is little difference between Java’s type system and Kotlin’s type system.

                                                                                                                                  1. 4

                                                                                                                                    Kotlin has literally the exact two features I just mentioned. Java does not.

                                                                                                                                    1. 1

                                                                                                                                      Yes, and those two features do little difference – so it’s weird saying “Java bad, Kotlin good”.

                                                                                                                                      1. 2

                                                                                                                                        Explicit nullability tracking is not a small deal. Never having to accidentally cause a NullPointerException again is liberating.

                                                                                                                                        ADTs mean you can implement everything in the “make wrong states unrepresentable” paper.

                                                                                                                                        1. 1

                                                                                                                                          That’s a bit like saying “look how crazy fast this 486 is .. compared to a 386!”.

                                                                                                                                    2. 2

                                                                                                                                      Doesn’t Kotlin have algebraic data types and pattern matching?

                                                                                                                                      1. 1

                                                                                                                                        Yes, barely, and no.

                                                                                                                                1. 3

                                                                                                                                  At this rate, C# 10 will be indistinguishable from F#! Although it’s weird that (per the top comment reply) records are only officially supported in .NET 5, when they don’t appear to be anything special compared to F# records (which evidently work fine currently). I hope that means F# records will have first-class runtime support in .NET 5, rather than there being two different-yet-identical record implementations.

                                                                                                                                  1. 1

                                                                                                                                    I think you are too optimistic. Maybe in .NET 7 :)

                                                                                                                                  1. 1

                                                                                                                                    F# lets you define a module with the same name as a different module (or class) in a different namespace, bring them both in scope, and use all definitions as if from a single module. There’s also type String with ... which I believe C# has a version of as well.

                                                                                                                                    1. 25

                                                                                                                                      0x5. I like when the publication date is easy to find.

                                                                                                                                      Oh my gods yes this. SO many blogs, and even actual news sites, omit the publication date. Information goes stale quickly people, especially technical judgements and opinions. Please.

                                                                                                                                      1. 4

                                                                                                                                        Some pages even deliberately change the publication date so it always looks fresh and up-to-date for SEO.

                                                                                                                                        1. 2

                                                                                                                                          I’ve heard about that trick too. Does anyone know if it really works…?

                                                                                                                                          1. 2

                                                                                                                                            As far as I know, search engine tech has long since outsmarted simple content-based tricks like this (and e.g. keyword stuffing) to the point where “SEO” is an obsolete strategy compared to simply writing good content.

                                                                                                                                            1. 2

                                                                                                                                              The quality (or lack thereof) of Google’s results lately does make me question that assessment.

                                                                                                                                              1. 3

                                                                                                                                                Ha, well, yes, there is that, but at least this was the general aura of advice while I was adjacent to the field a couple of years ago. The odd time I have used Google recently it feels like it’s gone the other way, where the poor quality results are because it’s trying to be too clever and completely missing the mark.

                                                                                                                                                1. 2

                                                                                                                                                  I’ve had, recently, searches where all the results, besides the one in the top, were malicious sites.

                                                                                                                                                  1. 4

                                                                                                                                                    I’m not surprised! Google is a high-profile target, and you can game any algorithm if you can figure it out. I guess I’m saying any SEO advice aimed at legitimate websites is likely outdated at best and snake oil at worst.

                                                                                                                                                    1. 1

                                                                                                                                                      I suspect Google just doesn’t care about their search engine anymore, as they’re getting as much money as they want elsewhere than search.