back to article Are you a Nim-by? C-ish language, gentler than Go, friendlier than Rust, reaches version 1.0

The Nim programming language reached v1.0 on Monday, bringing with it a stability guarantee and enthusiasm from its community of fans. "Version 1.0 marks the beginning of a stable base which can be used in the coming years, knowing that the future versions of Nim won’t break the code you have written with the current version …

  1. LosD

    "c-like" is pretty far from what Nim is. C-like, for example, would mean proper braces instead of that Python-like indentation hell.

    1. Anonymous Coward
      Anonymous Coward

      "Strong Functional Capabilities" also doesn't sound very "C-like"

    2. Andrew Moore

      Yup, indentation for grouping is a hard pass from me. Any language that can be broken just by switching text editor is not fit for purpose.

      1. Francis Boyle Silver badge

        Then

        maybe it's your text editor which is not fit for purpose.

        1. is0m0rph

          Re: Then

          LOL well said... nonetheless choosing whitespace for scoping is the worst idea ever, right up there with Hoare's null blunder.

      2. david 12 Silver badge

        Any language that can be Broken jUst by switcHing fonT is not fit for purpose.

        1. vincent himpe

          Any language requiring explicit statement terminators is designed by lazy nitwits.

          Why do you need semicolons to terminate a statement ? There is already a terminator : the CR or CR/LF when you hit return on the keyboard. In case a statement spans multiple lines : use a continuation character like an underscore. You will need fewer continuation characters than termination characters.

          win-win. Less keyboard pounding required and none of those compile time shenanigans like 'you forgot a semicolon here, compilation stopped'

          1. Tom 7

            that would be why there are ':'s terminating the if and else thingies?

            1. Ogi

              > that would be why there are ':'s terminating the if and else thingies?

              It seems to be a common misconception (mostly by the fresher Python converts), that Python only works with new line termination, and that is the only right and true way.

              I guess a little known fact, Python does in fact support semicolon termination. Try it yourself with this one liner (On a *nix):

              python3 -c "from os import system; system(' echo hello, world'); raise(SystemExit(0))"

              I have used it quite a few times to send one liners through a simple SSH command. It has been a feature since 2.0 at least (AFAIR).

              In the end, holy wars are only for the fanatics. I've used a slew of languages depending on the use case. They are like tools in a toolbox, each has their strengths and weaknesses.

              1. NetBlackOps

                Well past two dozen languages, even ignoring variants and specific (assembly), and that's what it comes down to which is best for the particular task at hand. More important here is whether different languages can be mixed and matched over a particular project. I'll certainly give this one a spin.

              2. Richard Plinston

                > Python does in fact support semicolon termination.

                No. You are wromg. Python uses the semicolon as a separator, not a terminator.

                """Python uses the ; as a separator, not a terminator. You can also use them at the end of a line, which makes them look like a statement terminator, but this is legal only because blank statements are legal in Python -- a line that contains a semicolon at the end is two statements, the second one blank."""

                1. This post has been deleted by its author

    3. Baldrickk

      Unpopular opinion

      maybe it is, but I actually really like the indentation in python. It forces you to structure your code in a readable manner.

      This is a positive when you semi-routinely come across code with funky indentation, usually because people just didn't care when they went in to make a bug fix or whatever..

      1. Teiwaz

        Re: Unpopular opinion

        maybe it is, but I actually really like the indentation in python. It forces you to structure your code in a readable manner.

        This is a positive when you semi-routinely come across code with funky indentation, usually because people just didn't care when they went in to make a bug fix or whatever..

        It's just plain annoying though, when a program falls over just over the matter of a couple of lines out by or in by one space.

        Seems to me, the difference between advocating a tidy desk and firing anyone who leaves a pencil across the top of the function key line.

        1. Ogi

          Re: Unpopular opinion

          > It's just plain annoying though, when a program falls over just over the matter of a couple of lines out by or in by one space.

          Trust me, its far worse when the program doesn't fall over due to incorrect indentation. Rather it is syntactically and logically valid (if incorrect), and so carries on running fine, while the output is valid, but wrong, causing all kinds of hell trying to work out where the problem is.

          I would rather it bombs out, at least the traceback gives you a line number as a hint and the problem.

          (Python programmer for > 15 years, and yes, I've come across the above bug depressingly often. A real PITA to debug when you got 350k lines of Python written by others, and no versioning history).

          1. is0m0rph

            Re: Unpopular opinion

            f*ck! u just made me want to stop learning Python. this is depressing sh*t.

        2. is0m0rph

          Re: Unpopular opinion

          couldn't agree more. i just started learning Python and wrote a simple test program. we are talking about really baby stuff here and the darn thing wouldn't run! syntax and all that was checking out BUT 1 line was off by 1 space. WTF!!? i hollered. TBH this whitespace stuff is the worst language design decision ever made across all the known universes in the multiverse.

      2. iron Silver badge

        Re: Unpopular opinion

        If they can't be bothered to make another language more readable with indents I would imagine they stand no chance of getting anything to work in a language like Python.

    4. diodesign (Written by Reg staff) Silver badge

      C-like

      By C-like, we mean, it compiles like C, it kinda looks like C, and it's supposed to be a systems language. On reflection, it does look like Python, too.

      The lines are blurred and fuzzy.

      C.

      PS: The indentation doesn't bother me because it's Python-ish, and also it gets rid of the whole argument over where to put any scope-containing braces - on a newline or same line.

      1. is0m0rph

        Re: C-like

        who cares same line or newline!? at least that way scope will be clearly delimited. the more i learn about Python and the more i rue the day i didn't argue against it when my boss said i should do the next project in Python. christ! computer science is full of madmen.

  2. Anonymous Coward
    Anonymous Coward

    I see not a few pascalisms...

    But that of course cannot be said because Pascal is not fashionable.

    Soon we will have more programming languages than applications...

    1. Anonymous Coward
      Anonymous Coward

      Re: I see not a few pascalisms...

      That's what I was going to say. It is far more Pascal-like than C-like.

      1. Mage Silver badge
        Boffin

        Re: I see not a few pascalisms...

        Or Modula-2 like, a much misunderstood and undervalued language.

        I may take a closer look.

        1. Red Ted
          Go

          Re: I see not a few pascalisms...

          All hail Niklaus Wirth

        2. Anonymous Coward
          Anonymous Coward

          Re: I see not a few pascalisms...

          Modula-2 itself was derived form Pascal, as both (plus Oberon later, IIRC) were all designed by Wirth.

          In some ways that was his mistake - instead of evolving a language, he designed new ones that although part of a family were not compatible. While good for researches purposes, that made them far more difficult to turn into a viable commercial option.

          At least well before everybody and his dog started to design his or her own not compatible language...

          1. Red Ted
            Meh

            Re: I see not a few pascalisms...

            instead of evolving a language, he designed new ones

            I see that comment and raise you the Python 2 and Python 3 situation that has existed for the last ten years.

            1. Anonymous Coward
              Anonymous Coward

              Re: I see not a few pascalisms...

              I see *that* and raise you the Perl 5 and not-really-perl-no-siree-6 debacle.

          2. Androgynous Cow Herd

            Re: I see not a few pascalisms...

            I too am part of a family I am not compatible with.

    2. Pascal Monett Silver badge

      Re: I see not a few pascalisms...

      Ah, Turbo Pascal, that was fun. My first OO language.

      What memories.

    3. James 51

      Re: I see not a few pascalisms...

      Beat me to it. Had a flashback when I saw the screenshot.

  3. Bronek Kozicki

    There is nothing wrong with yet another programming language

    ... as long as I get to choose if I will use it or not.

  4. A Non e-mouse Silver badge
    Meh

    A bit more detail

    In an El Reg article, I would have liked a bit more detail as to what nim brings to the party.

    For the curious, there's the obligatory Wikipedia page.

  5. Baldrickk

    Compiles to C ... javascript...

    Isn't that transcoding?

    1. Mage Silver badge

      Re: Compiles to C ... javascript...

      Or Preprocessing. Most of the first C++ compilers produced C, which as C was really originally a machine independent macro assembler in concept, was reasonable.

      Or Compiling.

      Some Pascal compilers produced P-Code. That is a principle that both Java, Visual Basic, later J++ and C# used.

      Transcoding is a more idiot sort of process.

      So you can have a multipass real compiler and not produce a native binary but something else to take advantage of existing mature tools.

    2. Tom 7

      Re: Compiles to C ... javascript...

      I tend to think of it as encryption - when debugging in many situations you only have the encrypted code to look at and to many it will mean Jack.

  6. steelpillow Silver badge

    Indents

    Are the indents part of the language or just a display convenience like the line numbers? I like to use blank lines as delineators rather than / as well as curly brackets or excessive indents, and I notice that some of the code examples on their website do that, but I can't see whether the accompanying indents are strictly necessary.

  7. Anonymous Coward
    Anonymous Coward

    Just what we needed

    Another language that's fractally different from a bunch of existing languages, that has a few new ideas of its own along with bunch of new and old drawbacks. Why?

  8. mmccul

    1977 called

    It wants its whitespace sensitive languages back.

  9. Claptrap314 Silver badge

    Programming is hard. Language design is harder. Allowing programmers to rewrite the syntax tree is a BAD idea for almost all programmers out there.

  10. Tom 7

    Those who do not understand computing

    are destined to spend their lives designing new languages.

  11. Kevin McMurtrie Silver badge

    Tabs and spaces

    The problem I've seen in the past with Python was when multiple people with different indentations were editing the same file. The lines looked right but they were all different mixes of tabs and spaces. Well, that and the "Python has threads" versus the "Python doesn't have threads" developers. It looks like Nim is starting off with a threading demo to set expectations.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like