1.  

    When there are a lot of parameters to pass and there are some defaults, I use dataclasses. You get a field(default_factory=list) syntax and you are able to pass the parameters as a group to other functions as well.

    1. 2

      Are databases considered as dependencies? What about web servers, load balancers, reverse proxies, operating systems? It seems like there is a missing line in the graph. I think it should have “Benefit of a dependency” going downwards over time vs “Benefit of rewriting from scratch” going upward over time.

      1. 2

        It sounds as if there’s also a tightness of coupling argument. A web server is a great example here: it’s pretty trivial to swap out Ningx for Apache (or vice versa) without changing any of the rest of your stack. Reverse proxies, by design, are transparent and so this is even more true there. Databases are a lot more interesting because if you’re using some middleware or sticking to standard SQL then you can often swap them out quite easily, but if you’re using a lot of vendor-specific features then this is much more difficult.

        1. 1

          From TFA:

          Few companies will reinvent a database for their project, yet if you’re operating on Google’s scale it can actually make sense.

        1. 1

          IMO forced meetings are harmful. You are pressed to find something useful to talk about in order to avoid making the meeting a loss of time. Turns out having to find useful things, you only end up with sub-par items. And for actual useful items, you end up waiting a day at which point you either forget some of it or are not enthusiastic about it anymore and this is multiplied with the number of participants. So unless the meeting coincides with the issue, it ends up harming more than helping.

          The more useful way of doing things is to complain about your blockers soon after trying your best. It doesn’t matter if it is caused by your lack of skills or competence or just bureaucracy. And declare your tasks as complete as soon as you are ready and comfortable.

          1. 12

            I’m confused by the distinction between Emacs and an IDE. In what way is Emacs not an IDE? It’s more of an integrated environment than any other IDE I have used, IntelliJ included. Hell in Emacs I can read my emails and browse the web.

            1. 19

              That’s a sad terminology confusion: when people say IDE today, they often don’t have the original “integrated” meaning. Rather, they mean “that, which understands the exact semantics of the code and provides semantic-driven code assistance”. PostIntelliJ is the canonical post which captures the essence of this new IDE meaning. As I work on IDEs (in the modern sense), I tried to invent a better term here (code understander) but it doesn’t stick even with me. So I resorted to just re-defining IDE as Intelligent Development Environment.

              While Emacs is indeed probably the most integrated of them all, it doesn’t fare too well on the intelligent bits. There were attempts to add semantic understanding to emacs: CEDET had some grand vision, js2-mode a real parser for JavaScript, but they are nowhere close to the level of semantic support you get in IntelliJ.

              Today, there’s a trend for separating the semantic engine from the editor front-end (LSP), so we might see Emacs as intelligent environment in the future. Qualitatively, I think that Emacs + lsp-mode for a language which has an OK LSP implementation passes as IDE. Quantitatively, today LSP capabilities are inferior to those of IntelliJ.

              1. 2

                Totally agree that our development tooling still has a lot of areas to improve, “intelligent bits” as you call it but also better support in terms of debugging, tracing, and insights into a programs runtime. The existing stepping debugger support in emacs & most other tools are just very basic and haven’t really changed on what existed 25, 30 years ago. A “live development” experience such as with the Smalltalk debugger is still missing in most other tooling (except for Common Lisp / Scheme to some degree).

                In any case, thank you & the rust-analyzer team in particular that Emacs + rust-analyzer is my favorite Rust development environment that is getting better every week!

              2. 2

                I’ve used Vim since the early 2000s. Each tool has a purpose. In Intellij IDEA for example, you can create a kotlin based spring boot project and start debugging or start writinh some test cases and run them to see the coverage. It will underline code where you need to add null checks. It will auto-install dependencies in your pom or gradle files. This is supported out of the box as expected from any IDE. It is a time saver. I install emacs and stare at a blank page. No “create project” menus, no “project options” it just stares with its gray, listless, lifeless terminal screen.

                1. 1

                  Good point. “Specialized IDE” would have been more accurate but would have been more verbose

                1. 4

                  CSV doesn’t need to go away. Data interchange can still be done in some other human readable/modifiable format and CSV can still be produced in order to support legacy software. The problem with being plaintext/modifiable is: people don’t use linters to check for errors and they don’t count rows and columns before and after modifications. They will do that with any format and you can’t solve for laziness.

                  1. 1

                    I wonder if this will work on a RPi

                    1. 2

                      It runs fine on my Raspberry Pi Zero W.

                    1. 31

                      On a technical level it’s implemented very well.

                      It is matching against a list, so unlike a general recognition AI, there’s very little chance of misidentification.

                      The blocklist and matching process is split between client-side and server-side, so it can’t be easily extracted from the phone for nefarious purposes.

                      Apple has spent a considerable effort to cryptographically ensure they know nothing until multiple matches are found. Phone even sends dummy traffic to obscure how many potential matches are there.

                      So as far as scanning for the intended purpose, it’s a careful well thought-out design.

                      I am worried about governments putting pressure on Apple to add more kinds of unwanted images to this list. The list is opaque, and for obvious reasons, it can’t be reviewed.

                      1. 6

                        This is an improvement over their existing policy of giving authoritarian governments access to iCloud keys for their users: https://www.reuters.com/article/us-china-apple-icloud-insight/apple-moves-to-store-icloud-keys-in-china-raising-human-rights-fears-idUSKCN1G8060

                        This technology will allow Apple to expose only content that governments specifically ban rather than having to give them access to everything. We should be celebrating this for both its ability to combat child abuse and that it protects Apple’s customers from over-broad privacy invasion.

                        1. 1

                          This technology will allow Apple to expose only content that governments specifically ban

                          Do governments always make fair and righteous decisions in when deciding what images to ban? I see this situation as disastrous for human rights because you know darn well countries like China will bully Apple into including whatever images they want in that database.

                          1. 1

                            But China including whatever images they want is WAY better for privacy than today when China simply has access to all of Apple’s Chinese users’ data.

                            1. 1

                              That’s not the case, unless you mean to say China bullying Apple into giving them a user’s decryption key? That scenario is possible with or without this system.

                              1. 1

                                This has been the status-quo for the past 3.5 years: https://www.reuters.com/article/us-china-apple-icloud-insight/apple-moves-to-store-icloud-keys-in-china-raising-human-rights-fears-idUSKCN1G8060

                                China demand access to user data so many large American tech companies don’t have a significant presence there. Some American companies that are less committed to privacy comply with the conditions that China places for operating there. It’s a huge market so it’s been a great business move for Apple.

                                Having the ability to scan users’ content in device might be a way to achieve censorship without such indiscriminate access to user data.

                                1. 1

                                  The article makes many speculations, but there is nothing concrete regarding the Chinese government having the kind of access you described written in it.

                                  Also see this more recent article: https://www.nytimes.com/2021/05/17/technology/apple-china-censorship-data.html

                                  Documents reviewed by The Times do not show that the Chinese government has gained access to the data.

                                  1. 3

                                    Apple user data in China is not controlled by Apple, it’s controlled by GCBD, a company owned by a Chinese regional government. Instead of using standard HSMs they use a hacked up iOS system. Apple’s security chips are vulnerable to local attacks. https://arstechnica.com/information-technology/2020/10/apples-t2-security-chip-has-an-unfixable-flaw/

                                    So there’s a government owned company that controls the user data which is encrypted with keys stored in an insecure system. If user data is not being accessed that’s a choice that the Chinese government is making, not a restriction on their access.

                                    1. 1

                                      GCBD is the Chinese company that provides apple with datacenter type services. This is not the same as “controls the user data”.

                                      1. 2

                                        From the New York Times article you linked:

                                        U.S. law has long prohibited American companies from turning over data to Chinese law enforcement. But Apple and the Chinese government have made an unusual arrangement to get around American laws.

                                        In China, Apple has ceded legal ownership of its customers’ data to Guizhou-Cloud Big Data, or GCBD, a company owned by the government of Guizhou Province, whose capital is Guiyang. Apple recently required its Chinese customers to accept new iCloud terms and conditions that list GCBD as the service provider and Apple as “an additional party.” Apple told customers the change was to “improve iCloud services in China mainland and comply with Chinese regulations.”

                                        The terms and conditions included a new provision that does not appear in other countries: “Apple and GCBD will have access to all data that you store on this service” and can share that data “between each other under applicable law.”

                                        So to get around US privacy laws and comply with Chinese surveillance laws a Chinese government owned company is the iCloud “service provider” (with Apple listed as an “additional party”) and per the ToS “will have access to all data that you store on this service”.

                                        It was a great business decision. They’re the only major western tech company making a lot of money from the huge Chinese market. I personally wouldn’t want to work there but the people who do are doing very well.

                        2. 2

                          Could such a feature be “pretty easily” fooled to trigger law enforcement to someone as the article implies?

                          Is it plausible to assume that they scan the cached Telegram/Whatsapp/Browser images? If so, how would it behave if someone sends you a set of known infractor images? (an evil chat bot, for example)

                          1. 6

                            Apple says they scan only images in the iCloud library, so images in 3rd party apps and browsers won’t be scanned, unless you save them or screenshot them to your iCloud library. Of course, Apple devices belong to Apple, not you, so Apple could later decide to scan whatever they want.

                            With the current scheme, to cause someone trouble, you’d first have to have multiple banned images to send to them. I hope obtaining actual CSAM is not “pretty easy”.

                            My big worry was that a plaintext blocklist on the phone could be used to generate arbitrary new matching images, but fortunately Apple’s scheme protects against this — the phone doesn’t know if images match. Therefore, you can’t easily make innocent-looking images to trick someone to save them.

                            1. 3

                              Of course, Apple devices belong to Apple, not you, so Apple could later decide to scan whatever they want.

                              Is there a source for this information?

                              1. 3

                                What’s your source for the “multiple banned images” part? Skimmed through Apple’s technical PDF descriptions a bit but didn’t find that part right away.

                                1. 4
                                2. 2

                                  Apple says they scan only images in the iCloud library, so images in 3rd party apps and browsers won’t be scanned, unless you save them or screenshot them to your iCloud library.

                                  I believe pictures in a lot of messaging apps are automatically uploaded to iCloud. So you could just send someone some pictures over WhatsApp, email, or whatnot. Not 100% sure of this though; I’d have to check. I disabled all the iCloud stuff because it kept nagging.

                                  1. 1

                                    That or you can generate adversarial images that trigger known hashes. It isn’t using cryptographic hashes, it is using perceptual hashes.

                                    1. 1

                                      No, you can’t, because the device doesn’t know if it has got a match.

                                      1. 1

                                        And you think there will be no other way to get ahold of any of the perceptual hashes that are being scanned for?

                                        1. 2

                                          What I’m saying is that you can’t easily abuse Apple’s implementation for this. They’ve anticipated that problem and defended against it.

                                          If you get hold of some hashes or banned images from another source, that’s not Apple’s fault.

                              1. 1

                                I’m so thankful for kotlin, idea community edition and android studio that I can almost forgive the fact that there is no simplified community edition of rubymine which is the only decent ruby IDE out there that works out of the box.

                                1. 2

                                  It always upsets me that 1 isn’t prime.

                                  1. 7

                                    It’s just a convention. It would make a bunch of theorems annoying to state if 1 were prime.

                                    1. 3

                                      “1 is a prime” can be the new “tau is superior to pi”.

                                      On a more serious note, I read a bit about this and apparently for a long time 1 wasn’t even considered a number: https://blogs.scientificamerican.com/roots-of-unity/why-isnt-1-a-prime-number/

                                      1. 2

                                        The current ad-hoc definition of a prime is of a natural number with exactly two distinct positive natural divisors. It appeared to be convenient so it was normalized this way about one century ago (but you can still find very old books citing 1 as the first prime number).

                                        1. 2

                                          2 being prime is pretty disappointing as well.

                                          1. 1

                                            1 is only divisible by 1 and itself, but then considering it as prime will destroy “sieve of eratosthenes”

                                          1. 5

                                            This seems fun, and maybe a good tool for build proof of concepts. But I hardly see it as being useful for large projects. Or have I become old and grumpy?

                                            1. 13

                                              As a stranger on the internet, I can be the one to tell you that you are old and grumpy.

                                              Ruby is definitely unusable without syntax highlighting… (Sadists excepted) Java is definitely unusable without code completion… (Sadists excepted) Whatever comes next will probably be unusable without this thing or something like it.

                                              1. 9

                                                I’m confused… Ruby has one of the best syntaxes to read without highlighting. Not as good as forth, but definitely above-average

                                                1. 3

                                                  Well, this is the internet. Good luck trying to make sense of every take.

                                                  1. 2

                                                    I used to think this way. Then I learned Python and now I no longer do.

                                                    When I learned Ruby I was coming from Perl, so the Perl syntactic sugar (Which the Ruby community now seems to be rightly fleeing from in abject terror) made the transition much easier for me.

                                                    I guess this is my wind-baggy way of saying that relative programming language readability is a highly subjective thing, so I would caution anyone against making absolute statements on this topic.

                                                    For instance, many programmers not used to the syntax find FORTH to be an unreadable morass of words and punctuation, whereas folks who love it inherently grok its stack based nature and find it eminently readable.

                                                    1. 1

                                                      Oh, sure, I wasn’t trying to make a statement about general readability, but about syntax highlighting.

                                                      For example, forth is basically king of being the same with and without highlighting because it’s just a stream of words. What would you even highlight? That doesn’t mean the code is readable to you, only that adding colour does the least of any syntax possible, really.

                                                      Ruby has sigils for everything important and very few commonly-used keywords, so it comes pretty close also here. Sure you can highlight the few words (class, def, do, end, if) that are in common use, you could highlight the kinds of vars but they already have sigils anyway. Everything else is a method call.

                                                      Basically I’m saying that highlighting shines when there are a lot of different kinds of syntax, because it helps you visually tell them apart. A language with a lot of common keywords, or uncommon kinds of literal expressions, or many built-in operators (which are effectively keywords), that kind of thing.

                                                      Which is not to say no one uses syntax highlighting in ruby of course, some people find that just highlighting comments and string literals makes highlighting worth it in any syntax family, I just felt it was a weird top example for “syntax highlighting helps here”.

                                                      1. 3

                                                        Thank you for the clarification I understand more fully now.

                                                        Unfortunately, while I can see where you’re coming from in the general case, I must respectfully disagree at least for myself. I’m partially blind, and syntax highlighting saves my bacon all the time no matter what programming language I’m using :)

                                                        I do agree that Ruby perhaps has visual cues that other programming languages lack.

                                                        1. 1

                                                          ’m partially blind, and syntax highlighting saves my bacon all the time no matter what programming language I’m using :)

                                                          If you don’t mind me asking - have you tried any Lisps, and if so, how was your experience with those? I’m curious as to whether the relative lack of syntax is an advantage or a disadvantage from an accessibility perspective.

                                                          1. 1

                                                            Don’t mind you asking at all.

                                                            So, first off I Am Not A LISP Hacker, so my response will be limited to the years I ran and hacked emacs (I was an inveterate elisp twiddler. I wasted WAY too much time on it which is why I migrated back to Vim and now Vim+VSCode :)

                                                            It was a disadvantage. Super smart parens matching helped, but having very clear visual disambiguation between blocks and other code flow altering constructs like loops and conditionals is incredibly helpful for me.

                                                            It’s also one of the reasons I favor Python versus any other language where braces denote blocks rather than indentation.

                                                            In Python, I can literally draw a veritcal line down from the construct and discern the boundaries of the code it effects. That’s a huge win for me.

                                                            Note that this won’t eventually keep me from learning Scheme, which I’d love to do. I’m super impressed by the Racket community :)

                                                        2. 1

                                                          For example, forth is basically king of being the same with and without highlighting because it’s just a stream of words. What would you even highlight? That doesn’t mean the code is readable to you, only that adding colour does the least of any syntax possible, really.

                                                          You could use stack effect comments to highlight the arguments to a word.

                                                          : squared ( n -- n*n ) 
                                                               dup * ;
                                                           squared 3 .  
                                                          

                                                          For example, if squared is selected then the 3 should be highlighted. There’s also Chuck Moore’s ColorForth which uses color as part of the syntax.

                                                    2. 6

                                                      Masochists (people that love pain on themselves), not sadists (people that love inflicting pain on others).

                                                      1. 2

                                                        Ah, thank you for the correction.

                                                        I did once have a coworker who started programming ruby in hungarian notation so that they could code without any syntax highlighting, does that work?

                                                        1. 4

                                                          That count as both ;)

                                                        2. 2

                                                          Go to source is probably the only reason I use IDEs. Syntax highlighting does nothing for me. I could code entirely in monochrome and it wouldn’t affect the outcome in the slightest.

                                                          On the other hand, you’re right. Tools create languages that depend on those tools. Intellij is infamous for that.

                                                        3. 6

                                                          You’re old and grumpy :) But seriously, the fact that it’s restricted to Github Codespaces right now limits its usefulness for a bunch of us.

                                                          However, I think this kind of guided assistance is going to be huge as the rough edges are polished away.

                                                          Will the grizzled veterans coding exclusively with M-x butterflies and flipping magnetic cores with their teeth benefit? Probably not, but they don’t represent the masses of people laboring in the code mines every day either :)

                                                          1. 4

                                                            I don’t do those things, I use languages with rich type information along with an IDE that basically writes the code for me already. I just don’t understand who would use these kinds of snippets regularly other than people building example apps or PoCs. The vast majority of code I write on a daily basis calls into internal APIs that are part of the product I work on, those won’t be in the snippet catalog this things uses.

                                                            1. 4

                                                              I don’t doubt it but I would also posit that there are vast groups of people churning out Java/.Net/PHP/Python code every day who would benefit enormously from an AI saying:

                                                              Hey, I see you have 5 nested for loops here. Why don’t we re-write this as a nested list comprehension. See? MUCH more readable now!

                                                              1. 4

                                                                The vast majority of code I write on a daily basis calls into internal APIs that are part of the product I work on, those won’t be in the snippet catalog this things uses.

                                                                Well, not yet. Not until they come up with a way to ingest and train based on private, internal codebases. I can’t see any reason to think that won’t be coming.

                                                                1. 2

                                                                  Oh sure, I agree that’s potentially (very) useful, even for me! I guess maybe the problem is that the examples I’ve seen (and admittedly I haven’t looked at it very hard) seem to be more like conventional “snippets”, whereas what you’re describing feels more like a AST-based lint that we have for certain languages and in certain IDEs already (though they could absolutely be smarter).

                                                                  1. 2

                                                                    Visual studio (the full ide) has something like this at the moment and it’s honestly terrible. Always suggests inverting if statements which break the logic, or another one that I haven’t taken the time to figure out how to disable is it ‘highlights’ with a little grey line at the side of the ide (where breakpoints would be) and suggests changes such as condensing your catch blocks from try/catches onto one line instead of nice and readable.

                                                                    Could be great in the future if could get to what you suggested!

                                                                  2. 3

                                                                    Given that GH already has an enterprise offering, I can’t see a reason why they can’t enable the copilot feature and perform some transfer learning on a private codebase.

                                                                    1. 1

                                                                      Is your code in GitHub? All my employer’s code that I work on is in our GitHub org, some repos public, some private. That seems like the use case here. Yeah, if your code isn’t in GitHub, this GitHub tool is probably not for you.

                                                                      I’d love to see what this looks like trained on a GitHub-wide MIT licensed corpus, then a tiny per-org transfer learning layer on top, with just our code.

                                                                      1. 1

                                                                        Yeah, although, to me, the more interesting use-case is a CI tool that attempts to detect duplicate code / effort across the organization. Not sure how often I’d need / want it to write a bunch of boilerplate for me.

                                                                  3. 1

                                                                    it feels like a niftier autocomplete/intellisense. kind of like how gmail provides suggestions for completing sentences. I don’t think it’s world-changing, but I can imagine it being useful when slogging through writing basic code structures. of course you could do the same thing with macros in your IDE but this doesn’t require any configuration.

                                                                  1. 2

                                                                    If you dive into the C++ hello world, follow every header, every overload and trace every iostream class that is instantiated, it feels like you are sitting on a giant complex structure that was obfuscated by the deceptively simple looking abstraction which causes hello world to be flushed to stdout.

                                                                    1. 4

                                                                      Why doesn’t the Game send an instance of Hit to the Monster instance? What in OOP stops this? Object oriented doesn’t mean that we constrain ourselves to two classes, we can still use data transfer objects.

                                                                      1. 14

                                                                        Can someone explain me the point of the rant? I don’t really understand what it’s trying to say.

                                                                        1. 84

                                                                          Every language has some core idea that inspired its creators to make it, instead of putting up with the other perfectly good languages that already existed. Sometimes, that idea is simple (“everything is an object” for Smalltalk, “everything is a cons cell” for LISP), and sometimes that idea is more complex (the way that Java is designed to scale to huge teams, or the way that Perl is “the Cliff’s Notes of Unix”).

                                                                          The author’s idea is that the core idea of Ruby is (waves hands) for making domain-specific languages. It’s not the universal syntax for expressing all algorithms, but if you have an idea for how a particular algorithm should be expressed, you can probably bend Ruby into that shape, at least within a particular class or project.

                                                                          The author’s lament is that Ruby’s core idea was never really named, and thus never advertised, and thus never formed part of Ruby’s reputation. As a result, it didn’t build up the audience of tinkerers and experimenters who could form a long-lived supportive community around it.

                                                                          Instead, what it got was Rails, which was the opposite of that core idea: instead of bending Rails into a domain-specific language for the application you want to create, the idea is to bend your application to fit within the framework Rails provides. And since Rails became hugely popular, the vast majority of the Ruby community valued that framework-style approach and Ruby just became the incidental-complexity runtime for Rails instead of an interesting thing in its own right.

                                                                          1. 11

                                                                            Brilliant summary. Well done.

                                                                            1. 4

                                                                              The Ruby-on-Rails revolution and its consequences have been a disaster for the Ruby race.

                                                                              1. 2

                                                                                Can you expand a bit on the idea that Ruby is for DSLs? I feel like I’ve heard that here and there and it always seemed like a bit of a stretch. Ruby just doesn’t have things that I would think would be critical for truly writing DSLs, such as lazy evaluation and macros.

                                                                                The vagrant config, for example, is a bunch of ruby code that calls itself a DSL but it really just feels like… writing ruby. Python, for instance, could do it just as well (see: SCons).

                                                                                1. 5

                                                                                  The instance_exec method allows for succinct DSLs whose syntax couldn’t be easily copied in other languages like Python. Basically, it allows you to evaluate blocks as if they were running in the scope of an arbitrary object’s methods — or to put it in Rubyist terms, it allows you to execute blocks with an arbitrary receiver. For (a completely contrived) example, in Python you might write:

                                                                                  conf = Library.config_object()
                                                                                  conf.config_file("foo.txt")
                                                                                  conf.worker_processes(2)
                                                                                  worker = Library.worker(conf)
                                                                                  

                                                                                  Whereas a Ruby library might read:

                                                                                  worker = Library.worker do
                                                                                    config_file "foo.txt"
                                                                                    worker_processes 2
                                                                                  end
                                                                                  

                                                                                  The interior of the Ruby block defining the worker feels in a certain sense like a DSL; these methods are not in global scope: they’re special methods that are accessible inside the block, running on an anonymous object. It’s sort of like having a domain-specific language with new keywords — config_file and worker_processes — that elegantly composes with standard Ruby.

                                                                                  Of course, really all it means is you can leave out repeated references to conf, since Library.worker makes everything run as if it’s in the scope of some method on conf (and Ruby has implicit self inside method calls, so you can write config_file instead of self.config_file). But ergonomically it can feel nice. It’s the same number of lines, but much less significant text.

                                                                                  1. 1

                                                                                    To your point: until I read this comment, I had no idea that the Vagrant config was even supposed to be any kind of DSL. It just looked like ordinary Ruby to me.

                                                                                  2. 1

                                                                                    Thank you… Didn’t even bother reading the post - love your writing style too!

                                                                                    1. 1

                                                                                      Thanks for that. I never learned that about ruby because the first and only place I tried it was (gross) codecademy, before I’d started learning how to code.

                                                                                      1. 1

                                                                                        The author’s lament is that Ruby’s core idea was never really named, and thus never advertised

                                                                                        I know this is not your point, but I have a bunch of populer old books from ruby 1.9 times such as “metaprogramming ruby” and “rspec” which disagree.

                                                                                      2. 5

                                                                                        That Ruby never gained traction for the face value of its expressiveness. I feel that this rant imply that the mix of semantic approach of Perl and the meta-approach of Lisp meeting in the right balance in Ruby have not been recognized and exploited fully to show what Ruby really is.

                                                                                        The way the author speaks about “phrase-based” reminds me of Perl, Raku, APL, dense language where you can express yourself in short understandable phrase. The author pushes the idea that this is the meaning of the mantra “Desifned for developer’s happiness”. To be happy, you have to be able to express yourself without convolution and Ruby provided that solid base and rich vocabulary to be expressive and precise.

                                                                                        1. 3

                                                                                          Me neither. Wondering if I should flag this as off-topic.

                                                                                        1. 11

                                                                                          This is a helpful article for me, thank you for posting!

                                                                                          Does Lobsters allow posts like these, though? It’s a great article, but includes an ad for a service as the last section.

                                                                                          1. 9

                                                                                            It’s a useful article until then so it’s worth letting the votes govern its relevance, imo.

                                                                                            1. 6

                                                                                              I’d say there’s a difference between “here’s some useful Rust stuff, btw use our logging SaaS at the end” and “here’s why you should use our logging SaaS”

                                                                                              1. 5

                                                                                                Author here, glad you like it.

                                                                                                I will add a conclusive sentence to make the distinction between the article and the advertisement clearer.

                                                                                                1. 1

                                                                                                  Thanks for the article, I didn’t mind the ad. Do you inspect the stack frames non-intrusively via sampling?

                                                                                                2. 4

                                                                                                  if it’s not too intrusive its okay, for example when you can read the article without the ad and you don’t miss big parts of the post

                                                                                                  1. 3

                                                                                                    Personally, I don’t mind it. There’s a lot of great and interesting content out there published by companies that usually includes some sort of “ad” for their service. I don’t want to cut that out just because they say, “hey, use our stuff” at the end. Especially because I can just ignore the ad bit and still learn something.

                                                                                                  1. 7

                                                                                                    Assemblers, what luxury! I wrote my first 6502 machine language programs directly in the Epyx FastLoad monitor on the C64 (a particularly deprived monitor at that) manually in hex. This is a little sad for me personally as I have no source code from my childhood projects to refer to. When my best friend and I got a KIM-1 as a weekend project in high school, it was easy for us to program, because we already knew the opcodes by heart!

                                                                                                    Actually being able to enter mnemonics in the C128’s MONITOR was a huge leap. Then it was TurboAssembler, and I’ve used xa65 (and now maintain it) since the late 1990s.

                                                                                                    1. 4

                                                                                                      FastLoad! Monitors! Luxury! Kids these days not knowing what they have! When I wanted to write assembly I had to enter it as raw DATA statements in a BASIC program and write it to disk!

                                                                                                      1. 3

                                                                                                        Hexadecimal was a great convenience :)

                                                                                                        1. 3

                                                                                                          Disks! What luxury! I had to record my programs on 80s mix tapes using the 1530 datasette.

                                                                                                      1. 10

                                                                                                        I’m on the side of the people who consider this a mis-overreaction out of spite. I’d like to see a mass revert… of the actual bogus commits. The would-be researchers state in their methodology description they consciously chose to submit their patches under non-UMN email addresses, so using @umn.edu as a revert criterion has a 100% miss rate for identifying bogus commits, and using no other criterion has a 0% inclusion rate. So I don’t know if this is a case of “something must be done; this is something” or something else, but I can’t find a way to frame it as a rational reaction.

                                                                                                        (Of the would-be researchers and what they did, I won’t even speak.)

                                                                                                        1. 12

                                                                                                          I think blatant violations of ethics in research deserve to be dealt with harshly, and making it the university’s problem is absolutely the right move because it is the university’s job to police their researchers. Reputation is a very hard currency for universities: it drives grants, it drives student applications, it drives where prestigious researchers want to work. Making a big dramatic stink about this threatens UNM’s reputation in the computer science field, which helps ensure the problem gets taken seriously.

                                                                                                          1. 3

                                                                                                            Greg is what we call a high-performer. Publically shaming a university for their “research” was probably a couple hours of work at most for him. And if you can do it, why not? It will likely prevent future “experimentation” from other “research groups dedicated to improving the linux kernel”.

                                                                                                          1. 14

                                                                                                            Maintaining an identity is hard, keep in mind.

                                                                                                            1. 3

                                                                                                              I’m trying to deal with something like this for myself. How much I want to separate my ‘professional’ persona from the side of me that constantly posts about being gay, NSFW things, and the like. I don’t have a good answer.

                                                                                                              1. 2

                                                                                                                Just have an anonymous account somewhere on fediverse, seems to be working fine for others.

                                                                                                                1. 1

                                                                                                                  I’m separating all my “gaming” stuff from my official open-source-contributing real name persona. Not for a real good reason, mostly it’s an experiment and literally nothing is at stake.

                                                                                                                  Here’s what I do:

                                                                                                                  • different (free) email addresses
                                                                                                                  • different domain hosters
                                                                                                                  • different server IPs
                                                                                                                  • different twitter & fediverse handles
                                                                                                                  • obviously not the same nickname
                                                                                                                  • 2 different browsers, so I don’t accidentally post as the other persona

                                                                                                                  Is this completely doxing-proof? No, someone with enough time and knowledge will make the right connections.

                                                                                                                  Am I 100% safe here? No, I’ve had to delete comments and force push to repos because I messed up (but so far I think I’ve managed to notice in <1min every time), my defense would be “needs some digging and not just a google search”.

                                                                                                                  Also I’ve posted my gaming blog’s url in channels where only friends are, so it’s only separated 100% from one side.

                                                                                                                  If I was really serious about this I’d take more care, like only using TOR or simply use another computer/VM with VPN permanently on to not have the same ip address, probably not using Google accounts on at least one of the personas - but I feel some of the steps taken in the article are taking it a little far, for needless reasons.

                                                                                                                  Like… downloading that Linux ISO from a public wifi. Not sure if the author will manage to 100% not leak to their ISP that they are connecting from that computer with that OS. And that’s the only piece of metadata I can think of right now, when using a VPN all the time.

                                                                                                              1. 24

                                                                                                                I mean, I agree, I understand where the author is coming from. But this, I am sorry to say, really does sound like someone who drank kool-aid, and I think it will be less effective for that reason. I think it is an interesting challenge for Rust people to figure out how to express the same thing in a manner that less triggers kool-aid warnings.

                                                                                                                1. 9

                                                                                                                  Yeah it sounds like the perfect ad-whitepaper.

                                                                                                                  Can we add a disclaimer about how clunky UI and web-service development feels compared to things like django ? Starting from missing crates to unbearable compile times when changing 1 line of code. And error reporting for especially the paths where you can’t really handle all failures (UI stuff with lazy initialized things). Thinking about a .clone() and restructuring stuff just to avoid it when using parts of your initial configuration struct at different places in the program, while it wouldn’t matter at all in other langs? These are parts where I dread using rust. I like the feeling of how perfect it can feel to have it written in rust. But at the same time I look at ~2Gb of build artifacts for ~300 dependencies to get a comparable web-service with 5 endpoints and a DBMS connection to run. The resulting debug ELF being ~150MB. (Or 15 minutes of release build time for ~9MB ELF)

                                                                                                                  I know the tradeoffs, I know how unfair this comparison is and how I could “just” use django. But why wouldn’t I want the speed and safety of rust? This is simply the experience I get in the end, technical reasons or not.

                                                                                                                  Maybe OPs opinion will change in ~3 years? Probably related to the types of application they write. At least to me rust is still in my heart after 6 years and still in my toolbox. But I enjoy writing programs in languages where I’m not forced to care about every None or Err. Where compilation time is instant and I’m not the early adopter of crates that are pretty much finished in other languages.

                                                                                                                  1. 7

                                                                                                                    I think the question of ‘what is my alternative?’ is a helpful framing. If Django is a reasonable alternative, you probably shouldn’t be using Rust for all of the reasons you just listed and more.* I really like using Rust because my only alternative is C++, and C++ is…

                                                                                                                    • Not that you should 100% be using Django, but something in the Django, Rails, Go, etc family would be a better fit.
                                                                                                                    1. 6

                                                                                                                      These complaints (which are real) feel pretty similar to issues I’ve run into when using Django. Dealing with dependencies in Django projects, like in any python project, can be a time-consuming pain in the ass. I’ve definitely seen Django projects many megabytes in size - not to mention the size of the Python interpreter you need to run them (not to mention debugging problems with selecting the right Python interpreter version!). To be clear, I personally like Django, and think it’s an eminently reasonable choice of web framework. But I don’t think it’s dramatically better than the Rust frameworks I’ve used.

                                                                                                                      But I enjoy writing programs in languages where I’m not forced to care about every None or Err.

                                                                                                                      If you’re not forced to care about None and Err values explicitly in the code, you’ll be forced to care about them when you try to do an operation on some value that turns out to be a null when you weren’t expecting it and throws a runtime error. Having to manually unpack an Option<T> replaces TypeError: Cannot read property 'x' of undefined (or whatever your language’s equivalent is).

                                                                                                                      1. 2

                                                                                                                        I think rust triggers my struggle for perfection. I can simply ignore failures in django by letting it crash and dealing with it or leaving it as a crash. While in rust I always try to make it correct and handle all of these cases as I see every possible “exception” point. And this is the part where just setting up a mockup in django for some lightweight ERP system or data management feels so light, so easy. And as my naming suggests I probably won’t build something that requires high correctnes this way in django. But in rust I get the feeling that there’s no other way than the correct, perfect one, if you don’t want to unwrap() at every point.

                                                                                                                        Declaring some stuff as lateinit var in android and then later initialize it. Just bind it when you need it and it’ll probably be fine, don’t handle each possible case of “it should be initialized because we’re past point X but you can’t be sure”*. Something you won’t do in rust and where the same program in the same setting would be just so ugly.

                                                                                                                        This also comes down to the last point: Many things like UI just feel clunky because they’re build for different languages or rather idioms. It’s ok to just write loosely coupled UIs in android that get initiated from design sheets during runtime and then bind to them. But you won’t do that in rust. You’ll probably use iced and bake the whole UI declaration and logic into one program that compiles as one big thing (thus taking seconds for a println!() change). Yes its a nice all-in-one binary that runs pretty correct. But I don’t get the feeling that I’ll ever do something serious with this kind of coding style for UI based systems. That I’d have to invest so much more work to reach the same kind of completeness (feature wise, behaviour, look’n feel), reaching the point where its not feeling like a mockup that you won’t ever show to someone that isn’t a CS grad. As if someone would try to write a CMS in assembly, while having seen how fast you get this up with django/rails/cake-php/..

                                                                                                                        *And yes I hate those NullPointerExceptions and state-loss on rotation. But I like at how many places I don’t have to code around possible nulls. Even though I’m using kotlin to get a little more awareness of possible nulls.

                                                                                                                        1. 1

                                                                                                                          Returning Optional[T] in python function signature helps your syntax checker mark your code with a warning. Syntax checkers are even clever enough to stop warning you after you add the None check. Never had an issue with evaluating None.x after python 3.6.x

                                                                                                                          1. 2

                                                                                                                            Yup, and this is effectively the same thing as matching on an Option type in a language like Rust with ML-style types, just retrofitted onto Python’s existing syntax and semantics. Using a type checker in modern Python makes you have to care about Nones, because that affects whether the type-checker will pass or fail on your code.

                                                                                                                            1. 2

                                                                                                                              I actually enjoyed this behavior for several years while using kotlin with the jetbrains community edition IDE. Very nice to see other languages adopting it where their type system allows.

                                                                                                                      2. 3

                                                                                                                        not joking, you worded perfectly what i was imprecisely thinking

                                                                                                                      1. 1
                                                                                                                        1. 4

                                                                                                                          This is neat, though what would be more interesting to me (and what I’ve thus far been unable to find) is whatever discussion (of this particular code/merge) took place on the mailing list.

                                                                                                                          From a quick skim it looks like the rust code is set up to panic on allocation failure in at least some scenarios – that’s certainly a thorny issue language-wise, but if it remains that way does that just relegate rust to second-class status, making it unable to implement a module capable of returning ENOMEM when appropriate? Have there been any breakthroughs on solving problems of interop with the rest of the kernel using very C-specific APIs like struct list_head or the tracepoint macros?

                                                                                                                          Getting some basic code compilable and integrated into the build system is cool and an important step, but it still seems like there are much bigger and more difficult problems to address before there’s any clear path to it being viable for serious, widespread use in the Linux kernel.

                                                                                                                          1. 6

                                                                                                                            The panicking error handler is only for the alloc crate. If you allocate memory directly from the allocator, you can handle failures however you like. Rust is also adding fallible Box::try_new and Vec::try_reserve, so it should be possible to handle allocation errors gracefully even if you use the standard containers.

                                                                                                                            And finally there’s catch_unwind to catch all panics. That will most likely be necessary anyway, just in case the code trips on something else like arr[bad_index].

                                                                                                                            1. 1

                                                                                                                              I remember having to remove exception support and runtime support when developing a custom kernel module in c++, is that not the case with rust?

                                                                                                                              1. 1

                                                                                                                                Rust doesn’t have exceptions (panics are not an equivalent mechanism). However, you can choose to configure a crate to abort on panic instead of panicking the current thread and unwinding the stack, which removes the small bit of code necessary to support unwinding. In that case though, panics are no longer able to be handled, and instead kill the program entirely.

                                                                                                                                1. 1

                                                                                                                                  Thanks, though I’m not sure how we can handle a panic during module initialization as resources need to be released in lifo order in case one of them fails. This might cause module initialization to hang and we won’t be able to unload.