1. 4

    Seems like the Perl community is getting pretty lost. My team at work is still using Perl 5 for some pretty non-trivial applications, but there is no plan to ever change versions. Either keep maintaining or rewrite it in another language when we can. I imagine there are others in similar situations?

    1. 6

      I think you’re overestimating the cost of the version transition. If your team follows Perl’s best practices, they’re already not using the things that will be phased out. If they update to current Perl 5 versions, they’ll move on to Perl 5 and exhale in relief, not having to declare 10 lines of Modern Perl Boilerplate at the start of every file.

      It’s nowhere close to a Huge Language Change. It’s mostly a culture shock, like leont mentions in the post, where the “stability first” mentality that’s been driving Perl for all this years is being phased out in favour of “let’s actually make the new, good features available by default”.

      1. 3

        I’m learning Perl5 (after a brief glimpse at Perl6/Rakudo and saying to myself that Perl6 does not seem to have rooted enough).

        As I’m learning on my own, what cultural shock are you referring to ? I add to my learning bits of Perl, just ad hoc, at the moments I need some improvement, and that makes me learn something. (For example I’m not there yet to use what seems strikingly similar to OOP in Perl)

        Is it the fact of always having use strict; use warnings; and always using my for variables? Or are there deeper coding rules ? In such case, what is the name, or a name, for this group of recommendations ?

        1. 6

          what cultural shock are you referring to ?

          Like I mentioned in my post:

          the “stability first” mentality that’s been driving Perl for all this years is being phased out in favour of “let’s actually make the new, good features available by default”

          Perl5’s MO, for as long as I remember was “we never break old code, unless there is a really good reason. Everything should be backwards compatible by default”. It was not all roses, but the maintainers have stuck to it, for better or worse – a lot of progress was inhibited because of it. If you’re new to Perl you may have noticed that a lot of good features (like subroutine signatures) are locked out behind use experimental or similar: that’s because Perl really tries to not break old code. But because of this, the experience for a new programmer is really substandard – unless you know what to enable, the Perl you write is the Perl from roughly 20 years ago – hardly the best Perl there is.

          If you’re new here, you’re the main benefactor of this culture shock – good for you, and welcome to the community :) The change will mostly hurt the “I have a Perl code from 2004 that I haven’t updated since” people – and they often don’t update their Perls anyway.

          1. 2
        2. 3

          Perl 7 is still very far from workplace adoption, considering the project itself is still figuring it out. Its necessity is definitely obvious though. Perl is an awesome idea that should definitely keep being explored, nothing else is quite like it, so I think Perl 7 is a step in the right direction, they just need to figure out where to leave the footprints.

          First build the new thing, then push for adoption. One step at a time.

        1. 1

          I am trying to learn more about Pleroma and Elixir web development in general, and this was a great overview of the code structure itself. I am able to find my way around the codebase much better after reading this.

          1. 2

            This is awesome. I don’t know how they are able to add support for both old and new languages at the same time. But color me impressed. Xmake has become by go-to build tool.

            1. 10

              Doing some Erlang stuff :)

              1. 1

                I always wanted to get into Erlang but it seemed pretty intimidating. I read Learn you some Erlang but never got around to finishing it unfortunately. Hopefully this weekend I could make some time to mess around with it ;)

                1. 4

                  I’ve always wanted to work with Erlang. Even before it was open sourced I had my supervisor sign an NDA so that I could download it from Ericsson. At the time I saw it as the perfect platform for load balancers and the like. And it was not only me. Members of the Erlang team saw that too (link 1, link 2). But like most people I am not paid for stuff I love to hack with, rather on stuff people who pay think I am good at.

                  I have the book in print too. Mostly for library completeness.

                  So this is a 20 year long slow process for me.

                  1. 3

                    Go check it out! It’s my favorite programming language. It gets the functional parts right, the data structures right, the network & RPC primitives right… It’s a lot of fun. Build a small thing with it. I never found that book very helpful.

                    1. 1

                      I am evaluating Erlang for use in a professional project, so I have been spending some time learning it. I’ve been going through the Getting Started Guide from Erlang.org, and I’ve found it is actually very approachable and helpful just going through each example. Going through a whole book was too much for me right now.

                      1. 2

                        Your link to getting started is a little messed up (here it is fixed) https://erlang.org/doc/getting_started/users_guide.html

                        I’ve always had an interest in Erlang, but like most languages I’m never sure what to build :/

                  1. 1

                    When doing something like this on a production system, are there any dangers or extra load it puts on the VM?

                    1. 5

                      Yes. This is why libraries such as recon have been written. See Erlang in Anger for more content on debugging production systems.

                    1. 5

                      Ah, this is great! I was just starting to think through how I could port a lot of Lua codeI have into fennel. I’ll be giving antifennel a try tomorrow.

                      1. 6

                        Cool! There’s a good chance you’ll hit some bugs since I’ve only ever run this on a handful of codebases so far, so if you do (or if you don’t!) I’d be interested to hear about it.

                      1. 6

                        awesome! There is also this pretty exhaustive list: https://github.com/hengestone/lua-languages

                        1. 2

                          that is awesome, thanks a lot for sharing.

                          1. 1

                            And by the way, as mentioned in that repo, I’d love to see more languages compile directly to bytecode using Rochus Keller’s tools so tracebacks and debugging become less convoluted.

                            Willing to pony up for beer/coffee/pizza if someone wants to take on a project like that :)

                            1. 2

                              I’ve considered this, but the idea of being tied to one specific implementation seems like a big bummer when there are so many Lua runtimes out there; PUC, LuaJIT, Fengari, rembulan, moonsharp, go-lua, luerl, and a bunch more I’m forgetting.

                              1. 1

                                … though … thinking about it, one thing we’re working on for Fennel right now is a plugin API, which will add hooks/extension points for various parts of the compiler cycle.

                                Once that’s fleshed out a bit, it may eventually be possible to build a plugin that overrides the special forms in the AST responsible for emitting Lua with ones that emit bytecode instead.

                                It would at least make for a nifty experiment! It will be a while before that’s feasible, though; the compiler still has a number of internal functions that are tightly coupled with generating Lua, and it’ll take some time to break those up.

                          1. 2

                            I’ve tried a lot of Linux desktop environments, and Mint is easily my favorite. I can’t quite explain why except that it’s the only one I started using and never wanted to move away from or try another. Mate is probably a close second.

                            1. 2

                              I’ve been a Cinnamon user for a long time and before that I was using MATE. I’m currently on GNOME but to tell you the truth I’m not satisfied. Cinnamon’s great.

                            1. 6

                              I think Perl is slow to really go extinct because it is used as a tool very often (like sed and awk). If you know Perl, and you need to do this one specific one off thing, Perl is going to be a easy route to do it. Maybe no one wants to use it in new big projects, but it still comes in very handy when needed.

                              1. 3

                                This was a great read! I’ve been looking at postgraphile but wanted something that was just regular rest. Now I know there is postgrest!

                                But I have been thinking more and more about how critical knowing databases is for being able to build new things, especially when you don’t have the money or the people to build abstractions around databases. But, like mentioned in the article, it does require time, and that is precious.

                                1. 5

                                  There are a few tools like PostgREST out there. Supabase, Hasura, XGeneCloud, Prisma. You can also generate a REST API from OpenAPI specs with OpenAPI Generator. I’ve been working on a similar tool that can generate a REST API and admin UI from Postgres or MySQL.

                                  1. 2

                                    Do any of these tools intercept the query and rewrite it, possibly joining across multiple SQL backends? Of those that do, do they do query push down?

                                    1. 2

                                      Stardog’s virtual graphs can do that.

                                      1. 2

                                        Not that I’m aware of.

                                        1. 2

                                          I think Hasura can stitch GraphQL queries. Or I guess they call it remote joins: https://hasura.io/blog/remote-joins-a-graphql-api-to-join-database-and-other-data-sources/

                                        2. 1

                                          FWIW I’m writing out the Part 2 of this blog post where I ship actual code on AWS (hopefully for publishing tomorrow, repo here: https://github.com/yingw787/postgres_as_app), and it’s shockingly easy to get started with PostgREST. It’s tar one binary, copy in a conf file, and go. The robustness of Haskell with the simplicity of Go. All runtime conf options, like pagination, are handled via HTTP headers. It’s definitely a tool I want to incorporate into my future apps, because it’s stupid simple and transparent.

                                      1. 6

                                        As an amateur Common Lisper and professional Clojurian, it bothers me when people learn Clojure, get excited about “a Lisp”, and then start touting a bunch of features that have everything to do with Clojure being functional and nothing to do with it being a Lisp*. Pure functions and immutable data structures are neat, but they’re just as neat in Haskell or Elixir or OCaml or whatever—and arguably FP in Clojure would be even more powerful with better typing.

                                        It seems like CL’s focus on macros (and DSLs), multi-paradigm programming, an incredibly sophisticated object system (CLOS / the MOP), sophisticated error handling (conditions and restarts) and so forth has dropped out of current discussion. I realize half of that is CL-specific, but at the very least I wish there was more recognition of 1) why Lisps uses S-expressions and 2) the fact that Clojure is relatively unique among Lisps for using immutable data structures and defaulting to laziness.

                                        * The author did mention reader conditionals, but the specific use case is supported by other languages too

                                        1. 1

                                          I am new to Clojure, and I can echo your sentiments. Lots of stuff about the functional part of Clojure, but not too much of the Lisp side. Do you have any links that go into the Lisp side of things?

                                          1. 3

                                            Standard literature is:

                                            Practical Common Lisp for a general overview of CL

                                            On Lisp for advanced macro hackery

                                            Object-Oriented Programming in Common Lisp: A Programmer’s Guide to CLOS. You may also like diving down the C2 Wiki rabbithole.

                                            The Art of the Metaobject Protocol (C2 Wiki)

                                            1. 1

                                              Thank you! I’ve also done some fennel-lang programming, and they seem pretty much the same besides the ecosystem.

                                        1. 8

                                          Karabiner for me by far. I have access to over 500 actions/hotkeys without moving my fingers at all. Caps lock is too far so is return key. i.e. my return key is mapped to s+f. That is I press s key, then f key. My control key is a key. Most map control to caps lock but why map it to caps lock when you always hover over a key already.

                                          It’s pretty powerful stuff. My config. https://github.com/nikitavoloboev/dotfiles/blob/master/karabiner/karabiner.edn

                                          1. 2

                                            I love Karabiner. It is an essential part of my workflow on Mac. Vim bindings, layers, media controls, screen organization, all on my 60% keyboard with Mac-compatible keys is amazing.

                                            1. 1

                                              This looks awesome. I see that your config is EDN format but I’m seeing JSON in the docs. Do you just convert yours to json?

                                              1. 2

                                                Yeah its converted from EDN to Karabiner JSON using Goku (https://github.com/yqrashawn/GokuRakuJoudo)

                                              2. 1

                                                This looks amazing, admittedly I looked at karabiner when I had a 60% keyboard, but didn’t realize that it could do all the extra things it can do! I’m going to have to give this a try this weekend, may steal some of your config to test it out.

                                              1. 4

                                                Just recently been building a side project in Clojure. Wanted to learn a lisp and this seemed the most viable or relevant. Though I’m just learning it for fun and learning. After watching a few Rich Hickey talks and reading this, I really like his ‘vibe’, if I can use such a crass term. Similar to Larry Wall with Perl, I respect that they wanted to build a language that they liked, and so they did.

                                                1. 2

                                                  Whenever I read Larry Wall’s writings I like him even more. It’s like everything people love and hate about Perl is exactly what he wanted it to be. Plus he is very articulate.

                                                  Off topic, but his talk Perl, the first postmodern computer language is awesome.

                                                  1. 1

                                                    I haven’t used Tor Browser in a while but these new features seem pretty neat. Seems like they are trying to make onion urls more usable:

                                                    • websites can advertise their onion address to tor users
                                                    • onion error pages
                                                    • onion names (example.securedrop.tor.onion)
                                                    1. 5

                                                      Playing Ticket to Ride which is a boardgames I really liked the first times I played at friends. Making a bike trip to a nearby city. Cooking a lot. Messing with Julia and Franklin.jl because why not.

                                                      1. 2

                                                        Ticket to Ride is a great game! Which version are you playing?

                                                        1. 2

                                                          I played USA and Nederlands version and I will try the Europe version soon. The USA version is perfect to get a hold of the game and get addicted!

                                                      1. 4

                                                        (responding to myself) – and after searching a bit more I find this – https://github.com/agzam/spacehammer which is amazing if a bit more complex to understand.

                                                        1. 1

                                                          Never heard of Hammerspoon before. This is great! Thanks for sharing. Also go fennel-lang!

                                                        1. 3

                                                          I am trying to learn a lisp and I settled on fennel-lang, since I have a lot of Lua experience. But, working with fennel is showing me so much I never bothered to grasp about Lua. This is a post by one of the main fennel contributors, and it has so much useful and practical details about Lua. One of those times I realize I am not operating at the same level as other folks.

                                                          1. 6

                                                            I feel like with some languages you get pretty comfortable with them on the surface level, and then after you’ve been using it for a while you start to dig a little deeper and get really weirded out by some questionable choices in the lower-level bits that you’d been shielded from so far. Lua has been the opposite of this; the deeper into the language you get, the more appreciation you get for the fact that everything has a good reason behind it, even if there are times when I don’t 100% agree with it. (mostly around multiple values)

                                                            Glad you liked the post!

                                                            1. 2

                                                              I appreciate this; are you okay with sharing an insight or two into this? For example, I can’t imagine any good reason that referencing an undefined variable or table entry returns nil rather than an error. It might make “update table entry if it’s not there” easy I guess, but it’s been far more of a footgun than anything else each time I’ve used it.

                                                              1. 6

                                                                Great question.

                                                                I’m not 100% in agreement with this behavior when it comes to locals, but for tables I think Lua’s handling of nil is better than any other dynamic language I know (other than the ones like Erlang or Racket which just don’t have nil at all, which is a much safer path). In Lua, nil has exactly one meaning: it is the absence of a value. So when you look something up in a table and get nil back, there’s no ambiguity about “did I get a nil because someone put a nil in that table, or because the table has no value at that key?” It’s impossible to put nil in a table, and that’s great. It’s also very easy to turn a nil into an error; simply wrap it with assert, which returns its argument when truthy. In other languages that don’t work this way, you end up with nonsense situations like “I put nothing into this data structure, and now it contains more things than it did before”. Just logically absurd.

                                                                Now while that’s great for tables, applying this same logic to variables is more of a stretch. Part of it may be because global variables technically are nothing more than table lookups in the _G table. But I think the behavior they decided on is a compromise between “easy for newcomers to learn” vs “allows for more maintainable code in larger codebases”. They chose the out-of-the-box behavior that favors the former. But it’s worth noting here that just because it doesn’t work that way out of the box, it’s very easy to change the behavior so that trying to reference an undefined variable throws an error! (using metatables) And the people who are likely to benefit from this behavior are the more experienced programmers, who are also more likely to be knowledgeable enough to opt-in to stricter variables. That said, in Fennel we chose to make it a compile-time error to reference an unknown variable by default, and allow Lua’s sloppier approach as an opt-in flag.

                                                                So while I don’t totally agree with the decision that was made, I understand the rationale behind it, and it’s clear that they understood the tradeoffs and chose the compromise that best supported what they were trying to accomplish.

                                                                1. 2

                                                                  Aha, I didn’t realize Lua’s meaning for nil was quite so specific; I am indeed more used to Python’s ability to, say, insert multiple None‘s into a list. That’s a fantastic explanation, thank you!

                                                          1. 1

                                                            What are the use cases for fortran? What would be the things it is/could best used for?

                                                            1. 2

                                                              Just search for “scientific” and “HPC” computing. It’s used in a lot of that. It helps that it’s a language that’s easy to optimize and has lots of optimizations over time for these things.

                                                            1. 24

                                                              I can appreciate the sentiment of this article, but it does border on encouraging incompetence. I know people who really treasure that they’ve always been “nerds” and “into computers and programming”, but were actually very ineffective. But, I’ve seen the other way too, where people clearly are just interested in trying to skate by with an easy gig, minimal effort, no extra effort at learning new things or gaining useful skills unless required.

                                                              I feel like hard work, competence, and initiative is all that is expected. These are hard to define in practical steps, but easy to spot when you see it.

                                                              1. 10

                                                                I agree. Imposter syndrome is very real, and I understand that many people don’t want to be the stereotypical nerd-cliche programmer or a math-major computer scientist. It’s a wide field and there’s room for everyone.

                                                                But the author of this article even goes so far as to say they do not understand functions of their job, or things that they have been shown how to do repeatedly. Which is honestly not something I feel you should be telling everyone on your blog.