1.  

    Rust’s trait object syntax is one that we ultimately regret.

    I appreciate they’re willing to admit their mistakes.

    1.  

      I recently was at JSConf EU, where Ryan gave a talk about his regrets with node, ten years later. I think it was discussed here.

      I immediately started dreaming about my own talk, seven years from now…

      1.  

        I think I’ve watched that talk on YouTube. I’m not a JS developer, but that was a fantastic presentation that I think really highlighted lessons that apply equally to all programmers.

    1. 6

      Rust was eliminated for lack of nested functions, which is entirely fair. Although I understand why it was not included in Rust (because of safety problems), I sometimes miss it.

      Clueless people on HN are arguing why closures are not sufficient. Well, because it’s a different feature.

      1. 6

        How is it different? Other than the lack of mutual exclusion enforcement in D, Rust closures seem the same to me. What am missing?

        1. -2

          A nested function can modify a variable in the enclosing scope. I don’t think Rust can do that.

          https://dlang.org/spec/function.html#nested

          Edit: Whoa, whoa, RESF, just one of you was enough.

          1. 2

            A closure can. A fn can’t.

            1. 2

              Rust can do that: http://play.rust-lang.org/?gist=cbedf929dc6ee3a45b8e5fa5787460a4&version=stable&mode=debug

              I wrote it a little differently than D’s example because of the borrow checker. It’s just an example after all, so I don’t feel that bad about it, but if you want to be a stickler to match D’s example more precisely, I’d probably just use interior mutability: http://play.rust-lang.org/?gist=16d817b9a819518d2c51436730b48e75&version=stable&mode=debug

              Go can also do this as well.

              1. 1

                Man, I really have a hard time reading Rust. Why did they have to pick such a weird syntax that looks like nothing else?

                1. 4

                  Looks fine to me. I was never bothered by it, even when I first started, when the syntax was considerably noisier (before 1.0).

                  But then again, I can’t remember the last time I ever bothered to complain about the syntax of anything. I realize people disagree with me, but as long as it’s reasonableish, I don’t think it matters very much.

                  I also think discussions about syntax are mildly annoying, primarily because most of it probably isn’t going to change. Either you’re willing to live with it or you’re not.

                  edited to soften my language

                  1. 1

                    So it turns out that OCaml is a strong inspiration for Rust and that’s why it looks foreign to me. I didn’t know that.

                    1. 1

                      I don’t know OCaml either, but I have done a fair amount of work in Standard ML. That got me used to the tick marks used as lifetime parameters (type parameters in SML).

                      Types after names I think is in Go, which I’ve also done a fair amount of work in. I don’t know if Go originated that though. I’d guess not.

                      Most of the rest of the syntax is pretty standard IMO. Some things are too abbreviated for some folks’ taste, but I don’t really mind, because once you start writing code, those sorts of things just disappear. They are really only weird to virgin eyes. Some other oddities include using ! in macros and perhaps the different syntaxes for builtin pointer types, e.g., &mut T. (Probably defining macros themselves looks really strange too, but there are a relatively small amount of rules.)

                      Maybe the closure syntax is weird too, I don’t know. I think it’s similar to Ruby’s syntax? I definitely appreciate the terseness, as found in SML, Haskell and heck, even Javascript’s arrow functions, particularly when compared to Python’s or Lua’s longer syntax. Go’s is also mildly annoying because there’s no type inference, and you need to write out the return keyword. But, you don’t use closures as much in Go as you do in Rust as parameters to higher order functions (in my experience) because of the lack of generics. It’s for loops all the way down.

                      As long as it’s within a broad realm of reasonableness, syntax mostly just bleeds into the background for me.

                      It’s also worth mentioning that the use of interior mutability can lead to more noise in the code, especially in an example as terse as the one up-thread.

              2. 2

                You can if the closure borrows a reference to the value (which is necessarily how it works in D). Sharing a mutable reference requires an explicit Cell/RefCell/UnsafeCell, though. UnsafeCell would presumably have the same semantics as in D.

                1. 2

                  Edit: Whoa, whoa, RESF, just one of you was enough.

                  Instead of being a troll about it, you might consider that we all started responding around the same time and didn’t know others had already done so. (e.g., When I clicked post, Steve’s comment wasn’t on my page.)

                  1. 1

                    Well, the RESF is pretty strong. I make one off-hand wrong comment and three of you, whether intentionally or not, jump on it. I practically never get that many comments in quick succession in Lobsters. I obviously struck a nerve by speaking a falsehood that must be corrected immediately.

                    I’m also slightly unhappy that we can’t ever talk about D without “I would like to interject for a moment, what you are referring to as D is in fact Rust or as I’ve taken to calling it, CRATE+Rust”.

                    1. 3

                      I called out the RESF effect here. Hit Twitter immediately haha. Ive been keeping an eye out since. Ive seen no evidence of an active RESF here or on HN. Just looks like a mainstream language with a lot of fans, areas of usefulness, and therefore lot of comments. I see more comments about Go than Rust.

                      And then there’s Pony. Now, that one comes across as having an evangelism team present. ;)

                      1. 1

                        that one comes across as having an evangelism team present

                        Where? :) I’d like to read more actual articles about Pony, but all I’ve seen so far are links to minor release announcements…

                        1. 3

                          It was an inside joke about the Pony fan club we have here on Lobsters. Sometimes I see more Pony articles than those for mainstream languages. They usually have plenty of detail to be interesting enough for the site. Only exceptions are release submissions. I’m against release submissions in general being on this site since people that care about that stuff will likely find the release anyway. Might as well use that slot for something that can teach us something or otherwise enjoyable.

                      2. 3

                        The OP mentions Rust, and you were talking about it too. Scanning the posts tagged with D, I see exactly one substantive discussion involving Rust other than this thread. So I’m going to have to call shenanigans.

                        Well, the RESF is pretty strong.

                        Just stop. If you have an issue, then address it head on instead passive aggressively trolling.

                        D and Rust are used to solve similar sets of problems. This invites comparisons, not just on the Rust side but on the D side too. A lot of people who haven’t used Rust get their claims mixed up or are just outright wrong. I see nothing bad about politely correcting them. That’s what I did for your comment. What do I get in exchange? Whining about syntax and some bullshit about being attacked by the RESF. Please. Give me a break.

                        Do you want to know why you don’t see me talking about D? Because I don’t know the language. I try not to talk about things that I don’t know about. And if I did, and I got something wrong, I’d hope someone would correct me, not just for me, but for anyone else who read what I said and got the wrong idea.

              1. 15

                As a junior developer doing my best to learn as much as I can, both technically and in terms of engineering maturity, I’d love to hear what some of the veterans here have found useful in their own careers for getting the most out of their jobs, projects, and time.

                Anything from specific techniques as in this post to general mindset and approach would be most welcome.

                1. 33

                  Several essentials have made a disproportionate benefit on my career. In no order:

                  • find a job with lots of flexibility and challenging work
                  • find a job where your coworkers continuously improve themselves as much (or more) than you
                  • start writing a monthly blog of things you learn and have strong opinions on
                  • learn to be political (it’ll help you stay with good challenging work). Being political isn’t slimy, it is wise. Be confident in this.
                  • read programming books/blogs and develop a strong philosophy
                  • start a habit of programming to learn for 15 minutes a day, every day
                  • come to terms with the fact that you will see a diminishing return on new programing skills, and an increasing return on “doing the correct/fastest thing” skills. (e.g. knowing what to work on, knowing what corners to cut, knowing how to communicate with business people so you only solve their problems and not just chase their imagined solutions, etc). Lean into this, and practice this skill as often as you can.

                  These have had an immense effect on my abilities. They’ve helped me navigate away from burnout and cultivated a strong intrinsic motivation that has lasted over ten years.

                  1. 5

                    Thank you for these suggestions!

                    Would you mind expanding on the ‘be political’ point? Do you mean to be involved in the ‘organizational politics’ where you work? Or in terms of advocating for your own advancement, ensuring that you properly get credit for what you work on, etc?

                    1. 13

                      Being political is all about everything that happens outside the editor. Working with people, “managing up”, figuring out the “real requirements’, those are all political.

                      Being political is always ensuring you do one-on-ones, because employees who do them are more likely to get higher raises. It’s understanding that marketing is often reality, and you are your only marketing department.

                      This doesn’t mean put anyone else down, but be your best you, and make sure decision makers know it.

                      1. 12

                        Basically, politics means having visibility in the company and making sure you’re managing your reputation and image.

                        A few more random bits:

                    2. 1

                      start a habit of programming to learn for 15 minutes a day, every day

                      Can you give an example? So many days I sit down after work or before in front of my computer. I want to do something, but my mind is like, “What should I program right now?”

                      As you can probably guess nothing gets programmed. Sigh. I’m hopeless.

                      1. 1

                        Having a plan before you sit down is crucial. If you sit and putter, you’ll not actually improve, you’ll do what’s easy.

                        I love courses and books. I also love picking a topic to research and writing about it.

                        Some of my favorite courses:

                    3. 14

                      One thing that I’ve applied in my career is that saying, “never be the smartest person in the room.” When things get too easy/routine, I try to switch roles. I’ve been lucky enough to work at a small company that grew very big, so I had the opportunity to work on a variety of things; backend services, desktop clients, mobile clients, embedded libraries. I was very scared every time I asked, because I felt like I was in over my head. I guess change is always a bit scary. But every time, it put some fun back into my job, and I learned a lot from working with people with entirely different skill sets and expertise.

                      1. 11

                        I don’t have much experience either but to me the best choice that I felt in the last year was stop worrying about how good a programmer I was and focus on how to enjoy life.

                        We have one life don’t let anxieties come into play, even if you intellectually think working more should help you.

                        1. 8

                          This isn’t exactly what you’re asking for, but, something to consider. Someone who knows how to code reasonably well and something else are more valuable than someone who just codes. You become less interchangeable, and therefore less replaceable. There’s tons of work that people who purely code don’t want to do, but find very valuable. For me, that’s documentation. I got my current job because people love having docs, but hate writing docs. I’ve never found myself without multiple options every time I’ve ever looked for work. I know someone else who did this, but it was “be fluent In Japanese.” Japanese companies love people who are bilingual with English. It made his resume stand out.

                          1. 1

                            . I got my current job because people love having docs, but hate writing docs.

                            Your greatest skill in my eyes is how you interact with people online as a community lead. You have a great style for it. Docs are certainly important, too. I’d have guessed they hired you for the first set of skills rather than docs, though. So, that’s a surprise for me. Did you use one to pivot into the other or what?

                            1. 7

                              Thanks. It’s been a long road; I used to be a pretty major asshole to be honest.

                              My job description is 100% docs. The community stuff is just a thing I do. It’s not a part of my deliverables at all. I’ve just been commenting on the internet for a very long time; I had a five digit slashdot ID, etc etc. Writing comments on tech-oriented forums is just a part of who I am at this point.

                              1. 2

                                Wow. Double unexpected. Thanks for the details. :)

                          2. 7

                            Four things:

                            1. People will remember you for your big projects (whether successful or not) as well as tiny projects that scratch an itch. Make room for the tiny fixes that are bothering everyone; the resulting lift in mood will energize the whole team. I once had a very senior engineer tell me my entire business trip to Paris was worth it because I made a one-line git fix to a CI system that was bothering the team out there. A cron job I wrote in an afternoon at an internship ended up dwarfing my ‘real’ project in terms of usefulness to the company and won me extra contract work after the internship ended.

                            2. Pay attention to the people who are effective at ‘leaving their work at work.’ The people best able to handle the persistent, creeping stress of knowledge work are the ones who transform as soon as the workday is done. It’s helpful to see this in person, especially seeing a deeply frustrated person stand up and cheerfully go “okay! That’ll have to wait for tomorrow.” Trust that your subconscious will take care of any lingering hard problems, and learn to be okay leaving a work in progress to enjoy yourself.

                            3. Having a variety of backgrounds is extremely useful for an engineering team. I studied electrical engineering in college and the resulting knowledge of probability and signal processing helped me in environments where the rest of the team had a more traditional CS background. This applies to backgrounds in fields outside engineering as well: art, history, literature, etc will give you different perspectives and abilities that you can use to your advantage. I once saw a presentation about using art critique principles to guide your code reviews. Inspiration can come from anywhere; the more viewpoints you have in your toolbelt the better.

                            4. Learn about the concept of the ‘asshole filter’ (safe for work). In a nutshell, if you give people who violate your boundaries special treatment (e.g. a coworker who texts you on your vacation to fix a noncritical problem gets their problem fixed) then you are training people to violate your boundaries. You need to make sure that people who do things ‘the right way’ (in this case, waiting for when you get back or finding someone else to fix it) get priority, so that over time people you train people to respect you and your boundaries.

                            1. 3

                              I once saw a presentation about using art critique principles to guide your code reviews. Inspiration can come from anywhere; the more viewpoints you have in your toolbelt the better.

                              The methodology from that talk is here: http://codecrit.com/methodology.html

                              I would change “If the code doesn’t work, we shouldn’t be reviewing it”. There is a place for code review of not-done work, of the form “this is the direction I’m starting to go in…what do you think”. This can save a lot of wasted effort.

                            2. 3

                              The biggest mistake I see junior (and senior) developers make is key mashing. Slow down, understand a problem, untangle the dependent systems, and don’t just guess at what the problem is. Read the code, understand it. Read the code of the underlying systems that you’re interacting with, and understand it. Only then, make an attempt at fixing the bug.

                              Stabs in the dark are easy. They may even work around problems. But clean, correct, and easy to understand fixes require understanding.

                              1. 3

                                Another thing that helps is the willingness to dig into something you’re obsessed with even if it is deemed not super important by everyone around you. eg. if you find a library / language / project you find fun and seem to get obsessed with, that’s great, keep going at it and don’t let the existential “should i be here” or other “is everyone around me doing this too / recommending this” questions slow you down. You’ll probably get on some interesting adventures.

                                1. 3

                                  Never pass up a chance to be social with your team/other coworkers. Those relationships you build can benefit you as much as your work output.

                                  (This doesn’t mean you compromise your values in any way, of course. But the social element is vitally important!)

                                1. 1

                                  This is very cool! Congrats on shipping.

                                  Using control-click to open in a new tab is broken for some reason, fixing that would be great!

                                  1. 1

                                    Thank you, and thank you for taking a look :)

                                    Odd that the control-click issue is still present. I thought I fixed it for both Ctrl and Cmd (for Macs), unfortunately I only have a Mac with me so I can’t verify the Ctrl issue. I’m checking for ctrlKey, I wonder if it isn’t true for some reason.

                                    1. 1

                                      I’m on Firefox on Windows, hm. Maybe I’ll see if I can fix the bug.

                                      1. 1

                                        So, I went to look at this today and it works perfectly now. I don’t know if anything changed, but it seems to work just fine.

                                        1. 1

                                          Wow, you have a good memory :)

                                          We did fix some IE bugs, likely was the same issue.

                                    1. 1

                                      Does this means Rust dumping a lot assembly code than C by providing some feature over the developer side?

                                      Please consider my above thought as humble question, I haven’t even write a single program in Rust but I found lots of good word about it from the community and may be in future I will give a try.

                                      But, I found that FF is fast now but taking huge memory ( > 750 MB while running with couple of tabs ) and process ( 54% of total process ) on my Pentium system. It just my thought that Rust provide good abstraction by giving an easiness way to write system code but dumping lots of code that make it huge and processor lover! Don’t consider me negative, I may wrong, but just asking you for further explore.

                                      1. 1

                                        There’s still so little Rust in Firefox compared to the whole codebase that that shouldn’t be the sole issue with something like this.

                                        In general, it should be roughly the same as C or C++, not significant more. Sometimes it’s less!

                                      1. 4

                                        Nice article. How do you feel about the size of the language? One thing that keeps me off from looking at rust seriously is the feeling that it’s more of a C++ replacement (kitchen & sink) vs a C replacement.

                                        The Option example feels a bit dropped off too early, you started by showing an example that fails and then jumped to a different code snippet to show nicer compiler error messages without ever going back and showing how the error path is handled with the Option type.

                                        You should also add Ada to the list of your languages to explore, you will be surprised how many of the things you found nice or interesting were already done in the past (nice compiler errors, infinite loop semantics, very rich type system, high level language yet with full bare metal control).

                                        1. 2

                                          Thank you for commenting! I agree that Rust’s standard library feels as big as C++‘s, but I haven’t been too bothered by the size of either one. To quote Bjarne Stroustrup’s “Foundations of C++” paper, “C++ implementations obey the zero-overhead principle: What you don’t use, you don’t pay for [BS94]. And further: What you do use, you couldn’t hand code any better.” I haven’t personally noticed any drawbacks of having a larger standard library (aside from perhaps binary size constraints, but you would probably end up including a similar amount of code anyway, just code that you wrote yourself), and in addition to the performance of standards-grade implementations of common data structures, my take on it is that having a standardized interface to them improves readability quite a bit - when you go off to look through a codebase, the semantics of something like a hashmap shouldn’t be surprising. It’s a minor draw, but I feel like I have to learn a new hash map interface whenever I go off to grok a new C codebase.

                                          I’ll definitely take a look at Ada, seems like a very promising language. Do you have any recommendations for books? I think my friend has a copy of John Barnes’ Programming in Ada 2012 I can borrow, but I’m wondering if there’s anything else worth reading.

                                          Also, thank you for pointing out the issue with the Option example, I’ll make an edit to the post at some point today.

                                          1. 5

                                            It’s funny how perspectives change; to C and JavaScript people, we have a huge standard library, but to Python, Ruby, Java, and Go people, our standard library is minuscule.

                                            1. 2

                                              I remember when someone in the D community proposed to include a basic web server in the standard library. Paraphrased:

                                              “Hell no, are you crazy? A web server is a huge complex thing.”

                                              “Why not? Python has one and it is useful.”

                                            2. 2

                                              What you don’t use, you don’t pay for [BS94]

                                              That is true however you have little impact on what others use. Those features will leak into your code via libraries or team mates using features you might not want. Additionally when speaking about kitchen & sink I didn’t only mean the standard library, the language itself is much larger than C.

                                              I think my friend has a copy of John Barnes’ Programming in Ada 2012 I can borrow, but I’m wondering if there’s anything else worth reading.

                                              Last I did anything related to Ada was somewhere around 2012. I recall the Barnes books were well regarded but I don’t know if that changed in any significant way.

                                              For casual reading the Ada Gems from Adacore are fun & informing reads.

                                              1. 2

                                                I’ll definitely take a look at Ada, seems like a very promising language. Do you have any recommendations for books? I think my friend has a copy of John Barnes’ Programming in Ada 2012 I can borrow, but I’m wondering if there’s anything else worth reading.

                                                I recommend Building High Integrity Applications in SPARK. It covers enough Ada to get you into the meat of SPARK (the compile time proving part of Ada) and goes through a lot of safety features that will look familiar after looking at Rust. I wrote an article converting one of the examples to ATS in Capturing Program Invariants in ATS. You’ll probably find yourself thinking “How can I do that in Rust” as you read the book.

                                            1. 6

                                              All these points mentioned in the post are also applied to C except latest language standard revision. Also, C have C11.

                                              Why I am pointing out C? Because I am still not fan of C++ syntax.

                                              1. 5

                                                I think it is a stretch to say C is in active development. It is at best in maintenance mode.

                                                C++ is in active development.

                                                1. 11

                                                  It looks like C is on track to possibly get a new published standard around 2021/2022. It also seems to me that C has always been a significantly simpler language than C++. Where C++ is getting everything and the kitchen sink, making an already complex language even more complex, C has less to change and therefore changes less frequently.

                                                  1. 9

                                                    One barrier here is that Microsoft has seemingly decided to stop working on C compatibility with MSVC; it doesn’t even fully support C99 yet, let alone C11. A new standard doesn’t matter much if one of the largest platforms in the world won’t support it.

                                                    1. 2

                                                      A new standard doesn’t matter much if one of the largest platforms in the world won’t support it.

                                                      These days I would not be much surprised if Microsoft would replace MSVC with clang or even GCC.

                                                      1. 4

                                                        Why? My impression is that the MSVC compiler is quite good. I only use the linker daily, not the compiler itself, but especially recently, I’ve only heard good things. Very different than ten or even five years ago.

                                                        1. 2

                                                          Why?

                                                          A project manager making their numbers look better on the compiler side by using less programmers and moving at higher velocity. The reason: clang or GCC are doing most of that work now with MSVC a front end for them.

                                                          1. 1

                                                            I’m sorry, I’m finding this reply really hard to parse.

                                                            Are you saying, people will move compilers because they want to use the new standard, which brings benefits?

                                                            And what’s this about MSVC being a front-end for Clang?

                                                            1. 3

                                                              You asked why Microsoft would ditch their proprietary compiler that they pay to maintain in favor of a possibly-better one others maintain and improve. I offered cost cutting or possibly-better aspects as reasons that a Microsoft manager might cite for a move. Business reasons for doing something should always be considered if wondering what business people might do.

                                                              Far as front end part, that was just speculation about how they might keep some MSVC properties if they swapped it out for a different compiler. I’ve been off MSVC for a long time but I’d imagine there’s features in there their code might rely on which GCC or Clang might not have. If so, they can front end that stuff into whatever other compiler can handle. If not and purely portable code, then they don’t need a front end at all.

                                                              1. 3

                                                                Ah, ah, yes. Sorry. Makes perfect sense now.

                                              1. 8

                                                Glad you liked TRPL! I agree that some of the examples can be too abstract at times, it’s tough. Totally open issues if you want to talk about it; I’m open to improving things, but I’m also pretty particular about the book.

                                                1. 1

                                                  Glad to hear confirmation that the book is open to those kinds of suggestions :) And I can totally understand being particular about something like that, hopefully I’ll be able to offer some analogies that are up to snuff

                                                1. 2

                                                  Personally I think these small language are much more exciting than big oil tankers like Rust or Swift.

                                                  I’m not familiar with either of those languages, but any idea what the author means by this? I thought Rust has been picking up quite a bit recently.

                                                  1. 10

                                                    I understood the author to be talking about the “size” of the language, not the degree of adoption.

                                                    I’m not sure that I personally agree that C is a small language, but many do belive that.

                                                    1. 3

                                                      Your involvement with rust will bias your opinion - rust team hat would be appropriate here :)

                                                      1. 11

                                                        He is right though. C’s execution model may be conceptually simple but you may need to sweat the implementation details of it, depending on what you’re doing. This doesn’t make C bad, it just raises the bar.

                                                        1. 9

                                                          I had that opinion before Rust, and I’m certainly not speaking on behalf of the Rust team, so in my understanding, the hat is very inappropriate.

                                                          (I’m also not making any claims about Rust’s size, in absolute terms nor relative to C)

                                                          1. 4

                                                            Or you can just test his claim with numbers. A full, C semantics is huge compared to something like Oberon whose grammar fits on a page or two. Forth is simpler, too. Whereas, Ada and Rust are complicated as can be.

                                                            1. 5

                                                              I agree that there are languages considerably smaller than C. In my view, there is a small and simple core to C that is unfortunately complicated by some gnarly details and feature creep. I’ve expressed a desire for a “better C” that does all we want from C without all the crap, and I sincerely believe we could make such a thing by taking C, stripping stuff and fixing some unfortunate design choices. The result should be the small and simple core I see in C.

                                                              When comparing the complexity of languages, I prefer to ignore syntax (focusing on that is kinda like bickering about style; yeah I have my own style too, and I generally prefer simpler syntax). I also prefer to ignore the standard library. What I would focus on is the language semantics as well as the burden they place on implementation. I would also weigh languages against the features they provide; otherwise we’re talking apples vs oranges where one language simply makes one thing impossible or you have to “invent” that thing outside the language spec. It may look simpler to only present a floating 64-bit point numeric type, but that only increases complexity when people actually need to deal with 64-bit integers and hardware registers.

                                                              That brings us to Oberon. Yes, the spec is short. I guess that’s mostly not because it has simple semantics, but because it lacks semantics. What is the range of integer types? Are they bignums, and if so, what happens you run out of memory trying to perform multiplication? Perhaps they have a fixed range. If so, what happens when you overflow? What happens if you divide by zero? And what happens when you dereference nil? No focking idea.

                                                              The “spec” is one for a toy language. That is why it is so short. How long would it grow if it were properly specified? Of course you could decide that everything the spec doesn’t cover is undefined and maybe results in program termination. That would make it impossible to write robust programs that can deal with implementation limitations in varying environments (unless you have perfect static analysis). See my point about apples vs oranges.

                                                              So the deeper question I have is: how small can you make a language with

                                                              1. a spec that isn’t a toy spec
                                                              2. not simply shifting complexity to the user
                                                              3. enough of the same facilities we have in C so that we can interface with the hardware as well as write robust programs in the face of limited & changing system resources

                                                              Scheme, Oberon, PostScript, Brainfuck, etc. don’t really give us any data points in that direction.

                                                              1. 5

                                                                So the deeper question I have is: how small can you make a language with

                                                                1. a spec that isn’t a toy spec
                                                                2. not simply shifting complexity to the user
                                                                3. enough of the same facilities we have in C so that we can interface with the hardware as well as write robust programs in the face of limited & changing system resources

                                                                Scheme, Oberon, PostScript, Brainfuck, etc. don’t really give us any data points in that direction.

                                                                Good question. There are few languages with official standards (sorted by page count) that are also used in practice (well.. maybe not scheme ;>):

                                                                1. Scheme r7rs - 88 pages - seems to be only language without useful standard library
                                                                2. Ruby 1.8 - 341 pages
                                                                3. Ada 95 - 582 pages
                                                                4. Fortran 2008 - 621 pages - seems to be only language without useful standard library
                                                                5. C11 - 701 pages
                                                                6. EcmaScript - 885 pages
                                                                7. Common Lisp - 1356 pages
                                                                8. C++17 - 1623 pages

                                                                I know that page count is poor metric, but it looks like ~600 pages should be enough :)

                                                                1. 3

                                                                  Here are the page counts for a few other programming language standards:

                                                                  1. PL/I General purpose subset 443 pages
                                                                  2. Modula-2 800 pages - base - 707 pages, generics - 45 pages, objects - 48 pages
                                                                  3. Ada 2012 832 pages
                                                                  4. Eiffel 172 pages
                                                                  5. ISO Pascal 78 pages
                                                                  6. Jovial J73 168 pages
                                                                  1. 2

                                                                    I know that page count is poor metric, but it looks like ~600 pages should be enough :)

                                                                    Given that N1256 is 552 pages, yeah, without a doubt.. :-)

                                                                    The language proper, if we cut it off starting at “future language directions” (then followed by standard library, appendices, index, etc.) is only some 170 pages. It’s not big, but I’m sure it could be made smaller.

                                                                  2. 2

                                                                    I’ve expressed a desire for a “better C” that does all we want from C without all the crap, and I sincerely believe we could make such a thing by taking C, stripping stuff and fixing some unfortunate design choices. The result should be the small and simple core I see in C.

                                                                    That might be worth you writing up with hypothetical design. I was exploring that space as part of bootstrapping for C compilers. My design idea actually started with x86 assembler trying to design a few, high-level operations that map over it which also work on RISC CPU’s. Expressions, 64-bit scalar type, 64-bit array type, variables, stack ops, heap ops, expressions, conditionals, goto, and Scheme-like macros. Everything else should be expressable in terms of the basics with the macros or compiler extensions. The common stuff gets a custom, optimized implementation to avoid macro overhead.

                                                                    “ What I would focus on is the language semantics as well as the burden they place on implementation. “

                                                                    Interesting you arrived at that since some others and I talking verification are convinced a language design should evolve with a formal spec for that reason. It could be as simple as Abstract, State Machines or as complex as Isabelle/HOL. The point is the feature is described precisely in terms of what it does and its interaction with other features. If one can’t describe that precisely, how the hell is a complicated program using those same features going to be easy to understand or predict? As an additional example, adding a “simple, local change” show unexpected interactions or state explosion once you run the model somehow. Maybe not so simple or local after all but it isn’t always evident if just talking in vague English about the language. I was going to prototype the concept with Oberon, too, since it’s so small and easy to understand.

                                                                    “but because it lacks semantics.”

                                                                    I didn’t think about that. You have a good point. Might be worth formalizing some of the details to see what happens. Might get messier as we formalize. Hmm.

                                                                    “So the deeper question I have is: how small can you make a language with”

                                                                    I think we have answers to some of that but they’re in pieces across projects. They haven’t been integrated into the view you’re looking for. You’ve definitely given me something to think about if I attempt a C-like design. :)

                                                            2. 4

                                                              He also says that the issues with memory-safety in C are overrated, so take it with a grain of salt.

                                                              1. 13

                                                                He is not claiming that memory safety in general is not an issue in C. What he is saying is that in his own projects he was able to limit or completely eliminate dynamic memory allocation:

                                                                In the 32 kloc of C code I’ve written since last August, there are only 13 calls to malloc overall, all in the sokol_gfx.h header, and 10 of those calls happen in the sokol-gfx initialization function

                                                                The entire 8-bit emulator code (chip headers, tests and examples, about 12 kloc) doesn’t have a single call to malloc or free.

                                                                That actually sounds like someone who understands that memory safety is very hard and important.

                                                                1. 3

                                                                  Not at all the vibe I got from it.

                                                                2. 4

                                                                  I’m not familiar with either of those languages, but any idea what the author means by this?

                                                                  I’m also way more interested in Zig than I am in Rust.

                                                                  What I think he’s saying is that the two “big” languages are overhyped and have gained disproportionate attention for what they offer, compared to some of the smaller projects that don’t hit HN/Lobsters headlines regularly.

                                                                  Or maybe it’s a statement w.r.t. size and scope. I don’t know Swift well enough to say if it counts as big. But Rust looks like “Rubyists reinvented C++ and claim it to be a replacement for C.” I feel that people who prefer C are into things that small and simple. C++ is a behemoth. When your ideal replacement for C would also be small and simple, perhaps even more so than C itself, Rust starts to seem more and more like an oil tanker as it goes the C++ way.

                                                                  1. 3

                                                                    I agree with your point on attention. I just wanted to say maybe we should get a bit more credit here:

                                                                    “compared to some of the smaller projects that don’t hit HN/Lobsters headlines regularly.”

                                                                    Maybe HN but Lobsters covers plenty oddball languages. Sometimes with good discussions, too. We had authors of them in it for a few. I’ve stayed digging them up to keep fresh ideas on the site.

                                                                    So, we’re doing better here than most forums on that. :)

                                                                    1. 2

                                                                      Sure! Lobsters is where I first learned about Zig. :-)

                                                                1. 6

                                                                  Yes, strict aliasing was a mistake. While Rust memory model is in development, it is generally agreed that Rust will have no strict aliasing.

                                                                  1. 1

                                                                    I didn’t think Rust had any way of creating aliasing pointers/references that weren’t of the same type (except perhaps via “unsafe” code) which makes the “has strict aliasing / has no strict aliasing” decision somewhat redundant. Do you mean that pointers generated via unsafe code are always assumed to be able to alias any other pointer, even of another type?

                                                                    1. 3

                                                                      Yes. Unsafe Rust is part of Rust. More contentious is whether pointers are integers. Tentatively they are not, just as in C.

                                                                      1. 1

                                                                        I’m not questioning whether unsafe Rust is part of Rust. I’m questioning whether aliasing pointers with different types and dereferencing them will always give defined behaviour. (And maybe it will; but it seems an odd decision to make, seeing as Rust is generally ok with unsafe code producing being able to produce undefined behaviour, and this doesn’t seem like a worthwhile behaviour to define).

                                                                        1. 1

                                                                          Everyone that I know of is against TBAA. I don’t know enough about the details to tell you why, but /u/sanxiyn is correct.

                                                                          And maybe it will; but it seems an odd decision to make, seeing as Rust is generally ok with unsafe code producing being able to produce undefined behaviour,

                                                                          This is true and not true, that is, UB has a cost, in that it’s a footgun. If you don’t get much optimization benefit, then you’re introducing a footgun for no benefit. One of our goals for the unsafe code guidelines is that they will not require large swaths of already existing unsafe code to be unwritten.

                                                                          1. 1

                                                                            Everyone that I know of is against TBAA.

                                                                            You can consider that untrue as of now. :)

                                                                            I don’t know enough about the details to tell you why, but /u/sanxiyn is correct

                                                                            Ok, thanks. Interesting to know.

                                                                            1. 1

                                                                              I meant, the people inside of Rust. Otherwise that’d be a hell of a statement :)

                                                                  1. 5

                                                                    Congratulations to Lua, Zig, and Rust on being in C’s territory. Lua actually beat it. Nim and D are nearly where C++ is but not quite. Hope Nim closes that gap and any others given its benefits over C++, esp readability and compiling to C.

                                                                    1. 1

                                                                      To be clear, and a little pedantic, Lua =/= Luajit.

                                                                      1. 1

                                                                        The only thing I know about Lua is it’s a small, embeddable, JIT’d, scripting language. So, what did you mean by that? Do Lua the language and LuaJIT have separate FFI’s or something?

                                                                        1. 5

                                                                          I think just that there are two implementations. One is just called “Lua”, is an interpreter written in C, supposedly runs pretty fast for a bytecode interpreter. The other is LuaJIT and runs much faster (and is the one benchmarked here).

                                                                          1. 1

                                                                            I didn’t even know that. Things I read on it made me think LuaJIT was the default version everyone was using. Thanks!

                                                                              1. 2

                                                                                I waited till I was having a cup of coffee. Wow, this is some impressive stuff. More than I had assumed. There’s a lot of reuse/blending of structures and space. I’m bookmarking the links in case I can use these techniques later.

                                                                              2. 2

                                                                                I think people when doing comparative benchmarks very often skip over the C Lua implementation because it isn’t so interesting to them.

                                                                            1. 4

                                                                              Extra context: LuaJIT isn’t up to date with the latest Lia either, so they’re almost different things, sorta.

                                                                              LuaJIT is extremely impressive.

                                                                        1. 20

                                                                          sigh

                                                                          So, this has already sparked a discussion about taste, freedom of speech, the whole thing.

                                                                          The joke in question is bad, very bad. It’s plain unfitting, and it isn’t even remotely funny. It’s US-centric. RMS, the person making and subsequently claiming it, has a history of making sexual and other inappropriate commentary (e.g. arguing eugenics). His quoted comment about child birth is another example of RMS speaking about things he probably doesn’t have a very qualified opinion on. Most (all?) of the people mentioned in the article discussing the issue will never be affected by this in the real world. Seriously, I expect one of those people to stand up and say “You know what? We aren’t even the right group to discuss that in!”.

                                                                          And this is the issue he pulls his authority card? Seriously? For a bad joke that was already shit in the 90s? That - even ignoring the punchline being terrible - just plain isn’t funny? Which boundary does that cross? Probably his egos.

                                                                          Seriously, this is a tech manual. This is the place where you can finally have your “let’s just talk tech her”. And there, this discussion comes up?

                                                                          1. 17

                                                                            The thing I find weird is the clear generational gap in Internet users that mean that people end up talking past each other.

                                                                            For older people who grew up thinking that Sendmail m4 macros were somehow intuitive, and that C was the new hotness, this is not a joke about abortion. It’s about censorship. That’s the hill RMS thinks he’s dying on. Removing the joke is at the risk of putting words in his mouth, censoring the manual.

                                                                            Of course, the younger people who live in a world where Javascript isn’t ridiculous to use on a server, where everything-as-a-service is the norm demand takedowns of things outside of their overton window. To them, it’s a matter of not having a frankly disgusting joke about the very real problems of abortion in the US in a technical manual that has nothing to do with those problems. They don’t understand the culture in which GNU was founded, they believe that it is RMS’ job to change to fit with their culture.

                                                                            This is what happens when an unstoppable force meets an immovable object. I’m just not sure who plays which part here. There is a reasonable answer, and the good news for the kids is that this has happened before several times: fork glibc. Fork it to remove RMS’ influence from the project and fork it to remove the offending text (for people that want it removed).

                                                                            1. 17

                                                                              Even as a commentary about censorship, it’s pretty freaking oblique. It should be removed on the technical grounds that it’s inefficient GNU crap.

                                                                              1. 2

                                                                                Stallman is pretty freaking oblique at the best of times when it comes to his sense of humour. Saying that GNU is full of inefficient crap is like saying that water is wet, or that the Linux kernel is a bug-ridden dumpster fire.

                                                                                If every GNU inefficiency was removed, it’d be BSD.

                                                                                1. -1

                                                                                  It should be removed on the technical grounds that it’s inefficient GNU crap.

                                                                                  Nobody force you to use GNU crap.

                                                                                  But GNU is and have always been openly political.

                                                                                  You are free to use software that is apparently neutral. if you don’t like it.
                                                                                  And you have plenty of choice on the market: Microsoft, Apple, Google… all are pretty ready to serve your needs (and collect your data for whatever purpose, and lobbying for DRM and so on../)

                                                                                  But “as a commentary about censorship”, that joke is perfectly fine.

                                                                                  1. 6

                                                                                    Nobody force you to use GNU crap.

                                                                                    The fact that you are saying this to tedu (an OpenBSD developer) is kind of funny.

                                                                                    1. 5

                                                                                      I’m fine with GNU being a political project. Indeed, I actively advocate for projects to make their mind up.

                                                                                      But “as a commentary about censorship”, that joke is perfectly fine.

                                                                                      A lot of the project itself does not seem to agree, especially in the context of having it in the documentation. Except RMS, who pulls rank over a joke that he himself made. Which makes the GNU project his personal opinion/joke vehicle.

                                                                                      1. 3

                                                                                        Except RMS, who pulls rank over a joke that he himself made. Which makes the GNU project his personal opinion/joke vehicle.

                                                                                        I don’t see the point you’re making here? The GNU project was always an expression of political views that were, originally, personal to RMS. If the project ran by majority consensus it would have given up on the whole free software thing a long time ago.

                                                                                        1. -3

                                                                                          Using your “Rust Community Team” hat here is crass, and only reinforces some people’s beliefs (myself included) about these types of thought police organizations.

                                                                                          I sure hope the non-“Rust Community Team” people show less virtue signalling. It puts your project under a terrible spotlight.

                                                                                          1. 5

                                                                                            FWIW, I find the use of the hat inappropriate here as well.

                                                                                            That being said, as discussed below, I think it depends on what you think the hat means, exactly. It seems Florian uses the hat differently than many here might expect.

                                                                                  2. 7
                                                                                    1. I think the joke is funny. It’s even more funny now.
                                                                                    2. RMS’s character has no bearing on the legitimacy of the joke.
                                                                                    3. You don’t need to be qualified to have an opinion.
                                                                                    4. Any group can discuss any topic, there is no “right” group.
                                                                                    5. RMS is the benevolent dictator of GNU, and as such has the authority to veto decisions in rare situations like these.
                                                                                    1. 10

                                                                                      Be that as it may, when the people who have written the code (glibc was originally written by someone else (not RMS), and Ulrich Drepper is now responsible for something like 70% of the code) and make it all work ask you to back off, it’s a stupid hill to die on. Yeah, you might win the battle, but you’ll lose the war.

                                                                                      Last time something like this happened, everyone switched to using eglibc and it wasn’t until the RMS-mandated steering committee was dissolved that people switched back to glibc. If RMS decides to be a jerk about things, watch everyone fork it again or sink their resources into musl.

                                                                                      There’s being right, and there’s being so egotistical that you burn down the house because you didn’t get your way.

                                                                                      1. 4

                                                                                        He has veto power for precisely these cases where “everyone else” disagrees, so I don’t think it’s a stupid hill to die on. In any case, I agree with you, RMS will lose this war, this is just the beginning.

                                                                                        1. 15

                                                                                          Vetoing the removal of a little-used architecture with heavy maintenance burden because they want to support those few users is a good hill to die on. Vetoing the removal of a joke that everyone else wants to remove from the manual and doesn’t in any way affect the operation of the library is a stupid hill to die on.

                                                                                          1. 3

                                                                                            That’s in your opinion. If you care the culture of your project not taking itself so seriously, I think it’s a good hill to die on.

                                                                                    2. 5

                                                                                      As a participant in Rust Community and a proponent of eugenics, your use of Rust Community Team hat makes me uncomfortable. Was it necessary? Are you really speaking for Rust Community Team here? I hope my eugenics advocacy won’t affect my Rust participation.

                                                                                      As for the joke, the joke is clearly about censorship and not about abortion. I think attempt to censor the joke makes it more relevant.

                                                                                      1. 2

                                                                                        As for the joke, the joke is clearly about censorship and not about abortion.

                                                                                        Jokes, by their nature, are not clear and subject to cultural background and education. In my opinion, it’s a bit condescending to claim that it has universal understanding and appeal.

                                                                                        I think attempt to censor the joke makes it more relevant.

                                                                                        The origin of the patch seems to be the person just didn’t think it relayed any meaningful information to a user of the function. I don’t think that falls into common usage of “censorship”.

                                                                                        1. -2

                                                                                          I don’t think that falls into common usage of “censorship”.

                                                                                          Yes, and I have yet to see a documentation patch forced on a project by a state.

                                                                                          1. 2

                                                                                            Censorship exists only when done by the state??

                                                                                        2. 1

                                                                                          On FOSS social issues, I generally put the hat on here. As my work for the Rust project is social, judging which of these issues I should put the hat on would only lead to problems. I’m fine with people knowing my affiliation and I think it’s more honest for people to know it. I don’t speak for the team, but I am a member of the team.

                                                                                          On Eugenics: it’s, in my view, an only thinly veiled form of Ableism, and as such opposed to the goal of being inclusive, especially also to people with disability. Many forms fundamentally attack the right to live of people with disabilities, for example by arguing for their abortion.

                                                                                          Just to be clear on which comment by RMS I’m referring to (on people with Trisomy 21):

                                                                                          If you’d like to love and care for a pet that doesn’t have normal human mental capacity, don’t create a handicapped human being to be your pet. Get a dog or a parrot…

                                                                                          If you want to support that comment, go ahead.

                                                                                          1. 3

                                                                                            I support the idea behind the comment. Given medical acceptance of prenatal screening of trisomy 21, this is one of less extreme among RMS’s positions.

                                                                                            I agree the expression of the idea in the comment you quoted leaves a lot to be desired.

                                                                                            1. -1

                                                                                              Prenatal screening of trisomy 21 are generally accepted as a way to increase survival chances for the fetus.
                                                                                              Trisomy 21 increases the risk of heart issues at birth, that can be handled in the proper structure, but would lead to secure death if not addressed promptly.

                                                                                              Some people use it for eugenetics (usually with amniocentesis, that kills 1 healthy children out of 200 if I remember correctly).

                                                                                              Now, IMO what RMS means is horrible, disgusting and plain dangerous.
                                                                                              But it’s not related to freedom. And he has the right to think (and say) it.

                                                                                              1. 1

                                                                                                Prenatal screening of trisomy 21 are generally accepted as a way to increase survival chances for the fetus.

                                                                                                Do you have a citation for your “generally accepted” claim? There appears to be at least some evidence to the contrary:

                                                                                                About 92% of pregnancies in Europe with a diagnosis of Down syndrome are terminated.[14] In the United States, termination rates are around 67%, but this rate varied from 61% to 93% among different populations.[13] Rates are lower among women who are younger and have decreased over time.[13] When nonpregnant people are asked if they would have a termination if their fetus tested positive, 23–33% said yes, when high-risk pregnant women were asked, 46–86% said yes, and when women who screened positive are asked, 89–97% say yes.[75]

                                                                                                https://en.wikipedia.org/wiki/Down_syndrome#Abortion_rates

                                                                                                1. 0

                                                                                                  This is entirely offtopic here, but I don’t want to flee the question.

                                                                                                  My source is my doctor, that incidentally is also my wife.
                                                                                                  When the prenatal screening of our second daughter established 1/350 probability of a Down syndrome, she explained me about amniocentesis, about the risks for the fetus and about the implications and the medical reasoning beyond it. It’s a complex topic and I’m not competent enough to expose it here deeply, but the relevant point was that, while several doctors object to abortion as a murder in contrast with their oath and ethics, prenatal screening is designed to increase the survival of the fetus, so every doctor is fine with it.

                                                                                            2. 1

                                                                                              On FOSS social issues, I generally put the hat on here. As my work for the Rust project is social, judging which of these issues I should put the hat on would only lead to problems. I’m fine with people knowing my affiliation and I think it’s more honest for people to know it. I don’t speak for the team, but I am a member of the team.

                                                                                              While I do not agree with you on the “joke on documentation” issue, I really support this approach.

                                                                                              Hacking is a ethical and political action.

                                                                                            3. -1

                                                                                              I hope my eugenics advocacy won’t affect my Rust participation.

                                                                                              If that’s what you think that means, and you advocate for any intelligence-based eugenics, you might want to reconsider your position on eugenics.

                                                                                              This obviously would only affect you if you attempted to add eugenics commentary to the Rust project itself in some way. Same as if you attempted to add any other irrelevant polarizing commentary.

                                                                                              1. 1

                                                                                                I don’t talk eugenics on Rust space. Not because eugenics is wrong (it isn’t), but because it’s off-topic.

                                                                                                1. 2

                                                                                                  it’s off-topic

                                                                                                  Yes. And it’s also off-topic for glibc.

                                                                                                  1. 0

                                                                                                    No, it isn’t. By definition.

                                                                                                    You might not agree with GNU or with rms here, or you might prefer that glibc would not be a GNU project, but it is.

                                                                                                    1. 2

                                                                                                      Fine. But the consensus of the primary maintainers is that it’s off-topic. Therefore it’s off-topic for whatever fork of glibc everyone ends up using. Because if we get another eglibc situation, everyone will use the fork maintained by the maintainers, and no one will use the fork “maintained” by rms.

                                                                                                      It’s de facto off-topic for those who accept reality.

                                                                                                      1. 0

                                                                                                        Anyone who “accepts reality” in that sense wouldn’t be contributing to GNU in the first place. The project has always been about RMS telling the rest of the world they’re wrong.

                                                                                                        1. 1

                                                                                                          See eglibc. A non-GNU fork already happened, and was reintegrated when the issue was dropped.

                                                                                                          I don’t see how you can say that those kind of people wouldn’t be contributing to GNU, when they clearly are and that’s what this is all about. If those kind of people wouldn’t be contributing to GNU, then why is there any debate?

                                                                                                          1. 1

                                                                                                            There is debate precisely because the people contributing don’t subscribe to your notion that the primary maintainer consensus is all that matters. glibc contributors do care about GNU and RMS, otherwise the eglibc-style fork would already have happened and the project would now be being maintained outside the GNU umbrella.

                                                                                          1. 4

                                                                                            I enjoyed this post. The before after graphs are great. It seems like a fairly good review of what newcomers can expect from using Rust in production. Particularly the Pros and Cons at the end. Although the bit on error handling felt a bit off. The failure crate they mention is the correct solution to their problem and has been promoted the official rust-lang-nursery organisation. The Rust community probably should make that information easier to discover though.

                                                                                            1. 3

                                                                                              The Rust community probably should make that information easier to discover though.

                                                                                              We will when it’s ready; it’s just not quite there yet.

                                                                                              1. 2

                                                                                                I recently ran into the need for the failure crate, and it felt like I was doing something wrong, because failure type is not specific and it relied on an “external” crate.

                                                                                              1. 2

                                                                                                Very cool. I wonder if once WebAssembly matures will browser let it interact with the DOM directly instead of through a JS API.

                                                                                                1. 3

                                                                                                  Yes, that’s in the works as one of the most desired feature, it’s called the “host bindings proposal.”

                                                                                                  1. 1

                                                                                                    Thank you for the name. I hadn’t ever heard anyone ever give the specific proposal name before. It’s much appreciated.

                                                                                                    1. 1

                                                                                                      No problem! One related bit of info: originally, it was thought that GC support would have to come first, but with host bindings, GC isn’t necessary. So that upped the possible timeline quite a bit!

                                                                                                  2. 1

                                                                                                    See also wasm-bindgen. Should ve mentioned in the blog post.

                                                                                                  1. 1

                                                                                                    Is it just me, or does the interactive demo they posted look very similar to VS Code?

                                                                                                    1. 2

                                                                                                      That’s because both are built with https://github.com/Microsoft/monaco-editor

                                                                                                    1. 25

                                                                                                      Why do people overthink this? Versions are for human consumption. If I use x.y.z and x.y.z+1 comes out, my expectation is that I should be able to upgrade (if I need to) with minimum friction. Sometimes (rarely!) this is not the case. Tough life.

                                                                                                      Similarly I expect I should be able to upgrade to x.y+1.zz, but in this case I expect there might be more work involved, more testing, etc. In general, it should still work though. If not, tough life.

                                                                                                      I fully expect moving to x+1.yy.zz would be painful. Sometimes it isn’t though. Life is great.

                                                                                                      What’s the problem? The version communicates information to me. Like every other communication, sometimes it’s not perfectly accurate. So what? it’s news, not math.

                                                                                                      It seems that people who complain about this are the people who want to upgrade without testing. That is insane. You always need to test. You can’t trust that it will work because some guy who doesn’t know how you use the software promised you that it will work. No, he promised it should work. There are no guarantees. You always need to test.

                                                                                                      1. 5

                                                                                                        You are missing one final thing. I expect to be able to install X and X+1 side by side in whatever system. So many things seem to miss that, at least vgo gets that right.

                                                                                                        1. 2

                                                                                                          Yes, unfortunately almost every package manager gets this wrong.

                                                                                                          1. 3

                                                                                                            In a lot of cases it’s not the package manager’s fault; it’s the way the language does module loading. npm gets this right but the only reason it’s able to is because Node’s module loading algorithm supports (was designed to support?) this usecase.

                                                                                                            1. 1

                                                                                                              They were written at the same time by the same person, so yes, “designed” is appropriate.

                                                                                                              1. 1

                                                                                                                Do you mean require() and npm? I don’t think that’s right. I’m just assuming require() was Ryan Dahl in the very beginning of Node (docs say 0.1.13). And npm was by Isaac Schlueter, quite a while after that. People used to share Node modules on the Node GitHub wiki, and IIRC (though I wasn’t there, I just know from reading) npm was one of several package managers at the time.

                                                                                                                1. 2

                                                                                                                  I was told that Isaac implemented both; it’s possible that I was misinformed, or maybe it was re-implemented by him.

                                                                                                            2. 1

                                                                                                              Package managers that allow side-by-side global installs that I can think of:

                                                                                                              • gem / bundler
                                                                                                              • maven
                                                                                                              • homebrew
                                                                                                              • nix

                                                                                                              They all require special tools to choose which version you want to use though. Are there any others? Are there any without that requirement?

                                                                                                          2. 1

                                                                                                            After accepting that every upstream change can break our code the next step is to accept that additional “level of probability” communicated by those dotted numbers are useless: they don’t affect your behavior as a maintainer, you still have to a) read and understand what changed and b) update and test your system. Which means that a single number would do just nice.

                                                                                                            I can speculate that semver became popular because of people who want to be trendy by “living on the bleeding edge” but still want some escape hatch that would “allow” them to not really read and understand all change logs of all those dozens of dependencies changing daily. So they like semver because if anything breaks after a minor version change, they can say it’s not their fault.

                                                                                                            1. 1

                                                                                                              It seems that people who complain about this are the people who want to upgrade without testing.

                                                                                                              Unfortunately, I’ve found that most people setup their package dependencies in whatever system to take X.*.*, so you automatically get updates between builds. That isn’t necessarily a fault of semver but it is what semver is selling.

                                                                                                              1. 2

                                                                                                                To clarify, when you say lots of people set things up this way, you’re not counting people who use lockfiles, correct?

                                                                                                                1. 2

                                                                                                                  I guess not since I have experienced this fairly often.

                                                                                                                2. 1

                                                                                                                  Why is this unfortunate? Due to lacking test between builds and shoddy upgrade procedures and builds that don’t lock down versions when the tests pass?

                                                                                                                  Kinda like what @4ad said, it’s as if people expect this to solve world hunger when it should be regarded as a canned food in your pantry.

                                                                                                                  1. 0

                                                                                                                    Assuming no locks, the biggest problem is that it means what you built and what I built are not guaranteed to be the same thing. So reproducible builds are out. It also means if you have a bug and I don’t, we don’t know why.

                                                                                                                    IME, semantic versioning has not helped me upgrade dependencies. I have to test the new update no matter what, despite the SemVer spec using words like MUST when it defines what things mean. And people fuck up their SemVers enough that backwards compatible changes end up not being backward compatible. So are we better off with SemVer than just some incrementing release number? I’m not really convinced the complexity of SemVer is really bringing a lot of value other than making us all feel like we elegantly solved a problem.

                                                                                                              1. 2

                                                                                                                how long till we go full circle and have “web apps” that just use our normal os.

                                                                                                                1. 3

                                                                                                                  You know that isn’t going to happen. ;) You can make Oberon or Smalltalk your normal OS followed by using them for web apps. Amber Smalltalk in davidedc’s related work comes to mind. Then, you’ve cheated your way into web apps that use your normal OS.

                                                                                                                  1. 3

                                                                                                                    Related but slightly different, https://github.com/nebulet

                                                                                                                  1. 3

                                                                                                                    I don’t know if this page of the rustc guide fits what you’re talking about or not https://rust-lang-nursery.github.io/rustc-guide/high-level-overview.html

                                                                                                                    Otherwise, consider this post the opposite: we have a whole book these days!

                                                                                                                    1. 2

                                                                                                                      Right that’s describing the information I want in words – but I want the code to look like the words! The code should be a high level outline of the compiler, IMO (links in the Reddit post).

                                                                                                                      I mentioned I would like to write a blog post about this, which would require looking at open source compilers, and rustc would be a good one. If it has the “skeleton” or “driver” in one place, I’d love to see it.

                                                                                                                      I did look at the old OCaml Rust compiler, and as far as I remember it had fe/, me/, be/, but I don’t know if it glued the whole thing together in 100 lines.

                                                                                                                      I do recall that Clang has a “pass manager”, although that might just be for the codegen portions.

                                                                                                                      1. 2

                                                                                                                        Yeah, totally.

                                                                                                                        the call chain is basically main, rustc_driver::main, so https://github.com/rust-lang/rust/blob/master/src/librustc_driver/ is the driver. It’s not super structured in that way, but that’s where you’d look.

                                                                                                                        1. 1

                                                                                                                          Thanks! This is what I was looking for:

                                                                                                                          https://github.com/rust-lang/rust/blob/master/src/librustc_driver/driver.rs

                                                                                                                          It’s not a single function, but it’s all in a single file, which is better than most. The big list of imports at the top is the giveaway. You can see the internal structure of the compiler; it’s not hidden behind a big compile() function or module as in many other examples.

                                                                                                                          One “wart” is that you don’t see the tokenizer; it appears to go directly from the Input string/file to parsing. But otherwise it looks like it shows all the parts in one place.

                                                                                                                    1. 1

                                                                                                                      I wonder how this compares with other languages designed for the embedded space, like micropython.

                                                                                                                      1. 4

                                                                                                                        Binaries compiled from Go are 50 to 100 times bigger than similar functionality using C. The “blink led” program is 20 to 40 bytes on embedded C (plus platform-dependent boilerplate).

                                                                                                                        MicroPython advertises itself as being able to fit in 256 Kilobytes, so i dont think it will be better than Go.

                                                                                                                        Especially for mass production (thousands of flash chips), using frameworks with big run-time boilerplate is just uneconomical. This is also the reason why, even with Go and Rust, embedded will stay an stronghold for C.

                                                                                                                        1. 2

                                                                                                                          Sure, but there’s definitely a constant overhead factor. A trivial program will have a lot of size overhead from the runtime. A nontrivial program will not have so much.

                                                                                                                          1. 2

                                                                                                                            The smallest known ELF binary produced by Rust was 151 bytes. While WASM isn’t exactly an embedded thing, conceptually it’s similar, and a single “plus one” function compiles to ~100 bytes.

                                                                                                                            There are lots of barriers for Rust in this space, but binary size shouldn’t be one of them.

                                                                                                                            1. 1

                                                                                                                              I consider rust one of the candiates that have indeed a chance here. I’ll wait until the toolchain and interfaces have somewhat stabilized, hoping they’ll ever do (Which many trendy things dont).

                                                                                                                              1. 1

                                                                                                                                What kind of instability are you worried about? We take the stability of the language quite seriously. This (embedded) isn’t my area of expertise though, so always looking to collect feedback!

                                                                                                                                1. 1

                                                                                                                                  Mostly API stability. But thats sort of inevitable for a young project of that complexity.

                                                                                                                                  1. 1

                                                                                                                                    Lack of well defined and stable ABI and second tier support for more exotic hw platforms. ABI problem can be fixed by Rust team, but unless hw vendors start shipping rust and llvm, it will be hard for rust to break into embedded.

                                                                                                                              2. 1

                                                                                                                                Im sure it could be made smaller given OcaPIC got some Ocaml on a PIC microcontroller. That seems harder. Far as alternatives, Astrobe lets people use Oberon. That’s a bit closer to Go given it’s inspired by Oberon-2 partly.

                                                                                                                            1. 7

                                                                                                                              It would be a fine page if titled “why we picked C to base SQLite on in 2000”.

                                                                                                                              1. 11

                                                                                                                                If you mean it would be written in Rust in 2018, nope. Most platforms of interest to SQLite are still tier-2/tier-3 support by Rust at best.

                                                                                                                                1. 3

                                                                                                                                  I believe it. But what platforms are at issue? Edit: yikes, the tier 1 list is way more limited than I thought. Never mind this question.

                                                                                                                                  Also, for projects starting in 2018, the question isn’t what Rust supports today, but what platforms you’re willing to bet Rust will support in 5-10 years. Hopefully that list is bigger.

                                                                                                                                  1. 8

                                                                                                                                    We’ve been talking about re-vamping the tier system, because it doesn’t do a great job of recognizing actual support. For example, ARM is a Tier 1 platform for Firefox, so stuff gets checked out and handled quite a bit, but given the current rules of how we clarify support, it appears like it’s a lot less than it actually is.

                                                                                                                                    in 5-10 years. Hopefully that list is bigger.

                                                                                                                                    We recently put together a working group to work on ease of porting rust to other platforms, so yeah, we expect it to grow. The hardest part is CI, honestly. Getting it going is one thing, but having someone who’s willing to commit to fixing breakage in a timely manner without bringing all development to a halt is tough for smaller/older platforms.

                                                                                                                                2. 2

                                                                                                                                  Depends on whether they had access to Pascal, Ada, Scheme, or Smalltalk. ;)