Threads for nutty-buddy-bars

  1. 1

    The proliferation of browser-based docs is interesting to me, because it suggests there’s a critical mass of people who flip back and forth between their editors and a browser all the time while they program. Is this a web dev thing? It’s hard for me to imagine using docs that aren’t integrated into my editor.

    1. 2

      I do this, but that’s partially since my editor is vim, so unless I’m looking for vim documentation, I need to look it up elsewhere. For man pages and (where available) C library APIs I just use good-old man(1), but for most library reference docs I reach for the browser. I am not primarily doing web development.

    1. 2

      Is anyone else getting a rendering error where if you look at a man page (e.g., tar) there’s a menu on the left that covers most of the text?

      I thought it was because I browse with JavaScript off, but I tried reloading with JavaScript on and I get the same problem.

      1. 1

        Can someone ELI5 why it’s important to distinguish between “exactly once” and “at least once” plus “idempotent processing”?

        Is there something functionally different about the two? Maybe “exactly once” implies a degree of efficiency that might matter in some applications?

        Or is it just a way to signal that you have heard of Two Generals and aren’t doing all the easy, reasonable, wrong things that someone like me might try?

        1. 1

          Given a system that delivers messages, and a system that receives and processes those messages, “exactly once” means the receiving system doesn’t need to be idempotent. This is important because “idempotent processing” can be nontrivial to achieve in practice.

          1. 2

            Thanks, I hadn’t thought of it as a statement about an interface rather than a statement about an implementation detail inside a system.

        1. 5

          Not sure that nitpicking the OCaml asides is really on topic here, but that is the part I know anything about, so:

          After this article was published, Akiva Leffert reminded me that SML later settled on a third fix to this problem, the “value restriction”

          OCaml also uses the value restriction and it’s…basically fine? Sometimes you have to eta-expand things. That’s not usually a problem because most OCaml code I’ve seen will prefer fully eta-expanded definitions as a stylistic choice anyway.

          The only example I know where it’s a real problem was for implementing lenses. I think they ended up writing a ppx to do all the eta expansion automatically.

          Also, wow, he’s been away from ML a long time if the value restriction happened “later.”

          Here, OCaml’s +. trick was unworkable. You cannot have a different identifier for equality comparisons at every different type.

          Why not? In OCaml you can have String.(=), Int.(=), and Bool.(=). You can even have String.(=) and String.Caseless.(=), because some strings are case sensitive and others aren’t.

          The ability to define custom comparisons is crucial for stuff like

          type user = {
            display_name : string; (* not necessarily unique *)
            id : int;              (* use this for comparison *)
            }
          

          (Well, I guess crucial is hyperbole. JavaScript has no way to specify custom comparisons for keys of maps and that hasn’t stopped the entire internet from getting stuff done.)

          1. 5

            SML still uses a stronger than really necessary version of the value restriction. OCaml makes the user eta-expand much less often thanks to that work by Jacques Garrigue et al.

            Regarding Int.(=) and similar, I think the reason they weren’t used is that they would be really annoying to use, especially before local module opens.

            1. 3

              It also seems like OP isn’t aware of local opens and the operator-overloading pattern that they enable.

            1. 4

              What did it mean for the zig self hosted compiler to be self hosted if it wasn’t previously able to build itself?

              (I couldn’t figure it out how to make this not sound snarky, but it’s really not. I’m not a compiler/PL person.)

              1. 3

                It means previously it was a compiler written in Zig, which accepted some subset of Zig programs, which included many Zig programs but not itself.

                1. 1

                  Thanks!

                1. 4

                  We need to pick “looser” groups which aren’t so tied to people’s identity. So maybe:

                  • Left-handed people

                  Am left handed. Read a book about lefties once. I think lefties are indeed among the loosest group you’ll find. With the exception of Ned Flanders, nobody’s really proud or ashamed of being a lefty. It’s just a thing, and not a really important one. (Speaking from a Central European perspective. I’m not surprised if there are still regions that „has bo lefties“ :/)

                  1. 7

                    I’m fairly tall (~1.95m, or about 6’4”) and there are all sorts of things that clearly aren’t designed for people of my size. I’ve been in buses where my legs just don’t fit, there have been hotel room beds that are just too small (camping tents that are not tall enough are double fun), buying clothes can be a challenge (a lot of “large” clothing is designed for people who are large in multiple dimensions, and doesn’t look too great on someone who is large only in the vertical sense), all sorts of things are too low for me (kitchen tables/sinks, desks), etc.

                    Many women seem to like it so that’s nice I guess 🤷 But other than that it’s just downsides really.

                    It’s basically impossible to design around all these things really, but it’s still frustrating at times.

                    1. 2

                      At 1.93m height, I feel ya. Pants usually work, because e.g., jeans come in waist/length sizes and I have two nice tents from Exped and Hilleberg, that are OK for my height/length. :) For the rest, I can only say “yup. sucks”

                    2. 3

                      Except, that is, Orthodox Jewish lefties, who are considered better qualified to work as scribes. (The reason for that is left as an exercise for the reader.)

                      1. 1

                        not fair. it takes a fair bit of knowledge to understand that one.

                        1. 1

                          Is it referring to anything more than the fact that hebrew is a right to left language?

                          1. 1

                            Nope. To be perfectly honest, I’m not sure why I wrote that. I guess I just wanted to comment… 😀

                    1. 4

                      Server side go is the old fashioned way now?

                      I feel old.

                      1. 5

                        Want to impress your boss with a super snappy, low maintenance, quickly build, trivial to install backend system which Just Works? Use go templates and old-school forms. It’s unbeatable in many respects :)

                      1. 6

                        I have been on the lookout for an indentation based language to replace Python for some time now as an introductory language to teach students. Python has too many warts (bad scoping, bad implementation of default parameters, not well-thought-out distinction between statements and expressions, comprehensions are a language within the language that makes student’s life difficult, and so on.). Is Nim the best at this point in this space? Am I missing warts in Nim that makes the grass greener on the other side? Anyone who has experience with both Nim and Python, can you tell me what the trade-offs are?

                        1. 9

                          I am uncomfortable with statements like (from this article) “if you know Python, you’re 90% of the way to knowing Nim.” The two languages are not IMO as similar as that. It’s sort of like saying “if you know Java, you’re 90% of the way to knowing C++.” Yes, there is a surface level syntactic similarity, but it’s not nearly as deep as with Crystal and Ruby. Nim is strongly+statically typed, doesn’t have list comprehensions, doesn’t capitalize True, passes by value not reference, has very different OOP, etc.

                          That said, there’s definitely evidence that Nim has a smooth learning curve for Pythonistas! This isn’t the first article like this I’ve read. Just don’t assume that whatever works in Python will work in Nim — you don’t want to be like one of those American tourists who’s sure the locals will understand him if he just talks louder and slower :)

                          So yes, Nim is excellent. It’s quite easy to learn, for a high performance compiles-to-machine-code language; definitely easier than C, C++ or Rust. (Comparable to Go, but for various reasons I prefer Nim.) When programming in it I frequently forget I’m not using a scripting language!

                          1. 2

                            Thank you for your perspective. Much appreciated.

                            1. 1

                              passes by value not reference

                              The terminology here is very muddied by C, so forgive me if this sounds obvious, but do you mean that if you pass a data structure from one function to another in Nim, it will create a copy of that data structure instead of just passing the original? That seems like a really odd default for a modern language to have.

                              1. 4

                                At the language level, it’s passing the value not a reference. Under the hood it’s passing a pointer, so this isn’t expensive, but Nim treats function arguments as immutable, so it’s still by-value semantically: if I pass an array or object to a function, it can’t modify it.

                                Obviously you don’t always want that. There is a sort-of-kludgey openarray type that exists as a parameter type for passing arrays by reference. For objects, you can declare a type as ref which makes it a reference to an object; passing such a type is passing the object by reference. This is very common since ref is also how you get dynamic allocation (with GC or more recently ref-counting.) It’s just like the distinction in C between Foo and *Foo, only it’s a safe managed pointer.

                                This works well in practice (modulo some annoyance with openarray which I probably noticed more than most because I was implementing some low-level functionality in a library) … but this is going to be all new, important info to a Python programmer. I’ve seen this cause frustration when someone approaches Nim as though it were AOT-compiled Python, and then starts either complaining or asking very confused questions on the Nim forum.

                                I recommend reading the tutorial/intro on the Nim site. It’s well written and by the end you’ll know most of the language. (Even the last part is optional unless you’re curious about fancy stuff like macros.)

                                (Disclaimer: fate has kept me away from Nim for about 6 months, so I may have made some dumb mistakes in my explanation.)

                                1. 4

                                  Gotcha; I see. I wonder if it’d be clearer if they just emphasized the immutability. Framing it in terms of “by value” opens up a big can of worms around inefficient copying. But if it’s just the other function that’s prevented from modifying it, then the guarantee of immutability isn’t quite there. I guess none of the widely-understood terminology from other languages covers this particular situation, so some new terminology would be helpful.

                            2. 5

                              Python has too many warts (bad scoping, bad implementation of default parameters

                              I don’t want to sound like python fanboy, but those reasons are very weak. Why do you need to explore the corner cases of scoping? Just stick to a couple of basic styles. Relyokg on many scoping rules is a bad idea anyways. Why do you need default parameters at all. Many languages have no support for default parameters and do fine. Just don’t use them if you think their implementation is bad.

                              Less is more. I sometimes flirt with the idea of building a minimal indendtation based language with just a handful of primitives. Just as a proof of concept of the practicallity os something very simpl and minimal.

                              1. 7

                                At least for python and me, it’s less a matter of exploring the corner cases in the scoping rules and more a matter of tripping over them involuntarily.

                                I only know three languages that don’t do lexical scoping at this point:

                                1. Emacs lisp, which does dynamic scoping by default for backwards compatibility but offers lexical scoping as am option and strongly recommends lexical scoping for new code.

                                2. Bash, which does dynamic scoping but kind of doesn’t claim to be a real programming language. (This is wrong but you know what I mean.)

                                3. Python, which does neither dynamic nor lexical scoping, very much does claim to be a real programming language, and has advocates defending its weird scoping rules.

                                I mean, access to variables in the enclosing scope has copy on write semantics. Wtf, python?

                                (Three guesses who started learning python recently after writing a lexically scoped language for many years. Thank you for indulging me.)

                                1. 4

                                  It is weirder than copy on write. Not tested because I’m on my iPad, but given this:

                                  x = 1
                                  def f(cond):
                                     if cond:
                                        x
                                     x = 2
                                  

                                  f(false) does nothing, but f(true) will thrown an undefined variable exception.

                                  1. 4

                                    I think you need nonlocal x but I don’t quite get why this is weird/nonlexical.

                                    It has lexical scoping but requires you mark variables you intend to modify locally with ‘nonlocal’ or ‘global’ as a speed bump on the way to accidental aliasing. I don’t think I’d call puthon “not lexically scoped”

                                    1. 3

                                      Have you tried declaring a variable inside an if?

                                      if True:
                                          X = 1
                                      print(X)
                                      
                                      1. 1

                                        Yeah, if doesn’t introduce scope. Nonlexical scope doesn’t IMO mean “there exist lexical constructs that don’t introduce scope”, it is more “there exist scopes that don’t match any lexical constructs”

                                        1. 2

                                          I just learned the idea of variable hoisting thanks to this conversation. So the bizarre behavior with carlmjohnson’s example can be understood as the later assignment declaring a new local variable that comes into scope at the start of the function. Because python does block scope instead of expression scope.

                                          I guess I’ve been misusing “lexical scope” to mean expression-level lexical scope.

                                          I still find the idea of block scope deeply unintuitive but at least I can predict it’s behavior now. So, thanks!

                                          1. 1

                                            Yeah I’m not a huge fan either tbh, but I guess I’ve never thought of it as weird cause JavaScript has similar behavior.

                                      2. 2

                                        I agree. This is more of a quirk due to python not having explicit variable declaration syntax.

                                        1. 2

                                          It’s multiple weird things. It’s weird that Python has† no explicit local variable declarations, and it’s weird that scoping is per function instead of per block, and it’s weird that assignments are hoisted to the top of a function.

                                          † Had? Not sure how type declaration make this more complicated than when I learned it in Python 2.5. The thing with Python is it only gets more complicated. :-)

                                          Different weird thing: nonlocal won’t work here, because nonlocal only applies to functions within functions, and top level variables have to be referred to as global.

                                    2. 3

                                      JavaScript didn’t have it it either until the recent introduction of declaration keywords. It only had global and function (not block) scope. It’s much trickier.

                                      But I am puzzled with why/how people stumble up on scoping problems. It doesn’t ever happen to me. Why do people feel the urge of accessing a symbol on a block outside the one when it was created? If you just don’t do it, you will mover have a problem, on any language.

                                      1. 1

                                        For me it’s all about closures. I’m used to using first class functions and closures where I suspect an object and instance variables would be more pythonic.

                                        But if you’re used to expression level lexical scope, then it feels very natural to write functions with free variables and expect them to close over the thing with the same name (gestures upward) over there.

                                        I’m curious, do you use any languages with expression level scope? You’re not the first python person I’ve met who thinks pythons scope rules make sense, and it confuses me as much as my confusion seems to confuse you.

                                        1. 2

                                          I don’t need to remember complicated scoping rules because I don’t ever use a symbol in a block higher up in the tree than the one it is defined in. Nor do I understand the need to re-assign variables, let alone re-using their names. (Talking about python now). Which languages qualify having expression level scope? Is that the same as block scope? So… Java, modern JavaScript, c#, etc?

                                          I am confused. What problems does python pose when using closures? How is it different than other languages in that respect?

                                          1. 1

                                            I use closures in python code all the time. I just tend not to mutate the free variable. If you do that, then you don’t need to reference the free variable as global or nonlocal. If I was mutating the state then I might switch over to an object.

                                    3. 5

                                      Nim is pretty strongly typed, that is certainly different from Python. I’m currently translating something with Python and Typescript implementations, and I’m mostly reading the Typescript because the typing makes it easier to understand. With Nim you might spend time working on typing that you wouldn’t do for Python (or not, Nim is not object oriented), but its worth it for later readability.

                                      1. 4

                                        Nim is less OO than Python, but more so than Go or Rust. To me the acid test is “can you inherit both methods and data”, and Nim passes.

                                        Interestingly you can choose to write in OO or functional style, and get the same results, since foo(bar, 3, 4) is equivalent to foo.bar(3, 4).

                                        IIRC, Nim even has multimethods, but I think they’re deprecated.

                                        1. 2

                                          what? don’t you mean foo(bar, 3, 4) and bar.foo(3, 4)? AFAIK the last token before a parenthesis is always invoked as a function.

                                          1. 1

                                            Oops, you’re right!

                                          2. 1

                                            what? don’t you mean foo(bar, 3, 4) and bar.foo(3, 4)? AFAIK the last token before a parenthesis is always invoked as a function.

                                        2. 3

                                          Latest release of Scala 3 is trying to be more appealing to Python developers with this: https://medium.com/scala-3/scala-3-new-but-optional-syntax-855b48a4ca76

                                          So I guess could make it an option.

                                          1. 2

                                            Thanks!, this certainly looks interesting. Would it make an introductory language, though? By which I mean that I want to explain a small subset of the language to the pupil, and that restricted language should be sufficient to achieve fairly reasonable tasks in the language. The student should then be able to pick up the advanced concepts in the language by self exploration (and those implementations should be wart free. For example, I do not want to explain again why one shouldn’t use an array as a default parameter value in Python).

                                            1. 2

                                              There is no such thing as a programming language that is “wart free”, and while initially you want to present any language as not having difficulties or weirdness, in the long run you do need to introduce this to the student otherwise they will not be prepared for “warts” in other languages.

                                          2. 1

                                            Depending on what you’re trying to teach, Elm does fit your description of an introductory language for teaching students that uses indentation. I know there’s a school that uses Elm for teaching kids how to make games, so it definitely has a presedence for being used in education too. Though, of you’re looking to teach things like file IO, http servers, or other back end specific things then it’s probably a poor choice.

                                          1. 2

                                            In our analysis, we figured out that the most frequent category of bugs caught by End-to-End tests was schema violations

                                            Is a schema violation something more subtle than “this was supposed to have a foo field but it doesn’t”? Or, “it was supposed supposed to be a string but it’s null”?

                                            How was that the common bug caught by end to end testing? Did they completely not have unit tests before? This reads like a straw man dreamed up by some kind of static typing zealot.

                                            (I say this as a static typing zealot.)

                                            1. 3

                                              How was that the common bug caught by end to end testing? Did they completely not have unit tests before?

                                              I think here it’s because the data is coming from a different service, so the E2E test fails if one service changes its data format and the client doesn’t. A unit test (or static typing) wouldn’t cover that because it’s different codebases.

                                              1. 1

                                                Is it common practice to change your end points in place?

                                                What I’ve always seen done is that each end point either never changes or only changes in backwards compatible ways. Then the server and client can independently use unit tests or types to check that they satisfy or understand the schema of that end point.

                                                Actually for monoglot code bases I’ve mostly seen services provide a client side library that handles the versioning internally and exposes an unversioned api to the client linking it.

                                              2. 1

                                                It might be something like “it’s supposed to be a valid NANP phone number, but it’s not” (experienced that one at work).

                                              1. 6

                                                Should I be embarrassed by how long it took me to realize that this was satirical?

                                                Or should rust?

                                                1. 9

                                                  Sound like some people in here are talking about unconsciously continuing to work inc a problem after hours:

                                                  • “debugging happens on the toilet”
                                                  • “stuck on a tough problem long enough”
                                                  • “Taking time off on the bed”

                                                  And others are talking about involuntarily imposing the patterns of software onto non-software things, productively or not:

                                                  • “spinning incoherently, thinking in terms of programming constructs”
                                                  • “parsing other people as structs”
                                                  • “correlating politics and social structures with arquitectural problems in software”

                                                  (I’m down for either or both conversations, Fwiw)

                                                  1. 12

                                                    I go the other way. I gave up on lisps because I love my types too much, but I wish more languages had s-expresion syntax - they’re such a joy to edit in an editor with appropriate tooling.

                                                    1. 6

                                                      Have you tried Carp?

                                                      https://github.com/carp-lang/Carp

                                                      1. 1

                                                        I have not, but it looks pretty cool. I don’t get much time to noodle around with random languages any more =|

                                                      2. 6

                                                        they’re such a joy to edit in an editor with appropriate tooling.

                                                        I’d say this differently: it’s easier to build appropriate tooling for S-expression based languages. But if you have “extend selection”, a bunch of intentions for common editing tasks, typing assists and proper cursor placement, you’ll get a better editing experience for any language. But yeah, building all that is non-trivial.

                                                        1. 2

                                                          Hear hear! I started writing an s expression syntax for python once.

                                                          It was a sad day when I admitted thatsuch a thing would have a user base of exactly one.

                                                          1. 5

                                                            Have you seen Hy lang?

                                                            1. 2

                                                              Surely you mean a use base of two!

                                                              :-D

                                                              1. 1

                                                                There’s https://github.com/hylang/hy in that field

                                                                1. 2

                                                                  Jinx!

                                                              2. 2

                                                                I think that’s a form of BDSM ;-)

                                                                1. 3

                                                                  Benign Dictator S-expression Mandates?

                                                              1. 12

                                                                No other language has people claiming what the Lisp people claim. Many langs claim to be influenced by Lisp, or try to do things that Lisp can do, or do things that started in Lisp (which is just about everything but OOP). But the Lisp crowd doesn’t see a need to be like other languages. It’s like fat people want to date fit people, but fit people do not want to date fat people.

                                                                Been a while since I last got to call someone a Smug Lisp Weenie

                                                                1. 17

                                                                  Also, astonishingly gratuitous swipe at fat people.

                                                                  What was that supposed to accomplish? Most people don’t listen better when you start off by randomly reminding them how many people don’t think they’re attractive.

                                                                  1. 5

                                                                    You’re welcome.

                                                                  1. 8

                                                                    To paraphrase the old saw about computers and productivity:

                                                                    “We see evidence of the efficacy of Lisp everywhere except in production code. “

                                                                    1. 9

                                                                      I’ve been using lisp nearly exclusively at work since 2009, and it’s been very successful. I believe the reason you don’t see it is that it requires companies to invest in training their people. You can’t hire many people who have the skills you need, but you can teach them, and we’ve had great success in leveling people up with lisp who have never seen it before in their life. But it requires an investment and many companies simply aren’t willing to invest in people.

                                                                      1. 4

                                                                        There was an interesting anecdote in this story:

                                                                        https://lobste.rs/s/xzzrct/lisping_at_jpl_2002

                                                                        The Remote Agent software, running on a custom port of Harlequin Common Lisp, flew aboard Deep Space 1 (DS1), the first mission of NASA’s New Millennium program. Remote Agent controlled DS1 for two days in May of 1999. During that time we were able to debug and fix a race condition that had not shown up during ground testing. (Debugging a program running on a $100M piece of hardware that is 100 million miles away is an interesting experience. Having a read-eval-print loop running on the spacecraft proved invaluable in finding and fixing the problem. The story of the Remote Agent bug is an interesting one in and of itself.)

                                                                        The author also offers this up at the end:

                                                                        The demise of Lisp at JPL is a tragedy. The language is particularly well suited for the kind of software development that is often done here: one-of-a-kind, highly dynamic applications that must be developed on extremely tight budgets and schedules.

                                                                        1. 2

                                                                          We see evidence of the efficacy of Lisp everywhere except in production code

                                                                          Yeah, and oddly it seems like projects that grew to success with Lisp choose to embark on a rewrite journey using another language. Few examples: Viaweb, reddit.

                                                                          I’m baffled by this, but then again, I’ve never written anything serious on Lisp. The language (at least the Common variant) seems to be fairly practical and has high-quality implementations.

                                                                          http://www.aaronsw.com/weblog/rewritingreddit

                                                                          1. 2

                                                                            My guess: expressive static types make refactoring easier, and easy refactoring becomes more important as your code base grows.

                                                                            You’ll always need tests. A lot of behaviors are hard to prove (or even define) statically. Does this error out when it exceeds some configurable limit? In sure you can do this with dependent types or formal verification, but I won’t, and you probably don’t care enough to pay someone who will.

                                                                            But a lot of behaviors are way easier to enforce with types than tests. Is this a string? Is it a valid user name, or can it be an error message too? Can it just be null? The more of these easy properties you can offload to the type checker, the more of your time you can dedicate to writing tests for the hard stuff.

                                                                            Or, the less time it takes to get to fearless refactoring.

                                                                            1. 6

                                                                              It’s 100% about hiring. (OK, maybe 95%…)

                                                                              Early on a small team can move really quickly in lisp languages (I don’t buy the argument that macros magically double your effectiveness, at best you’re going to get a boost of 10-15% with a lisp, and most of that doesn’t come from macros) but when a company gets big they start to get nervous about what happens when their original team moves on. Very rarely this will happen at a company that’s got a culture that values training and spending time to invest in their new hires, and they’ll keep the language, but usually they bring in MBAs who don’t know how to operate unless every worker is a replaceable cog.

                                                                              1. 1

                                                                                What is the boost with a Lisp, besides macros? Afaik macros are the only unique part of lisps that haven’t been subsumed by other languages

                                                                                1. 5

                                                                                  Great question. Here are the advantages I was thinking of:

                                                                                  • Regularity of syntax
                                                                                  • Repl-first interactive development
                                                                                  • Conceptual simplicity

                                                                                  The only non-lisp I know which achieves the first is Forth, which also hasn’t seen much production uptake. Maybe Rebol?

                                                                                  The second one is particularly interesting because nowadays lots of languages can technically support a repl, but it’s rare to see languages which really embrace it to the extent that lispers do. Erlang is the only language I know where this happens a lot. (Other than Smalltalk, of course.) You can do it in Ruby, but … no one does, for some reason? I can’t say I understand this at all.

                                                                                  The last one is harder to put my finger on. But all my professional lisp experience comes from Clojure, and being able to take advantage of the JVM and its libraries without the suffocating ceremony of Java gives you a definite edge. I guess this one doesn’t apply to lisps in general though; Common Lisp’s spec is famously enormous, and Racket is a big language with certain murky corners (like the class system) that most people just pretend don’t exist. Emacs Lisp is clunky as hell but makes up for it in the second category, taking it further than anyone except Smalltalk.

                                                                                  So I don’t mean to say that these advantages are unique to lisps, but in the context of this thread we’re talking about lisps in comparison to languages which have seen widespread production adoption.

                                                                                  1. 3

                                                                                    At least as far as common lisp goes: stability, resource-efficient implementation, gradual typing and the best REPL.

                                                                                    Negatives: you’re practically forced to use emacs and the language is clunky at some places. And everybody’s suspicious of common lisp because there are so few success stories.

                                                                                    Macros are almost totally worthless to me, frankly. Of course, when it so happens that their power is needed, they’re pretty damn good. S-expressions are artistically fascinating, but I also feel like they’re usually more difficult to read. I would expect that to change rapidly for the better if I actually worked with common lisp for a while.

                                                                                    1. 2

                                                                                      Except they’re not unique to LISP. Nim has a very powerful macro feature that has been used for, among other things, adding async/await to the language. I was tempted to try to implement a SQL parser in a macro, but never got around to it.

                                                                                      1. 3

                                                                                        I haven’t used Nim and am a novice Lisper so I can’t comment on it - would be interesting to hear a comparison of the macro system from someone who has used a lot of each language. Those statically typed languages with macros ala Zig, Jai etc are very interesting as successors to C

                                                                                        1. 1

                                                                                          I haven’t gotten deep into Nim macros, but in a nutshell, a macro function is evaluated at compile time and is passed the ASTs of its arguments (there is an AST module defining the structs for this.) The macro code then generates a new AST and returns it.

                                                                                          1. 3

                                                                                            The difference is that Nim macros operate on AST nodes which use a completely separate notation for expressing code than programmers normally use when writing it. You can accomplish the same thing in Nim as in lisps of course (turing tarpit, etc) but in non-lisps you have to translate between the two notations in your head.

                                                                                            1. 2

                                                                                              Yes, but I’d much rather do that mental translation on the rare occasions that I write or edit a macro, than all the time when I write regular code.

                                                                                              1. 2

                                                                                                I’m not trying to convince anyone, just explaining the tradeoffs. But there’s no “translation” involved in writing regular lisp code once you know it, any more than you’re translating pseudocode in your head into Algol-like notation when writing C.

                                                                                                That feeling you’re describing is due to unfamiliarity, not due to lisp. You would feel the same mental effort when you start writing prolog, or factor, or smalltalk.

                                                                                  2. 3

                                                                                    Reddit was rewritten in another dynamic language (python) so I don’t think static types are a perfect answer here. I suspect many rewrites are for people reasons: easier to hire and bigger ecosystem access libraries.

                                                                                    E.g., I saw this article about writing new services in Kotlin from a company that does a lot of Elixir work.

                                                                                    No matter how intelligent or smart any single person, you really can’t beat the millions of people years that have been put into big ecosystems.

                                                                                    1. 2

                                                                                      How much more prevalent was Python than Common Lisp when Reddit was rewritten?

                                                                                      1. 3

                                                                                        TBH, I’m not sure. The TIOBE Very Long Term History chart says that in 2006 Lisp was 13th and Python was 8th. (Of course, TIOBE, Red Monk, etc. are questionable.)

                                                                                        That said, it looks like my suspicions were wrong. Here is Aaron Swartz’s blog post on switching from Lisp to Python. Here are some salient quotes:

                                                                                        Over at reddit.com, we rewrote the site from Lisp to Python in the past week. It was pretty much done in one weekend. (Disclosure: We used my web.py library.) The others knew Lisp (they wrote their whole site in it) and they knew Python (they rewrote their whole site in it) and yet they decided liked Python better for this project. The Python version had less code that ran faster and was far easier to read and maintain.

                                                                                        Others assumed there must have been outside pressure. “Either libraries or hiring new programmers I guess.” Another concluded: “some vc suit wants a maintainable-by-joe-programmer product. I hope he pays you millions.”

                                                                                        The more sane argued along the lines of saying Lisp’s value lies in being able to create new linguistic constructs and that for something like a simple web app, this isn’t necessary, since the constructs have been already built. But even this isn’t true.

                                                                              1. 9

                                                                                In video games, an oft-overlooked accessibility feature that also gets constant use is the ability to remap input to different keys/buttons. It’s so overlooked that I feel people don’t even realize it’s actually an accessibility feature, because so many people take advantage of it for simple things like, “Why would you set run to this?” The reason it’s an accessibility feature is that it allows people without the fine-motor skills to hit certain buttons or key combinations to reconfigure their input to something they can use, but again, we don’t realize that because it’s so obviously something that’s beneficial to the vast majority of players regardless.

                                                                                At its core, accessibility is about customizability, something that shows a respect by the developer for the end-user. Good customizability doesn’t even need to fully understand a cause for the need to customize (“I’m deaf” vs. “I want to eat chips”), it just needs to understand that someone has occasion to want that choice. Obviously there are accessibility features that would see more limited use outside of the direct need they’re addressing (color-blind options come to mind), but it seems to me that if your commercial software struggles to implement that particular feature then it’s a failure of software design; you hard-coded your text, or your color scheme, or your inputs, and now you feel the friction of the assumptions that went into that.

                                                                                I wonder if it wouldn’t be an easier sell to teach developers about the value of customizability as a quality indicator for their software more than trying to compel via the more moral arguments about accessibility.

                                                                                1. 4

                                                                                  Remapping is quite big in PC gaming – from the Quake tradition of console/autoexec binds that still persists in even very distant descendants like CS:GO to the bindings editor in SteamVR, there are lots of amazing examples, but even the average 2000s console port usually has some mapping menu.

                                                                                  easier sell to teach developers about the value of customizability

                                                                                  Well, for big serious products, you might have to deal with something else: not developers ignoring customizability, but business/marketing heads being obsessed with Bringing a Complete Vision™ and Unified Experience®, i.e. specifically selling non-customizability as a feature.

                                                                                  1. 2

                                                                                    Obviously there are accessibility features that would see more limited use outside of the direct need they’re addressing (color-blind options come to mind)

                                                                                    I have a non-accessibility use for color-blindness support: my telephone is primarily an e-reader, so I got one with a black and white e-ink screen. I was shocked, shocked! at how dramatically that narrowed my software options. (Totally worth it, though.)

                                                                                    1. 1

                                                                                      interesting, which model is it? my current phone is slowly dying and I’m considering buying something weird to replace it.

                                                                                      1. 2

                                                                                        Hisense A5 pro. It does not officially support Google Services Framework. There are guides online for how to get it kind of mostly working. I’m okay with that, but YMMV.

                                                                                  1. 7

                                                                                    Kalyn adopts Haskell’s abstraction of monads with youthful exuberance.

                                                                                    You might think that using monadic IO is in conflict with the design goal of making Kalyn as easy as possible to compile. You would be correct. But it’s so cool!

                                                                                    He’s so happy it makes me happy.

                                                                                    1. 2

                                                                                      Please,can someone post a working link to the dolan paper? Inquiring minds want to know!

                                                                                        1. 1

                                                                                          Thanks!

                                                                                      1. 21

                                                                                        Please don’t bring this toxicity over to lobste.rs. Let it live and die on the orange site.

                                                                                        1. 19

                                                                                          I’ve had a few interesting discussions about our tribal and memetic expectations as exemplified by this repository. Sometimes, when somebody does something unbearably cringy in the name of what they think is supremely excellent taste, it is an opportunity to delve deeper into their implicit beliefs.

                                                                                          Nowhere in this repository is it ever imagined that C is not an appropriate language for today’s coders. Rather, the machismo which is required to write fresh C code against an ever-steeper gradient of better toolchains for higher-level languages is also the same machismo which is stoked by the underlying family of memes used to theme and decorate the repository.

                                                                                          Sometimes a project’s only purpose is to serve as a warning to others. Even in those moments, let us learn something from the precise nature of the warning.

                                                                                          1. 22

                                                                                            Can you define what you mean by ‘toxicity’? I don’t see anything ‘toxic’ in this repository.

                                                                                            1. 5

                                                                                              I don’t like the way its naming and meming relies on using virgin man vs not as a shorthand for bad vs not, however ironically.

                                                                                              It’s a cool trick. Why couple it with a bad meme?

                                                                                              1. 19

                                                                                                The meme is incredibly funny, that’s why.

                                                                                            2. 21

                                                                                              Toxicity? Orange site? I didn’t get any of that.

                                                                                              I could agree that the theming is a little overboard, not because of bad taste, but because it detracts from the technical side, as speps said.

                                                                                              Code needs to market itself, and it seems “skullchap” had some fun in that department.

                                                                                              1. 11

                                                                                                It seems interesting from a technical perspective but I agree on the bad taste aspect, it detracts from the technical side.

                                                                                                1. 8

                                                                                                  I think we need a new flag, because this isn’t really spam or off-topic: I suggest “bad taste” ;)

                                                                                                  1. 27

                                                                                                    The best way to deal with content that’s on-topic but otherwise not very valuable is simply to ignore it.

                                                                                                    A comment, btw, counts as an upvote, at least as far as visibility on the front page is concerned.

                                                                                                    1. 16

                                                                                                      Or maybe some more tags. “based” and “redpilled” come to mind :-D

                                                                                                      Alright, I’ll see myself out.

                                                                                                      1. 5

                                                                                                        Agreed. I marked it off-topic. Whatever your taste or politics, this repository was built simply “for the lulz”. It’s not tech, it’s a social experiment with code.

                                                                                                        While there are many social topics in the tech world, that’s generally not what lobste.rs is good for.

                                                                                                        1. 53

                                                                                                          It’s tech, you and others just seem to be distressed by the cultural shibboleths it touches.

                                                                                                          We have articles here that are dripping with furry stuff that are routinely defended from fursecution…a mainstream meme plus cool hack isn’t outside our Overton window for me.

                                                                                                          1. 10

                                                                                                            Labeling something “toxic” with the intent of banning it is as much of a cultural shibboleth as any of the memes in the article.

                                                                                                            1. 4

                                                                                                              The furry stuff is a positive expression of someone’s own personal identity, while the chad/virgin meme is a ridiculous objectification of others for being ingroup/outgroup. Do you see a difference?

                                                                                                              1. 4

                                                                                                                Yeah, what’s up with all the furry stuff?

                                                                                                              2. 13

                                                                                                                this repository was built simply “for the lulz”. It’s not tech,

                                                                                                                It’s not? I’m confused. I haven’t tried compiling it, but there’s a C file in there with a bunch of complex-looking code in it. Does that count as tech?

                                                                                                                I don’t know if anyone would use this library for reals (I sure hope not), but the same goes for stuff like Brainfuck or (IMHO) a 6502 assembler. There’s a lot of stuff posted here that is, at some level, done for teh lulz.

                                                                                                                1. 8

                                                                                                                  this repository was built simply “for the lulz”. It’s not tech, it’s a social experiment with code.

                                                                                                                  A lot of software is written “just because” or “for the lulz”. A lot of good software is even written for this express purpose— Linux started out as a hobby project, no?

                                                                                                                  I also don’t see what makes this a social experiment. What’s the experiment? The readme being silly? Is that an experiment?

                                                                                                                  1. 4

                                                                                                                    Linus Torvalds biography is called “Just for fun”, because that is why he wrote Linux. That is how older people say “for the lulz”. Is Linux now also off-topic?

                                                                                                                    There is some actual C macro (ab-)use in there, that is interesting to look at. It is def. tech.

                                                                                                                    Why are you so triggered by this stupid meme?

                                                                                                                2. 6

                                                                                                                  The shitposting C chad versus the virgin crustacean.

                                                                                                                1. 1

                                                                                                                  I recently switched to a telephone with an e ink screen that only shows grayscale. It has been a lesson in accessible design. So many UIs are utterly unusable without color. I rage quit this website after about the images.