Threads for codemac

  1. 10

    Software use is a social phenomenon, not a technical one.

    1. 3

      It is! Fossil was made for projects with a small number of contributors that trust each other, where drive-by contributions are rare and changes are shared often and openly (more info on that here).

      For me, that’s the model for the vast majority of the repositories I contribute to.

    1. 1

      You can also use the logging features of org-mode to compute this, without git. This is how I do my weekly reviews.

      1. 2

        I dig the approach in the article. Any hints on how to do this without git?

      1. 4

        I still think rc hits the nail on the head for shell programming in a way no one else managed:

        ; false | true
        ; echo $status
        1 0
        ; true | false
        ; echo $status
        0 1
        ; man rc
        ; if (true | false) { echo succeed } else { echo fail }
        ; if (false | true) { echo succeed } else { echo fail }
        ; if (true | true) { echo succeed } else { echo fail }

        $status is an array, and all the conditionals in the shell interpret an array of all 0’s as success.

        1. 2

          Very cool indeed, do you use rc as your daily driver?

          1. 1

            Very much so, yes. After working with byron, I specifically recommend his version of rc, it handles pretty much every ergonomic issue correctly:

        1. 19


          Apple Silicon machines are designed first and foremost to provide a secure environment for typical end-users running macOS as signed by Apple; they prioritize user security against third-party attackers, but also attempt to limit Apple’s own control over the machines in order to reduce their responsibility when faced with government requests, to some extent. In addition, the design preserves security even when a third-party OS is installed.

          … these machines may possibly qualify as the most secure general purpose computers available to the public which support third-party OSes, in terms of resistance to attack by non-owners.

          1. 2

            I’m surprised to not see ChromeOS mentioned here, reading this analysis it seems it would stand up fairly well?

            1. 2

              If you run a third-party OS on a Chromebook, doesn’t that severely compromise the security of the Chrome OS system? If I remember correctly, many Chromebooks required you to take out a screw to install another operating system and the process prevented secure boot from functioning on the primary Chrome OS installation.

              What’s nice about Apple Silicon Macs (from my understanding) is that their secure boot settings are per-OS, not systemwide. You can still perform all of the signature checks on a macOS installation without doing so on a Linux system on the same disk.

              1. 1

                Without some kind of physical intervention by users doesn’t that leave macs vulnerable to a persistent attack? Like an evil maid or trojan that installs something like a keylogging hypervisor that boots regular macOS. That would be indistinguishable from the perspective of the user and probably macOS yet could easily be malicious.

                1. 3

                  It does require physical actions. You have to

                  1. reboot
                  2. reboot again because you forgot which buttons you needed to press on the keyboard :D
                  3. press correct buttons during boot
                  4. Enter the recovery OS
                  5. Enter the administrator password
                  6. Change the security setting

                  That said, I had to work on a chromebook for a while and that didn’t require a screw or anything to get into the unsafe mode, it was also a key chord.

                  There are a few critical differences though:

                  • Changing to the insecure mode on a Chromebook erases all local content
                  • From the article it sounds like beyond allowing you to launch a untrusted OS the security features are available to multiple OS’s (this is purely my reading of the article, I could very well be wrong). Whether linux or what have you support/use it i don’t know.
                  1. 2

                    Without some kind of physical intervention by users doesn’t that leave macs vulnerable to a persistent attack?

                    The article answered this.

                    1. 1

                      It relies on their SEP being trustworthy which doesn’t have a great track record…

                      1. 4

                        You’ve now shifted the goalpost from your original question (original goalpost was “vulnerable to a persistent attack” due to not requiring something similar to Chromebooks’ screw removal, new goalpost is alleging flaws in the SEP). I’ll no longer be responding to you.

                        1. 1

                          Wait, when was the SEP compromised?

                          1. 3

                            Up to the Apple A10 by the checkra1n jailbreak (to bypass the measurement by the SEP used to lock data access on access to DFU for more recent iOS releases).

                            On the Apple A13 onwards, the measurement of the current SEP firmware version (by the monitor) is a component of the encryption key, making such attacks no longer able to have user data access.

              1. 18

                Emacs in Guile.

                I know there was the work in ~2014, but being able to run things that were multi-threaded, have a much simpler language, and support the guile ecosystem where emacs libraries would just be guile libraries makes my heart happy.

                Doesn’t make a lot of sense to actually do, and I understand the limitations.. but whoooo boy have I been lusting for this for years and years.

                1. 5

                  Why Guile instead of Common Lisp? Elisp is far closer to Lisp than to Scheme; Lisp has multiple compatible implementations while Guile (and every other useful Scheme) is practically incompatible with any other useful Scheme, because the RnRS series, even R6RS, tend to underspecify.

                  GNU’s focus on Scheme rather than Common Lisp for the last 20 years has badly held it back. Scheme is great for teaching and implementation: it is simple and clean and pure. But it is to small, and consequently different implementations have to come up with their own incompatible ways of doing things.

                  While the Common Lisp standard is not as large as I would like in 2021, it was considered huge when it came out. Code from one implementation is compatible with that of others. There are well-defined places to isolate implementation-specific code, and compatibility layers for, e.g., sockets and threading, exist.

                  1. 3

                    I’d also love to see a Common Lisp Emacs. One day, I’m hoping that CLOS-OS will be usable, and using it without Emacs is kind of unthinkable.

                    1. 2

                      Why Guile instead of Common Lisp?

                      Because it’s my favorite flavor of scheme, and I enjoy programming in scheme much more than common lisp. I do not like lisp-2’s, but I do like defmacro (gasp) so who knows.

                      Emacs being rewritten in common lisp would also be awesome.

                    2. 2

                      Multiple times I’ve considered, and then abandoned, taking microemacs and embedding a Scheme in it. The reality is that it’s basically a complete rewrite, which just doesn’t seem worth it…. And you lose all compatibility with the code I use today.

                      Guile-emacs, though, having multiple language support, seems to have a fighting chance at a successful future, if only it was “staffed” sustainably.

                      1. 2

                        Multiple times I’ve considered, and then abandoned, taking microemacs and embedding a Scheme in it.

                        Isn’t that basically edwin?

                        1. 2

                          I mean, by the reductivist’s view, yes. Edwin serves a single purpose of editing scheme code with an integrated REPL. You could, of course, use it beyond that, but that’s not really the goal of it, so practically no one does (I am sure there are some edwin purists out there).

                          My interest in this as a project is more as a lean, start from scratch standpoint. I wonder what concepts I’d bring from emacs over. I wonder if I’d get used to using something like tig, instead of magit. I wonder if the lack of syntax highlighting would actually be a problem… The reason I’ve never made a dent in this is because I don’t view reflection of how I use things like this as deeply important. They’re tools…

                      2. 1

                        I’m going to go more heretical: emacs with the core in Rust and Typescript as the extension language. More tooling support, more libraries, more effort into optimizing the VM.

                        Lisps are alright but honestly I just don’t enjoy them. That maxim about how you have to be twice as clever to debug code as you do to write it, so any code that’s as clever as you can make it is undebuggable.

                        1. 1

                          this exists doesn’t it?

                          1. 2

                            The last implementation work was ~2015 according to git.

                            If you know of this existing, let me know!

                        1. 1

                          I read the full article last night, and I struggled with the author’s ability to both explain why agile failed, even saying sentences like:

                          Trying to scale a methodology that focuses on individuals and interactions will inevitably lead to problems – and erode the original value of the methodology.

                          And then somehow forgetting this just a few paragraphs later:

                          Jeffries in the article mentioned above, says, “However, the values and principles of the Manifesto for Agile Software Development still offer the best way I know to build software, and based on my long and varied experience, I’d follow those values and principles no matter what method the larger organization used.”

                          I agree.

                          The vast majority of people are employed buy businesses that are larger than one team. In fact, in many cases even when the business does only have one team, they desperately need to be able to scale to two teams if they want to succeed in the market.

                          If agile can’t describe how a team functioning with agile interacts with the organization they are a part of, I don’t see how “studying the founding principles” leads to anything different. Management by Objectives/OKRs have been adopted successfully because they specifically address the intersection of the organization and your customers.

                          Under no circumstances would I touch scrum/agile/whatever without deep understanding of how I tell my boss, my board, my investors what the fuck I’m doing.

                          1. 1

                            Having deep visibility into “what I’m doing” is a core principle of Agile and is supposed to be the carrot we use to get management (or clients, whoever owns the product vision) to buy in. The contrast is vs waterfall where you have no idea what anyone is doing but you know what you told them to do.

                            Also, while I hate OKRs with the fire of a thousand stars, they are not incompatible with agile and don’t even really cover the same management surface area. Goal setting is totally fine.

                            1. 1

                              Does visibility into “what I’m doing” relate to how you work in a team of 100+?

                              The entire article discusses this tension, but I don’t see the direction/follow up as to why inspecting the core agile values will bring clarity to managing an organization making significant software, rather than client/consultant relationships.

                              1. 1

                                If your org has teams of 100+ you may have lower hanging fruit to fix before digging into workflow. Even at some if the biggest companies in the tech industry with some of the least-agile workflows I’ve ever had to work with, I never worked with team over ~20

                                1. 1

                                  Ah, I should have said “group” or “product” instead of team. I’m saying that teams of ~10 combine together to be a team of 100+ for a single product. Anything even mildly complex (say, a website for reserving hotel rooms) can end up easily with that much engineering investment.

                                  I’m frustrated with agile folks like this author who say SAFe etc are inherently wrong/evil/failure, but at the same time don’t address the problem they attempt to solve - interactions between internal teams.

                                  A concrete example. Team A’s Feature A requires Team B’s Feature B to be complete before they can ship. All these “scaled agile” things are meant to help communicate that plan between teams, but this author specifically says these don’t work. Ok - great, but then at the end they say we should just.. stick with agile anyways?

                          1. 3

                            One of the best feelings in the world is when you realize what makes lisp “LISP” rather than just a programming language is code as data, data as code. Because then you’ll see it everywhere, and suddenly you realize everything is a lisp, and all it’s like no one learned the lesson of the turing machine.

                            1. 3

                              Concatenative languages aren’t a LISP. They’re based on function concatenation, not function application, which is slightly but importantly different than lambda calculus. There’s a good explanation here:

                              “Everything is Turing complete” is not the same as “everything is a LISP”.

                              1. 2

                                (…) what makes lisp “LISP” rather than just a programming language is code as data, data as code. (…) it’s like no one learned the lesson of the turing machine.

                                “Everything is Turing complete” is not the same as “everything is a LISP”.

                                The reference was to a single tape, holding data and instructions - not to the idea of Turing completeness.

                              2. 1

                                If everything is a lisp, then lisp is just another programming language. You can’t have both uniqueness and ubiquity.

                                1. 1

                                  This is the exact conflict that I enjoy experiencing :)

                              1. 17

                                Am I missing something from this story?

                                She told me she knew I was busy with work and the app helped make certain she was on my mind and continued to keep communication high between us.

                                I thought the whole point of this is that you’re busy/distracted/mentally engaged/what have you with work, and thus she isnt on your mind?

                                I’m also still not even sure what it’s supposed to do. What does “automate your text messages” even mean?

                                Does it just send random non committal messages to people? Or canned responses to messages?

                                For anything outside of the “I’m driving and will see this when I stop” type auto responses I don’t see how “automation” is actually useful?

                                1. 5

                                  This starts conversations with people by sending the starting text, it doesn’t have the full conversation.

                                  Some people, especially those that grew up with ubiquitous phones in school, see texting frequently as how you show you care about someone. This ensures that if you haven’t sent a text or called in a while, you start something automated to jump start the conversation.

                                  1. 2

                                    Perhaps it’s not clear enough from the story, but, for my use case, it allows me to provide my significant other with a quick “bid for affection” without breaking my focus; a notification pops up and I simply swipe it away and the automation happens. In other cases where I want more of a connection or dialog, I will configure the app to remind me at more convenient times and ask more open-ended questions.

                                    1. 2

                                      So it is more of a texting reminder with builtin suggestions?

                                      The link to the app does not work for me and the article does not really describe the app itself.

                                      1. 2

                                        In a nutshell, yes. Depending on how you configure it, its behavior changes and It also handles other communication methods. The story purposefully focuses on my experience with indie app development and not the details of the app itself. The app is currently in beta, so it’s limited to 47 countries/regions to better support this, but feel free to let me know what country you are in or send me a message.

                                  1. 3

                                    The problem as it’s always been is that popular software has almost always been commercial, especially for normal uses.

                                    Am I the only one at a loss at that sentence? I can’t for the life of me figure out what software they might be talking about.

                                    As for the laptop, I have a decent Thinkpad so I don’t really need it. But it is pleasant to see that this much is possible at around $200 new.

                                    So, I look forward to future, more polished such devices but based on RISC-V architecture; I’d actually buy that, regardless of thinkpad.

                                    1. 3

                                      I think all the years outside of English countries is making me lose the language.

                                      Anyway it’s stuff like chrome, Minecraft, that are always buried by default and force the user to find some way to invoke them, unlike how easy it is to use IE to download chrome and just run it.

                                      I just think the packaging options are backwards and people should opt out of having more choices instead of a barren default.

                                      Isn’t allwinner going to tap out a physical riscv? I’m sure it’ll happen soon enough

                                      1. 1

                                        The problem (as it’s always been) is that popular software has (almost always) been commercial (especially for normal uses)

                                        1. 1

                                          I have to wonder just how abnormal my uses are, and how unpopular the software I use is.

                                          Outside of steam (and games installed through it) and, ages ago, the nvidia drivers (I use AMD these days), I haven’t installed proprietary software in decades.

                                          The idea that a distribution is somehow unusable without installing proprietary software does thus manage to seem extremely questionable to me.

                                      1. 2

                                        Paywalled, or at least walled behind “sign in with a free account to read this story!”

                                          1. 3

                                            That’s what the “cached” link is for.

                                          1. 11

                                            we settled on $11,000 per month as a baseline salary

                                            Am I missing something about working in the USA, or is that very high? Especially for a project running on donations trying to reach sustainability.

                                            1. 22

                                              That’s $132000/year, which would be a junior developer level of salary at many US tech companies.

                                              Also, in the US anyone who is a contractor or “self-employed” pays an automatic additional 15% tax on their wages/salary above the normal income tax (which still applies), and has to fund all their own benefits (health insurance, pension, etc.) from their salary as well (regular employees of companies often get that at least partially funded by the employer).

                                              1. 29

                                                From my experience, salaries like that at a Junior level are only found in the Bay area and at FAANG like companies. For a lot of the devs who work at small/medium sized companies in reasonably priced areas, junior dev salaries are closer to $60,000-$90,000.

                                                1. 8

                                                  $132k/year for a jr dev is about 100k more than I’ve seen in areas of the US. Even in NYC, you can expect maybe $75-90k/year as a jr dev at most companies. That seems extraordinarily high.

                                                  1. 5

                                                    … I got paid a lot more than 32k/yr as a junior developer straight out of school, with bad grades, in the south atlantic, in the aughts.

                                                    If you’re getting paid 32k/yr as a programmer, please quit and work at chipotle - you’ll get paid more, probably have better benefits and at least you’ll get free lunch, saving another ~$7/workday.

                                                    1. 1

                                                      Edit: disregard, I can’t read.

                                                  2. 3

                                                    That’s $132000/year, which would be a junior developer level of salary at many US tech companies.

                                                    Is considered good source to check the average salaries? or any other sites?

                                                    1. 5

                                             is good if you’re looking at joining a Big Tech (tm) company or similar companies near Silicon Valley, but it’s definitely not representative of salaries across the country.

                                                  3. 8

                                                    someone on the orange site mentioned the twitter post by one of the babel founders which claims that the funding went to the wrong hands for some time, though they seem to be biased.

                                                    The discussion over there also has some links that seem to proof these claims.

                                                    1. 2

                                                      Yeah, he seems to have deleted that because he was mostly considering commits and such and ignoring all the work around the project that isn’t just code, and he rightfully got a lot of crap for it.

                                                      The scope of the project and the associated busy work around it is very different from when he started it.

                                                      1. 1

                                                        Like what? What other work was done by Henry that doesn’t result in commits, comments and other visible artefacts?

                                                        1. 1

                                                          Some of the stuff they mention in the post possibly. Public speaking, other activities involved in fund raising and supporting the project that probably don’t all take place directly in the repository and more likely in other points of contact.

                                                          This isn’t so different from work done in engineering organizations. As your responsibility or level of seniority increases, the size of your output might lower, but the impact might be higher.

                                                          At the same, time, the quantification that was originally pointed out was a number of pull requests, issues, etc, which is highly disingenuous.

                                                          In Open Source projects in particular, an issue investigation can stretch out for weeks or months. PRs can have different sizes, and some of them can perhaps have a lot of work gone into them (research, etc) that isn’t directly visible in code committed. There’s also the time spent in reviewing and understanding contributors work. And all of this becomes even more complex and time consuming as a project grows in size and complexity.

                                                    2. 7

                                                      One thing to consider is that this number is likely fully-loaded (I imagine that in practice everyone is being paid like a contractor), so there’s a big chunk of that that disappears into taxes, and the takehome is probably more similar to if someone was pulling in $7k/month at a “normal company”. Seems pretty reasonable as take home in places like the US (with high rent + health insurance).

                                                      I don’t think that it’s unreasonable for full-time maintainers to expect a salary at that level.

                                                      1. 4

                                                        I don’t think that it’s unreasonable for full-time maintainers to expect a salary at that level.

                                                        I agree. The thing everyone is forgetting about is that for someone of the skill level required to maintain a popular OSS project is likely able to command a salary easily in this range. There are hundreds of companies that would hire them remotely at a salary well above $132k p/year. It’s not just FAANG companies in this range anymore.

                                                        I mean, sure there are lots of companies paying 60 to 90k. Maybe those devs are happy with the amount. Maybe they are unhappy, but not motivated to run through interviews. Maybe they haven’t put themselves out there enough with OSS or giving presentations. We don’t know their situations, but if a developer can command a higher salary its not really in our best interests as a community to criticize them. (The fact that some say its unwarranted in this particular situation is a different matter)

                                                      2. 1

                                                        Even if that’s a huge salary for most tech jobs outside of SF and NY, if we consider the amount of value Babel has created for all the companies around the world and if the project was compensated accordingly they should be drowning in money.

                                                      1. 13

                                                        I am going through and rewriting go programs in rust as they have a much more expressive type system along with scheme style macros…

                                                        edit: EVERYTHING AFTER THIS IS OFFTOPIC: but whooo boy am I considering just going back to C++. The compile times are astronomical, which make me not want to compile or run my test programs.

                                                        Also, I haven’t figured out why I struggle with the sheer volume of vanity types (aka type Bar = GenericArray). My current struggle is with the AES crypto libraries using GenericArray with a Nonce type, but somehow I can’t figure out how to write a function that returns a correctly typed Nonce! And the compiler keeps suggesting types that are longer than 200 chars at this point. I just figured out strings, and now arrays, vectors, and slices of things are some new confusion.

                                                        Finally, rust documentation organization is completely baffling for me to navigate right now. It’s very hard to figure out “given type A, what are all the methods it has?”

                                                        Note: I complain because I’m excited and want to use rust, and the few programs I have written to parse my org files have ended up with easy to reason code and only slightly slower than my old C code, and 3x faster than my Go code.

                                                        1. 11

                                                          You should look at Zig. It’s beautiful, though not yet ready for prime time.

                                                          1. 10

                                                            Finally, rust documentation organization is completely baffling for me to navigate right now. It’s very hard to figure out “given type A, what are all the methods it has?”

                                                            I find the official book equally annoying. I think it’s been revised but back when I started learning Rust a few years ago it was incredibly frustrating.

                                                            Virtually every section consists of 1-5 “we could do it like this, but this thankfully won’t compile because it might have this bug” examples, followed by the correct program listing. Just tell me how to do it already. Every compiler rejects an infinite amount of programs (okay, maybe except for Perl), I don’t need to look at every one of them.

                                                            If you want to illustrate how the compiler usefully rejects potentially buggy programs – a great idea! – list the rules and explain them after you’ve explained the correct approach, so that at least I have a working reference to compare the rules to. And then by all means list a bunch of examples, after you’ve explained the logic that the runtime or the compiler employs. Don’t make me try to figure out what’s wrong with a program written in a language that I don’t know yet, and don’t bury the useful, two-sentence description of the compiler’s logic in three pages of broken sample code and snark about C++.

                                                            1. 6

                                                              Try Ada 2012. It compiles to native binaries quickly and feels like a Pascal version of a safer and simpler C++, there’s a lot of underlying conceptual familiarity so you’ll feel at home. The type system is also ludicrously powerful. I’m rewriting some tooling in it and it’s pretty easy since there’s a lot of functionality between the standard library and GNATcoll.

                                                              1. 4

                                                                I’ve been thinking a bit about trying to make a language that takes the best bits of Ada SPARK (nice integration with Why3 for great SMT reasoning, ability to “turn-off” language features, nice bare-metal ergonomics etc…), building off of the work around stacked borrows applied to Rust, and generally trying to lean more into linear + temporal + separation logic. Ada and Rust have shown that some amazing things are possible. This effort might “collapse” into tooling around Rust that tries to prove contracts specified in comments + additional clippy lints that disable more features as well as those in dependencies.

                                                                1. 2

                                                                  linear + temporal + separation logic

                                                                  I’ve dived heavily into the Ada 2012 side, but not too much into SPARK, and there’s a lot of things people aren’t familiar with in regular Ada. You can force stateless behavior of a package using with Pure to be able to safely write your code with a compiler-enforce “functional core, imperative shell”, and mutable behavior is contained by parameters being readonly unless marked as out. On the temporal side, tasks contain active concurrent behavior and coordinating behavior and use protected types for passive concurrent behavior (mutual exclusion). For separation, Ada uses storage pools tied to individual access types and you can create multiple access types for the same type with each having its own pool. I haven’t played much with this yet, but access types are typed and you can’t cross access types from different pools, so I’m curious how far people could push this.

                                                                  1. 2

                                                                    You might like to take a look at F*. It looks quite like F# (i.e. ML), but integrates with Z3 and allows you to express programs and proofs in the same language. The output is C code and so it can be deployed on any system with a C compiler.

                                                                  2. 2

                                                                    Someone mentioned Ada 2012 here the other day and on their recommendation I bought the Ada 2012 book and started playing around with it.

                                                                    I like what I’ve seen of the language (I remember working with Ada 83 in college for some reason, a PLT class or something, but I didn’t see enough of it to say I “know” it or anything).

                                                                    The problem, of course, is the rather slim ecosystem and, more troubling to me, the tooling seems a little wonky. Maybe I’m not doing it right but getting things working on my Mac wasn’t nearly as easy as Rust or Go or Zig. I am 100% sure I have no idea what I’m doing so correct me if I’m wrong.

                                                                    1. 4

                                                                      I havent tried Mac, but Linux and Windows have worked well for me. Grab GNAT Community edition, most of what you need is built in if you look under project “dependencies”, but theres a project called Alire, which aims to be a package manager. Theres a silly amount of stuff in those bundled libraries already: json parsing, sockets, regular expressions, containers and such, which has made me pick it for projects I would have done in C++. I had to rebind a bunch of keybindings in the IDE to be sane for me, and you have to treat tab as “I trust my ide to indent” and use Pretty Print (i rebound it, if I get time I’ll see if i can contribute “format on save” or something back to the ide) to just fix things up for you.

                                                                      It was slow getting started, but my velocity is steadily going up rather than falling off. If this wasn’t true, I wouldnt be recommending it.

                                                                  3. 7

                                                                    am I considering just going back to C++. The compile times are astronomical, which make me not want to compile or run my test programs.

                                                                    That’s strange, Rust shouldn’t compile significantly slower than C++ most of the time (*). Have you tried figuring out why it’s so slow in your case? cargo build -Ztimings and cargo-llvm-lines are helpful tools here.

                                                                    Less specifically, but I personally found that writing simple, “C with classes” Rust makes the language much more enjoyable. A rule of thumb is avoiding dependencies that require using traits or macros. Especially avoiding something that visibly stretches the language to its limits (HLists and GenericArray are big red flags). And yeah, in this case the advice clashes with “don’t roll your own crypto”, which obviously is more important.

                                                                    (*) the case where Rust does compile slowly than C++ is when you build an enormous project on a machine with a huge number of cores — typical Rust build is not as parallel as typical C++ build.

                                                                    1. 4

                                                                      I’d be super interested in a comprehensive tutorial/guide on “How to quickly write slow but barely passable Rust”, aimed at complete newbies who didn’t read/internalize The Rust Book. I.e. something that would give me a minimal subset of Rust that I could use to write any Turing-complete stuff, yet not in a most efficient or pretty way possible. E.g. maybe using RefCells (or what’s the name) everywhere, to mimic GC-like attitude. I heard this advice “just use RefCells for everything if you’re a beginner and don’t care about performance”, the problem is I tried but I don’t really have a slightest idea how to do that :( Currently, I’d have to first learn whole Rust (which I repeatedly failed to do), to then understand what and how I can drop for less efficient coding. I’d love a guide teaching me “pidgin Rust”, enough of it that I could be dangerous and scorned with disgust by Rust gurus. Yet able to get the job done, in Rust (and then slowly start advancing into more fancy stuff).

                                                                      1. 3

                                                                        This is something I am unsure about. I too often here advice about Rc RefCelling your way out of borrowchecker fights. I think this is a bad advice, but this is just my own reasoning, rather than empirical observation on many different people learning Rust. To me, interior mutability is one of the hardest aspects of the language, and, while it sometimes can be used to mimic some GC language patterns, it brings a lot of accidental complexity. It’s much harder than doing the Rust thing with owned values and references.

                                                                        To me, this advice seems a bit like “you can embed imperative language in Haskell via state monad, so, to learn haskell, just use state monad”.

                                                                        My own take on learning Rust is that one really needs to sit down and learn the inner logic of the language. Not sure what’s the best way to do this though, I’d say:

                                                                        1. 1

                                                                          I must check out the Programming Rust book (I assume you mean O’Reilly) - the ToC looks solid; thanks for the recommendation!

                                                                        2. 3

                                                                          You can use Rust while mostly ignoring generics, macros, overloading, and fancy zero-copy code, but I don’t think you’ll get far without internalizing ownership.

                                                                          Rc<RefCell> is not a reasonable GC replacement. It’s fine if you want a graph structure, but spamming it everywhere is not going to make Rust a Python. You’ll be just as likely get stuck fighting with temporaries returned by borrow().

                                                                          I think that properly knowing the difference between String and &str (and alike) is a fundamental requirement in Rust, and it’s better to learn it properly than invent workarounds.

                                                                          If you need a compiled language to get something done quickly, then golang is fine.

                                                                      2. 1

                                                                        I think the issues you mention about rust are things that with experience you’ll struggle a lot less with over time. Compile times are a cultural issue in the ecosystem, but you can write code that compiles without spending minutes and minutes waiting on deps. “Experts write baby code” and when you learn which features of rust you don’t need at all, the whole language feels a lot nicer - until you have to read or use other people’s rust lol…

                                                                      1. 11

                                                                        There is also this less specialized tool:

                                                                        column --table /etc/fstab
                                                                        1. 5

                                                                          But that also spreads the fields in the comments out, right?

                                                                          1. 3

                                                                            Ah, good point!

                                                                            Maybe worth mentioning. I was kind of wondering what I was forgetting. I think I removed the comments I had because of this.

                                                                            Congratulations with a new tool!

                                                                            1. 2
                                                                               gawk '/^#/ { print $0 } !/^#/ { print $0 | "column --table" }' < /etc/fstab

                                                                              This will still group your comments up above your fstab entries, so I think this specific tool (or really any real programming language) will be required to do something like this as you’d need to track where lines started and update the table width.

                                                                              1. 3

                                                                                This picked my curiosity, could it be solved using tools installed by default on my system?

                                                                                I managed to get this, but probably a shorter solution without perl is possible, if one is willing to write some loops in bash:

                                                                                $ perl -wnle 'BEGIN{open($fmt, "<&", 5) or die("cannot");}; print, next if /^#/; next if /^\s*$/; $l=<$fmt>; chomp $l; print $l;' fstab 5< <(grep -v '^#' fstab|column -t)
                                                                                # Static information about the filesystems.
                                                                                # See fstab(5) for details.
                                                                                # <file system> <dir> <type> <options> <dump> <pass>
                                                                                # /dev/nvme0n1p2 LABEL=root
                                                                                UUID=2bb3c21b-dc8f-401e-991b-66afd7301cb7  /      xfs   rw,relatime,inode64,logbufs=8,logbsize=32k,noquota                                                         0  1
                                                                                # /dev/nvme0n1p1 LABEL=boot
                                                                                UUID=1815-DD5D                             /boot  vfat  rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro  0  2
                                                                                1. 7

                                                                                  picked my curiosity

                                                                                  FYI, it’s piqued – the more you know!

                                                                            2. 1

                                                                              Shouldn’t it? I think it makes more sense for the field headers to be spread out too, indicating their associated columns directly. That’s how I format my fstab when I do it manually.

                                                                              1. 2

                                                                                That could actually be nice, but surely you don’t wish to spread out the rest of the comments?

                                                                          1. 4

                                                                            C’mon, these are great books even for the entry level grunt.

                                                                            And I struggle with “An Elegant Puzzle,” it is not a book I would recommend.

                                                                            1. 1

                                                                              That’s fair. Wasn’t sure if the “staff engineering” label made sense, but I went with it because

                                                                              • These books generally aren’t about actually coding
                                                                              • When I was getting started, the most useful books I found were the specifics of writing code (for Rails, HTML, CSS, etc)

                                                                              But agreed that these are probably great choices for anybody. Updated some wording in the article to account for this.

                                                                            1. 5

                                                                              I’ve taken a slightly different tact, how can I take notes and share them as a typed document the fastest?

                                                                              • A paper notepad with a pen/pencil, and a mobile phone with a scanning function.
                                                                              • Eink tablet e.g. remarkable
                                                                              • Color tablet e.g. apple ipad

                                                                              The paper notepad option has been by FAR the most successful, after trying all of them. Especially recently with coronavirus wfh options at my work, I’ve been taking hand written notes during meetings. I save them and share them through a google doc for work. It takes seconds to go from written note -> email’d text using the google drive scanning function on my phone. The writing experience is incredible (because it’s writing)

                                                                              The Eink tablet I just spent time fiddling with it, openning the “right” template, getting the cloud syncing working the way I like, re-uploading to google drive for sharing (which now I need to open the phone app anyways to do?), then again transcription to a document. The writing experience was very good, though I don’t like how slow eink is for flipping between pages of notes.

                                                                              The color tablet was a complete shit show, even though it had the most superior software. While flipping pages etc was faster, the writing experience was so bad I almost never used it.

                                                                              Only caveat of the eink tablet - annotating someone else’s typed paper is much better as the root document isn’t part of your scanned notes. This is actually very rare for me as all collaboration on documents occurs within google docs for work, so the hand written notes need to be re-transcribed if I go this route.

                                                                              1. 2

                                                                                I definitely agree with the color tablet analysis. From my brief usage of an iPad as a note taking device, it was absolutely terrible – nothing like writing by hand.

                                                                                I spent the first half of this school year taking notes by hand and then scanning them (and then the reMarkable arrived), so I’m not a stranger to the workflow. It seems like you do a lot of work in Google’s suite, so our workflow differs there – I mostly just write and submit, which the rM is quite good at, rather than working collaboratively.

                                                                                Ultimately, it’s whatever works best for you – I’ve definitely thought about getting one of the Evernote books that has enhanced scanning, but I’m definitely going to be a reMarkable guy for the foreseeable future.

                                                                              1. 5

                                                                                A lot of these examples work well when the code fits in ~20 lines. In almost all code I write for work, functions are 100s of lines easily, for ~reasons~. They start with error handling and bounds checks - which this article doesn’t address.

                                                                                Once you’re up to 100’s of lines, I would get very pissed off if a coworker did not use early returns to rule out boring edge cases in the main function. The example sentence:

                                                                                If you don’t get home early ignore everything I’d say after this sentence. Bring me a coffee.

                                                                                Which seems weird, but instead if it was:

                                                                                If don’t use our service, you should go back and read the front page! Anyways, <insert entire description of ToS>.

                                                                                1. 4

                                                                                  “Stop me if you have heard this one…”

                                                                                1. 5

                                                                                  I can’t recall who, but one of our fellow crustaceans made an offhand comment the other day that, when you use shell buffers in Emacs, it frees you from being tied to command completion/whatever in your shell itself and makes using alternative shells that much easier. The example they gave was the Tenth Edition/Plan 9 rc shell being fantastic to use in Emacs because of this.

                                                                                  I love rc but I never got the hang of Emacs.

                                                                                  Interestingly, the Amiga (I know, here I go again), put shells in “console windows”. Such windows were handled by the CON: or NEWCON: driver. There were alternative drivers available, like KingCON: that made things more like Emacs as well. I’ll have to dig up some of the documentation. It was neat.

                                                                                  1. 2

                                                                                    That was me because I’m a complete zealot about rc shell & emacs.

                                                                                    Your comment inspired me to figure out how to explain my set up better, I’m working on it.

                                                                                  1. 3

                                                                                    cscope still works well for me - I find it very easy to use, and I’ve used it on very large codebases. The indexing time is not significant.

                                                                                    I do not use completion frameworks, but that’s a personal choice.

                                                                                    1. 5

                                                                                      I’ve been learning guitar for the past year and WFH has super-charged it. It’s been really nice developing a hobby that doesn’t require a computer. And it’s fun when I’m waiting on someone or some task at work to be able to pick up the guitar just play it for a little bit.

                                                                                      1. 2

                                                                                        I bought a guitar for covid! It’s been a lot of fun, I used to play music every day for a couple hours - but when I graduated college the opportunities for marching band & symphonic trombone were few and far between.

                                                                                        Guitar is so accessible, and being able to play more popular songs from my childhood has really re-ignited my musical side.