Threads for rlonstein

  1. 33

    The problem is that C have practically no checks, so any safety checks put into the competing language will have a runtime cost, which often is unacceptable. This leads to a strategy of only having checks in “safe” mode. Where the “fast” mode is just as “unsafe” as C.”

    So, apparently the author hasn’t used Rust. Or at least hasn’t noticed the various benchmarks showing it to be capable of getting close to C performance, or in some cases outpacing. Also that because of Rust’s safety, it’s much easier to write working parallelised code v.s. C and so you can get a lot of improvements that way.

    I’ve written a lot of C over the years (4 years of embedded software PhD), and now never want to go back now I’ve seen what can be done with Rust.

    1. 12

      The author notes that he does not consider Rust a C alternative, but rather a C++ alternative:

      Like several others I am writing an alternative to the C language (if you read this blog before then this shouldn’t be news!). My language (C3) is fairly recent, there are others: Zig, Odin, Jai and older languages like eC. Looking at C++ alternatives there are languages like D, Rust, Nim, Crystal, Beef, Carbon and others.

      Now, you could argue that it’s possible to create a C-like language with a borrow checker. I wonder what that would look like.

      1. 20

        C++ is a C alternative. The author dismisses rust without any explanation or justification (I suspect it’s for aesthetic reasons, like “the language is big”). For a lot of targets (non embedded), rust is in fact a valid C alternative, and so is C++.

        1. 8

          For a lot of targets, especially embedded, Rust is an amazing C alternative. Granted, currently it’s primarily ARM Cortex M that has 1st class support but I find your remark funny how from my perspective embedded is probably the best application of Rust and its features. Representing HW peripherals as type-safe state machines that won’t compile if you missuse them? Checked. Concurrency framework providing sane interrupt handling with priorities that is data race and deadlock free without any runtime overhead that won’t compile if you violate its invariants?. Checked. Embedded C is a joke in comparison.

        2. 13

          Adding a borrow checker to C requires adding generics to C, at which point it would be more C++-like than C-like. The borrow checker operates on types and functions parameterized by lifetimes, so generics is not optional, even if you do not add type generics.

          1. 6

            Also, not adding type generics is going to make the safety gained from the borrow checker a lot less useful, because now instead of writing the unsafe code for a Vec/HashMap/Lock/… once (in a library) and using it a gazillion times, you write it once per type.

            1. 3

              Isn’t this more or less what Cyclone is?

              1. 4

                Yes it is. It is why Cyclone added polymorphic functions, polymorphic data structures, and pointer subtyping to C, check Cyclone user manual. Not because they are cool features, but because they are required for memory management.

              2. 1

                Even though types and functions are parameterized by lifetimes, they do not affect codegen. So it should be possible to create a “C with borrowchecker”.

                1. 1

                  I don’t understand how codegen matters here. Clang and rustc share codegen… If C-like codegen (whatever that is) gives C-with-borrow-checker, C-with-borrow-checker is rustc.

                  1. 1

                    ops, I guess I should’ve said “lifetimes do not affect monorphisation”

                    1. 1

                      This is still a mysterious position. You seem to think C++-ness of templates comes from monomorphisation code generation strategy, but most would say it comes from its frontend processing. Monomorphisation is backend implementation detail and does not affect user complexity, and as for implementation complexity it is among the simpler one to implement.

                      1. 1

                        the whole point was that generics are not needed for a language to have a borrowchecker.

                        if you call a generic function twice with different types, two function code is generated. if you call a generic function twice with different lifetimes, only one function code is generated.

                        borrowchecker is anmotation + static analysis. the generated code is the same. the same is not true for generics or templates.

                        1. 1

                          If you think this, you should write a paper. Yes, borrow checker is a static analysis. As it currently exists, it is a static analysis formulated to work on generics. As far as I know, no one knows how to do the same without generics.

              3. 5

                There was some recent discussion on Garnet which is an attempt to make a smaller version of Rust.

                1. 5

                  This is the correct position on Rust.

                  1. 32

                    I disagree. To me Rust is a great C replacement, and Rust is incompatible with C++ both technically and philosophically. I’ve used C for two decades. I’ve never liked C++, but really enjoy Rust. I’ve written a C to Rust transpiler and converted projects from C to Rust.

                    C programs can be converted to Rust. C and Rust idioms are different, but language features match and you can refactor a C program into a decent Rust program. OTOH C++ programs can’t be adapted to Rust easily, and for large programs it’s daunting. It’s mostly because Rust isn’t really an OOP language (it only has some OOP-like syntax sugar).

                    I think people superficially see that both Rust and C++ are “big” and have angle brackets, and conclude they must be the same. But Rust is very different from C++. Rust doesn’t have inheritance, doesn’t have constructors, doesn’t have move constructors, doesn’t use exceptions for error handling. Rust’s iterator is a completely different beast than C++ iterators. Rust’s macros are closer to C++ templates than Rust’s generics. Lots of Rust’s language design decisions are at odds with C++’s.

                    Rust is more like an ML language with a C subset, than C++.

                    1. 9

                      To me Rust is a great C replacement

                      When you say “replacement”, what do you mean, exactly? For example, could C++ or Ada be great C replacements?

                      I think some of the disagreements about Rust - and the whole trope about Rust being a “big” language - come from different people wanting different things from their “C replacement”. A lot of people - or maybe just a particularly vocal group of people on Internet forums - seem to like C not just because it can be used to write small, fast, native code, but because they enjoy the aesthetic experience of programming in C. For that sort of person, I think Rust is much more like C++ than C.

                      Rust is very different from C++. Rust doesn’t have inheritance, doesn’t have constructors, doesn’t have move constructors, doesn’t use exceptions for error handling.

                      Modern C++ (for some value of “modern”) doesn’t typically have inheritance or exceptions either. I’ve had the misfortune to program in C++ for a couple of decades now. When I started, it was all OO design - the kind of thing that people make fun of in Enterprise Java - but these days it’s mostly just functions in namespaces. When I first tried Rust, I thought it was just like C++ only I’d find out when I screwed up at compile-time rather than with some weird bug at run-time. I had no trouble with the borrow checker, as it just enforced the same rules that my team already followed in C++.

                      I’ve never liked C++ because it’s too complicated. Nobody can remember the whole language and no two teams use the same subset of the language (and that applies to the same team at two different times too, as people leave and join). People who program alone, or only ever work in academia in small teams, might love the technical power it offers, but people who’ve actually worked with it in large teams, or long-lived teams, in industry, tend to have a dimmer view of it. I can see why people who have been scarred by C++ might be put off by Rust’s aesthetic similarity to it.

                      1. 2

                        I’ve never liked C++ because it’s too complicated. Nobody can remember the whole language and no two teams use the same subset of the language (and that applies to the same team at two different times too, as people leave and join).

                        I think that’s a correct observation, but I think that’s because C++ standard library and the language itself has over 3 decades of heavy, wide industry use across much of the depth and breadth of the software development, generating demands and constraints from every corner of the industry.

                        I do not think we had ‘solved’ the problem of theoretically plausible definition of the minimal, but sufficient set of language features + standard library features, that will be enough for 30+ years of use across everything.

                        So all we have right now is C++ as a ‘reference stick’. If a newbie language compares well to that yardstick, we hale it. But is that the right yard stick?

                        1. 1

                          I definitely don’t use C for an “aesthetic experience” (I do not enjoy aesthetics of the preprocessor, spiral types, tediousness of malloc or header files). I would consider C++ also a C replacement in the same technical sense as Rust (native code with minimal runtime, C ABI, ±same performance), but to me Rust addresses C’s problems better than C++ does.

                          Even though C++ is approximately a C superset, and Rust is sort-of a C superset too, Rust and C++ moved away from C in different directions (multi-paradigm mainly-OOP with sugar vs ML with more explicitness and hindsight). Graphical representation:

                          Rust <------ C ----> C++
                          

                          which is why I consider Rust closer to C than C++.

                          1. 2

                            Sorry for the obvious bait, but if you don’t like C, why do you use it? :-). If you’re looking for a non OOP language that can replace C, well, there’s a subset of C++ for that, and it’s mostly better: replace malloc with smart pointers, enjoy the RAII, enjoy auto, foreach loops, having data structures available to you, etc.

                            1. 5

                              In my C days I’ve been jealous of monomorphic std::sort and destructors. C++ has its benefits, but they never felt big enough for me to outweigh all the baggage that C++ brings. C++ still has many of C’s annoyances like headers, preprocessor, wonky build systems, dangerous threading, and pervasive UB. RAII and smart pointers fix some unsafety, but temporaries and implicit magic add new avenues for UAF. So it’s a mixed bag, not a clear improvement.

                              I write libraries, and everyone takes C without asking. But with C++ people have opinions. Some don’t like when C++ is used like “C with classes”. There are conundrums like handling constructor failures given that half of C++ users bans exceptions and the other half dislikes DIY init patterns. I don’t want to keep track of what number the Rule of $x is at now, or what’s the proper way to init a smart pointer in C++$year, and is that still too new or deprecated already.

                    2. 1

                      Now, you could argue that it’s possible to create a C-like language with a borrow checker. I wonder what that would look like.

                      Zig fits in that space, no?

                      1. 8

                        Zig is definitely more C-like, but it doesn’t have borrow checking. I think Vale is closer. There’s MS Checked-C too.

                        But I’m afraid that “C-like” and safe are at odds with each other. I don’t mean it as a cheap shot against C, but if you want the compiler to guarantee safety at compilation time, you need to make the language easy to robustly analyze. This in turn requires a more advanced static type system that can express more things, like ownership, slices, and generic collections. This quickly makes the language look “big” and not C-like.

                        1. 7

                          I don’t think Zig has borrow checking?

                          1. 7

                            It doesn’t. As I understand, its current plan for temporal memory safety is quarantine. Quarantine is a good idea, but if it was enough, C would be memory safe too.

                            Android shipped malloc with quarantine, and here is what they say about it:

                            (Quarantine) is fairly costly in terms of performance and memory footprint, is mostly controlled by runtime options and is disabled by default.

                      2. 2

                        Ada has made the same claims since 1983, and hasn’t taken over the world. Maybe Rust will do better.

                        1. 1

                          I think the big point here is that the author is talking in hypotheticals that don’t always pan out in practice. Theoretically, a perfectly written c program will execute faster than a rust program because it does not have safety checks.

                          That being said, in many cases those limited safety checks actually turn out to be a miniscule cost. Also, as you mentioned rust may unlock better threading and other performance gains.

                          Lastly, i think it is important to note that often software architecture, algorithms, and cache friendliness will matter much much more than rust vs c vs other low level languages.

                        1. 14

                          The new MacBook Pro, which I have, is all this and more. A clean build of my work project (C++, Xcode) is about 50% faster than on my 2018 model, with no audible fan noise. In fact I don’t recall ever hearing the fan. I’m getting multiple days of battery life, too. (This is with the baseline M1 Pro CPU, not the Max.)

                          I’ve been through every Mac CPU change, 68000 to PowerPC to x86 to ARM, and each one gets more transparent. The only time I noticed this one was when I first launched an x86 app and the OS told me it was going to install the emulator. Everything I’ve recompiled and run has worked fine.

                          Also kudos to Apple for backing away from earlier design decisions — “butterfly” keyboard, touch-bar — that turned out to be bad ideas. The Apple I worked at probably wouldn’t have done that.

                          1. 8

                            I liked new MacBooks Pro on paper, but when I touched them in the store I took my 3k$ and went home. I don’t care about useless to me ports, USB C is all I want (I do software). For me MacBook Air with M1 is much better in terms of form and weight. But this is my usecase.

                            1. 2

                              I don’t need an SD card reader, and I could do without the extra weight, but I do need at least a 15” display to do work. ¯\(ツ)

                            2. 4

                              Ditto to all of this. I spend a lot of time in and around WebGL graphics. One of our in-house apps makes my old MacBook and the laptops of all my colleagues sound like the decks of aircraft carriers. It’s completely silent on my new M1 MacBook Pro.

                              I was frankly a little nervous about getting this machine. I need it to run everything from Blender, a .NET server with a proxied webpack dev server on top, various node servers, to a headless WebGL engine. I was pleasantly surprised to find it does all but the last those things without breaking a sweat. Things that run natively feel instantaneous. Things that run on Rosetta 2 still feel snappier than before. Industry adoption for Apple Silicon is moving apace. I’m pretty sure I’m just a dependency upgrade away from getting the last item on my list working and I can finally shed my old machine for good.

                              The most revolutionary thing about the experience of using the new MacBook Pro isn’t the features or build quality per se (although they’re both excellent). It’s that the performance bottleneck in my day-to-day work is squarely back on the network. I haven’t felt that way in a while.

                              1. 1

                                I am really disappointed that Apple removed both the touchbar and the butterfly keyboard. The butterfly keyboard was the best feeling keyboard I have ever used, bar none, and the touchbar was very useful in some scenarios, while the physical F keys are absolutely useless to me.

                                1. 13

                                  The touch bar has an interesting idea, but without proper haptics (i.e. scan with your finger, more forecful click as you actually press), I don’t think most people wouldn’t have bought into it.

                                  I thought the butterfly keyboard was nice on the 12” MacBook (they should bring it back w/ M1, IMHO), but I wasn’t as impressed with it on the Pros…. and the reliability issues sunk that.

                                  1. 1

                                    I forget if I’ve mentioned it on here before, but HapticKey is worth trying. It uses the magnets in the touchpad to emulate feedback on the Bar, it work better than you’d expect.

                                    1. 1

                                      Oh yeah, the version of the 12’’ MacBook was the best. The newer version on the Pros wasn’t quite as good, but to me it was still better than the current keyboard.

                                      As for reliability, mechanical keyboards have atrocious reliability compared to both regular keyboards, and I suspect to the butterfly keyboards as well, but that’s not the reason why people use mechanical keyboards. They simply like the feel and accept the tradeoff. I would accept the same tradeoff for my laptop’s keyboard.

                                      1. 5

                                        As for reliability, mechanical keyboards have atrocious reliability compared to both regular keyboards, and I suspect to the butterfly keyboards as well, but that’s not the reason why people use mechanical keyboards.

                                        Do you have some evidence for this? I don’t have numbers, but I have numerous mechanical keyboards and the only one that has failed was stepped on, whereas I experienced multiple failures of my MacBook butterfly keyboard.

                                        1. 1

                                          Unfortunately I am not aware on any real studies, so all I have is anecdotal evidence, albeit I have a lot of anecdotal evidence.

                                        2. 1

                                          As for reliability, mechanical keyboards have atrocious reliability compared to both regular keyboards

                                          Just to clarify, you are only referring to mechanical keyboards on laptops and not to external mechanical keyboards?

                                          1. 1

                                            No, I am referring to external keyboards. I didn’t even know mechanical keyboards on laptops were a thing.

                                            1. 4

                                              There were, though I’m going back to the 486/Pentium era (easily portable might be a better description than what we think of now). The current ones I know of with mechanical keyboards are from Razer and Asus.

                                              My experience with mechanical keyboards differs, even cheap ones are long-lasting than any laptop keyboard I’ve seen since some of the old IBM Thinkpads and Toshiba Porteges.

                                        3. 1

                                          The touch bar has an interesting idea, but without proper haptics (i.e. scan with your finger, more forecful click as you actually press), I don’t think most people wouldn’t have bought into it.

                                          The most important feature of he touchbar was that it could run Doom. It’s still a mystery why touchbar equipped Macbooks didn’t fly of the shelf after this became known. :(

                                        4. 11

                                          I really wanted to like the touch bar, but my fingers rarely ended up using it, maybe because of the lack of tactile feedback. Also, I’ve long been accustomed to binding F1..F8 to switch between my most-used apps, so having other functions on the touchbar interfered with my muscle memory.

                                          You’re honestly the first person I’ve ever heard praise the butterfly keyboard, or even say it felt any better than the old type. I kept making typing mistakes on it, and even bought a little KeyChron mechanical BT keyboard to use when I wanted to do a lot of typing away from my desk.

                                          1. 2

                                            Well, add me to the likes for the feel. Besides that, it was an absolute disaster. I had a MacBook Pro with a butterfly keyboard from before they added the seals and keys would constantly get stuck or wouldn’t actuate correctly (I guess because a speck of dust got in).

                                            Though, the most reviews don’t mention this, the new M1 Pros have another scissor mechanism than the M1 Air and prior scissor MacBooks and I love it. It is much more ‘clicky’ than the earlier scissor keyboards and feels somewhat closer to mechanical keyboards.

                                          2. 5

                                            I am really disappointed that Apple removed both the touchbar and the butterfly keyboard.

                                            The butterfly keyboard seems to have had a lot of reliability issues, even after they made some changes to it.

                                            1. 1

                                              Why not bind the actions your wanted to the F keys? MacOS has a very good support for binding actions.

                                          1. 2

                                            I’m reminded of a much older technique: the X Macro (and also at Wikipedia).

                                            1. 24

                                              Typesetting systems. It’s interesting to think about the differences between TeX and html, one predating scrolling and one designed for screens rather than paper. What would a simple typesetting system look like that was built with a minimalist ethos, for scrolling, without perfect hyphenation and pixel-perfect page boundaries.

                                              1. 7

                                                I’ve been playing around with SILE recently. While it still has some rough edges, it has been refreshing coming from LaTeX. I don’t know if you’ve already looked into it.

                                                1. 2

                                                  Going the other way– a easier to deploy/run TeX system– have you seen Tectontic?

                                                  I’m using it on and off with some existing documents and was pleasantly surprised.

                                                  1. 2

                                                    I have seen it. I will admit that I haven’t dug too deep into it. I respect the effort, however the clean slate implementation of SILE (as opposed to Tectontic’s port of XeTeX to Rust) offers some advantages.

                                                    Documents can be either in TeX-like syntax or XML. (Meaning they can be generated by a program and be valid) Also the native support of SVG (instead of the convoluted Tikz) is a killer feature for me. But in general, SILE is more lightweight.

                                              1. 23

                                                Maybe I just don’t get where the fossil author is coming from but when I was using fossil regularly (and sometimes still do) I’d end up having two copies of the same repo… a short-lived one in whatever work-in-progress state with all the useless commits (“really fix edge case this time”, “friday WIP” etc.) and then a second persistent one where I’d rsync the worktree and make a new commit or, less easily, cherry-pick from the first. I’m not convinced that seeing the sausage being made in the commit history has any benefit over a single commit or small number of clean commits per feature.

                                                1. 14

                                                  I’m not convinced that seeing the sausage being made in the commit history has any benefit over a single commit or small number of clean commits per feature.

                                                  Yes, the lack of ability to clean up history, even locally, is the one thing about Fossil that ensures I’ll never use outside of work, where I have to use it in some situations.

                                                1. 2

                                                  Oh, this is delightful, and very nostalgic for me.

                                                  1. 2

                                                    Me too. I remember encountering it as “Lightspeed C” (and also the Lightspeed Pascal) circa 1987 when I first touched a Mac SE. I don’t remember why the college Fine Arts lab had copies of it but it was the first “IDE” I’d seen.

                                                  1. 3

                                                    I have painful memories of debugging m4 use/misuse in sendmail and autotools. -shudder-

                                                    1. 2

                                                      Does SO itself strongly reject this advice? For a long time they were proud of bucking the trend of cloud-scale deployments and just managing some small amount of beefy servers themselves.

                                                      Edit: nvm I see they cover it in the article

                                                      1. 3

                                                        For those who don’t bother reading the article: when StackOverflow launched, Azure was brand-new, Windows didn’t support containers, and Kubernetes didn’t exist. I remember as late as roughly 2012, the Stack team told the Azure team what they’d need in hosted SQL Server alone to go entirely to the cloud, and the Azure team effectively just blanched and dropped it. (I worked at Fog Creek at the time, and we’d do beer o’clock together fairly often and swap stories.)

                                                        It’s obviously an entirely different ballgame in 2021, so they’re allowed to change their minds.

                                                        1. 8

                                                          It’s obviously an entirely different ballgame in 2021, so they’re allowed to change their minds.

                                                          I think a lot of people here and HN would argue that the trend over the past decade has not been good, and the old way really was better. They say the move toward containers and cloud services is driven by hype, fashion, and particularly cloud vendors who have something to sell.

                                                          I admit I was sad to learn that Stack Exchange is no longer bucking the trend. Yes, I make heavy use of cloud infrastructure and containers (currently Amazon ECS rather than k8s) in my own work, and have often publicly defended that choice. But the contrarian, anti-fashion streak still has its appeal.

                                                          1. 2

                                                            Most of the contrarians are wrong: the old systems were not better, simple, easy to learn, or easy to use. The old way of every place above a certain size and/or age having their own peculiar menagerie of home-grown systems, commercial products, and open source projects bodged together hopefully with teams to support them just was how it was. But you got used to it and learned the hidden or half-documented footguns and for a time there weren’t better choices. Now there are choices and a different landscape (you don’t have to run your own DC), and many of them are very good and well-documented, but they’re still high in complexity and in depth when things go wrong. I think the greatest advantage is where they interact with home-grown systems they can be cordoned and put behind common interfaces so you can come in an say, “Oh, this is an operator doing xyz” and reason a little about it.

                                                            1. 6

                                                              I think there are just as many – or more – footguns with the overly deep and complex virtualization/orchestration stacks of today. In the “old days” senior developers would take time to introduce juniors into the company culture, and this included tech culture.

                                                              Nowadays developers are expected to be fungible, tech cultures across companies homogeneous, and we’ve bought into the control mechanisms that make this happen, hook line and sinker. </end-ochruch-poast>

                                                              1. 1

                                                                Nowadays developers are expected to be fungible, tech cultures across companies homogeneous, and we’ve bought into the control mechanisms that make this happen

                                                                Lol why is this bad? Imagine if your doctor wasn’t fungible. You’re ill and your doctor retires, well, time for you to not have a doctor. Moreover homogeneity leads to reliability and safety. Again imagine if each doctor decided to use a different theory of medicine or a different set of instruments. One of our doctors believes in blood leeches, the other in herbal medicine, which one is right? It’s always fun to be the artisan but a lot less fun to receive the artisan’s services, especially when you really need them.

                                                                1. 3

                                                                  Lol the doctors whom I trust with my health (and life) are not fungible, because I know them and their philosophy personally. If I want blood leeches I will go to the doctor who uses them well.

                                                                  1. 1

                                                                    So what if they retire or get sick themselves? What if you get sick badly somewhere away from your home? Also, do you expect everyone to do this level of due diligence with all services that people use?

                                                      1. 3

                                                        If the thrust were “Why you should DESIGN for Kubernetes from day one” I’d agree. If you do most or even some of the following: work out a containerized build, figure out how to manage deployment, puzzle over what and where to keep state and how to manage/recover it, consider load balancing and scaling, spend some time thinking about roles and entitlements, put in some time on dealing with logging and metrics, then you’ll be in good shape for any platform including rolling your own on VM or bare metal. If the answer to all of those is “I’ll use Kubernetes (and half of the CNCF projects)” you’re going to have a bad time. The complexity doesn’t just go away.

                                                        1. 24

                                                          I just wanted to highlight a distinction for anyone new to the scene who stumbles upon this thread. I think people lump a lot of hobbyist boards together. The RPI is a linux box basically. It has some headers on it for gpio but it runs ssh and uname works. This is kind of a “huge version” of embedded.

                                                          In this category you have things like Beagleboard, Odroid, the Asus Tinkerboard, RockPI, Teensy, etc

                                                          Then are the arduino style boards like @codejake said, the ESP32 compatible stuff, Particle.io, Sparkfun’s Thing. Many others. Even in the arduino proper space you have dev boards and then “pro” boards. Pro boards have less headers and tools on them because they are supposed to ship. After getting your code/hardware developed, you’d probably build a custom chip with a reduced BoM to do mass manufacturing. This is leaving my experience boundary, I’m just a hobbyist.

                                                          I just wanted to compare these two categories because if you are looking for the next step from the RPi, look at embedded devices where you burn your code in, can’t SSH or have an option to CAD up a design using Fritzing. It’s very different and you’ll learn a lot.

                                                          1. 2

                                                            Teensy boards are in the Arduino-esque camp — they have ARM Cortex-M CPUs and at most a few hundred KB of RAM. Definitely not capable of running Linux!

                                                            1. 2

                                                              So you actually can build Linux without MMU support. It’s an unusual choice, but it’s not actually impossible to run Linux on (especially beefier) microcontrollers.

                                                              1. 2

                                                                You can build it but it’s not what any normal person would regard as Linux. You’re not going to ssh into it, edit some code in vi, compile with gcc, run it.

                                                              2. 1

                                                                Ah, yeah. I edited my post incorrectly. Thanks. :)

                                                                1. 1

                                                                  You’re right but the latest Teensy 4.1 is almost in the “huge” category: 600MHz and 1MB RAM. Bigger than some historical machines.

                                                                2. 2

                                                                  You hit the nail on the head but I also find this distinction a little funny. If you break it down a RasPi with its GPIO pins are also just a much nicer version of soldering your own (parallel port) cable and plugging it in, maybe a case of “just a little more usability makes for really nice non-enthusiast product”, because I completely file myself under that category. Before the RasPi I had the knowledge, the hardware and the will to tinker, but it was just too tedious to do it more than once or twice.

                                                                1. 9

                                                                  The README doesn’t really describe what makes this different from something like screen or tmux, although it implies that it is.

                                                                  The website describes what seems to be a difference:

                                                                  https://zellij.dev/about/

                                                                  With an example of a plug-in. But it doesn’t make it clear what the difference is between running a plug-in and running a “full screen” executable.

                                                                  Zellij uses Webassembly and WASI in order to load these panes and give them access to the host machine, so they can be written in any compiled language.

                                                                  That’s the only differentiator I can find, and it’s kind of a strange one, since you can already run programs written in any compiled language natively.

                                                                  I assume that plug-ins have some control over multiple panes/allow some kind of multi-process coordination that distinguishes them, but this isn’t touted as a feature anywhere. So I’m not sure. Is there a provided UI toolkit that makes it very easy to write terminal UIs, maybe?

                                                                  I am happy to see a new terminal multiplexer, but since this project doesn’t bill itself as such, I spent a few minutes trying to understand why that is, assuming I was missing something. But I just came up confused. Declarative pane setup is a nice feature for a terminal multiplexer: although tmux is scriptable imperatively, you need a plug-in if you want the “yaml layout” model. But it’s still a feature for a terminal multiplexer.

                                                                  https://github.com/rothgar/awesome-tmux#tools

                                                                  If anyone from the project is reading this, a little section on “why it’s more than a multiplexer” or “differences between zellij and tmux/screen” (or whatever) would be very helpful for people encountering the project blind like this.

                                                                  1. 4

                                                                    That’s the only differentiator I can find, and it’s kind of a strange one, since you can already run programs written in any compiled language natively.

                                                                    What “pane access” means is that these programs get access to terminal state like scrollback while other programs are running as usual in the terminal. This can be used to extend the terminal to add features like:

                                                                    1. Copy selected terminal text to clipboard as HTML with color codes
                                                                    2. Extract all URLs from scrollback, save to clipboard

                                                                    It sounds very useful and hacker friendly to me. Kitty has had a similar feature: https://sw.kovidgoyal.net/kitty/kittens/custom.html

                                                                    When launching a kitten, kitty will open an overlay window over the current window and optionally pass the contents of the current window/scrollback to the kitten over its STDIN. The kitten can then perform whatever actions it likes, just as a normal terminal program. After execution of the kitten is complete, it has access to the running kitty instance so it can perform arbitrary actions such as closing windows, pasting text, etc.

                                                                    The differentiator here is that you can write Zellij plugins in any language that compiles to WASM, while Kittens are python scripts.

                                                                    1. 2

                                                                      That does sound very useful, but the things you described are also available in tmux and screen. They work by providing commands that output relevant pieces of scrollback or your selection to stdout, so you can compose tmux with standard filters or fzf or something like tmux thumbs (which, despite the name, operates on arbitrary text via stdin). You can do this from within tmux (via keybindings or the :command line), or from outside of a tmux session, by interacting with it as a server (which the tmux executable does by default, if you give it a command).

                                                                      This means you can “script” tmux in whatever language you want – rather than having a plugin architecture, it thinks in terms of stdin/stdout, which feels very hacker friendly to me – although I realize this is a personal preference.

                                                                      (Actually, I’m lying: as far as I know tmux doesn’t have a way to extract the current selection while preserving color escape codes. If you want to preserve escape codes, I think you have to output entire lines of the scrollback buffer. This would make it very annoying to implement (1) in tmux as a simple series of pipes; you’d either need to patch tmux or write a script that queries the scrollback contents and selection indices and do the slicing yourself. Which would maybe end up looking similar to a zellij plugin?)

                                                                      I’m not trying to be a shill for tmux here – I really am happy to see a new terminal multiplexer. The reason I want to dig into it to see what makes it tick is that I’m currently working on my own “terminal workspace” program (which is not quite a multiplexer) and I’m looking for good ideas to steal. :)

                                                                    2. 2

                                                                      […] what makes this different from something like screen or tmux

                                                                      At a superficial layer, having the powerline style cheat “menu” showing shortcuts, and sane shortcut defaults setup out of the box is a big enough difference that a few people at my office have started using zellij regularly where their efforts to get into tmux/screen were tenuous at best.

                                                                      1. 1

                                                                        Does it support copy/paste yet? I don’t see that in the docs or the code so I’m assuming not.

                                                                        1. 1

                                                                          I couldn’t say for sure. In my limited testing of it this far, I’ve only used the terminal emulator for copy/paste.

                                                                    1. 1

                                                                      I have both Hardkernel Odroid XU4 and Pine Rock64 (among others) and they’re great little devices but think they’re not ideal for workstation use unless you also have a larger faster x86 system nearby. I’d consider getting a NUC or a mini-PC (see this one from ASRock) or trolling auction site for a Lenovo Thinkcentre M93P “tiny” small form factor (sff) or HP G1-600 which go for $150-$200 and run Linux or Windows easily.

                                                                      1. 4

                                                                        * Removed CU-SeeMe support from libalias(3).

                                                                        Damn, that’s a throwback. I’ve been meaning to write something on the history of videoconferencing…

                                                                        1. 2

                                                                          Right? I recall trying it circa 1992 at the Mac-based art lab I was working in while in grad school. That it worked at all seemed amazing.

                                                                        1. 1

                                                                          Company: Stellar Development Foundation

                                                                          Company site: https://stellar.org (open source: https://github.com/stellar)

                                                                          Position(s):

                                                                          Engineering

                                                                          Ecosystem

                                                                          Product

                                                                          Business Development

                                                                          Legal & Policy

                                                                          Location: SF, NY, Asia-Pacific, or Remote

                                                                          Description: Stellar is a decentralized, fast, scalable, and uniquely sustainable network for financial products and services. It is both a cross-currency transaction system and a platform for digital asset issuance, designed to connect the world’s financial infrastructure.

                                                                          The Stellar Development Foundation (SDF) is a non-profit organization that supports the development and growth of Stellar. The Foundation helps maintain Stellar’s codebase, supports the technical and business communities building on the network, and serves as a voice to regulators and institutions. The Foundation seeks to create equitable access to the global financial system, using the Stellar network to unlock the world’s economic potential through blockchain technology.

                                                                          The Foundations work is open sourced under the Apache 2.0 license: https://github.com/stellar

                                                                          Tech stack:

                                                                          • C++ 11, Go, TypeScript, JavaScript
                                                                          • Postgres, BigQuery
                                                                          • Kubernetes

                                                                          Contact: Apply here

                                                                          1. 2

                                                                            I tried to read the whitepaper a while back, correct me if I’m wrong here:

                                                                            • Stellar is a fork of ripple?
                                                                            • Stellar uses voting within subsets and has many overlapping subsets, the consensus is some convergence? I’d appreciate if you could explain this a bit.

                                                                            Another thing I’m curious about:

                                                                            • What does it take to become a validator?
                                                                            • How are new tokens minted / distributed?
                                                                            • How do you do oracles?
                                                                            • How do you make sure that these “stable assets” (pegs to fiats or other things) track what they are pegging?

                                                                            I was like 99.9999% sure this project was a scam when I looked at the paper, it tries so hard to obfuscate how it works and the ratio of claims to explanations is very bad. Seeing it here on lobsters is very surprising to me.

                                                                            1. 2

                                                                              I was like 99.9999% sure this project was a scam when I looked at the paper, it tries so hard to obfuscate how it works and the ratio of claims to explanations is very bad. Seeing it here on lobsters is very surprising to me.

                                                                              I can’t comment on the project directly but I’ve met one of the people involved in it socially not knowing we both worked in tech and later briefly discussed Stellar. I don’t believe it’s a scam or that they would have anything to do with it if it were.

                                                                              1. 2

                                                                                A scam in the sense of whether they are actually a byzantine fault tolerant decentralized system in the first place (something they claim to be).

                                                                                The paper does not feel clear but rather obfuscated. The questions I asked are pretty important prerequisites for deciding if you want to throw your lot in with these people, whatever people think of blockchains, it is pretty clear that byzantine fault tolerance is an important property that is desirable in any political / economic system. Exploring how it can be achieved is a worthwhile research. However due to the perverse incentives there’s all sorts of outrageous claims.

                                                                                Another problem that would be desirable to avoid is the tragedy of the commons (the cause of climate change), which proof of stake is vulnerable to (as well as at least a large class of voting protocols, if not all), but the exploit would require co-ordination that seems to be implausible with current social networking technology (however I believe that the exploit would come in the form of something not vulnerable to tragedy of the commons, though I have yet to prove that).

                                                                                I am not saying this because I am fond of proof of work, quite the opposite, the environmental consequences mean we should be trying to find a better solution. However we should be truthful in that pursuit and respect mathematical facts (like PoS being vulnerable to ToC) - they have a tendency to predict the future.

                                                                              2. 2

                                                                                I think they misrepresent achieving the same distributed consensus projects like bitcoin do. Its ultimately obfuscated federated control.

                                                                                That said I think many blockchain projects are scams in that they misrepresent distributed consensus being the solution to problems when it really isn’t.

                                                                                1. 1

                                                                                  @ilmu Great questions, thanks!

                                                                                  The old Stellar network that launched in 2014 was using software (stellard) that was a modified fork of the Ripple node software (rippled). In 2015 the current Stellar network was launched with a new consensus model (SCP) and new stellar-core software that was written fresh. There are some blog posts about the network upgrade that go into more detail: 1, 2.

                                                                                  For details about how the Stellar Consensus Protocol (SCP) works, I recommend these resources. The video talks about how the voting works.

                                                                                  1. 1

                                                                                    Thank you for answering, I just saw that you did due to the reply feature being back, I looked at these resources a bit (not through it yet) and it looks like the path you have chosen is interesting (to me at least, the model I am trying to figure out is similar in direction to yours). However I don’t think you can claim byzantine fault tolerance as-is.

                                                                              1. 13

                                                                                I can really suggest Mikrotik. They are cheap and very powerful. I have one running in my home as router and access point and it’s work fine from years.

                                                                                I had a bunch of ARM boards running Docker Swarm, but I am planning to migrate them to some refurbished x86 boxes because they struggling too much with CPU intensive applications (think about ELK). Anyway ARM boxes works fine for DNS or home automation services like HomeAssistant.

                                                                                1. 3

                                                                                  Which Mikrotik box are you using? I’m considering the catchily named RB4011iGS+5HacQ2HnD-IN to get 10 gigabit ethernet ports plus really fast wifi. I wish I could get away with the hAP AC2 or AC3, but have too many ethernet devices.

                                                                                  1. 2

                                                                                    Anything with metal boxes is good. They used to make too-cheap plastic boxes as well.

                                                                                    I’ve used RB433s (with capsman) for more than a decade and am a fanboi: Mikrotik still ships new firmware for >10yo hardware and replies to support email with a straightforward factual reply. If you want my undying love for whatever you’re doing, that’s the way to win it.

                                                                                    1. 2

                                                                                      I am a Mikrotik fanboy as well: in my very past work experience, I have used Mikrotik from small boxes to ISP BGP routers and they work very well. They are not Cisco or Juniper of course, but they cost a fraction and they are very powerful. You need a basic script skills and sometimes the configuration is a bit tricky (i.e. for QoS) but you can implement very advanced networking feature.

                                                                                      The support is good (at least for a free support) and they keep pushing lot of new features, like Wireguard implementation.

                                                                                    2. 1

                                                                                      I have the RB4011iGS+5HacQ2HnD-IN. It’s fantastic.

                                                                                      https://lobste.rs/s/dbr7yu/what_do_you_use_for_your_home_networking#c_pkpte7

                                                                                      1. 1

                                                                                        I have an hAP device. For my use case (I have a 50mb connection) it’s enough. Every room in my house has an Ethernet plug, but I am using a refurbished Cisco 3550 as core switch that I got for free at my job.

                                                                                        1. 1

                                                                                          I use RB4011 and a pair of PoE powered cAP ac. Copper throughout the house for desktop PCs and TV boxes. In conjunction with gigabit cable works amazingly well.

                                                                                          1. 1

                                                                                            RB4011iGS+5HacQ2HnD-IN

                                                                                            As far as I can tell, while that model has 10 ethernet ports, they are not switched which means if you treat it like a switch and plug in 10 Ethernet devices and they start using bandwidth, they’re going to hammer your router’s CPU and memory.

                                                                                            For best performance, you’re going to want to dangle a switch off of this, instead.

                                                                                            Edit: I stand corrected. The block diagram shows two Realtek switch controllers inside. These are performant, switched ports. You are good to go!

                                                                                            https://i.mt.lv/cdn/product_files/RB4011iGSplus5HacQ2HnD-IN_181032.png

                                                                                            1. 1

                                                                                              Keep in mind that the 4011 for some bizzare reason does not support passive DACs, which is really bizzare in the SFP+ world.

                                                                                            2. 1

                                                                                              +1 for Mikrotik. I have a couple Hap’s, Hex’s, CRSxxx, and an RB3011. Excellent kit. Fairly steep learning curve.

                                                                                            1. 10

                                                                                              Personally, I’d be quite interested in also seeing Nim, Zig, and maybe D versions. Though I assume every reader will have their own set of favourites they’d like to see the most.

                                                                                              1. 19

                                                                                                Here’s a quick “simple” version in Zig, it beats the simple version in C on my machine at 0.37 vs C’s 0.65.

                                                                                                https://zigbin.io/73ee75

                                                                                                Edited to fix the usual minor mistakes that happen when I write something quickly :)

                                                                                                1. 5

                                                                                                  Beautiful. Zig definitely scratches an itch for me; I just wish I had the time to devote proper attention to it. Maybe someday.

                                                                                                2. 4

                                                                                                  I’m sure the author would appreciate some submissions for those languages.

                                                                                                  I feel like this type of benchmarks usually suffer from the bias of the author’s proficiency with the tested languages which is not uniform. I’m sure optimized versions from experts of each language would be highly useful to them, and to us.

                                                                                                    1. 1

                                                                                                      Indeed. And they did solicit a contribution for Rust from the developer of rgrep- which is rather fast!

                                                                                                    2. 4

                                                                                                      I submitted naive and slightly profiled/optimized D-Language versions. There’s probably a bit more to squeeze out (the char to string idup allocation).

                                                                                                      edit: found some over a cup of coffee.

                                                                                                      edit #2: found more, now on par with optimized cpp. It’s not very readable anymore:

                                                                                                      https://github.com/rlonstein/countwords/blob/dlang/simple.d

                                                                                                      vs.

                                                                                                      https://github.com/rlonstein/countwords/blob/dlang/optimized.d

                                                                                                    1. 12

                                                                                                      A while back I bought two of these USB Thinkpad keyboards, using the old (good) keyboard layout: https://www.newegg.com/lenovo-thinkpad-usb-wired/p/N82E16823218006

                                                                                                      I have used the crap out of them. They are the absolute best.

                                                                                                      Internally it’s just a USB controller attached to the same keyboard that shipped in older Thinkpads, so I’ve already fixed up at least one keyboard with parts from eBay.

                                                                                                      Despite things like Vimium or i3 or other ways to reduce mouse usage, most folks still need a mouse from time to time. Reducing the travel time from your keyboard to your mouse seems really high value to me, and I’m lost why most of these custom or fancy keyboard people don’t focus on having a nearby mouse of some kind?? I’m not the OP of this thread, but I highly empathize: https://www.reddit.com/r/MechanicalKeyboards/comments/626sga/how_about_trackpoints/

                                                                                                      These Thinkpad trackpoint keyboards are perfect. The mouse is right there.

                                                                                                      1. 10

                                                                                                        I love my shinobi tex, a mechanical homage to the thinkpad design: https://tex.com.tw/products/shinobi

                                                                                                        1. 4

                                                                                                          Just got yesterday mine. Such a pleasure to have again some key travel, and feeling the fingers match the keys. Really nice to alternate with the laptop keyboard (X1E Gen1) and is an incentive to work more at the desk with a big screen. For me the trackpoint on the shinobi work much more precise and easy. I was expecting a little more pressure resistance from the keys, but in the end I think it is quite comfortable. It’s really nice too that there is a deeper mold in the keycaps. Was expensive, but I’m definitely happy about this purchase.

                                                                                                          1. 4

                                                                                                            oh my gosh i’ve never seen this before, this is amazing!

                                                                                                            1. 4

                                                                                                              Woah! This is the first keyboard I’ve seen in years that tempts me…

                                                                                                              1. 3

                                                                                                                How are the key symbol printings holding up? I got mine a week ago and I’m already noticing L-Ctl, Esc, and frequent letters fading. It’s not a big deal since I don’t really look but I’m surprised.

                                                                                                                1. 3

                                                                                                                  I’ve been using mine for ~9 months daily, and while it’s true that some letters started fading very quickly, they seem to have reached a “plateau”. Definitely the discolouring has slowed its pace or the keycaps would be blank by now.

                                                                                                                  1. 2

                                                                                                                    Same here. Fading on frequent used keys. Been using it since last november.

                                                                                                                2. 5

                                                                                                                  Thank you for your comment. I feel the same way about trackpoints, and your comment made me order a ThinkPad USB keyboard :)

                                                                                                                  I really like the newer chiclet design, so I’ve picked a more recent model. Luckily they seem to be designed with a similar concept; reuse of the existing laptop keyboard design (see https://dontai.com/wp/2018/09/06/thinkpad-wired-usb-keyboard-with-trackpoint-0b47190-disassembly-and-cleaning/ for disassembly). The number of key rows don’t really bother me, and for all I’ve tried I don’t feel comfortable on keyboards with mechanical switches. Too many hours on a ThinkPad, I think.

                                                                                                                  1. 4

                                                                                                                    i am very happy lenovo is still making these keyboards, even if it’s the new layout

                                                                                                                  2. 4

                                                                                                                    I have one of these and I love it! I’m a sucker for the trackpoint and I love the pre-chiclet key design. It’s super portable too - I can easily throw it in my backpack with my laptop if I’m going to be out of the (home) office all day.

                                                                                                                    It’s a little sad that these version seem to be so unavailable these days :(

                                                                                                                    1. 4

                                                                                                                      I’d recommend ThinkPad TrackPoint Keyboard II because it is wireless - via Bluetooth or Wireless Nano USB Dongle.

                                                                                                                      1. 5

                                                                                                                        I own the first generation as wired version and the micro USB socket is absolute garbage. Two out of three keyboards lose USB connection when the cable is moved slightly. But, this problem can be fixed pretty easily by disassembling the keyboard, bending the socket back to normal shape and then adding a large solder blob to the socket case such that it can’t bend that easily anymore. I fixed both keyboards reliably with this procedure.

                                                                                                                    1. 2

                                                                                                                      I got the impression that the questionnaire is making the assumption that touch typing is better and/or faster than all alternative methods of typing.

                                                                                                                      1. 3

                                                                                                                        It might be, if you’re transcribing or writing, but I find that thinking/coding is not constrained by my typing speed or correction rate (~35 wpm) and my half-learned touch-typing.

                                                                                                                        1. 3

                                                                                                                          I touch type but don’t care about the home row. I just hit the keys I want to without sight being necessary.

                                                                                                                          Not needing to use your eyes to type helps

                                                                                                                          1. 3

                                                                                                                            The questionnaire defines touch typing as “using all the fingers and thumbs to type without looking at the keyboard.” By this definition, I touch type, because I use all of my fingers and thumbs to type, and I don’t look at the keyboard, even though my resting position bears no resemblance to the standard “home row” technique that’s usually taught. Rather, my fingers simply know where they need to be and I hit each key with whatever finger happens to be closest at the time. My accuracy isn’t brilliant, but I can sustain 60wpm corrected, and at that point, I don’t find myself limited by typing speed.

                                                                                                                            1. 1

                                                                                                                              I didn’t mean to give that impression.

                                                                                                                              As @Vaelatern and @thequux point out not looking at the keyboard when typing is generally more efficient. From the research I’ve found, the evidence seems to point to the minimising finger movements and setting keys so that common letter clusters can be typed by different hands seems to improve speed, accuracy and comfort. The current default staggered QWERTY layout - does not allow natural hand placement, thus increasing the risks of fatigue and injury. The default key size and spacing was design for less than 6.1% of the worlds population, I’m hoping in the near future everyone will be able to get a keyboard that is a unique fit to their bodies, and thus a pleasure to use :~)

                                                                                                                            1. 3

                                                                                                                              Variously sized (full, tenkeyless, other) in QWERTY:

                                                                                                                              • Filco magestouch with Cherry MX Blue
                                                                                                                              • Unicomp Model M
                                                                                                                              • Leopold FC750R with Cherry MX Clear-White
                                                                                                                              • Tex Shinobi with Cherry MX Green
                                                                                                                              1. 8

                                                                                                                                I love your pricing page - those ‘our choice’ tags are such bullshit.

                                                                                                                                1. 4

                                                                                                                                  What, like somehow $999,999.98 isn’t the best value for you?

                                                                                                                                  1. 2

                                                                                                                                    What happens if someone seriously wants the $999k plan?

                                                                                                                                    1. 17

                                                                                                                                      I write an “amazing journey” post detailing how the service is seriously definitely never getting shut down for at least three days and retire on a beach while you deal with the rotting service.

                                                                                                                                      1. 1

                                                                                                                                        What startup is the phrase “amazing journey” in reference to?

                                                                                                                                        1. 15

                                                                                                                                          Many.

                                                                                                                                          1. 4

                                                                                                                                            Many! I think I’ve seen “incredible journey” used with that one email program you had to wait in line to get, one of the post-Flickr photo sites, Vine maybe?

                                                                                                                                        2. 1

                                                                                                                                          He throws a party… I mean… hires a lawyer and makes a Series-A announcement?