1.  

    Moore’s law is not a conspiracy to fleece people of their money. And the first company to build a high-density battery that doesn’t wear out will be able to buy Apple with their lunch-money. This article is bollocks.

    1.  

      We already have replaceable batteries based on standard sizes and connectors, and yet Apple choose not to support replaceable batteries. The thing with Apple’s batteries is not “Apple have done the best for product longevity that could possibly be done”.

      1.  

        Almost no flagship phones support user-replaceable batteries anymore.

        It’s cheap and fast to get a new replacement battery installed in a phone here (in Sweden).

        Apple phones (and products) have decent second-hand value (again, here in Sweden). The ability to cheaply replace a cracked screen or exhausted battery helps.

        1.  

          Almost no flagship phones support user-replaceable batteries anymore.

          This is specifically because everyone’s trying to copy Apple’s fashion moves; they’ve ruined things for everyone.

          1.  

            Shrug if customers cared more about user-replaceable batteries than looks, the phones with that feature would sell more.

    1. 2

      Blech. Why is it always people who want to gouge out your eyes with their theme that disable reader mode on their blogs? More importantly why does Firefox respect authors’ wishes, instead of my wish to avoid eye strain? If I were disabled rather than just old and crotchety surely it’d be a criminal act in some jurisdictions?

      1. 3

        I actually didn’t know that reader mode was disabled, I will look into fixing that. I’m sorry the white-on-black theme is too intense, would you prefer a more muted grayscale pallette? Bolder fonts? I went ahead and set it back to the default black-on-white for now since I had not considered the visibility implications.

        1. 1

          Sorry for assuming it was done on purpose! Don’t change your design to please random internet weirdos, but if I were you I’d look into why it doesn’t support reader mode on FF. For what it’s worth, reader mode on Safari worked fine, and it’s a good article.

      1. 24

        Please don’t suggest running a string-replace regex on JSON. That’s horribly dangerous.

        1. 4

          Sometimes, needs must as the devil drives.

          (Watched this approach blow up at work because it would be easier than using jq. Well, guess how that ended…)

          1. 2

            Yeah this is definitely a case of “don’t do what Donnie Dont does”

          1. 2

            Does that mean everybody who works there now has to join or quit? If not, what exactly is the vote for? Article assumes a familiarity with the details of US labour laws I don’t have.

            1. 10

              The vote allows the union to operate under the regulatory framework for unions, which gives it rights/protections that ordinary groups of employees do not have.

              1. 8

                In the US this depends on the state. States with so called ‘Right to Work’ laws do not require everyone to join the union, but the union still represents all eligible employees in the negotiation.

                1. 3

                  Wow, interesting - it would never have occured to me that closed shops were legal in America.

                  1. 10

                    “Closed shops” – workplaces where it’s forbidden to hire non-union members – are generally illegal in the US.

                    “Right to work” laws are misleadingly named. Since the work force may be a mix of members and non-members, there’s a potential free-rider problem where someone gets the benefits the union negotiated, but doesn’t pay dues to the union to support the union’s work. In some states it’s legal to have an “agency shop” or other similar arrangement, where employees are not required to join the union, but an employee who does not join the union still pays some type of “agency fee” or “fair share fee” to eliminate the free-ride problem.

                    A “right to work” law is about outlawing that arrangement, and generally is meant to hurt or weaken the union by allowing employees to get the union’s benefits without paying its costs.

                    1. 2

                      Thanks for the explanation. I was curious about the legal status of the “agency shop” model here in the UK, and I happen to know an expert on employment law and they told me this is also illegal here and would be considered a closed shop.

                      1. 2

                        That is interesting. Is the right to negotiate collectively automatically part of collective representation? In Germany, a “unionised company” doesn’t really exist, it generally has a formalised employee representation with rights (e.g. block certain decisions), but not necessarily collectively negotiate. This is depending on company size, at larger companies, they can e.g. block firings or disagreeing about firing with cause. “The union” is not the representation, though, so in larger companies, there’s proper political union blocks within this committee. No one forces the company to use this committee to negotiate wages with, though.

                        It is generally the employers right to decide to collectively negotiate wages or not and pick the partner for that. It even goes as far as employers forming associations that negotiate with larger unions, spanning many companies. There’s also the setup where a group within the company is part of the union and another not and collective negotiation only happen with the former. Employers often decide to extend the negotiations to non-unionised people, it’s more efficient. Yes, there’s a free-rider problem, but those people also have not representation at the table, then.

                        In some areas of business, the collective negotiation model of Germany is even seen as a competitive advantage, as it removes a lot of bandwidth need from HR.

                1. 8

                  This is gonna be one crazy, but awesome, week:

                  1. Giving a lunch & learn presentation at ${DAYJOB} titled “Human Rights-Centered OS Development Supply Chain.”
                  2. I’m hoping to catch up on all the administrative tasks I’m nearly a year behind on with respect to HardenedBSD. I need to get US-based donors their tax receipts.
                  3. Reach out to a few potential sources of major funding for HardenedBSD to help fund a proper server for self-hosted Gitea of an enterprise OS.

                  My job tends to be a “here’s a fire, there’s a fire, everywhere’s a fire” so it’s really hard to gauge what I can do right now. I’ve found myself in a position where I’m effectively the acting director of IT for a 200-person subsidiary (but without the pay of an executive. darn!) I’m hoping to stop clocking 12-16 hour days this week. I’m feeling pretty tired and burnt out, TBH.

                  1. 8

                    My job tends to be a “here’s a fire, there’s a fire, everywhere’s a fire” so it’s really hard to gauge what I can do right now. I’ve found myself in a position where I’m effectively the acting director of IT for a 200-person subsidiary (but without the pay of an executive. darn!) I’m hoping to stop clocking 12-16 hour days this week.

                    Just saying, you can easily decide to stop this on your own :) I have seen countless cases of people working insane hours, and the few that decide “work is done at X o’clock”, they are much happier, and nothing changes in terms of urgency. There are still fires but they don’t get any larger or smaller.

                    In most orgs, there is always “a fire”. This is just to get people to work in a panic in an effort to get more done.

                    It just hurts me to see this when there’s no reason for it.

                    1. 3

                      I’ve learned this the hard way. Everything is burning all the time at my current job too (it’s pretty impressive actually), and I always leave at nearly the same hour even if something blew up (in that rare case I can work a bit from home). It’s important to differentiate the usual fire from an abnormal explosion, if you know what I mean.

                      1. 4

                        It’s important to differentiate the usual fire from an abnormal explosion

                        Lol, this is gold… And hits what I was getting at - thanks :) I learned it hard too. Suffered a bad panic attack for the first time ever and thought my heart was going to stop. I’m 24 and workout daily.

                      2. 1

                        It doesn’t even need to be a scam to trick you into working more hours, often the “fire” status is just to push that particular thing to the top of the org’s priority queue, rather than being targeted at the implementers / fixers.

                      3. 5

                        “Human Rights-Centered OS Development Supply Chain.”

                        I’d like to subscribe to your newsletter

                        1. 4

                          Haha. I’ll publish slides later this week. Want me to ping you when they’re available?

                          1. 3

                            Yes please!

                              1. 1

                                Thank you!

                      1. 31

                        One thing that is not specified is the language choice. E.g. if the language is Java, you are probably limited to JavaFX, SWT, AWT, or Swing.

                        But generally speaking: Qt. Has matured over 2.5 decades. Has a reasonable look & feel on macOS and Windows, is native to Linux (at least KDE). Has a large set of traditional widgets. Has a GUI builder (Qt Designer) where you can just drag and drop widgets. You can generate a class from the Qt Designer .ui files. The Qt with C++ learning curve is quite steep if you don’t know C++, but there are two awesome Python bindings (PyQt and PySide). The Python bindings also have the benefit that they integrate with things like matplotlib (which has a Qt backend). In contrast to all web solutions, Qt applications can be lean.

                        Background: I have used both Gtk+ and Qt for applications. I prefer Qt by a large margin, it’s better in almost every aspect: better widgets, better documentation, more logical, better look & feel in Windows and macOS. The big thing that Gtk+ has going for it is that it has bindings for more languages (since Gtk+ is written in C, it is easier to bind). So, for Rust applications I use Gtk+.

                        I absolutely hate Electron/web apps. But you should probably consider it, given the amount of documentation and the size of the communities.

                        1. 3

                          Totally agree about Qt. Qt also comes with networking and core library with regexp, etc. support.

                          1. 1

                            One thing that is not specified is the language choice. E.g. if the language is Java, you are probably limited to JavaFX, SWT, AWT, or Swing

                            Like I said in the title, I don’t care that much about language, I just want the best gui creation experience.

                            1. 1

                              Isn’t the licensing around Qt super complex though? It might work if OP is making a FOSS desktop app, but for any other situation I’d be extremely worried about licensing stuff.

                              1. 2

                                Complex and constantly shifting, as they keep trying new (often shady-seeming) ways to monetise.

                                1. 1

                                  If you’re doing it for money you might be in a position to pay for a licence (and get the less-buggy edition to boot).

                                2. 0

                                  what about cairo?

                                  1. 4

                                    Isn’t that more of a graphics primitive library (can draw shapes, curves, etc.) than a gui library?

                                    1. 1

                                      Yes, it’s just an immediate-mode API to draw things on a surface. It is an excellent base on which to build a gui library, but there’s a lot of work between those two places.

                                1. 14

                                  There is a reason for the proliferation of Electron apps. There is a huge ecosystem, and the time to ship is fairly low. There are tonnes of FOSS IDEs in electron that you could take inspiration from as well. Don’t worry about the size of binary - the intersection of people interested in IDEs/notebooks and people interested in minimal memory footprint is tiny.

                                  1. 36

                                    No, just.. no. The whole idea of making individual applications that each depend on their own copy of a fully featured web browser that, get this, will almost never be updated to patch future security issues is an extremely flawed and dangerous practice. You do not need an entire copy of chromium to edit text.

                                    1. 11

                                      you’re right that you don’t need it, but that analysis is only considering the user’s perspective, and is only considering it from a narrow frame of reference.

                                      For one thing: most Electron apps in most situations are being deployed to users who will run just a few applications at a time; less than ten. I agree that you don’t need to run a web browser to edit text. The reality is that the vast majority of users will only run one instance of VS Code (or Atom). The question is not whether or not you need it, it’s whether or not you can get away with it.

                                      For the majority of orgs, staffing is significantly simplified with Electron, because it has significant overlap with the web as a platform. You can’t seriously consider the merits of Electron without acknowledging how much Electron lowers the barrier to entry.

                                      With that said: I absolutely despise building Electron apps personally, and I loathe using them. It is, in my opinion, a terrible platform. It does, however, solve real problems that are not solved by the alternatives.

                                      My hope is that the proliferation of Electron will give Microsoft pause, and will encourage innovation in the desktop application development space. (I don’t think this is likely, but that’s a topic for another day.) It’s an absolute embarrassment that Slack takes about 3x as much memory to run as Blender, when the former is just a glorified IRC client and the latter is literally a world-building tool. But at the end of the day, Slack is taking 350mb of memory in an age where entry-level machines have 4 or 8gb of memory. For most users in most situations, the bloat just doesn’t actually matter. The irony is that the people most affected by this bloat are software people, who are the exact people that have the power to stop it.

                                      1. 14

                                        The irony is that the people most affected by this bloat are software people, who are the exact people that have the power to stop it.

                                        This is a pretty shallow analysis. The people most affected by this bloat are the people with the least capable hardware, which is not usually people in software engineering positions, and certainly not the people choosing to write Electron apps in the first place.

                                        1. 3

                                          I think that’s broadly true but I left it off because I’m having a very hard time imagining a user persona that describes this problem in a way where it really is a problem, and where there are realistic alternatives.

                                          A big sector of the low-end PC market now is Chromebooks (you can get a Chromebook with 4gb of memory for under a hundred dollars), but that’s a circular issue since Chromebooks can’t run Electron apps directly anyway, they have to run Chrome Apps, which are … themselves Chromium contexts. That user persona only increases the utility of Electron, inasmuch as that entire market is only capable of running the execution context that Electron is already using: the web. By targeting that execution context, you’re lowering the barrier to entry for serving that market since much of what you write for Electron will be portable to a Chrome App. The existence of Electron is probably a net positive for that market, even if, yes, as I said before, it’s a very wasteful foundation on which to build your software.

                                          The Raspberry Pi userbase is particularly notable here. Electron is probably a net harm to RPi 3 and Pi Zero users. Electron is a problem for the RPi userbase, but that’s a highly specialized market to begin with, and newer models of the RPi are fast enough that Electron’s bloat stops being as punitive. (when I say specialized here I don’t mean unimportant or rare, I mean that it’s notably different from other desktop environments both in terms of technical constraints and user needs.)

                                          It’s easy to say “Electron is bloated, therefore harmful to people with slow computers”, but as a decision-making tool, that conclusion is too blunt to be useful. Which users, on which hardware, in which situations, attempting to access which software?

                                          And besides, it’s not like Electron has cornered the market on writing bloated software. Adobe Photoshop is written in C++ and uses a cool 1gb of memory without a single document open. The reality is that Electron empowers beginner developers to create cross-platform desktop apps in a way that is absolutely dominating the space because it focuses on solving problems that actually exist, instead of problems that are only believed to exist. The path to getting people away from Electron is not to say “don’t use Electron because it’s bloated”, it’s for other tools to figure out what needs Electron is satisfying that are not satisfied by the alternatives.

                                          1. 4

                                            And besides, it’s not like Electron has cornered the market on writing bloated software. Adobe Photoshop is written in C++ and uses a cool 1gb of memory without a single document open. The reality is that Electron empowers beginner developers to create cross-platform desktop apps in a way that is absolutely dominating the space because it focuses on solving problems that actually exist, instead of problems that are only believed to exist. The path to getting people away from Electron is not to say “don’t use Electron because it’s bloated”, it’s for other tools to figure out what needs Electron is satisfying that are not satisfied by the alternatives.

                                            That’s not a fair comparison given how many plugins and features out of the box Photoshop has.

                                            1. 1

                                              The path to getting people away from Electron is not to say “don’t use Electron because it’s bloated”, it’s for other tools to figure out what needs Electron is satisfying that are not satisfied by the alternatives

                                              We need basically the Flash Player, without the legacy timeline or embedded VM. A cross-platform, high-performance scene graph with a small but complete API surface that developers can mate to the language of their choice, be it a VM like JS or Lua, or Python, or with D / Rust or C++ code.

                                              1. 2

                                                the timeline and the AS3 VM are … kinda the core of Flash, so I’m not really sure what would be left. Without that stuff isn’t it basically just Cairo?

                                                anyway, you know about Scaleform, right? Not clear by your answer if it’s already on your radar, but it was a licensed implementation of Flash, significantly more performant that Adobe’s implementation, that supported C++ interoperability, that was in its later years owned and run by AutoDesk. Using Scaleform to build the 2D UI for 3D games was a dominant trend in the games industry for over 15 years. Some people still use it today but it was cancelled years ago. https://en.wikipedia.org/wiki/Scaleform_GFx

                                                1. 1

                                                  Not at all. Most (complex) software written in Flash over the last few years of its meaningful existence completely ignored the timeline, and consisted of only 2 frames, once being the preloader and the other being the application. The reason I think it should separate out the VM and provide only an API is to share the load / interest across people coming from different language communities who all want to show something on-screen without Electron.

                                                  Flash 2d was a lot more than Cairo, which is comparable to the flash.display.Graphics API used to draw each individual item on the stage. It’s a proper retained-mode scene graph with events and a pretty good text API built in. And Flex, which was built entirely in AS3 on top of the basic scene graph was and still is the most well-thought-out, well-documented, and easy-to-use (both for beginners and advanced cases) UI framework I’ve ever had the pleasure of working with, and I’ve messed about with bunch of them over the years. Adobe Corporate (and Jobs’ pique) screwed over a great team of talented people who built and maintained Flex, robbed us hackers of an excellent cross-platform… platform, and created billions of dollars of waste heat running multiple redundant entire copies of Chromium on desktops everywhere for years.

                                          2. 3

                                            My hope is that the proliferation of Electron will give Microsoft pause, and will encourage innovation in the desktop application development space. (I don’t think this is likely, but that’s a topic for another day.)

                                            Nope, they’re huge users of it.

                                            1. 1

                                              I mean, my first example was VS Code and I said I thought this result was highly unlikely so … I feel like I’ve already demonstrated an awareness of that fact and I’m not sure what you’re getting at.

                                              1. 2

                                                Eep, I read it but didn’t catch that line. Sorry.

                                        2. 3

                                          the intersection of people interested in IDEs/notebooks and people interested in minimal memory footprint is tiny.

                                          In my experience the more someone crafts code, the more they care about memory footprint- even if it’s in the sense of “I’ll have less memory for testing my application”.

                                          1. 1

                                            In my experience the more someone crafts code, the more they care about memory footprint- even if it’s in the sense of “I’ll have less memory for testing my application”.

                                            I am with you to some degree - but we are talking about Notebook/repl-style applications here. These aren’t traditional applications in the sense that they are never daemonized, are always foreground applications, and are tested by manually tweaking and observing (or at least that is how I use notebooks). Also, I probably should clarify - if the application actually ships and people feel it is slow, then the effort involved in porting over to Qt or something might be justified. Most of the times, in crowded spaces, getting things to ship is more important than quibbling about memory use.

                                        1. 7

                                          Would anybody suggest Rust for prototyping?

                                          Many projects are so complex that we need a prototype to explore the options. Correctness is not an important aspect there. Python (JavaScript, Lua, Ruby, TCL,…) are great for prototyping. Never do we throw away the prototype to build the real product. So there is the desire for a language which can do both: Quick prototypes and reliable products.

                                          1. 11

                                            Rust can do both, about two years ago at work we wrote a ~300LOC middleware to handle redirects.

                                            Then proceeded to put that in front of the full request traffic of the company. This was our first Rust project, but a massive success: it took a reasonable amount of time to put the tool into production, the compiler said no a couple of times, but rightly so. The memory/cpu usage of the middleware were ridiculously low, even though it dealt with millions of redirects. Integrating cuckoo hashing, a LRU cache, and a database backend was easy. Zero production problems afterwards, because this thing just worked once it compiled.

                                            Ok, so 300 LOC is not exactly complex, but that’s not the point. This middleware was a part of a surreally complex project and that’s how prototypes should work: you identify part of a complex project, cordon it off and then prototype and implement it. Parallelize and iterate with everything and your complex project ends up being viable. Rust allowed us to get in, solve a problem, operate it in production and have it work reliably with a low maintenance overhead.

                                            1. 8

                                              I would say yes, because Rust-without-lifetimes* hits a sweet spot of letting you focus on structure without getting distracted by (as many) runtime bugs.

                                              *Writing fresh code, you can get away with cloning everything and having &mut self being the only borrow-y part.

                                              1. 5

                                                Lots of clone() and unwrap() and coding is quick, I suppose. Those can be easily searched for to clean it up once the design is stable. This clean up will surely be painful but you just pay off the technical debt accumulated to finish the prototype quickly.

                                                1. 10

                                                  I prototyped some code in Rust that used lots of clone and had an overabundance of Rc. Once I had it correct and a full suite of tests proving it’s behavior the compiler guided me on the refactoring. Just removing the Rc usage got me a 6x speedup on benchmarks.

                                                  I don’t think using Rust obviates the truism “First make it correct. Then make it fast”. Instead it allows you to use the compiler and the types to guide your make it fast refactoring and know that you didn’t break the code in non-obvious harder to test ways.

                                                  1. 3

                                                    That’s basically what I do. It’s actually not too difficult in my experience ’cause the compiler is so good at guiding you. The hard part happens before that, when you structure things correctly.

                                                  2. 5

                                                    Rust without lifetimes is OCaml (or ReasonML for those offended by OCaml’s syntax) :)

                                                    1. 3

                                                      I wonder if there would be a market for a simpler, runtime-checked, GC, lang that’s a subset of rust syntax that you could use on a per-module basis for prototyping, but still keeps the non-safety-related structures and idioms that real rust code uses, to aid porting to “safe mode” later if you want to keep it?

                                                      Sort of like the anti-typescript, but instead of adding some type safety, you keep the types but lose the borrow checker, and you pay for it with performance. But not by writing different code where you fill it with calls to cells and ref counts and such, rather you leave those annotations outand they just get added in during compilation / interpretation.

                                                      If you could do it without perverting the syntax much, it’d surely be easier to port from than if you say, just wrote your PoC in Python or JS.

                                                    2. 2

                                                      Really depends on what and how much you think you’ll have to refactor. Rewrites that challenge bigger architectural decisions are more costly in my experience with hobby (!) rust projects.

                                                      But if your protocol / API is stable, I’d go with rust from the start.

                                                      1. 2

                                                        I prototype with python, and gradually improve reliability with static typing (i.e. mypy) and unittests. Rust is great, but it’s correctness guarantees require an upfront cost which will likely penalise rapid prototyping. It all depends though.

                                                        On embedded systems, Rust is amazing for prototyping, especially compared to C or C++. It has a proper ecosystem, and debugging Rust’s compiler errors is far, far superior to debugging runtime bugs on the board.

                                                      1. 8

                                                        I didn’t expect something like this from Cadey, always seemed like a go advocate. (See also the fun hello-world compilation test with big functions.) I’ll still bet we’ll see another post about all the things that are (still) hard to get working in rust, in contrast to more mature ecosystems :)

                                                        1. 28

                                                          Expect the unexpected. I’m hitting a point in my career (and understanding of programming) where I really think that more elaborate tools are better. I gotta do a lot more with Rust to get fully up to speed on it, but so far I think it is a lot more fair to trade slower development time for more correctness.

                                                          1. 5

                                                            Nice to hear and wasn’t meant offensive. My second point was more from my own experience. Though it really depends on the use case.

                                                            1. 12

                                                              It does, but correctness is probably a lot more important than developer efficiency. At least if you don’t want to wake people like me up at 3 AM :)

                                                              1. 15

                                                                I hold a slightly different belief: correctness enables developer efficiency. In all its forms (type systems, test suits, formal proofs, module invariants, &c.), it enables developers to stop worrying about different things. The more background cycles you can free up to work on the actual problem, the more productive your developers become.

                                                                1. 10

                                                                  Types both direct me towards solutions AND check my solutions, at the SAME TIME.

                                                                  1. 8

                                                                    I think the phrase “slow is smooth and smooth is fast” is applicable here.

                                                                    1. 3

                                                                      IMO Correctness costs early, and pays off later. Maintenance is always easier the more explicit everything is, because you’re always shuffling different contexts in and out of your meat cache, and when you can’t see information in the code you’re looking at, you have to constantly stop and go hunting for it.

                                                                      1. 3

                                                                        Having coded rust for a while and used typical GC-based langs as well, I can totally see both sides. Especially when you also add the ecosystem into the mix. For some it’s faster to build stuff and also remove it fast again, the overhead to get it truly right isn’t worth it. I personally strive for the opposite but sometimes it’s really hard to sell this.

                                                                        1. 7

                                                                          I spent a lot of time looking at green tests and flames in production, and decided there had to be a better way to catch problems before they set prod on fire. Now I’m all about the types.

                                                                      2. 2

                                                                        Would be interesting to hear how this turns out. Most of my experience is from writing async stuff pre async/await, so I’m curious how it feels now. (Haven’t had the time to switch over my projects.)

                                                                    2. 5

                                                                      I feel this, in fact I feel a take brewing but I don’t have it fully realized yet.

                                                                      We have this eternal tension between “developer efficiency” which usually means, maybe simplicity however you may define it or intuitiveness (also subjective of course) and lack of friction to get up and running, and correctness which means robust software that handles many error cases and can self correct in some cases… but maybe this is a false dichotomy.

                                                                      I am thinking of musical instruments, where in order to really express yourself it takes years of effort to become fluent technically. nobody bats an eye at this, but we all also appreciate that the easiest way to play liszt on the piano is to put a bluetooth speaker on the top of it and connect it to spotify. I’m joking, but not by much.

                                                                      Anyway what I’m getting at is that the sharpest tools cut the most easily, which is axiomatic and we all laugh at the C jokes, but why shouldn’t it take a lot of effort to become fluent in them?

                                                                      This isn’t really a well thought out take but maybe you see what I’m getting at.

                                                                      1. 3

                                                                        Be careful, nowadays your attitude that using tools properly might take years of practice is often dismissed as “gatekeeping”.

                                                                      2. 3

                                                                        What kind of stuff are you looking to make with Rust?

                                                                        1. 7

                                                                          So far I’m easing into what I know really well: chatbots and webapps. Eventually I hope to port Olin to Rust and use it as the backend for wasmcloud. I’ve started to work on something for this here, but right now it’s a very elaborate hello world :)

                                                                          1. 3

                                                                            Here’s my first real public facing one: https://printerfacts.cetacean.club Here’s the source code: https://github.com/Xe/printerfacts

                                                                            1. 2

                                                                              Very cool, looking forward to reading more about that in the future.

                                                                          2. 3

                                                                            Interesting view. How do you feel about tools like Ada Spark, Agda, and others that try even harder for correctness?

                                                                            1. 2

                                                                              I have no opinion on them because I haven’t used them yet.

                                                                        1. 5

                                                                          What kind of gui? What controls you need? Where will it run?

                                                                          1. 4

                                                                            Notebook/REPL/IDE-type thing. Desktop platforms (linux primarily, but should work with all three).

                                                                            1. 5

                                                                              If you don’t mind non-native widgets, I’d suggest looking at ReveryUI. Check out OniVim for an example application built with it.

                                                                              1. 2

                                                                                I thought (without having any experience with Revery) that a large part of the appeal was that it compiled to native code? Or by “non-native widgets”, do you mean something else?

                                                                                I’ve been looking at Revery for a project I’ve been sketching out; it seems like a very nice option. If you have any experience building things with it, I’d be interested to hear what you think - one small downside to adopting the framework now is that it seems not much other than Oni2 has been built with it yet (and so there’s more concern about documentation, stability, etc.)

                                                                                1. 2

                                                                                  I thought (without having any experience with Revery) that a large part of the appeal was that it compiled to native code? Or by “non-native widgets”, do you mean something else?

                                                                                  You’re right that it does compile to native code and that’s one of it’s great benefits.

                                                                                  Some people prefer their apps to have a “native” feel, by which I mean, buttons, input, windows, and other UI elements have the Operating System’s design. This is not what you get with Revery, each app will mostly look the same on each platform.

                                                                                  I’ve been looking at Revery for a project I’ve been sketching out; it seems like a very nice option. If you have any experience building things with it, I’d be interested to hear what you think.

                                                                                  At the moment I’ve been mostly playing around with tiny projects while I learn ReasonML. I do really like it, but I have not got the experience with a large project, releasing, or long term maintenance to give all the disadvantages.

                                                                                  One negative I can give is that I feel I’ve had to learn React to learn ReactReason and Revery. As someone who mostly used Vue before rather than React this has added an extra hurdle.

                                                                                2. 1

                                                                                  ReasonML is an absolute pain to setup on a new machine. I wish you luck if you follow that path.

                                                                                  1. 3

                                                                                    What setup are you using? It seems to be as easy as doing:

                                                                                    sudo apk add reason

                                                                                    on alpine

                                                                                    1. 3

                                                                                      I didn’t come across any issues when I did it a few months ago. Granted, I’m on MacOS so I couldn’t say if this experience is different on Linux.

                                                                                      1. 2

                                                                                        Maybe I should try again. Last time I tried to install anything with ML on the bottom, it left junk all over my computer.

                                                                                      2. 1

                                                                                        Can you say more? I’ve been playing around with ReasonML and haven’t had any trouble getting going (at least, on Linux - I can’t speak to other OSes).

                                                                                1. 3

                                                                                  Last week, I was able to take C++ code that I wrote 18 years ago and incorporate it into a new project. This is precisely why I consider C++ to be one of the greatest languages and Bjarne Stroustrup one of the best if not the best language desgners in the world.

                                                                                  It’s even better than C, because C++ is improving at a faster rate while making sure your code that you wrote 18 years ago still works. People severely underestimate how hard and impressive this is.

                                                                                  This is why I trust C++ with my new code because I trust that it will work 20 years from now.

                                                                                  1. 4

                                                                                    I totally agree with your comment; I just wanted to point out that the evolution of C++ is managed by a committee, not just Bjarne Stroustrup. Bjarne was the initial language designer, but we should make sure we acknowledge the hard work and effort of everyone involved in the evolution of C++ (or really any community-driven technology).

                                                                                    :-)

                                                                                    1. 2

                                                                                      Yes definitely! I don’t want to diminish the herculean efforts of the committee. Just pointing out that Bjarne could have given up long ago or created other languages like so many language designers do. He is now just a member of the committee but I think it’s fair to say his opinions still carry a lot of weight. The committee embodies a lot of the values he has always advocated for.

                                                                                      1. You pay for only what you use.
                                                                                      2. Don’t break old code.
                                                                                      3. Make things as simple as possible but not simpler.

                                                                                      If you keep rubbing a stone, eventually it will shine.

                                                                                    2. 2

                                                                                      I too would trust C++ in this fashion. What I don’t trust is all the meat to write C++ code without all the CVEs.

                                                                                      1. 1

                                                                                        Curious, which OS and browser are you using?

                                                                                        1. 2

                                                                                          Those that I distrust the least. The paucity of my available options has no impact on the quality of code being written around the world, the causal chain goes in the other direction if at all.

                                                                                          1. 1

                                                                                            Sure it does! Have you wondered WHY there are so few options? There are social and economic reasons. In other words, security requires investment that no government or corporation have interest in. They WANT leaky software.

                                                                                            1. 1

                                                                                              Yes, they do. And they also explicitly want everybody to throw it out and replace it constantly, which is the opposite of what we’re talking about.

                                                                                              1. 1

                                                                                                I guess, who is “they” in your response?

                                                                                    1. 10

                                                                                      This idea of being able to have your code still work when you want to show it to your kids also leads me to thinking about scientific and academic software and publishing. A lot of papers out there are hard to reproduce because the code isn’t available, or even if it is available there isn’t a documented list of the versions of every dependency. People include the seed values they used for random number generators in their Monte Carlo problems sometimes without actually listing the exact version of everything else they were using, which I think shows that people do care about reproducibility but just don’t really know how to get it.

                                                                                      I should be able to pick up a paper and reproduce exactly what the authors did 20 years later, 40 years later, 60 years later. There are lots of physical science experiments you can still reproduce hundreds of years after they were first carried out.

                                                                                      1. 4

                                                                                        I recently took a job at a lab and hope to help solve this exact problem eventually. I was hoping to attack it with guix (or nix).

                                                                                        1. 1

                                                                                          I think virtual machines images will be the de facto way of resolving this. Problem is long-term storage, among other things.

                                                                                          1. 2

                                                                                            Virtual machines are one of many methods to get old code working. They’re not a full solution, at least not in my experience (some programs are still a pain/impossible).

                                                                                            For mainstream stuff that’s not too far gone: running old Windows or DOS in a VM is not that hard. Now look to more obscure systems and hardware, eg game consoles, and how poor some of their emulation is (ie many programs/games not working).

                                                                                            Given how complex modern operating system stacks are: creating this whole environment and getting it to work reliably, just for one program to run, is going to get harder and harder. Some language environments are essentially operating systems of their own; and others are VMs themselves. OS in OS, VM in VM. Possible to setup, but progressively harder.

                                                                                            1. 2

                                                                                              True, but we need the underlying system being virtualised to itself be both thoroughly specified, and simple enough for new implementations to be both built and checked against specification. The closest thing we have to this would probably be JVM, but it’s not so small these days and a bit too high-level.

                                                                                              1. 2

                                                                                                Agree 100%. This is a big issue, and it’s going to get bigger and bigger as more and more research is going to be essentialy the output of random Python scripts, written by researchers who really aren’t programmers.

                                                                                          1. 3

                                                                                            We do know how to write software that works a lot better than this example, it just takes more than $60k and 2 months. You get what you pay (and plan) for.

                                                                                            1. 3

                                                                                              60k is entirely reasonable for two months of work outside of silicon valley, if we’re assuming Shadow isnt based in one of the tech hubs.

                                                                                              Extrapolate that out to a year long project and it’s 360k, which is enough to pay four developers around 80k for the year with 40k left over for business expenses like office space, admin, etc. 80k is what senior developers make where I’m from and I can tell you that’s a perfectly middle class salary.

                                                                                              The two month timeline was very tight, sure, and these developers clearly did not have a process in place for robustly testing this app and deploying it, but I believe it serves the author’s point that they failed horribly.

                                                                                              It also serves the point that developers are saying 60k isn’t enough given the timeframe, but imo that shows how little math they’re actually doing before clutching their pearls and trying to distance themselves from a clear example of failure in their craft.

                                                                                              1. 1

                                                                                                Two months just isn’t enough time for 4 regular developers to develop 3 applications (2 clients and a backend) to anything even approaching production-ready status in the kind of hostile environment of politics + online. Unless they’re customising an existing system, they’re extremely talented, the project is properly specced out, and the clients are communicative, responsive, and helpful, it’s a pipe dream. Even then I wouldn’t put money on it. And there’s no way working with ${politicalParty} would be any of those things.

                                                                                                1. 1

                                                                                                  The two clients and a backend could’ve been a single webapp with a backend. If they wanted to save more time they could’ve made the web app static and handled most of the logic in the backend. There are few, if any, native APIs on any platform that would’ve helped in a situation like this that can’t be accessed from the browser and pointing users to a website would’ve been way easier to build, deploy, and ship than a cross platform phone app.

                                                                                            1. 4

                                                                                              We need to stop writing drivers in such ad-hoc and low-level ways. This is the second large effort to reverse-engineer Mali, after Lima, and the primary artifacts produced by these projects are piles of C. Long-term maintainability can only come from higher-level descriptions of hardware capabilities.

                                                                                              I’m a little frustrated at the tone of the article. I was required to write this sort of drivel when I was applying for grants, but by and large, the story of how I wrote a GPU driver is simple: I was angry because there wasn’t a production-quality driver, so I integrated many chunks of code and documentation from existing hard-working-but-exhausted hackers to make an iterative improvement. The ingredients here must have been quite similar. The deliberate sidelining of the Lima effort, in particular, seems rather rude; Panfrost doesn’t mark the first time that people have been upset with this ARM vendor refusing to release datasheets, and I think that most folks in the GPU-driver-authorship world are well aware of how the continual downplaying of Lima is part of the downward spiral that led to their project imploding.

                                                                                              I don’t think I ever hid that r300, r500, and indeed radeonhd, from the same author as Lima, were all big influences on my work, and that honest acknowledgement of past work is the only way to avoid losing contributors in the future.

                                                                                              1. 15

                                                                                                I’m a little frustrated at the tone of the article. I was required to write this sort of drivel

                                                                                                Is it not possible that the tone is a true, unforced reflection of the author’s enthusiasm? That’s how I read it. Maybe that’s just naive of me.

                                                                                                1. 9

                                                                                                  Long-term maintainability can only come from higher-level descriptions of hardware capabilities.

                                                                                                  Is there any source you can provide indicating that this would actually work? From my understanding, creating meaningful abstractions over hardware is an extodinarily tough problem to solve. For example device trees work as a general purpose description of hardware, but still need a lot of kernel-space driver fluff to get anything talking correctly. What kind of higher level description do you think would work in this space?

                                                                                                  FYI: I have zero experience in graphics driver land so I don’t actually know anything about this domain. ¯\_(ツ)_/¯

                                                                                                  1. 1

                                                                                                    I read it not as “assembling a driver from common code components and interfaces in c”, but as “write a high-level description of the hardware and api, from which implementations in C or Rust or whatever can be generated”.

                                                                                                    But maybe we’re both reading it wrong :)

                                                                                                  2. 4

                                                                                                    Isn’t the primary artefact produced a set of instruction able to use a GPU? I would think it comes first, before the piles of C.

                                                                                                    Long-term maintainability can only come from higher-level descriptions of hardware capabilities.

                                                                                                    This seems like an extraordinary claim. “Can only come from” is a very strong statement.

                                                                                                    1. 4

                                                                                                      GPU drivers are not required to have a single shape. Indeed, they usually have whatever shape is big and complex enough to fit their demanded API. The high-level understanding of GPUs is what allowed the entire Linux GPU driver tree to be refactored around a unified memory manager, and what allowed the VGA arbiter to be implemented. High-level descriptions, in particular datasheets, are already extremely valuable pieces of information which are essential for understanding what a driver is doing. At the same time, the modern GPU driver contains shader compilers, and those compilers are oriented around declarative APIs which deal with hardware features using high-level descriptions of capabilities.

                                                                                                      Let me show you some C. This module does PCI ID analysis and looks up capabilities in a table, but it’s done imperatively. This module does very basic Gallium-to-r300 translation for state constants, but rather than a table or a relation, it is disgustingly open-coded. (I am allowed to insult my own code from a decade ago.) I won’t lie, Panfrost has tables, but this is, to me, only the slightest of signs of progress.

                                                                                                      1. 3

                                                                                                        Ah, I see what you mean.

                                                                                                        Higher-level description means genericity, this can lead to bloated code trying to deal with the future, impairing the present. Trying to keep the proper balance of high-enough description and low-enough efficient description is a challenge.

                                                                                                        Helping the maintenance effort by lending hands to refactor with a fresh mindset is my naive view of how to fight this, but I know this is falling prey to the rewrite fallacy.

                                                                                                  1. 1

                                                                                                    Slavery is fine, I’d love to work outdoors.

                                                                                                    1. 25

                                                                                                      I was reminded of something I lost in an edit, so I painted with a broader brush than I meant to. I don’t think all content marketing is awful and tried to caveat that in my opening paragraph. I don’t have a narrower term, though - maybe someone would like to paint this “know it when I see it” bikeshed. I wish I had a non-pejorative phrase to draw a line around the stuff we don’t want that was so clear that even its authors would accept the label.

                                                                                                      We do get wonderful stuff that exists to promote businesses. Maybe my two favorite examples are jvns.ca who sells zines and hillelwayne.com who sells a book and corporate training. In chatting about this I have joked about individually naming them as exceptions to any rule, but I’m sure we can do better than that.

                                                                                                      1. 16

                                                                                                        In chatting about this I have joked about individually naming them as exceptions to any rule, but I’m sure we can do better than that.

                                                                                                        While I’d appreciate being able to still share my stuff, I don’t want to be special-cased as an exception. If whatever we decide ends up preventing me from submitting, then it’d be unfair for me to sidestep that.

                                                                                                        (I know you mean it jokingly, but I’d still like to be on the record as saying this :) )

                                                                                                        1. 12

                                                                                                          But goal is never “enforcement of rule X”, it’s “stop content-marketing dbags”, which everybody in here would agree that you aren’t, whatever definition of that we carry around in our heads.

                                                                                                          1. 1

                                                                                                            There’s a tipping point somewhere where content, like yours Hillel, which is clearly written both to inform others & as an exercise in personal marketing becomes far too much of the latter & not enough of the former.

                                                                                                            Content which is interesting and informative to Lobsters readers should always be welcome here I think, whether it benefits a specific individual to have it posted or not. What we don’t want is an avalanche of low-value blogspam which contains no content that couldn’t be found in a higher quality form elsewhere & only exists because someone wrote it to market a product. (That product often being themselves.)

                                                                                                            1. 4

                                                                                                              Ideally we’d want to have zero false alarms or missed signal, but any sort of rule-based solution will either let in some marketers or block some legit posts. So far we’ve preferred missed signals, but are thinking of moving more away from that. I just think an exception-based filter is unfair as a way of avoiding false alarms here.

                                                                                                              1. 1

                                                                                                                That’s fair.

                                                                                                          2. 6

                                                                                                            The first person I thought about when I read the OP was @aphyr. I don’t know that he posts here to promote a business, but according to the criteria discussed here, his submissions history looks like a surefire way to get banned. (https://lobste.rs/newest/aphyr) And yet, aphyr is the furthest you could get from a content marketer or spammer! A large percentage of posts I enjoy the most would fall under the same pattern: people working hard at interesting stuff and posting about it regularly. It seems to me there is probably way to solve this (very real) problem without putting human moderators in the loop. The actual value of the material linked to the community should be paramount, surely?

                                                                                                            1. 3

                                                                                                              I think that having a vetting process where if people are going to bump up against that limit, it promotes them for mod review, and then they can be whitelisted, would be how I would go about it. We have quite a few domains that are primarily self-posted.

                                                                                                            1. 4

                                                                                                              Which company told her to stop writing and stop helping random people in the company? (From the chopped off link in the OP.)

                                                                                                              1. 9

                                                                                                                Rachel used to be at Facebook.

                                                                                                                1. 4

                                                                                                                  Ironically, a company whose service is connecting people, letting them write what’s on their mind, and share it with others.

                                                                                                                  1. 5

                                                                                                                    Facebook’s service is surveilling people, sorting them into demographic buckets, and selling their attention to the highest bidder. Anything else they do is simply fertilising the field in which the targettable consumers grow.

                                                                                                                    1. 2

                                                                                                                      I was talking the user-facing side. You’re spot on about the business side. Love that last sentence, too.

                                                                                                                  2. 1

                                                                                                                    Thanks.

                                                                                                                1. 4

                                                                                                                  My gut feeling tells me it’s mostly due to the fact that a hash value of an int is the int itself, so there’s no time wasted on hashing.

                                                                                                                  Oh wow I hope not. Is this actually true in CPython?

                                                                                                                  1. 6

                                                                                                                    This is the most sensible implementation as you want to avoid collisions in a hash table. It isn’t supposed to bear any cryptographic properties if that’s your concern. Here’s more: https://github.com/python/cpython/blob/master/Objects/dictobject.c#L134

                                                                                                                    1. 5

                                                                                                                      It’s not the most sensible implementation, because simple key patterns cause collisions that never resolve, even when resizing the hashtable. The comment you linked specifically mentions this pathology, and the numerous ways it destroys performance.

                                                                                                                      The rest of the comment describes how CPython mitigates the issue by adding weak integer hashing to its collision probing. At first I thought integer keys were never hashed at any point, hence my surprise.

                                                                                                                      From the comments it sounds like sequential integer dict keys are somehow common in Python, which I don’t understand. But I don’t write much Python.

                                                                                                                      1. 6

                                                                                                                        From the comments it sounds like sequential integer dict keys are somehow common in Python, which I don’t understand. But I don’t write much Python.

                                                                                                                        While you can have a dict with keys of any hashable type – and a single dict may have keys of many types – the most common case, so overwhelmingly more common that it’s almost not even worth thinking about other cases, is a dict whose keys are all strings. This is because, sooner or later, basically everything in Python is backed by a dict. Every namespace is backed by a dict with string keys (the names defined in that namespace). Every object is backed by a dict with string keys (the names of the object’s attributes and methods). Keyword arguments to functions/methods? Yup, dict. In comparisons of languages by their “one big idea”, Python is sometimes described as having its big idea be “what if everything was a string-keyed hash table”?

                                                                                                                        Anyway. This is so common that Python goes out of its way to have special-case optimized implementations for the case of a dict whose keys are all strings (and for what it’s worth, in CPython as of Python 3.4, str is hashed using SipHash-2-4).

                                                                                                                        As to hashing of numeric types, it’s a bit more complicated than “ints hash to themselves”. Here’s what the Python documentation has to say. For the specific case of int, you can think of it as reducing to hash(n) == hash(n % sys.hash_info.modulus), where in CPython sys.hash_info.modulus is 2^61 - 1 on systems with 64-bit long and 2^31 - 1 on systems with 32-bit long.

                                                                                                                        While I don’t have a way of being certain, I suspect the linked comment’s note that the hashing of int is “important” has to do with the importance of real-world int key values being unlikely to collide with the hashes of other common real-world key types.

                                                                                                                        1. 1

                                                                                                                          In comparisons of languages by their “one big idea”, Python is sometimes described as having its big idea be “what if everything was a string-keyed hash table”?

                                                                                                                          I’ve always thought of PHP’s “one big idea” as “What if everything is an array” where array means PHP’s strange half-dict half-list interface that funnily enough Python is now one small step closer to.

                                                                                                                      2. 1

                                                                                                                        Avoiding collisions isn’t as important as using up a larger % of the spots before you need allocate and move things, I believe.

                                                                                                                        1. 3

                                                                                                                          Aren’t those the same thing? Less collisions implies you can go longer without expanding.

                                                                                                                          1. 1

                                                                                                                            It depends on the exact implementation, but in my understanding, not exactly; you also want a good distribution between your buckets, even if there are patterns / non-random distributions in the actual encountered keys. It might waste space rather than time, but it’s still not great.

                                                                                                                            1. 3

                                                                                                                              Python’s hash table isn’t implemented as an array-of-buckets. It’s a single contiguous array into which you insert a new element at the position determined by the hash of its key, and if that position is occupied you try the next one in a pseudo random order. Same with lookups: you try entries in succession until you find the one that equals (it’s usually the first one). And this is why the number of free spots and the probability of collisions are directly related.

                                                                                                                      3. 2

                                                                                                                        it is:

                                                                                                                        Python 3.7.6 (default, Dec 21 2019, 11:56:31)
                                                                                                                        [Clang 10.0.1 (clang-1001.0.46.4)] on darwin
                                                                                                                        Type "help", "copyright", "credits" or "license" for more information.
                                                                                                                        >>> hash(2)
                                                                                                                        2
                                                                                                                        >>> hash(37)
                                                                                                                        37
                                                                                                                        >>> hash(892474)
                                                                                                                        892474
                                                                                                                        
                                                                                                                        1. 8

                                                                                                                          Almost! hash(-1) returns -2.

                                                                                                                          Python 3.8.1 (default, Jan  8 2020, 23:09:20)
                                                                                                                          [GCC 9.2.0] on linux
                                                                                                                          Type "help", "copyright", "credits" or "license" for more information.
                                                                                                                          >>> hash(-1)
                                                                                                                          -2
                                                                                                                          >>> hash(-2)
                                                                                                                          -2
                                                                                                                          >>> hash(-3)
                                                                                                                          -3
                                                                                                                          
                                                                                                                          1. 4

                                                                                                                            wat

                                                                                                                            do you happen to know why?

                                                                                                                            1. 7

                                                                                                                              Ah, it’s because the C API function uses -1 as an error code. It goes deeper than that too:

                                                                                                                              In [1]: class yolo:
                                                                                                                                 ...:     def __hash__(self):
                                                                                                                                 ...:         return -1
                                                                                                                                 ...:
                                                                                                                              
                                                                                                                              In [2]: y = yolo()
                                                                                                                              
                                                                                                                              In [3]: hash(y)
                                                                                                                              Out[3]: -2
                                                                                                                              
                                                                                                                          2. 2

                                                                                                                            I’ve heard that this is a somewhat common way to implement hashing for ints, but I don’t understand why it’s a good idea. Isn’t hash collisions terrible for hash tables? And isn’t a somewhat common key pattern “some number with some low bits masked”? And wouldn’t that be a pathological case for a hash table which grows with a factor of 2?

                                                                                                                            Are hash table implementations which does hash(x) = x somehow better at handling collisions than most hash tables, or do they just hope that the ints people want to put in their tables have high entropy in the lower bits?

                                                                                                                            1. 3

                                                                                                                              IIRC there is some sort of random salt added to it and it goes through some internal hash for the actual hash table, since there was a DoS attack by abusing worst case scenario over HTTP requests.

                                                                                                                          3. 2

                                                                                                                            Why would that be a problem?