1. 8

    I saw this a while ago and while helpful to some degree, I think it conveys a narrow view of what mathematical notation is about. Notation in mathematics isn’t fixed and it isn’t a programming language, and most of the time mathematicians are not even trying to approximate a programming language. A good mathematical text can be read out loud, in full sentences. Mathematical notation is just abbreviation for English or other natural languages. If you look carefully, you’ll observe that in papers that follow the American Mathematical Society style guide, a very influential style, they use punctuation like commas, periods and semicolons within mathematical notation, because it really is just abbreviated English.

    The linked document on github covers a narrow subset of mathematical notation, which may nevertheless be sufficient for most things that computer people might be interested in, but may convey the wrong impression when going far afield from calculus, linear algebra, and statistics. An example from the document, the hat can mean a bunch of different things, and using it to represent a unit vector isn’t even all that standard from my experience. A unit vector may or may not be represented by a hat, or by an entirely different symbol, and a hat can also mean things as disparate as a Fourier transform in harmonic analysis or an estimator in statistics. It really depends what the author wants it to mean. A human reader should not be immediately thwarted by the presence or absence of a hat in an unfamiliar context.

    I know this view of mathematical notation can be frustrating to computer people who are used to compiler errors and a very rigidly defined syntax, but mathematicians aren’t usually writing for computers: they are writing abbreviated natural language for other humans. Like all natural languages, mathematical writing is full of context dependence and ambiguity. Despite computer people’s aspirations, this fuzzy and human interpretation of mathematical writing isn’t going to go away soon, so it pays to be aware of it and try to get used to it. I say this because fighting it only results isolation and balkanisation of mathematical traditions, with computer people going off on their own doing their own thing with mathematical people on the other side of this divide.

    1.  

      Heck, you don’t even have to go that far afield for things to shift in meaning. I’ve seen some linear algebra books use 1 to mean an identity matrix instead of a number.

      1.  

        It’s not so uncommon to use 1 for the multiplicative identity, a lot of german math books for example even call rings with unity, rings with 1.

        Edit: removed extra books.

    1. 4

      This has nothing to do with computing.

      1. 1

        Is that the only thing the education tag is for? I mean, is Lobsters only for things that happen around computers?

        1. 4

          From https://lobste.rs/about

          Lobsters is a computing-focused community centered around link aggregation and discussion, launched on July 1st, 2012.

          So yes. The education tag is for articles about computing that have an education component.

      1. 2

        Probably gonna work on those FFVI screenplays.

        I’ve been writing and rewriting the “pilot episode” (up until the moogle battle) for far too long. It’s time to take the plunge and write the story after that.

        1. 1

          While we’re on this topic, can someone explain to me why laziness makes this Haskell implementation in the bottom here so fast? It’s really fast for comparing [1..1000] with [2..1001], which most implementations are very slow with.

          https://wiki.haskell.org/Edit_distance

          I’ve wondered how to reimplement this in a different language, but I can’t understand enough Haskell to translate it.

          1. 1

            Not as catchy, but far less problematic.

            Well, you didn’t throw anything we could catch, so yeah…

            1. 2

              Well throwing things you couldn’t catch is just not the way I was raise’d…. but I can retry just for you as an exception.

            1. 2

              I’m thinking maybe these things would be more interesting if I could better explain the mathematics behind them. It must be underwhelming to draw some splines without understanding what kinds of calculations are going on.

              1. 3

                I’m meeting up with friends and going to an opera concert.

                Also I’ve been trying to toy around with really simple NLP stuff, just learning the basics, and want to continue that this weekend. I still don’t really know what I’m doing. What I want to do is be able to take an unstructured text document and extract a handful of specific things that I know are in there, but I don’t know how to do this yet and I’m not even sure what to Google for. If anyone has any tips for me that would be appreciated. :)

                1. 1

                  Oh, cool, what opera?

                1. 3

                  I didn’t manage to finish my D3.js spline code in time for my talk which I gave yesterday (which I think went really well, I loved the questions that I got!), so I’m going to try to finish it this weekend.

                  I also have to finish reviewing the last few chapters of a book for No Starch Press so I can collect my sweet sweet money for technical review.

                  1. 1

                    I do not trust Software Freedom Conservancy (and with good reasons), but I agree with most of what is written here, except:

                    Copyright and other legal systems give authors the power to decide what license to choose […]
                    In my view, it’s a power which you don’t deserve — that allows you to restrict others.

                    As an author of free software myself, I think that I totally deserve the right to decide who and how can use my work.

                    1. 3

                      I read the article you linked to but didn’t really understand how that means SFC can’t be trusted. Because a project under their umbrella git rebased a repo?

                      1. 1

                        No.

                        I cannot trust them anymore, because when the project joined Conservancy, I explicitly asked them how my copyright was going to change and Karen Sandler replied that it was not going to change.

                        One year later I discovered that my name was completely removed by the sources.

                        According to the GPLv2 this violation causes a definitive termination of the project’s rights to use or modify the software.

                        Now, I informed Sandler about that mess (before the rebase) and never listen her back after, despite several of my contributions got “accidentally squashed” during the rebase.

                        That’s why I cannot trust them anymore.

                        Because they are still supporting a project that purposedly violated the GPLv2 (causing its definitive termination) and despite the fact that I gave them the possibility to fix this, they didn’t… and tried to remove all evidences of this violation and of the license termination with a rebase… (that still squashed some of my commits).

                      2. 2

                        He’s objecting to restricting others in the way that proprietary software does, that’s the right he says you shouldn’t have. I think you edited out the part in your quote what bkuhn was talking about.

                        But more to your point, I also think that your right to to decide how others can use your work should be very limited. With software, an unlimited number of people can benefit from using your work in ways you may disagree with while you would be the only who would object. As a bargain with society, your authorial rights should be given smaller weight than the rights of your users.

                        1. 1

                          As a bargain with society, your authorial rights should be given smaller weight than the rights of your users.

                          Is this a principle that you believe should be only applied to software?

                          Because if not, one could argue that a person’s special skills (say, as a doctor) are so valuable to society that that person should work for free to assure that the greatest number of people have access to their skill.

                          If the principle is restricted to expression, a photograph I take of a person could be freely used by a political party that I despise to further their cause through propaganda. I am only one person, and they are many. My pretty picture can help them more than it helps me. So according to the principle above (as I read it) they should have unrestricted access to my work.

                          I believe that the current regime of IP legislation is weighted too much towards copyright holders, but to argue that a creator should have no rights to decide how their work is used is going too far.

                          1. 2

                            Software is different than doctors because software can be reproduced indefinitely without inconveniencing the author. Photographs are more similar to software than doctors.

                            I also didn’t say an author should have no rights. I just said their rights should weigh less. For example, copyrights should expire after, say, 10 years, instead of lasting forever as they de facto do now.

                            1. 2

                              Thanks for clarifying your position in this matter.

                              I think we are broadly in agreement, especially with regards to the pernicious effects of “infinite copyright”.

                              1. 2

                                It’s funny that I’m taking the parts of copyright here…

                                Let’s put it this way: if I invented a clean energy source I would do my best to ensure it was not turned to a weapon.

                                Same with software.

                                It’s my work, thus my responsibility.

                        1. 2

                          Oh, this is called uniform function call syntax (UFCS) in D and Nim. It does make code nicer to read in my experience.

                          1. 6

                            I would also like to share this log from the epic epoch date of 123457890 (i.e. February 13, 2009) and its eponymous channel.

                            http://jordi.platinum.linux.pl/1234567890_prelim.txt.gz

                            1. 3

                              I never thought I’d be nostalgic for the days I hung around IRC channels hosting crass conversation like these, but here I am, skimming through these logs and fighting to hold back a smirk

                            1. 4

                              I’m preparing a talk for our local Papers We Love. I’m going to be talking about special splines! And I think I’m going to try to implement the algorithm in D3.js because I can’t figure out how else to quickly implement a nonstandard spline algorithm. If anyone has a suggestion, I’d be curious to hear it.

                              1. 3

                                Interesting. A lot of people have told me to check out nim whenever I say how much I like D, and I definitely see the parallels. It even has UFCS, just like D! And D also has the same thing where unqualified imports are the same as from foo import * in Python.

                                I think those unqualified imports are less of a problem in D. Unlike with Python where namespace clashes can happen at runtime and be a huge (and silent!) surprise, namespace clashes in D (and hopefully nim) are much less of a problem because they’re quickly caught at compile time. I sort of understand the problem about reading a piece of code and not having a clear indication from reading it where a certain name came from. D has an optional import foo: bar; syntax to only import the bar symbol from foo. Does nim have this too?

                                1. 2

                                  import the bar symbol from foo. Does nim have this too?

                                  Yes :) The syntax is very close to how you said it.

                                  from foo import bar
                                  

                                  Here’s a real example:

                                  from strutils import join
                                  
                                1. 0

                                  This is ill-advised.

                                  You cannot define 1/0 and still have a field. There’s no value that works. Even when you do things like the extended real numbers where x/0 = infinity, you’re really just doing a kind of shorthand and you acknowledge that the result isn’t a field.

                                  You can of course define any other algebraic structure you want and then say that operating on the expression 1/0 is all invalid because you didn’t define anything else and no other theorem applies, but this is not very helpful. You can make bad definitions that don’t generalise, sure, definitions that aren’t fields. But to paraphrase a famous mathematician, the difficulty lies not in the proofs but in knowing what to prove. The statement “1/0 = 0 and nothing else can be deduced from this” isn’t very interesting.

                                  1. 1

                                    Could you explain why, formally, defining 1/0=0 means you no longer have a field?

                                    1. 7

                                      I want to make an attempt to clarify the discussion here because I think there is some substance I found interesting. I don’t have a strong opinion about this.

                                      The article actually defines an algebraic structure with three operators: (S, +, *, /) with some axioms. It happens that these axioms makes it so (S, +, *) is a field (just like how the definition of a field makes (S, +) a group).

                                      The article is right in saying that these axioms do not lead to a contradiction. And there are many non-trivial such structures.

                                      However, the (potential) issue is that we don’t know nearly as much about these structures than we do about fields because any theorem about fields only apply to (S, +, *) instead of (S, +, *, /). So all the work would need to be redone. It could be said that the purpose of choosing a field in the first place is to benefit from existing knowledge and familiar expectations (which are no longer guarantteed).

                                      I guess formally adding an operator means you should call it something else? (Just like how we don’t call fields a group even though it could be seen as a group with an added * operator.)

                                      This has no bearing on the 1/0 = 0 question however, which still works from what’s discussed in the article.

                                      1. 1

                                        As I understand it, you’ve only defined the expression 1/0 but you are saying that /0 isn’t shorthand for the multiplicative inverse of 0 as is normally the case for /x being x^-1, by definition. Instead, /0 is some other kind of magical non-invertible operation that maps 1 into 0 (and who knows what /0 maps everything else into). Kind of curious what it has to do with 0 at all.

                                        So I guess you can do this, but then you haven’t defined division by zero at all, you’ve just added some notation that looks like division by zero but instead just defined some arbitrary function for some elements of your field.

                                        If you do mean that /0 is division by zero, then 1/0 has to be, by definition, shorthand for 1*0^-1 and the arguments that you’ve already dismissed apply.

                                        1. 4

                                          The definition of a field makes no statements about the multiplicative inverse of the additive identity (https://en.wikipedia.org/wiki/Field_(math)#Classic_definition). Defining it in a sound way does not invalidate any of the axioms required by the field, and, in fact, does define division by zero (tautologically). You end up with a field and some other stuff, which is still a field, in the same way that adding a multiplication operator on a group with the appropriate properties leaves you with a group and some other stuff.

                                          The definition of the notation “a / b => a * b^-1” assumes that b is not zero. Thus, you may define the case when b is 0 to mean whatever you want.

                                          That people want to hold on to some algebraic “identities” like multiplying by the denominator cancels it doesn’t change this. For that to work, you need the assumption that the denominator is not zero to begin with.

                                          1. 1

                                            In what way, whatever it is you defined /0 to be, considered to be a “division”? What is division? Kindly define it.

                                            1. 3

                                              Division, a / b, is equal to a * b^-1 when b is not zero.

                                              1. 2

                                                And when b is zero, what is division? That’s the whole point of this argument. What properties does an operation need to have in order to be worthy of being called a division?

                                                1. 3

                                                  Indeed, it is the whole point. For a field, it doesn’t have to say anything about when you divide by zero. It is undefined. That doesn’t mean that you can’t work with and define a different, but still consistent, structure where it is defined. In fact, you can add the definition such that you still have the same field, and more.

                                                  edit: Note that this doesn’t mean that you’re defining a multiplicative inverse of zero. That can’t exist and still be a field.

                                                  1. 1

                                                    In what way is it consistent? Consistent with what? As I understand it, you’re still saying that the expression 1/0 is an exception to every other theorem. What use is that? You still have to write a bunch of preconditions, even in Coq, saying how the denominator isn’t zero. What’s the point of such a definition?

                                                    It seems to me that all of this nonsense is about not wanting to get an exception when you encounter division by zero, but you’re just delaying the problem by having to get an exception whenever you try to reason with the expression 1/0.

                                                    1. 3

                                                      I mean that the resulting structure is consistent with the field axioms. The conditions on dividing by zero never go away, correct. And yes, this is all about avoiding exceptions in the stack unwinding, programming language sense. The article is a response to the statements that defining division by zero in this way causes the structure to not be a field, or that it makes no mathematical sense. I am also just trying to respond to your statements that you can’t define it and maintain a field.

                                                      1. 1

                                                        It really doesn’t make mathematical sense. You’re just giving the /0 expression some arbitrary value so that your computer doesn’t raise an exception, but what you’re defining there isn’t division except notationally. It doesn’t behave like a division at all. Make your computer do whatever you want, but it’s not division.

                                                        1. 5

                                                          Mathematical sense depends on the set of axioms you choose. If a set of axioms is consistent, then it makes mathematical sense. You can disagree with the choices as much as you would like, but that has no bearing on the meaning. Do you have a proof that the resulting system is inconsistent, or even weaker, not a field?

                                                          1. 1

                                                            I don’t even know what the resulting system is. Is it, shall we say, the field axioms? In short, a set on which two abelian operations are defined, with two distinct identities for each abelian operation, such that one operation distributes over the other? And you define an additional operation on the distributing operation that to each element maps its inverse, except for the identity which instead is mapped to the identity of the distributed-over operation?

                                                            1. 2

                                                              It’s a field where the definition of division is augmented to include a definition when the divisor is zero. It adds no new elements, and all of the same theorems apply.

                                                              1. 1

                                                                I’m bailing out, this isn’t a productive conversation for either of us. Sorry.

                                                                1. 1

                                                                  You are correct. The field axioms are all still true, even if we extend / to be defined on 0.

                                                                  The reason for this is that the axioms never “look at” any of the values x/0. They never speak of them. So they all hold regardless of what x/0 is.

                                                                  That said, even though you can define x/0 without violating axioms it doesn’t mean you should. In fact it seems like a very bad idea to me.

                                            2. 1

                                              That doesn’t make it not a field; you don’t have to have a division operator at all to be a field, let alone a division operator that is defined to be multiplication by the multiplicative inverse.

                                              1. 1

                                                What is division?

                                                1. 1

                                                  zeebo gave the same answer I would give: a / b is a multiplied by the multiplicative inverse of b when b is not zero. This article is all about how a / 0 is not defined and so, from an engineering perspective, you can define it to be whatever you want without losing the property that your number representation forms a field. You claimed that defining a / 0 = 1 means that your numbers aren’t a field, and all I’m saying is that the definition of the division operator is 100% completely orthogonal to whether or not your numbers form a field, because the definition of a field has nothing to say about division.

                                                  1. 1

                                                    What is an engineering perspective?

                                                    Also, this whole “a field definition doesn’t talk about division” is a bit of misunderstanding of mathematical idioms. The field definition does talk about division since “division” is just shorthand for “multiplicative inverse”. The reason the definition is written the way it is (excluding 0 from having a multiplicative inverse) is that giving zero a multiplicative inverse results in contradictions. When you say “ha! I won’t let that stop me! I’m going to define it anyway!” well, okay, but then either (1) you’re not definining a multiplicative inverse i.e. you’re not defining division or (2) you are defining a multiplicative inverse and you’re creating a contradiction.

                                                    1. 1

                                                      (I had a whole comment here, but zeebo is expressing themselves better than I am, and there’s no point in litigating this twice, especially when I feel like I’m just quoting TFA)

                                                      1. 1

                                                        Me too, I’m tapping out.

                                        1. 4

                                          I use Mercurial via hg-git.

                                          That gives me templating, revsets, hg absorb, Evolve, and a bunch of other goodies that make it really easy to read history and rewrite draft commits (and also rewrite published history, with a little bit of --force, but I pretty much never do that).

                                          1. 13

                                            How to Solve It - G. Polya.

                                            1. 6

                                              The only thing I ever remember about that book is, paraphrased, if there’s a problem you can’t solve, there’s also a smaller problem you can’t solve. Find that smaller problem and solve it first.

                                              1. 2

                                                Sounds like a good summary, but for much broader meaning of the word “problem” that would seem from it. The book gives a list of questions designed to explore the space around your problem from many different perspectives, hopefully guiding you towards a different problem that’s easier to solve, and will contribute necessary insight or data into your main one.

                                                1. 1

                                                  The idea is called divide and conquer.

                                                  1. 3

                                                    Divide and conquer is a specific instance of that tactic. It’s one where solving the smaller problem actually gives you part of the solution of the larger problem. But in mathematics you often solve a truly simpler version of a problem to discover a strategy to attack the larger problem. The solution to the simpler problem itself is not used any more.

                                              1. 3

                                                Rust itself runs tests in CI on every pull request that are required to pass. For example, https://travis-ci.org/rust-lang/rust/builds/410084149

                                                I can see why in a project as young as Rust maintaining different distributions’ forked build and test scripts for the compiler could be prioritized lower than e.g. language-level improvements.

                                                1. 6

                                                  Yes, Rust CI runs tests on x86_64. Hence lots of breakages on other Debian architectures.

                                                  I agree with you on the priority, but I am of the opinion that you can’t have it both ways. Either Rust should address test failures on other architectures, or Rust should stop claiming C level portability. Rust portability is “almost” there, but not there yet because other architectures are not maintained well.

                                                  1. 12

                                                    Can you please point out where Rust “claims C level portability”?

                                                    1. -3

                                                      This is one of those things where it doesn’t matter what the “official” stance but what the popular interpretation of that stance is. Certainly a number of people are writing Rust replacements for old C bastions, like grep or the coreutils. This along with the RIIR meme spreads the idea that Rust is a viable replacement for C in all situations, including portability.

                                                      If the RESF wants to be clearer about how Rust isn’t ready to replace C yet, they need to be clearer that it’s not ready instead of being silent on the point about portability claims and saying they never said that.

                                                      1. 7

                                                        This is one of those things where it doesn’t matter what the “official” stance but what the popular interpretation of that stance is. Certainly a number of people are writing Rust replacements for old C bastions, like grep or the coreutils. This along with the RIIR meme spreads the idea that Rust is a viable replacement for C in all situations, including portability.

                                                        If the RESF wants to be clearer about how Rust isn’t ready to replace C yet, they need to be clearer that it’s not ready instead of being silent on the point about portability claims and saying they never said that.

                                                        I realize you’re probably just going to go bitch about me on IRC again, but your comment smells like a load of bullshit to me. Rust’s supported platform list looks like a pretty good indicator to me of what the platform support looks like. In fact, it looks like the exact opposite of “silence.”

                                                        saying they never said that.

                                                        I actually didn’t say that. I asked where we claimed C level portability. If we were doing such a thing, I’d want to know about it so we can correct it. Which is exactly the thing you’re blabbering on about. But no. Instead, I get RESF thrown in my face.

                                                        Lose, lose. Thanks for playing.

                                                        1. -1

                                                          Aha, I also see this:

                                                          We do not demand that Rust run on “every possible platform”. It must eventually work without unnecessary compromises on widely-used hardware and software platforms.

                                                          So I guess the current situation with failing tests is entirely intentional but not well-known. Well, it should be better known.

                                                    2. 1

                                                      I agree that Rust needs a better multi-architecture story - as someone who does embedded development, I’ll play with Rust but I’d be very wary of using it “for real” - but lack of serious support for non-x86 [EDIT: non-Windows/-Linux/-Mac] is pretty well-documented.

                                                      [EDITed in response to sanxiyn’s clarification, thanks!]

                                                      1. 1

                                                        Rust Platform Support page is pretty clear. x86 is Tier-1, anything else is not.

                                                  1. 28

                                                    Possibly unpopular opinions (and a large block of text) incoming:

                                                    C++, Go, Swift, D and Rust all fail to adequately replace C for me. When given the choice, I would likely choose to just stick with C (for the moment; I’ll talk about what I’m considering at the end).

                                                    C++ has so much historical baggage and issues, it’s already an immediate turn-off. More than that, it’s explicitly understood that you should carve out a subset of C++ to use as your language because trying to use the whole thing is a mess of sadness (given that it’s massive at this point). I appreciate the goal of zero-cost abstraction and having pleasant defaults in the standard library, but there are just too many problems for me to take it as a serious choice. Plus, I still have to deal with much of the unfortunate UB from C (not all of it, and honestly, I don’t mind UB in some cases; but a lot of the cases of UB in C that just make no reasonable sense come across to C++). It should be noted that I do still consider C++ occasionally in a C-with-templates style, but it’s still definitely not my preference.

                                                    Despite how often people place it here, I do not believe Go belongs in this group of candidates The garbage collection alone makes it unfit for systems programming. I see Go as a very reasonable choice to replace Java (but I don’t use Java whenever I have the choice, so I might not be the best person to ask). There are many other parts of this language that rub me the wrong way, but mostly, I just think it’s not a good systems language (but is instead a great intro language for higher-level stuff).

                                                    Swift is really easy to rule out: It’s not cross-platform. Even if it were, it has all sorts of terrible issues (have they fixed the massive compile times yet?) that make it a no-go.

                                                    D, as far as I can tell, manages to be C++ without the warts in a really lovely way. Having said that, it seems like we’re talking about good replacements for C, not C++, and D just doesn’t cut it for me. GC by-default (being able to turn that off is good, but I’ll still have to do it every time), keeping name mangling by-default, etc. -betterC helps with some of this, but at that point, there’s just not enough reason for me to switch (especially with all the weirdness of there being two de facto standard libraries from different organizations, one of which I think is still closed-source? sounds like I might need to take another look at D; though, again, its emulation of C++ still suggests to me that it won’t quite cut it).

                                                    Rust is the only language in this list that I think is actually a reasonable contender. Sadly, it still bites a lot of these issues: names are still mangled by-default, the generated binaries are huge (I’m still a little bugged that C’s hello-world with glibc dynamically links to 6KB), et al.

                                                    But more than all of these things I’ve listed, the problems I have with these languages is that they all have a pretty big agenda (to borrow a term from Jon Blow). They all (aside from C++ which has wandered in the desert for many years) have pretty specific goals with how they are designed to try and carve out their ideal of what programming should be instead of providing tools that allow for people to build what they need.

                                                    So, as for languages that I think might (someday, not soon really) actually replace C (for me):

                                                    Zig strikes a balance between C (plus compile-time execution to replace the preprocessor) and LLVM IR internals which allow for incredibly fine-grained control (Hello arbitrarily-sized, fixed-width integers, how are you doing?). It also manages to have the best C interop story I have ever seen in a language so far (you can import from C header files no problem, and zig libraries can have their code called from C also no problem; astounding).

                                                    Myr is still really new (so is Zig really), and has a lot left to figure out (e.g., its C interop story is not quite so nice yet). However, it manages to be incredibly simple and terse for a braced language. My guess is that, in the long run, myr will actually replace shell languages for me, but not C.

                                                    Jai looks incredibly cool and embraces a lot of what I’ve mentioned above in that it is not a big agenda language, but provides a lot of really useful tools so that you can use what you make of it. However, it’s been in development for four years and there is no publicly available implementation (and I am worried that it may end up being closed-source when it is released, if ever). I’m hoping for the best here, but am expecting dark storms ahead.

                                                    Okay, sorry for the massive post; let me just wrap up a few things. I do not mean to imply with this post that any of the languages above are inherently bad or wrong, only that they do not meet my expectations and needs in replacing C. For a brief sampling of languages that I love which suffer from all the problems I mentioned above and more, see here:

                                                    • Haskell and Idris, but really Agda
                                                    • Ada
                                                    • Lua
                                                    • APL (specifically, the unicode variants)
                                                    • Pony

                                                    They are all great and have brilliant ideas; they’re just not good for replacing C. :)

                                                    Now then, I’ll leave you all to it. :)

                                                    1. 15

                                                      (especially with all the weirdness of there being two de facto standard libraries from different organizations, one of which I think is still closed-source?)

                                                      That was resolved a few years ago. D just has one stdlib, it’s fairly comprehensive, and keeps getting better with each release.

                                                      1. 12

                                                        a few years ago

                                                        a bit of an understatement! The competing library was dropped in 2007.

                                                      2. 10

                                                        Despite how often people place it here, I do not believe Go belongs in this group of candidates The garbage collection alone makes it unfit for systems programming. I see Go as a very reasonable choice to replace Java (but I don’t use Java whenever I have the choice, so I might not be the best person to ask). There are many other parts of this language that rub me the wrong way, but mostly, I just think it’s not a good systems language (but is instead a great intro language for higher-level stuff).

                                                        Agreed with this. Go is my go-to when I need to introduce dependencies to a Python script (and thus fuck with pip --user or virtualenv or blah blah blah) for high level glue code between various systems (e.g. AWS APIs, etc.)

                                                        I think there’s a reason Go is dominating the operations/devops tooling world - benefits of static compilation, high level, easy to write.

                                                        Look at the amount of hacks Docker needs to do things like reexec etc. to work properly in Go, that would be trivial to do in C.

                                                        1. 3

                                                          Note that Zig is x86-only at the moment. Check “Support Table” on Zig’s README.

                                                          For that matter, Rust is x86-only too, if you want Tier-1 support.

                                                          1. 3

                                                            I’m a big d fan, but I agree that it’s the wrong thing to replace c. Betterc doesn’t really help in this respect, because it doesn’t address the root reason of why d is the wrong thing to replace c (which being that the language itself is big, not that the runtime or standard library are). Personally, I think zig is the future, but rust has a better shot at ‘making it’, and the most likely outcome is that c stays exactly where it currently is (which I’m okay with). I haven’t looked at myr (yet), and afaik isn’t jai targeted at game development? It might be used for systems programming, but I think it might not necessarily do well there.

                                                            It also manages to have the best C interop story I have ever seen in a language so far (you can import from C header files no problem, and zig libraries can have their code called from C also no problem; astounding)

                                                            I think nim does this, and d for sure does, with d++ (I think this may also help with the c++ emulation? Also, I’m not sure why you’re knocking it for its lack of quality c++ emulation when it’s afaik the only language that does even a mediocre job at c++).

                                                            1. 1

                                                              I agree!

                                                              As for knocking D for emulating C++, I did not mean to suggest that doing so is a count against D as a language, but rather just as a count against replacing C. I already ruled out C++, if a given language is pretty close to C++, it’s probably also going to be ruled out.

                                                              It’s been a long time since I looked at nim, but generating C code leaves a really poor taste in my mouth, especially because of some decisions made in the language design early on (again, I haven’t looked in a while, perhaps some of those are better now).

                                                              As for Jai, yes it’s definitely targeted at game development; however, the more I look at it, the more it looks like it might be reasonable for a lot of other programming tasks. Again though, at the moment, it’s just vaporware, so I offer no guarantee on that point. :)

                                                            2. 2

                                                              However, it’s been in development for four years and there is no publicly available implementation

                                                              I’m amazed that behind the project is Jonathan Blow, he is a legend programming original video games.

                                                            1. 18

                                                              I suppose I know why, but I hate that D is always left out of discussions like this.

                                                              1. 9

                                                                and Ada, heck D has it easy compared to Ada :)

                                                                1. 5

                                                                  Don’t forget Nim!

                                                                2. 3

                                                                  Yeah, me too. I really love D. Its metaprogramming alone is worth it.

                                                                  For example, here is a compile-time parser generator:

                                                                  https://github.com/PhilippeSigaud/Pegged

                                                                  1. 4

                                                                    This is a good point. I had to edit out a part on that a language without major adoption is less suitable since it may not get the resources it needs to stay current on all platforms. You could have the perfect language but if somehow it failed to gain momentum, it turns into somewhat of a risk anyhow.

                                                                    1. 4

                                                                      That’s true. If I were running a software team and were picking a language, I’d pick one that appeared to have some staying power. With all that said, though, I very much believe D has that.

                                                                    2. 3

                                                                      And OCaml!

                                                                      1. 10

                                                                        In my opinion, until ocaml gets rid of it’s GIL, which they are working on, I don’t think it belongs in this category. A major selling point of Go, D, and rust is their ability to easily do concurrency.

                                                                        1. 6

                                                                          Both https://github.com/janestreet/async and https://github.com/ocsigen/lwt allow concurrent programming in OCaml. Parallelism is what you’re talking about, and I think there are plenty of domains where single process parallelism is not very important.

                                                                          1. 2

                                                                            You are right. There is Multicore OCaml, though: https://github.com/ocamllabs/ocaml-multicore

                                                                        2. 1

                                                                          I’ve always just written of D because of the problems with what parts of the compiler are and are not FOSS. Maybe it’s more straightforward now, but it’s not something I’m incredibly interested in investigating, and I suspect I’m not the only one.

                                                                          1. 14
                                                                        1. 4

                                                                          -WliterallyAll would be very appreciated.

                                                                          1. 2

                                                                            The historical reason why -Wall doesn’t enable all warnings is that warnings have been gradually added to the compiler over time. Adding new warnings to existing options could cause builds to fail after upgrading gcc.

                                                                            Moreover, some pairs of warnings are incompatible (in the sense that any code accepted by one would be rejected by the other). An example of this is -Wstrict-prototypes and -Wtraditional.

                                                                            1. 5

                                                                              The historical reason why -Wall doesn’t enable all warnings is that warnings have been gradually added to the compiler over time. Adding new warnings to existing options could cause builds to fail after upgrading gcc.

                                                                              I’m aware of that, though I still find it wrong that -Wall doesn’t actually include the new warnings, a build breaking on upgrade with -Wall is in my opinion the more logical outcome. I would rather have flags like -Wall4.9 that would remain constant on upgrades so no one who’s just using that subset of the warnings breaks their build. -Wall can then remain true to its meaning. Seeing that the ship has sailed on that a long time ago, I still would like to have a -WliterallyAll (can be called something else) that would include -Wall -Wextra and others like -Wstrict-overflow.

                                                                              Moreover, some pairs of warnings are incompatible (in the sense that any code accepted by one would be rejected by the other). An example of this is -Wstrict-prototypes and -Wtraditional.

                                                                              These ones can’t be and don’t have to be included.

                                                                              1. 5

                                                                                I really like the idea of -Wall-from=$VERSION, and you could even support -Wall-from=latest for people who truly are okay with their builds breaking whenever they upgrade their compiler.

                                                                                1. 2

                                                                                  clang supports -Weverything which I’ve tried, and it happily spews out contradictory warnings (“Padding bytes added to this structure”, “No padding bytes have been added to this packed structure!”) along with (in my opinion) useless warnings (“converting char to int without cast”).

                                                                                  1. 1

                                                                                    Yep, -Weverything can be amusing, but it really does throw everything at the code.

                                                                                  2. 1

                                                                                    These ones can’t be and don’t have to be included.

                                                                                    So your -WliterallyAll would not enable literally all warnings either? I’m not sure how that solves the problem.

                                                                                    I would rather have flags like -Wall4.9 that would remain constant on upgrades so no one who’s just using that subset of the warnings breaks their build. -Wall can then remain true to its meaning.

                                                                                    Now this is a neat idea that I can get behind.

                                                                                  3. 1

                                                                                    Correction: I have been informed that new warnings actually have been added to -Wall on multiple occasions.

                                                                                    The better explanation for why -Wall leaves many warnings disabled is that many of them are just not useful most of the time. The manual states:

                                                                                    Note that some warning flags are not implied by -Wall. Some of them warn about constructions that users generally do not consider questionable, but which occasionally you might wish to check for; others warn about constructions that are necessary or hard to avoid in some cases, and there is no simple way to modify the code to suppress the warning.

                                                                                    In other words, it might be better to think of -Wall not as “all warnings”, but as “all generally useful warnings”.

                                                                                  4. 1

                                                                                    Except the -Weffc++ warnings, those are really annoying and are not really about actual problems in your code.