Better HN
topnewbestaskshowjobs
Log inSign up

cturtle

318 karma · joined Jun 7, 2020 (6y ago) · 105 submissions

Submissions

comment 4y ago · link · parent

I like Zig because it feels like a refinement of C with all the knowledge of the years since C was created. Some of my favorite features are no global allocator, well-defined pointers (with optionals required for nullability), generics and partial evaluation at compile-time, and builtin features/functions for all sorts of operations that are only extensions in C/C++ like SIMD and packed structs.

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

I enjoy sharing posts because I enjoy the process of writing about something that inspires me. If I made progress on a personal project or learned something interesting, it is nice to take a step back and log it. I find that I can recall what I learned more if I wrote about it, and if I forgot, I have a place to look back on!

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

Thanks! I guess I need to learn more about Nix then :)

comment 4y ago · link · parent

Maybe Nix but with Lua?

comment 4y ago · link · parent

Completely agree here

> Also, fantastic music

Sonic 2 (especially Chemical plant zone) is among my favorite game soundtracks.

comment 4y ago · link · parent

Yes! Or at least a language that gives you access to manual memory allocations.

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

I agree that an electron-based editor is not as responsive as a native one, but the vscode devs have done a lot to make it as fast as it is. This talk [0] is a very interesting look into everything the devs do to make it startup quickly.

[0]: https://m.youtube.com/watch?v=r0OeHRUCCb4

comment 4y ago · link · parent

Those are all valid points. At the moment I believe Zig has decided to leave full unicode support out of std because they don't want language releases dependent on unicode updates.

comment 4y ago · link · parent

Fancy shell prompts, often requiring patched fonts. Something like powerlevel10k[0] or starship[1]

[0]: https://github.com/romkatv/powerlevel10k

[1]: https://starship.rs/

comment 4y ago · link · parent

The style guide in the language reference explains the accepted naming conventions [0].

[0]: https://ziglang.org/documentation/master/#Style-Guide

comment 4y ago · link · parent

> With in-stack transform, the blending modes and overlapping layers are composited on top of the transform preview. This was a feature funded by the Blender Institute.

Great improvement, and it’s wonderful to see support from another open source project.

comment 4y ago · link · parent

Operator overloading, constructors, destructors, exceptions, etc. This page [0] is good for comparing Zig to other languages. And this [1] is a nice overview of the language.

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

Zig is a general purpose language with no hidden control flow, powerful compile time metaprogramming, and easy cross-compilation and interop with C code.

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

The UI is written in React, and apparently runs as a sort of an extension to chromium[0] according to a Vivaldi dev. I expect that would be a large source of performance decreases with a JS powered UI. It's certainly an impressive UI though.

[0]: https://www.reddit.com/r/vivaldibrowser/comments/f9ui2b/is_t...

comment 5y ago · link · parent

That reminds me of the many wonderful soldering stock images that show the user holding the metal tip enclosure rather than the handle.

comment 5y ago · link · parent

They probably meant the Intel denoiser bundled with Blender.

comment 5y ago · link · parent

As someone fortunate enough to participate in the GSoC twice, I think this is fantastic news. I had such a great experience and learned a lot. It’s wonderful that this change allows even more people the opportunity to be compensated for open source dev.

comment 5y ago · link · parent

In the last two years I’ve been on the arch-announce mailing list I think I have only needed to respond to breaking updates twice.

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

I do a lot of one-on-one programming teaching, and this really hit home with how I approach teaching. I especially liked the following:

> 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

Ziglings [0] is a series of small problems where you solve bugs in Zig code, and I enjoyed working through them. The readme claims "you are not expected to have any prior experience with... C." When I did ziglings I found the most difficult part was adjusting to the type syntax (which I now love).

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.

[0] https://github.com/ratfactor/ziglings

comment 5y ago · link · parent

I’m using Zig a lot right now, and I have been pleasantly surprised by the standard library. Maybe it’s due to Zig being a very straightforward language, but I find most everything I read in the standard library to make immediate sense.

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

Good to hear! Last I checked (around a year ago iirc) it wasn't possible.

comment 5y ago · link · parent

Maybe Venmo since there is no desktop/web client. It frustrates me that Venmo has become so popular in my circles when it’s smartphone-only. I have a smartphone so I’ll keep using it there, but I could imagine some might appreciate the option to run apps like Venmo on a PC.

comment 5y ago · link · parent

It certainly put a smile on my face :) and considering the events of Rhythm of War it’s a very fitting name too!

comment 5y ago · link · parent

Only slightly related, but this reminds me of searching on Google “how many electrons are in the Sun”. The quick answer page parser fails beautifully.

I wonder how often Google returns something wrong or completely unexpected for its quick answer result.

comment 5y ago · link · parent

I've been using the nightly builds for a while now, and the language server support works very well, but for me the most exciting part of Neovim is Lua. Lua isn't the headlining feature of v0.5, but the API has still grown a lot since the last release.

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

There is a draft on the GitHub wiki here: https://github.com/neovim/neovim/wiki/newsletter-%2311-:-the...

comment 5y ago · link · parent

That’s good to know!

For clarity, I wasn’t trying to say DDG is better than Brave, rather agreeing with the parent that there are smarter tools for gathering information rather than relying solely on a search engine.

comment 5y ago · link · parent

Along these lines I use ddg’s bangs for the same benefit. So many searches for Python help are filled with very shallow intros on tutorial sites of varying quality with the official docs rarely the first result.

Now I just prefix my query with !py and I’m immediately taken to the docs.

1234