1. 17

    My favourite wm of all time:

    #include <X11/Xlib.h>
    #include <X11/keysym.h>
    #include <unistd.h>
    
    static const char *term[] = { "x-terminal-emulator", "-maximized", NULL };
    
    void spawn(Display * disp, const char** com)
    {
        if (fork()) return;
        if (disp) close(ConnectionNumber(disp));
        setsid();
        execvp((char*)com[0], (char**)com);
    }
    
    int main(void)
    {
        Display * disp;
        XEvent ev;
    
        if(!(disp = XOpenDisplay(0x0))) return 1;
        XGrabKey(disp, XKeysymToKeycode(disp, XK_F11), Mod1Mask,
            DefaultRootWindow(disp), True, GrabModeAsync, GrabModeAsync);
        for(;;){
            XNextEvent(disp, &ev);
            if(ev.type == KeyPress &&(XLookupKeysym(&ev.xkey, 0) == XK_F11))
    	    spawn(disp, term);
        }
    }
    
    1. 5

      I’ve always meant to use Emacs as my window manager, but this looks just as good!

      1. 2

        I used exwm for a few weeks a year or so ago, and it worked great, but I had some problems with the Swing apps at work. If I didn’t have Java in my life, it would have been amazing and I would have stuck with it. The experience was positive enough that I might try it again soon.

    1. 2

      I love this idea. I wonder if it adds something to the experience, being able to throw things away, rather than having an immutable history constantly being added to.

      1. 2

        I doubt there is a measurable way to know if architecture is good or bad. I expect the best you can do is qualitative measures. Often you anticipate the need for flexibility in the future in a component or subsystem, so you elaborate it and create more abstractions. Sometimes you buy flexibility you don’t really need, but now you’re paying for it every time you need to make a small change. You can have too much flexibility, which makes it hard to determine which subsystem should be responsible for something because there are many associated subsystems that are all flexible enough to take on the burden.

        There are a lot of ways to fail at architecture but most of them aren’t measurable. Do you have too many systems? I like @apg’s “blast radius” analogy, but you have to weigh the cost of splitting your systems up and maintaining them in that fashion versus the cost of the downtime. Overarchitected systems tend to make some classes of work harder or take longer. Are you paying for complexity you’re not benefiting from? Good architecture I think, is really about aligning your costs and your complexities with the areas where you should be spending.

        1. 1

          I really like his workspace idea. I’ve sent one patch to three or four projects; there’s no need for me to have a whole clone of them up on github gathering dust.

          1. 1

            Would a PR from diff patch would be an interesting concept here ?

            1. 1

              Can you elaborate? I’m not sure what you mean.

              1. 1

                To this day, I’m surprised this isn’t a feature. I often only make one or two changes to a project, and would be happy to just push the refs (or create a patch) rather than forking and remember to garbage collect later.

            1. 5

              I think there is a lack of imagination in your comment and your tone. Suppose someone wanted to make a fire. Your same train of thought sounds like this:

              1. Making fire is hard. Most people don’t want to deal with that.
              2. There are other ways to be warm. Have you tried wearing furs? Way less hassle, immediate benefit, you should start there.
              3. Here’s a list of resources about how to make a fire.
              4. If you can make a fire, here are the things I need you to burn. Don’t hold your knowledge hostage, use it for the purposes me and my friends have already enumerated in the following list.

              You are aware that I made it through about half of Software Foundations. Don’t delude yourself into thinking if I had finished the book I would be helping you with formal verification of boring security software. I took the class because I know how to program and wanted a better understanding of math. All technology is like fire: applicable to many things, often not foreseen by the inventor or discoverer. Your list of things you need burned, is it going to include making pizza, wax seals, and hardening steel?

              If every programmer spends one day with Coq, the improvement in the general understanding of what the word “formal” means might yield deep benefits. To see that one day’s investment in math as failure because it might not blossom into full-blown you-hood is a very limited perspective. I got what I wanted to get from that class: exposure therapy and a better understanding of mathematics itself. You will have to be content with that.

              1. 3

                You bring up a good point that many people explore this stuff for reasons other than its utility in specific problem domains. My version above assumes the opposite in how I present it. So, I should probably change the next one to be posed as a question about what the person wants to achieve. If it’s similar to my aims, then I offer them the next version of this. Otherwise, I tell them I hope they enjoy themselves on the adventure into formal methods.

                1. 2

                  Thank you!

              1. 1

                If you can type at 70 WPM on Dvorak, why on earth are you looking at the keys on a “production system”?

                1. 1

                  Do you never want to take a moment to make sure you’re doing the right thing? I found myself slowing down for special characters, especially in situations where I wasn’t in a REPL-esque environment (resizing tmux panes, killing processes with htop, etc.)

                  1. 2

                    Looking at the keys to see if you’re typing the right thing is like looking at the light switch to see if the lights are on or looking at the brake pedal to see if the car is slowing down.

                    1. 1

                      I don’t think that’s a fair comparison. What if your A/C and stereo knobs were completely unlabeled? Sure, you could get use to their locations, but now if you could lose thousands of dollars by turning the wrong knob… wouldn’t it be nice to just be able to tell which one is which from a glance?

                      1. 1

                        The argument would make sense if terminals did not echo back what you type, but they do.

                        1. 2

                          This may be true for most of the time, but it isn’t always the case. Entering passwords, managing tmux or Vim panes/windows, backgrounding processes, etc.

                  2. 1

                    I’d generally lean towards using ^-x ^-e to edit commands in a production system, so that I can’t e.g. accidentally hit enter on half a command.

                  1. 4

                    I think this is quite intriguing, I can build a Beamer slide set with only fetching 20MB of data (+ 48MB Tectonic).

                    But I really wish it used LuaTeX, especially now as it moved to C. I think many future TeX developments will make use of Lua.

                    1. 1

                      Is LuaTeX part of the standard distribution? Just wondering what will make LuaTeX take off.

                      1. 3

                        Time, I think, will make LuaTeX take off. It’s already a huge part of ConTeXt. Any large macro package would be easier to implement in Lua than TeX.

                        1. 3

                          I love LuaTeX and ConTeXt, but they heavily suffer from a documentation problem. It’s always a struggle to find any practical advice. :(

                          (I write all my slides in ConTeXt through SHSC): https://github.com/skade/SHSC#usage

                          1. 1

                            I agree, but I have found whenever doing ConTeXt that I have fewer questions than I do using the alternatives. So, I get further before hitting a brick wall, but the brick wall’s a doozy. :)

                        2. 1

                          It is part of TeXLive, has good support for modern things like OTF and PDF, and the embedded Lua makes much logic a lot easier. Also, it seems to be one of the few engines that are actively developed.

                      1. 2

                        I have a friend who works on the F# team, but I still can’t bring myself to deal with Windows to try it.

                        I guess they’re going to keep making it harder for me to say I’m not interested until I have to just say, look, I’m biased. :)

                        1. 1

                          I went through about 40% of Software Foundations with some friends a couple years ago. As someone with a meaningful FP background but not a lot of formal math training, I found it enjoyable, but didn’t find myself reaching for the tool that often. I definitely could see the complexity of setup being a barrier to a working mathematician, and the unfamiliarity of the notation would be a significant issue as well I’m sure.

                          This looks like a very interesting effort, I hope they make some inroads, bridging the gap here.

                          1. 10

                            I think Standard ML ought to be considered a contender. It’s also a very small language, but can be compiled to extremely efficient code. It’s principal advantage is that there is a complete formal semantics for it—there is no “undefined behavior.” There isn’t a lot of passion for it these days but I often wonder if things would be nicer if it had caught on. I really like the module and functor system.

                            1. 9

                              I think most of Standard ML’s good ideas are in more widespread use in the form of OCaml. Standard ML does have a full program optimizing compiler in the form of MLton, but I don’t think there’s an equivalent for OCaml. That being said, I’m not sure OCaml is as performant as C, and it’s also started to gather some cruft as it gets older. It would be interesting to see a “fresh start” ML-style language designed for this day and age.

                              1. 3

                                Not quite whole program optimization but kinda close is the flambda version of the OCaml compiler. What would you consider cruft in OCaml? In my experience the cruftiest parts are actually the oldest parts, the newer things are quite alright.

                                1. 3

                                  I think that the functor syntax is a little messy, especially for multi-argument functors. Relatedly, the new support for first-class modules is great, but it’s a little hard to figure out the first time around. I also really wish that there was support for first class constructors (I think Standard ML has this), and though the new ppx stuff is really cool, I think the resulting extensions can be a little ugly.

                                  1. 1

                                    Hmm, now that you mention it, these are all valid points, thanks. Curiously, even OCamls predecessor, Caml Light had first class constructors. For OCaml there are a number of “solutions” to this, but the fact that there are multiple already illustrates the fact they are missing from the core language.

                              2. 3

                                Especially with MLton compiler.

                              1. 1

                                This is something we’re fighting with at the NRAO where I work. Radio astronomy data in particular requires quite a bit of post-processing to be scientifically usable. The director of the NRAO considers science-ready data products to be one of our most pressing issues.

                                The principal data analysis software, CASA, is basically a suite of Python libraries. I don’t see that changing, but a lot of the work in the new archive we’re building has to do with doing processing in our cluster prior to delivery because the datasets are just too big. In the long term, we will start furnishing more capabilities through that interface. It’s difficult for me to imagine us getting to 100% science-ready, “you don’t have to do any coding,” but I think everyone agrees that the situation really can’t afford to get much worse.

                                1. 3

                                  The suggestion later in the thread to use du instead seems odd to me. That’s some Plan 9 shenanigans there.

                                  I love find but it definitely is a pain to work with. walk looks a lot nicer, although with Subversion I definitely need a prune ability that is better than grepping out the results post-facto. find’s prune is insane though.

                                  1. 3

                                    Wow! Even setting aside the color version, that’s a pretty distinctive looking font. Doesn’t really look like any other font I’m familiar with. It does recall the 70s—although not in a fashion that screams “protest” to me. It will be interesting to see if this gets used much for protesting. We don’t really have a “protest font” today, but fonts are kind of faddish, maybe it will take off and own that niche? It’s definitely too complex for copy, but it’s eye-catching and weird without being completely unreadable. Might wind up used in marketing more. It’ll be interesting to see. I’m curious to hear commentary from people who actually know about typography rather than armchair types like me.

                                    1. 4

                                      More drama than I’m accustomed to from the Java community. As a “normal” Java web developer, this module system was either going to have no perceptible effect on me or a bad one, depending on whether or not I believed the noise about reflection and Maven. Still, I’m surprised to see this result. Many of the ‘no’ votes here seem to be hoping for patching up but I’m not hugely optimistic about what can be done in one month, or even whether those hopes are genuine, especially from Redhat and IBM. This one may be worth scrapping and trying again from scratch.

                                      1. 2

                                        I agree that this is more drama than we’re used to. For me, this is a good thing, but I don’t know how Oracle will react to this. Will they say that the JCP is more trouble than it is worth? Don’t know.

                                        1. 1

                                          That’s a frightening thought.

                                      1. 1

                                        I’ve been following the conventions prescribed by cronic for a while, which are similar:

                                        set -o errexit -o nounset -o xtrace
                                        

                                        This has greatly improved my ability to figure out WTF went wrong after it goes wrong. I will definitely check out this suite as well. I’m a little anxious about changing the word delimiter this late in the game but if it helps, maybe.

                                        1. 2

                                          Very cool looking. I happen to need something like this right now, so great timing!

                                          1. 33

                                            I think that’s missing the point I was trying to make. Even if 75% of them happened due to us using C, that fact alone would still not be a strong enough reason for me to reconsider our language of choice (at this point in time).

                                            Ironically this is missing the point that memory safety advocates are trying to make. The response the post got is less about Stenberg’s refusal to switch languages (did anyone actually expect him to rewrite?), and more about how he is downplaying the severity of vulnerabilities and propagating the harmful “we don’t need memory safety, we have Coverity™” meme.

                                            curl is currently one of the most distributed and most widely used software components in the universe, be it open or proprietary and there are easily way over three billion instances of it running in appliances, servers, computers and devices across the globe. Right now. In your phone. In your car. In your TV. In your computer. Etc.

                                            So in other words, any security vulnerabilities that affect curl will have wide impact. How does this support his argument?

                                            1. 12

                                              (did anyone actually expect him to rewrite?)

                                              I don’t think rewriting in a safe language would be the problem. I have ported a couple 50k line codebases, between objc, java, and cpp and the rewrite wasn’t the hard part. It’s the tooling. Even using supported languages it’s a ton of work to get the build systems to work well. Good luck getting your newish but safe language code base playing nice with the build systems for the big three platforms, consistently, fast, and with good developer support for e.g. debugging and logging and build variants.

                                              cURL isn’t popular because it’s written in C, per se, it’s popular because it runs freaking everywhere and very nearly just works.

                                              I think if you want safe language adoption you should go to the people that are choosing to use cURL and talk to them, and work on their barriers to adoption. cURL is C.

                                              1. 3

                                                He has the benefit of being able to promote the virtues of a working and widely used program versus some vaporware.

                                                1. 14

                                                  I’m having trouble understanding what you’re trying to say. He has a popular project, ok, and?

                                                  1. 7

                                                    I think he’s saying the project owner would say the good they’ve done outweighs the bad. That’s the impression I got from OP.

                                                    1. 7

                                                      What he’s saying is we’re comparing a tangible C program to a Rust program that does not exist. Faults of C notwithstanding, vaporware has all the attributes of the best software—except for that existence problem.

                                                      1. 5

                                                        Nah, if that’s all he wanted to say he wouldn’t have made such a big fuss about how popular his software is. He shoehorned that paragraph in there in an attempt to lend credibility to his arguments. Later he tries this again by implying that his detractors don’t code, or something:

                                                        Those who can tell us with confidence how to run our project but who don’t actually show us any code.

                                                        All of that is bunk. If maintaining a popular piece of software implied security expertise then PHP’s magic quotes would have never seen the light of day.

                                                        1. 1

                                                          I’m explaining Victor’s comment, not the OP. You lost the plot.

                                                      2. 2

                                                        Obviously, he knows what’s best, and knows everything, duh. /satire

                                                  1. 1

                                                    Every programming language has something like monads. In Prolog, it’s difference lists or definite clause grammars or metainterpreters; for Java, it’s reflection and generic methods and fancier generics; for Lisp, it’s fancy macros. It’s part of the fun.

                                                    I think other languages do a better job of not telling the beginners about these things on day one, but otherwise the situation isn’t that different. You put a high value on understanding something esoteric and tell the beginners about it and how hard it is, you shouldn’t be too surprised by seeing a bunch of blog posts about how easy and great it is. “Monads” are not a real problem.