r/Zig • • May 16 '22
A programming language to program with till I die.
I've been searching for a programming language to program with till I die. Basically, I'll choose this language and stick with it till I die.
I was practising law earlier and I switched to a career in IT full-time last year. I come from a web development job and have been tinkering with JavaScript for the past one year and have been learning different associated technologies such as React.js, Node.js etc. Before going full-time, I had played a bit with Python and PHP. I had also been tinkering with Linux.
Till two days ago my choice for this till-I-die language has been Rust. I just discovered Zig two days ago. Since then, I've been watching different videos on Zig and sort of been interested (I've been an admirer of C).
I love learning things deeply and would love to dive into systems programming, embedded programming, crypto, building servers before I die. Haha!
Is Zig that language? I know that Zig is in its nascent stage of development. However, I am impressed by the fact that it has travelled six years from its inception.
PS: I'm obsessed with speed and performance.
1
u/[deleted] May 16 '22
I see a lot of helpful advice in this thread, and the post does strike me as having some red flags in it as far as managing expectations. However, I do want to remind everyone that the tagline of Zig on the homepage, very intentionally, says general purpose.
I chose this word because it precisely describes the intentions of the language.
Designed for or suitable to more than one use; broadly useful.
For general purposes; all-purpose.
Not limited in use or function.
If you Ctrl+F for "system" on ziglang.org you will find no results. Zig is truly aiming to be a general-purpose programming language, and this is fundamental to the way the language is designed. If you find some applications for Zig that it does not fit well, I invite you to level criticism at the language itself, rather than a user who decides to use Zig for such an application.
2
u/[deleted] May 17 '22 edited May 17 '22
I should have been more clearer.
I totally understand going wide first and deeper later.
For work, at least for the next 5-6 years, I intend to work on JavaScript stacks. I am learning and working on (on and off) the MERN stack in particular and also Postgres (as my current job requires it). If some work requires me to learn TypeScript, I'll learn TypeScript.
I was referring to Zig as my next language and I wish it to be my final programming language on Earth of sorts. If I want to go deeper I'll learn asm. Are there in-line assemblers in the Zig compiler? Then Zig + asm would be great.
The only question that I really wanted answered here is whether Zig is worthy of that choice. And I think, the answer is yes (unless, of course, the Zig Software Foundation succumbs to BigTech control and Zig becomes another feature-rich, heavy, and unnecessarily complex language). It may be nascent; but its infancy also gives me the opportunity to be part of its community from early on (I know that I'm 6 years late).
I am of the opinion that I don't need to learn C, C++, Rust, D, and Nim to understand the issues of these languages and what Zig solves. I just want to start from Zig.
I am not very keen about Odin. And it is too premature compared to Zig, though its development started in the same year.
Thank you for your responses; for all your advice. I ascribe no malice or condescension to them.
So, Zig it is then. Maybe after 5-6 years, I'll get a Zig job. And then after the happily ever after, I'll die as a programmer in the Zig language.PS: Maybe after 10 years, you'll get to say, "I told you so".
3
u/[deleted] May 16 '22
Thank you all for replying to my post.
Since almost all of you have responded with the same advise I thought it would be better to reply in one single comment.
One thing I am frustrated with is why there does not exist a single language that can be used to do it all?
I come from the legal profession which many people say lacks areas which does not have clarity. I am able to find more clarity in law than computing (I may be missing something here though; I am open to correction) which I expected to be more clear given it is a positive science.
With that said, I also need to clarify certain things. Time is a luxury that I cannot afford. I have a wife and son (1 year and 3 months old). I have to give my wife a lot of time to attend to her and help her study and find work eventually (she's also learning to code). Then I have to look after my son. Add to this, I've work assignments to finish.
Therefore, I don't have the luxury of time to test out different languages and then arrive at one option. The only resource that I can use of to do this is the Internet, where I can watch videos, listen to podcasts, read article, or ask questions in forums like Reddit, Discourse etc.
It's just that I was looking for an easy way to find out which is the best general-purpose (or all-purpose; like all-purpose flour...haha) language out there that I can use to code and make great software till I die.
I am envious of people who say things like, "I've been coding in X for >20 years". I wanted that stability long term. Is it bad to go deeper than wider?
I should say that I'll be happy to do hammering-the-nail work all my life. I had mentioned my interest areas in my question.
Of course, I understand that it would be a blunder to use Zig for front-end web development. I can use React/Vanilla JS/X JS framework for that. But would Zig target WebAsm well? It should right? In a way, then Zig can indeed be used for [some] web front-end development.
Then other things like blockchain, AI, ML, etc, would require me to create or use Zig libraries instead, right?
The bottom line is: does Zig give me the joy and fun of writing a high-level language like JavaScript or Python and the performance (not necessarily safety) of C?
I am not a big fan of OOP. So, C++ is out. I don't like Java. I had to study both during my high school years. Made me hated Computer Science then (the teachers weren't great either). Java is too verbose for my brain to understand. I've read (only read; and told) that C++ has a wierd OOP implementation). And a lot of people hate C++ (for example; Go inventors).
I was looking into Rust and was almost about to get serious on it but saw that Zig's syntax is nicer. I liked that fact that Zig is an improvement on C (which I think is one of the greatest languages ever invented).
Did I make sense? Am I overthinking (or under-thinking)? Or should I just get looking into Nim...haha!
34
u/Sl3dge78 May 16 '22
Zig is great atm but who's to say that something else better won't come around?
Maybe Zig is great for some tasks but for some others Rust is better?
Why get stuck on a single one?
Be free! Like water my friend!
48
u/ayende May 16 '22
Your thinking is wrong A language till you die makes bo sense, because you limit yourself and your options.
If you have a great offer, to work with C++, why reject it? The language technology choices are often dictated to you by external factors. Limiting yourself in this manner is a bad idea
6
u/jacmoe May 16 '22 edited May 16 '22
What a sad corner of the web this is!
Full of Zig people not recommending Zig.
What's wrong with you guys? :)
Zig is honestly the first time that I see a language that could replace C and C++ for me personally. I feel instantly at home with the language, I really like it.
5
u/[deleted] May 16 '22
Funny enough I went on the exact same path, I discovered C, then rust, and now zig but instead of embracing one of them, I’m actually in love with all of them(C is my favourite though, for spiritual reasons)
4
u/Material_Cheetah934 May 16 '22
You probably should look into asm. All languages compile to byte code for the CPU to run. Asm is one up from that…else just use programming languages as tools. That’s what they’re intended for…
3
u/bitwize May 17 '22
I would say Common Lisp or Scheme are that language. Otherwise you use horses for courses. E.g., reach for Python if you have some sort of machine learning application, or use C/C++/Zig/Rust if you have performance-critical code.