"c-like" is pretty far from what Nim is. C-like, for example, would mean proper braces instead of that Python-like indentation hell.
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 …
COMMENTS
-
-
-
-
Tuesday 24th September 2019 17:45 GMT 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'
-
-
Tuesday 24th September 2019 19:01 GMT 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.
-
Tuesday 24th September 2019 19:33 GMT 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.
-
Tuesday 24th September 2019 20:13 GMT 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."""
-
This post has been deleted by its author
-
-
-
-
-
-
Tuesday 24th September 2019 09:18 GMT 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..
-
Tuesday 24th September 2019 10:38 GMT 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.
-
Tuesday 24th September 2019 18:56 GMT 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).
-
Friday 7th February 2020 08:46 GMT 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.
-
-
-
Tuesday 24th September 2019 21:06 GMT diodesign
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.
-
-
-
-
Tuesday 24th September 2019 12:24 GMT 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...
-
-
-
-
-
Tuesday 24th September 2019 11:00 GMT Mage
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.
-
-
Tuesday 24th September 2019 10:40 GMT steelpillow
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.
-
Tuesday 24th September 2019 21:05 GMT Kevin McMurtrie
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.