New Release Of Nim Borrows From Python, Rust, Go, and Lisp (fossbytes.com)
An anonymous reader writes:
"Nim compiles and runs fast, delivers tiny executables on several platforms, and borrows great ideas from numerous other languages," according to InfoWorld. After six years, they write, Nim is finally "making a case as a mix of the best of many worlds: The compilation speed and cross-platform targeting of Go, the safe-by-default behaviors of Rust, the readability and ease of development of Python, and even the metaprogramming facilities of the Lisp family..."
Fossbytes adds that Nim's syntax "might remind you of Python as it uses indented code blocks and similar syntax at some occasions. Just like Rust and Go, it uses strong types and first class functions... Talking about the benchmarks, it's comparable to C. Nim compiler produces C code by default. With the help of different compiler back-ends, one can also get JavaScript, C++, or Objective-C.
There's an improved output system in the newest release, and both its compiler and library are MIT licensed. Share your thoughts and opinions in the comments. Is anybody excited about writing code in Nim?
Fossbytes adds that Nim's syntax "might remind you of Python as it uses indented code blocks and similar syntax at some occasions. Just like Rust and Go, it uses strong types and first class functions... Talking about the benchmarks, it's comparable to C. Nim compiler produces C code by default. With the help of different compiler back-ends, one can also get JavaScript, C++, or Objective-C.
There's an improved output system in the newest release, and both its compiler and library are MIT licensed. Share your thoughts and opinions in the comments. Is anybody excited about writing code in Nim?
It's yet another hipster language that will be dead in a few months!
#DeleteFacebook
I prefer {} instead of tabs/spaces to define my code blocks. It's the only part of Python I don't like.
I lurk on the Nim IRC channel sometimes. The toxicity there can be unbelievable.
Look at these IRC logs, for example.
We see insults like:
And there's lots of unnecessary sarcasm:
Then there's lunacy and quasi-psychotic ranting and rambling:
What's there to discuss, then? What new thing does Nim bring to the table?
Show me some code that shows how Nim can do things better. It's more convincing than a list of bullet points anyway.
Nim (*).
We are The Knights Who Say "Ni!".
(*) In Portuguese, "Nim" can be seen as a hybrid of "no" [Não], and "yes" [Sim]. Often used to express "I could, but I won't".
I use indents, braces and BEGIN and END so....
BEGIN
{
code here
}
END
I'm working on a new version of Anal called Anal++
Anyways, the language is designed to keep anal retentive developers arguing in nonsense meetings for years to come. "Oh no! Never put the curly braces and the BEGIN/END on the same line!"
"No, it's better to do so but indent 4 spaces and not a tab!"
"I STRONGLY disagree, you should never use tabs but SHOULD put the curly braces on the same line!"
"No no no! Indent AFTER the Begin but before the curly brace!!!!"
The example code I've seen from Nim reminds me a bit of Pascal. At least the use of the keywords proc and var. Glad they went with Python-style blocks instead of Pascal-style begin and end.
But nim does look like a nice language. The fact that it generates C code and compiles with a C compiler means that it could be integrated quite smoothly into projects using other languages.
Nim is on my list of languages to try some time if I ever need to write C-compatible code.
Nim is great but I strongly recommend anyone using it consider the Rod framework. It improves maintainability by changing any Nim program to one that prints "Write this program in a real language" on the screen I n a blinking neon marquee.
"...the readability and ease of development of Python..."
I'll admit I'm not really a Python user, but I've seen lots of Python code and compared to other languages I've never considered Python to be very readable.
Just cruising through this digital world at 33 1/3 rpm...
HAI 1.2 ;)"
CAN HAS STDIO?
VISIBLE "I've been looking for something to outdo LOLCODE in terms of pointlessness.
KTHXBYE
Anons need not reply. Questions end with a question mark.
Just reading the docs, the first thing that pops out at me is that there is no need for a separate 'const' and 'let' keyword. They describe the difference as:
"The difference between let and const is: let introduces a variable that can not be re-assigned, const means "enforce compile time evaluation and put it into a data section":"
But the compiler can detect whether the expression on the right hand side of the let assignment is compile time constant, and "put it in the data section" if it is; no need for the programmer to have to make that decision.
Nim sounds similar in its goals to D, another batch-compiled statically typed language with GC. The main difference is that Nim seems to innovate a lot syntactically. How do the languages compare otherwise?
Show me some code that shows how Nim can do things better. It's more convincing than a list of bullet points anyway.
Wrong question. The single most interesting idea I've seen in Nim isn't something you can see in a piece of code: it's how it aids the programmer in optimising code late. It's only the memory management system, but the idea is that you prototype your code with a garbage collector switched on, and once the code is working, and assuming you need the performance gain, you code up your own memory management routines tailored to your code.
It's an idea that seems logical, but is frustratingly uncommon, and is not normally an in-built feature of the language, but rather just a part of the dev workflow (for example: use a generic sort algorithm from a library during prototyping, then analyse the data you're working with in large-scale tests and select or code a more efficient implementation for your situation). The weakness in doing this manually is that it first means tying your codebase to a library, with its various quirks, and then potentially rewriting vast chunks of code to get it to work with a different library (and then there's the risk of cascading changes).
I think Nim's approach is a small step in the right direction, taking us towards logic first, optimisation later.
Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
Looks like another language that does not thoroughly address parallel processing. With the mention of go, I was hoping for something like goroutines (one of the few things I like about the language) - but no. Doesn't look like it.
There's nothing to discuss since any algorithm can be written in any turing complete language.
There's plenty to discuss, since the ease with which you can express yourself matters greatly in any practical sense. However, the progress we have actually made in this area is not nearly as impressive as one might hope - new languages mostly bring us the same thing, but with slightly different syntax. Real breakthroughs are very, very rare. Remember the 4GL initiative from Japan in the nineties? Still waiting for that killer language... The closest I've seen is the Wolfram language. Maybe that's the way forward: a massive support library and huge, online databases.
As for Turing machines... On a machine with finite memory, all states the machine can be in can be enumerated, and each state always leads deterministically to a single next state. Since the total number of states is finite (very large, but finite), this means that at some point it must either return to a previous state, or halt. If it returns to a previous state, it will then continue to loop forever (since each state deterministically leads to a single next state). Thus, if you have the capacity to track state changes for long enough, you will be able to determine if a program will halt or not.
And yet, there's Turing's proof. Why the discrepancy? Well, simple: a Turing machine has an infinite tape, and can therefore produce not a finite, but an infinite number of states. Any computer we have in the real world does not have infinite memory, and is therefore not a Turing machine. To be considered Turing-complete, a language must be able to simulate a Turing machine - and that's actually impossible, since it can never meet the "infinite tape" requirement. You might claim that "any algorithm can be expressed in any Turing complete language", but since we don't have any, that's really a moot point, and we would perhaps be wiser to focus on other aspects of the language rather than a theoretically impossible, and perhaps even undesirable feature.
Your move, AC ;-)
They should follow Rust's example and start being more inclusive to minorities. I suggest renaming the Nim package manager (nimble) to NAMBLA.
Different AC here. A language can be considered Turing-complete even if the machines you can run it aren't universal machines.
In your reply you used "otherwise you'd knew" and "the sixt more spoken language".
I think you meant "otherwise you'd Gnu" and "the Sith more spoken language".
No brain, no pain.
And yet, there's Turing's proof. Why the discrepancy? Well, simple: a Turing machine has an infinite tape, and can therefore produce not a finite, but an infinite number of states. Any computer we have in the real world does not have infinite memory, and is therefore not a Turing machine.
A slight correction, perhaps: for practical purposes, and for algorithms that use memory bounded linearly in time, it's effectively infinite because we can just keep manufacturing it.
Ezekiel 23:20
The chief counterexample to the statement "Python is strongly typed" is that almost anything can be used in a boolean context.
Is it? I guess that's just a matter of interpretation, but to me, all it means is that Python has its own specific definition of truth and falsity. Many languages seem to have that.
Ezekiel 23:20
What if God Trumped all of us... Combed one over all of us...
doesn't sounds all that unique. Lots of languages let you muck with memory allocation. For example C++
Perhaps because languages that waste lots of white space and/or require it specially formatted are a pain to work with?
I found programming in nim fun; when I looked into runtime debugging nim, I wasn't very convinced I could actually use it for anything anytime soon.
Matt
To be considered Turing-complete, a language must be able to simulate a Turing machine - and that's actually impossible, since it can never meet the "infinite tape" requirement.
Languages are not machines. Languages have no memory limitations, and therefore have no trouble simulating a Turing machine.
The fact that we run code written in those languages on finite machines does not change the Turing-complete nature of the languages.
Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
So its pascal without begin and end?
http://michaelsmith.id.au
doesn't sounds all that unique. Lots of languages let you muck with memory allocation. For example C++
But C++ doesn't have a garbage collector, and more generally most languages have [i]either[/i] implicit garbage collection [i]or[/i] explicit memory management -- Nim has both, allowing you to ignore memory management completely until you're ready to optimise -- that's a very useful thing. I'm no expert on languages, so I don't know which of the more advanced multi-paradigm languages have similar options -- but it's something that's still missing from mainstream languages.
Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
By that logic, if I want a production script to copy some files around and test a few things I should code it up in C++ or ASM since all languages are technically equally suited for the task.
that's enough of a fail to ignore it completely even if the rest of it isn't brainded.
Ruby is along with Python and Perl one of the big 3 scripting languages. It seems pretty stable at over 1% of programs according to TIOBE and is currently surging again to 2.5%: http://www.tiobe.com/tiobe-ind... . At this point obviously Python is in first place but I'd say Ruby is mostly tied with Perl for 2nd. How is that not success? Certainly it isn't a top 5 language but a consistent top 100 is a successful language.
As for nim I think I've only heard of it a few times so I'd agree that language ain't doing so hot yet.
But what is the value of an algorithm that you can't actually execute?
In the practical world, language efficiency actually matters and is a reasonable thing to discuss.
Sure, that's true. But it has no bearing on the question of whether a language can accurately be called Turing Complete -- and Turing Completeness also matters, because it defines the class of algorithms that can be implemented in the language. What's the value of an algorithm that you can't implement because the language lacks the necessary expressive power? Except in very limited circumstances, Turing Completeness is a prerequisite. Without it, there's no point in discussing efficiency.
Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
FWIW Wolfram's language is a functional programming language. If you want to learn a very cool language that takes those ideas much much further I'd suggest Haskell.
Mod parent up. Excellent short description about what Nim is bring to the table.
Yet another language. What Nim is good for?
There's a bit of handwaving in the introduction concerning the garbage collector. There's a compiler option to turn it off allowing you to manually manage memory, but what if libraries you're using aren't all written to manually clean up after themselves? It seems to me that one of two things will happen:
1. Not everybody in the community manually manages their memory, making the --gc=none option impossible to use in practice.
2. Everybody is required to manually manage their memory so that others can gc off, effectively making the memory management mandatory.
So unless there's something more to this it seems like it's really just punting the gc decision to the community and creating confusion and uncertainty.
Can anybody with more knowledge maybe clear this up?