Live data from Hacker News

Why did we choose Rust to develop TiKV?

pingcap.github.io

131–140 of 206 posts

Re: Why did we choose Rust to develop TiKV?

#131
post #15

I can't wait until Rust is no longer be perceived as hipster trendy choice. It's a very solid language in the no-GC niche and shouldn't need a blog post from every project that uses it. Does it have to be 30 years old before it's not "new" and weird?

I'm (very) old school, C is still my language of choice (though it could use some help). I like the syntax, it's pretty simple. I tried playing with Rust and found the syntax to be off putting. I really wonder why each new language feels it is important to come up with a different syntax to say the same stuff. Go did a lot better than Rust in this respect, at least in my opinion. It may be that appealing to C program…

What is the biggest difference between C syntax and Rust syntax? I can only really think of how types are stated: in C they precede the variable, whereas in Rust you put a colon and then the type (but often you don't need to do this cuz of type inference).

This change is much better IMO because there's a clear delineation between types and variables.

The same idea applies to function signatures, which are much clearer to me in Rust than in C/C++.

Re: Why did we choose Rust to develop TiKV?

#132
post #130

Earlier quoted context omitted.

What parts of Go tooling do you miss in Rust?

go fmt

https://github.com/rust-lang-nursery/rustfmt

It should be distributed along with the rest of the tooling in the coming months!

Re: Why did we choose Rust to develop TiKV?

#133
post #15

I can't wait until Rust is no longer be perceived as hipster trendy choice. It's a very solid language in the no-GC niche and shouldn't need a blog post from every project that uses it. Does it have to be 30 years old before it's not "new" and weird?

I'm (very) old school, C is still my language of choice (though it could use some help). I like the syntax, it's pretty simple. I tried playing with Rust and found the syntax to be off putting. I really wonder why each new language feels it is important to come up with a different syntax to say the same stuff. Go did a lot better than Rust in this respect, at least in my opinion. It may be that appealing to C program…

Syntax is a method to express ideas. Ideas at the core of a language should be easy to express with that language's syntax.

Some ideas are not possible in C as they are possible in Go/Rust/other languages. With the years, some ideas become more mainstream and then get integrated into the new languages that arise. These new languages need to express ideas that were not expressible in C, and thus may be better served by adopting different syntaxes.

In short: the ideas at your disposition and the ergonomic with which you can express them is a function of the syntax used to represent them. Different languages focus on different ideas, and so it follows that different syntax might be warranted.

Re: Why did we choose Rust to develop TiKV?

#134
post #98

Earlier quoted context omitted.

Would you please give an example on how are Google's company-strategic goals making Go platform-specific, or hampered in any way? Please note that I am not demeaning your statement. It's a legitimate curiosity on my side.

One example that comes to mind is Go dependency management. For a long time (and still?) Go had no way to do versioned dependency. Obviously this is no problem for Google which reportedly build from HEAD, but this shows Google-bias in Go development.

It does not show a strategic agenda that influences the language's governance, it only shows that Google was blind in that area.

Re: Why did we choose Rust to develop TiKV?

#135

TLDR; the author likes rust and wanted to use it. The article reads like some dev's rationalizing what they want to do to the management. These types of things are fine, but as a dev to a dev it is obvious that they just want to use this cool tech. Good for them.

Even more, Go is excluded as (author's opinion) goleveldb is not as mature as RocksDB. Thus they should have used CGo, which is way suboptimal, slower etc. The title should have been: "C++11 or Rust? We chose Rust". In a greenfield project like this one seems to be, it's I choice I would approve. A personal note regarding future comments to this thread: I have had enough of negative advertising against Go in every la…

I will probably use Go as soon as it has generics.

=)

Re: Why did we choose Rust to develop TiKV?

#136

It is kind of funny how software engineers can engage in lengthy discussion about tooling. Imagine the same for architects. Instead of looking at the building they would talk about the type of hammer they used while building it.

I think "hammer" is pretty diminutive as a parallel for a choice of language. I feel a better parallel would be "architects talking about steel alloys versus composite materials" which is not crazy.

Re: Why did we choose Rust to develop TiKV?

#137
post #95

Earlier quoted context omitted.

What do you mean by not adequate? Go tooling is way better than Rust. The only thing that Rust does better in that field is package dependency and it's going to change soon for Go.

What parts of Go tooling do you miss in Rust?

- Fast / cross compile

- Benchmark / profiling are much better ( https://blog.golang.org/profiling-go-programs )

- go fmt / go vet

- go doc

All of that that is supported by default by the Go team on all platforms, meaning it works well and I don't have to worry of using a 3rd party Cargo package.

Re: Why did we choose Rust to develop TiKV?

#138

Considering that their team likes Go, it seems strange to me that they would consider Rust over Go for the storage layer. A storage layer should be IO-bound, and should hardly trouble the CPU; the choice of language really should not be a determining factor. The big wins in that space are architectural, not language specific.

Developing a storage layer as elaborate as RocksDB from scratch is quite an endeavor, and wanting to just use RocksDB instead of making your own is a smart decision. From there, Go is sort of easy to throw out of the picture: using cgo kills performance and safety. I say this as a person who uses Go as my workhorse, have used it for many years and has a favorable opinion of it.

Re: Why did we choose Rust to develop TiKV?

#139

Earlier quoted context omitted.

Even more, Go is excluded as (author's opinion) goleveldb is not as mature as RocksDB. Thus they should have used CGo, which is way suboptimal, slower etc. The title should have been: "C++11 or Rust? We chose Rust". In a greenfield project like this one seems to be, it's I choice I would approve. A personal note regarding future comments to this thread: I have had enough of negative advertising against Go in every la…

I will probably use Go as soon as it has generics. =)

So... Never?
Post reply on HN