A curmudgeon tries a language server

(entropicthoughts.com)

51 points | by crescit_eundo 2 hours ago

7 comments

  • dieggsy 1 hour ago
    As a Common Lisp developer, the intro about Lisp strikes me as sort of mostly(?) true.

    I would say in my experience we do actually "compile and execute" code, we can just do this incrementally and with less context switching because of the described workflow. But quite often there are in fact separate compile and run steps, it's just not at the whole program level (say, compile a function and run it or a calling function).

    And despite how often it's shown off as a strength, redefining code during actual execution isn't quite that common, I think. Yes, it is done sometimes, but lots of programs don't really fit that paradigm in the first place. It can work well for e.g. some games or long running servers.

    As for working in an image without source code: this seems like a terrible idea. You might do this for trivial, one off experiments, but in general you benefit from writing out and organizing your code early. I'm not even aware of a particularly easy or clean way to write out source code from an image as described. It could be done, but all the ways I can think of sound like more of a pain or mess than anything. Could just be my experience or I'm missing some neat feature of a commercial Lisp or something.

    • jerf 48 minutes ago
      I haven't used Lisp but I've used another environment that was heavily image based (Frontier). The runtime ability to modify things sounds super neat but in my opinion it leads to disaster. It is not a weakness that we have a lot of tech built on a concrete specification of the initial state of the system and very careful control over where data and the modified versions of that data live. It is hard-won experience that it is a good way to build robust systems. "Reboot & pray" isn't just an accident, it's a legitimately good way to set up a system.

      Some of you may object to the idea that we are super careful with data and modifications to it. I know where you are coming from... however, compared to an image-based system, the modern world is in fact super careful! To the extent that you think we are still not careful enough, that leads you even farther from wanting an image-based system.

      If you conceive of a system as the full state space of everywhere it can go, the vast, vast, vast majority of systems have pathological places in it. It is very hard to get them all out. It is advantageous to have a button that says "restart this system from the initial state", and to push it often to make sure it continues to work, even if you're not thinking of it this way. By contrast, image-based systems have the tendency to either 1. get into a bad place in the state space and then the user has no way back out or 2. accidentally create a scenario in which there is no way to bring the system up from scratch anymore, which includes things like "giving the system to someone else to start their own work up".

      Sure, it's a good idea to minimize the need to hit the reset button. But you don't really want to give it up entirely.

      There are a variety of ways of improving the image-based system. Most, perhaps all of the practical ones, involve basically removing the image-based nature of it and moving closer to the systems we all work with today.

  • PaulHoule 45 minutes ago
    Gawd, that image-based approach to programming has never been mainstream because it creates a terrible mess.

    Look at the nightmare notebooks you get from data scientists working in Python where they want to have their answers baked into a notebook that they can show to people and don't realize they need to separate code and data in version control and have a script you can run from top to bottom every single time if they want to put their skills on wheels.

  • ux266478 55 minutes ago
    To be honest given the amount of structural obliteration you get out of GHC, image-based development sounds like a really bad idea. Haskell is such a weird and unintuitive language to understand from a systems perspective, because it's almost like you're restricted to writing macros for a language that you never directly see or interact with. The transformation from your source code to what the compiler spits out is can be highly non-local and unpredictable, even before you start introducing things like custom rewrite rules.

    To me, I think the smart way to work with Haskell is the exact opposite of iteration. Work it out on paper, refine it, find the algebraic rules for it, refine it some more, and then start writing code once you know exactly what you're doing. I think giving in to the temptation to Just Start Writing Code is how you end up with opaque type spaghetti. That's just my feelings on it.

  • airza 2 hours ago
    i have learned a lot of interesting facts about haskell and lisp from this post. those facts make me want to run screaming away from trying to use either of them to develop software. My time with Haskell made me a better programmer and I bet that LLMs made some of the documentation more intelligible, but...
    • nobleach 1 hour ago
      I have other reasons - mostly hiring competent engineers that deeply undertand the language. I can hire a competent SpringBoot engineer who can "fill out the form" and have a fast-enough API ready in a few days. Will it be beautiful and elegant? Probably not. Will it take traffic and get the data from the producer into a database reliably? Most likely.

      From my time with Haskell, I learned to REALLY think about types. Like, REALLY. Having a type doc above every function that describes a curried path, is really cool. It made OCaml documentation (which I consider among the worst) make sense. (No shade at OCaml as a language. I LOVE it. But their docs aren't gonna win any awards)

    • kodoman 1 hour ago
      What in particular makes you want to run away? I have found that the some what cliched(but true) comment that type signatures are mostly what you need for documentation even with heavy transformer code. I am some what confused by the post in question saying their repl experience in haskell was bad, I found the repl very powerful and worked well. The things I disliked of haskell the most was the package management, templating, issues around lazy eval, program start up time, program performance (particularly memory size) and some library's being overly based on some abstract mathematical model for little benefit and lots of cost and less flexibility and template haskell again because I really hate it. working on a common lisp project at the moment and it's quite nice thought he package manager story is a little bad in the very opposite direction to haskell in that it's too bare bones (quicklisp) but it's pretty easy to just git clone repos you want and use asdf to load them (asdf is a little weird to start but when you understand the whole load system repo stuff and central-registry variable your good to go and build what ever you want around it.

      Another annoying thing with common lisp is when macros badly expand that can be tricky to debug.

      • dieggsy 1 hour ago
        You may already know of these, but for others curious:

        I'm also not a huge fan of quicklisp, though bundles[0] made it a little more bearable for me. You may also consider vend[1], ocicl[2] (heavily AI-assisted recently), or qlot[3].

          [0] https://www.quicklisp.org/beta/bundles.html
          [1] https://github.com/fosskers/vend
          [2] https://github.com/ocicl/ocicl
          [3] https://github.com/fukamachi/qlot
        
        For macroexpansion, SLIME and SLY have macrostep functionality that lets you expand macros in place, which has helped me immensely on more than one occasion, though you can also manually expand with macroexpand.
        • kodoman 46 minutes ago
          Thank you for this, I knew only of ocicl and have only been using macro expand in the repl, will have to try macrostep.

          My work flow for packaging is very hacky at the moment, I have sbcl install on the host but mostly for developing I run in a podman container and download repos of libraries as I need them and then mount them in a volume and also mount a link farm to load all the asdf systems and that is set up by the initialization script and starts swank and any other initialization needed. probably ocicl does a lot of what I want but for a particular things I was doing I was I also wanted to modify a library so it evolved like this it might be a little insane but new to common lisp development so might be bad.

  • noobplus 32 minutes ago
    It is always cool to implement a powershell code in Linux style. Credits to the author of GHCup
  • refactor_master 1 hour ago
    Sounds genuinely horrible to program this way.

    > A Lisp programmer does not need to …

    Have you even seen R? Jupyter notebooks? The above sounds like a level of insanity beyond that.

    The problem with checking things at runtime is that it’s an ever-moving target. Changed this? Now that other thing is out of sync. Changed that? Now the first thing is gone, and it came from far away so you can’t get it back in this session.

    • chuckadams 1 hour ago
      Most lisp systems get recompiled from sources, and while they support dumping an image, that's essentially an optimization. Emacs for example makes an initial dump, then loads the rest from .el files, and the base image remains static (you can dump a new image from a running emacs, but it's always been fiddly). The only thing left that I know of that's image-first is Smalltalk, and not even all implementations.
      • dmurray 59 minutes ago
        I once inherited an APL system which was just an image. I didn't know where to start trying to get function definitions out of it and into some kind of version control and eventually ported to something else. I'm interested to know how much better it would have gone with LLMs.
  • UltraSane 1 hour ago
    I find it so fascinating how many programmers proudly declare how they don't use any IDE when incredibly sophisticated tools like solidworks or Synopsis are universally used in engineering
    • agentultra 38 minutes ago
      I don’t like LSPs. They’re slow and bloated. I’ve been using clangd but I think I’ll stop. It’s slow as molasses. It constantly tries to insert headers into source files that cause compilation issues. There are easier and faster ways to jump to definitions.

      I don’t use LSPs with Haskell anymore. I work on multiple projects which use different versions of GHC and the base library which means having multiple LSPs installed for each one. Trying to get eMacs to reliably detect which project is using which version is not something I have been able to figure out. Plus it’s slow and uses way too much memory.

      At current job I’m doing C# and man does the ecosystem there really push you to use an IDE. Most of my org uses Rider. I find it just as fascinating that people actually like using tools like it. Too bad it doesn’t have a decent text editor built in.

      • inigyou 4 minutes ago
        Which is very strange when you remember that Visual C++ 6 on Windows 95 on whatever hardware from that era was pretty fast.
    • asa400 44 minutes ago
      Completely agree, having worked with engineers and scientists for a large part of my career.

      Programming is still in this goofy phase as a profession/industry where lots of practitioners interpret suffering and complexity and difficulty as signals of underlying quality.

      There are still large numbers of programmers who see advances in human-computer interaction and tools as basically childish, because what matters to them is the feeling of machismo they get while programming, rather than whether their efforts make their users more successful.

      See the pushback against IDEs (as you said), syntax highlighting (“syntax highlighting is for children”), Rust (“_I_ know how to manage memory, everyone else is an idiot who needs to git gud”), types generally (“_I_ don’t make type errors”). Even high level languages and garbage collection were met with similar derision when they were going mainstream. There are so many examples of this throughout the history of programming.

      If something is hard to do, or resulted in something impressively complex rather than something underwhelmingly simple, it must be good.

      Basically, we’re still a very immature profession and it’ll take time before we shed the “the most important thing about programming is that I get to be a wizard” stuff. The users care that the bridge doesn’t fall down when they drive over it. The users don’t care whether designing the bridge made me feel powerful and wizardly because I used a crayon rather than Solidworks.

      • kodoman 29 minutes ago
        Basically all text editors now do syntax highlighting, I have not heard any one say they avoid syntax high-lighting. I personally avoid the usual auto complete interface style and stick with the emacs default of explicitly requesting the editor to completion at point, not because it can't do it or that I am being macho but because I find it distracting and find it obscures code I often want to look at.

        I hate with passion GUI's that stop be copying text and other crack that modern IDE's often do.

        I don't avoid modern features at all and actively use pretty much all of them. If something like and IDE works for you that's great. But their is not some deep psychological need I am fulfilling, other then using tools that have less friction for me.

        Additionally the post is about haskell a very high level language with the type system being the main feature, this persons choice in emacs is clearly different to the type that shun type systems and GC. Additionally I do not actually think the types that shun GC and shun type systems intersect as much as you make out, the types that shun GC are performance obsessed kinds of people in which type systems can improve performance significantly and those that shun type systems are (a dying breed) tend to be those who like scripting languages and hacking something together quickly. Most people recognize that both have their place I think.

        Maybe the example of a carpenter who has a set of trusted tools and might like or a chefs set of knives, if we really need to look at other professions and measure are self against them. I think if you ask people why they use text editors (or IDE's) they will give their own valid reasons for each.

        • kqr 27 minutes ago
          > One of the basic rules of thumb in typography is that, when writing a piece of text, you should choose one typeface and stick to it. Likewise, a splash of colour may grab the reader's attention, but it will inevitably decrease the legibility of the text. The natural flow of the text is broken, and it takes more brain effort to piece together the individual letters into words and semantics. Cognitively, the reading process becomes slightly less automatic and slightly more conscious; leaving less room in the conscious part of the mind for actually understanding the text.

          https://www.linusakesson.net/programming/syntaxhighlighting/

    • mrkeen 1 hour ago
      The language dominates the tooling. Real C programmers probably can't imagine doing real programming without gdb and valgrind. Real Java programmers probably can't imagine doing real programming with gdb and valgrind.
      • refactor_master 1 hour ago
        Off topic but the way the four “program…” words line up on an iPhone is truly mesmerizing.
        • inigyou 3 minutes ago
          a typographical river
    • mcdow 1 hour ago
      every tool present in an IDE is available elsewhere. it’s not that the IDE-avoidant aren’t using sophisticated tools, they just aren’t using them packaged up in a single application.
    • kodoman 1 hour ago
      They are using Emacs that's basically an IDE.
      • theokrueger 1 hour ago
        IDE tends to be a curated tool for one specific language though. I guess in that sense Emacs is an ELisp IDE, but without any sense of curation.
        • kodoman 40 minutes ago
          Yeah and you just have one interface that you have to know and customize rather then 100. not to mention the pleasure of shell mode and and tramp and dired. I feel people are missing out not using emacs or emacs like tools where all your customization and custom functions, bindings and minor modes apply to everything else you do (should they be applicable).
          • inigyou 2 minutes ago
            An interface that does everything does nothing well.
          • theokrueger 34 minutes ago
            haha I am in fact a long-standing near-vanilla emacs user. never said it being uncurated was a bad thing, the customizability is unrivalled and the reason I use it.
            • kodoman 28 minutes ago
              Yes just adding to the point you gave.
        • inigyou 3 minutes ago
          What's Eclipse then?
    • ux266478 21 minutes ago
      Because 'engineering' is a different field, with a different software ecosystem? What's fascinating about it? It's pretty blatantly obvious, engineers pay Dassault through the nose for Solidworks because there are no real alternatives. The same is not true for programming.

      If there was a high quality CAD server that was interfaced via plugins for programmable 3D editing software like Blender, then we can start making comparisons. Fact of the matter is that this isn't the case, not like what programmers have gotten in the last 20 years. It's absolutely not impossible for such a thing to exist, it just doesn't. Building things like high quality heuristics for the topological naming problem is quite hard.

      It doesn't help that almost every IDE in existence these days is also not a real IDE. Visual Studio, Xcode, Jetbrains, etc. are just a more rigid programmable text editor, they lack the "I", and quite a bit of the "E". Compare them with things like LispWorks and Delphi, and the difference is stark. For the former category of "DE"s, there are often tools which are just as high quality, if not higher quality, elsewhere. Speaking as someone that uses a very wide variety of tools, including the ones mentioned, there's really not a lot of point to them unless you just really like their specific UI/UX.