Hi, just a question. I came across this video by the ZIG lang dev and what was interesting is he named NIM (along with some other languages) at 11:27 saying that the memory allocation is hopeless stating that C is the only one that writes perfect software. However, NIM compiles to C so I am not sure if I am missing something here. I am completely new to programming and looking for a language to get into so I am just going around researching every language and so far NIM is my favorite I bought the book so getting to learn it. However, from what I have seen so far is that people will make assumptions when talking about languages and not know the full facts hence why I am asking if this video is correct in its statement or if there is more to it?
Here is the video in question: https://www.youtube.com/watch?v=Z4oYSByyRak
If you don't want to open the link it is on youtube called "Zig: A programming language designed for robustness, optimality, and clarity – Andrew Kelley"
Well he is just plain wrong.
If you use only stack or ptr object (and no seq/strings/ref) there is no hidden memory allocation. For good measure you can compile with gc:none
Guess other languages with hidden memory allocations? C++ and Rust, if you use std::vector/Vector and you append to those containers when they are at full capacity, there will be a hidden memory allocation double the previous capacity, the old data will be copied into the new buffer and then the old buffer will be destroyed.
There is a reason why people are looking for a better C, because managing all those manual allocations is tedious and error-prone, and I do not see how having half your code being about memory management makes perfect software.
"Zig is perfect software"
"Manual Memory Allocation... every standard library function takes a Memory Allocator as argument"
🤔
Andrew Kelley is a smart guy. He is asking smart questions. But, like mratsim, I don't agree with him on some of his answers to those questions.
That said, Andrew Kelley is talking about super advanced stuff that you should not worry about if you are a complete beginner.
If you are completely new to programming, some languages are more beginner friendly than others. As much as I love Nim, honestly, I would suggest starting with Python. It has much more resources for beginners than any of the "hip" newer languages. Then come back here after you have some experience. Nim will be easy to pick up once you know Python, and you will really appreciate how great Nim really is :-P
the book expects you to have some other language knowledge first
Nim basics tutorial doesn't expect you to have some prior knowledge, and shows you the basic concepts in Nim.
Nim basics tutorial doesn't expect you to have some prior knowledge
Yes, I have to admit that the situation for beginners has improved in the last years, so for smart people starting with Nim as their first computer language is an option.
Note that we recently got one more core components for computer science beginners:
And while we are currently listing tutorials -- google recently gave me
https://flenniken.net/blog/nim-macros/
Not very fresh, but I regard it as a good companion to tut3 and macro section in manual.
Miram, are there links from Nim homepage to these documents?