318 karma · joined Jun 7, 2020 (6y ago) · 105 submissions
comment 4y ago · link · parent
Read [0] for a comparison among Zig, D, Rust, and C++, and read [1] for a deeper look at the language's goals. I personally really love Zig's type system [2], with a system for generics that is very simple and consistent.
[0]: https://ziglang.org/learn/why_zig_rust_d_cpp/
[1]: https://ziglang.org/learn/overview/
[2]: https://nathancraddock.com/blog/consistency-in-zigs-type-sys...
comment 4y ago · link · parent
Publishing writing on a blog just makes this information public. I chose to do that since I benefit from the blogs of others, so I might as well make my learning and insights public, hopefully helping someone else too!
comment 4y ago · link · parent
I learned python, JavaScript, and Java before C, and it wasn’t until I learned about manual allocations, pass-by-value, and pointers that the garbage collected languages made sense. It had never really clicked why all object params are references in those languages until I learned C and C++
Now, I don’t think it’s essential, but learning more about how computers and memory operate doesn’t hurt!
comment 4y ago · link · parent
[0]: https://github.com/romkatv/powerlevel10k
[1]: https://starship.rs/
comment 4y ago · link · parent
One reason I think "no hidden control flow" is used so much when talking about Zig, is because Zig wants code to be easy to read, including understanding what is happening behind the scenes. Zig also has no hidden allocations (a function call will not allocate unless given an allocator) which fits this model.
[0]: https://ziglang.org/learn/why_zig_rust_d_cpp/ [1]: https://ziglang.org/learn/overview/
comment 4y ago · link · parent
For me it hits the sweet spot of fixing major problems in C, while staying small, consistent, and easy to fit the language inside my head unlike C++ or Rust. Also absolutely loving the compile time evaluation and type syntax.
comment 5y ago · link · parent
[0]: https://www.reddit.com/r/vivaldibrowser/comments/f9ui2b/is_t...
comment 5y ago · link · parent
I choose arch for three reasons. 1. The official repos and the AUR have nearly every package I have ever needed. And usually packages are updated soon after a release. 2. Being rolling release, I never need to reinstall arch, just run updates periodically. 3. I love learning, and I have learned more about Linux and system maintenance from arch than anything else. While there might be a slightly larger cost of time spent setting up (and maintaining when I break something) arch, I have decided that the tradeoffs are worth it to me.
comment 5y ago · link · parent
> You’re not a machine. Every teacher and every student is different. The art of teaching is finding a technique that works for the situation at hand.
Just knowing something (like programming) isn't enough to be a good teacher. It really is an art that takes time and caring to develop. Thanks to the author for putting my thoughts into words so well!
80.
GitHub Copilot for Neovim(github.com ↗)
1 points · by cturtle · 5y ago · 1 comment
comment 5y ago · link · parent
I admittedly know C very well, but assuming you already know a language with a C-like syntax (C++, Java, JavaScript, C#, Rust, etc.) most things like functions, control flow, variables, statements map to Zig with only small syntactic differences.
One thing that may be difficult to learn not knowing C is working with strings, since they are just arrays of bytes. Most other languages have a string type, but Zig is much more like C in that strings are null-terminated fixed-sized arrays of bytes.
comment 5y ago · link · parent
I don’t know about reading std alone to learn Zig though, I used other sources like ziglings and ziglearn which taught me syntax and patterns. Had I started with the standard library I doubt I would have picked up the language as quickly as I have.
So having learned Zig I am much more inclined to look at standard libraries for languages I learn in the future, but I don’t think it’s wise to rely only on standard libraries for learning.
comment 5y ago · link · parent
comment 5y ago · link · parent
As an example of why I love Lua support, I wrote a small file finding plugin for myself because I wasn't satified with the many alternatives (not a huge fan of fuzzy-matching). It took only a couple days to have a working plugin, and it has been fun to extend it with new features over the last month. The Lua API is relatively straightforward, and it really lowers the bar for writing plugins and small helper functions to add to your config.
Switching from Vim is not necessary, but Lua support alone was enough to convince me to give it a try, and is the main reason I have stayed with Neovim.
comment 5y ago · link · parent
comment 5y ago · link · parent
Now I just prefix my query with !py and I’m immediately taken to the docs.