Live data from Hacker News

How I Built Zig-SQLite

rischmann.fr

101–104 of 104 posts

Re: How I Built Zig-SQLite

#101
post #99
post #96

Earlier quoted context omitted.

> rust also incurs a non-negligible ongoing productivity cost for its complexity This isn't really consistent with my experience. Compared to writing other languages with varying levels of strictness (C, Python, Go to name a few), Rust's compiler saves me a lot of time writing tests and finding bugs. It doesn't save me the work of fixing them, but in my experience, bugs that are hard to find and easy to fix drastical…

I am surprised that you don't encounter a productivity cost in rust vs languages with a gc (like python and go). If that were typical then I assume everyone would be using it. What do you consider to be the tradeoffs between rust and other languages? What are its drawbacks in your experience? How much rust experience do you have compared to other languages?

The productivity cost is mostly up front, once you understand borrowing it's seriously not bad in 99% of cases. Also, you can be initially productive in C or C++, but how much time goes into trying to fix undefined behavior, threading issues,etc. More importantly, when do those hours get spent? Is it after a customer is screaming into your support chatbot, or is it before you launch during normal development? To me that's the difference and the killer feature. That's why ms, aws, etc are using it. Not because it's new and marginally/debatably better then c/c++.

Once I started realizing what the borrow checker was saying it wasn't "fighting the compiler" I realized what I was asking the compiler to do was really not a good idea. It becomes your friend basically.

I didn't make this post to shill rust, I'm pretty language agnostic to my own detriment... The point is, it's worth considering and trying it again if you didn't get it the first time around. Rust took me 2x to become a tool I'd use, I honestly hated it at first.

Re: How I Built Zig-SQLite

#102

Earlier quoted context omitted.

Rust probably had a fairly small "language footprint" when it was only a few years old with no production use cases as well. I've used both in some small hobby projects. I like writing zig significantly more than rust, but we'll see how long the language remains small and compact.

I first tried rust in 2015[1]. It was my first serious attempt at rust. The language was not small whatsoever at the time. It was not fun. [1]: https://github.com/motiejus/makelua/tree/rust

I recommend trying it again. Consider how old the language is, 7 years is a really long time ago.

It may not be the smallest language, but, it compiles pretty tightly.

Re: How I Built Zig-SQLite

#103
post #11

Earlier quoted context omitted.

Yes, but say you are not yet writing Rust, perhaps you should choose Zig instead of it?

I think you're both asking the same question from different angles. If I understand correctly, and I could be misremembering but Zig is supposed to be compatible with C++ not just C, which is something that is not necessarily straight forward in other C / C++ competing languages. I hear even D has some issues with mangling and what not. In all honesty, I prefer the syntax of D over all the others, it feels the most l…

I like that the web server in Go's standard library comes as a library, so you can embed a web server into your application, even if it otherwise isn't web-related at all, just to allow for some introspection and/or control.

(To be fair, I think Python and Ruby have HTTP servers in their standard libraries as well, at least minimalist ones.)

Re: How I Built Zig-SQLite

#104
post #99

Earlier quoted context omitted.

I am surprised that you don't encounter a productivity cost in rust vs languages with a gc (like python and go). If that were typical then I assume everyone would be using it. What do you consider to be the tradeoffs between rust and other languages? What are its drawbacks in your experience? How much rust experience do you have compared to other languages?

The productivity cost is mostly up front, once you understand borrowing it's seriously not bad in 99% of cases. Also, you can be initially productive in C or C++, but how much time goes into trying to fix undefined behavior, threading issues,etc. More importantly, when do those hours get spent? Is it after a customer is screaming into your support chatbot, or is it before you launch during normal development? To me t…

I think we can agree that c and c++ are essentially table stakes at this point and that anything new needs to offer strong incentives.

I like rust (I actually liked it from the start years ago). However, I believe that there are tradeoffs and the companies you named use other languages in addition to rust because they also believe there are tradeoffs.

Rust won't be the last language. I don't want to get too comfortable with what I know and miss out on what I don't. I am excited by new languages that may also have something to offer. However, I can't master them all so a good discussion is valuable and can offer shortcuts through the noise. I think my assumption in my first reply to your original post was that you were interested in the same thing. However, if you are happy with rust then I don't want to spoil your enjoyment.

Post reply on HN