News for hackers. Stuff that matters.
Re:Why did we choose Rust to develop TiKV? by zerr on Wednesday September 27, 2017 @05:10AM (#15346058)
On the other hand I can't wait when Swift becomes general, non-Apple language, available on most platforms (including the most popular one) "with batteries" - that will be the end of Go and Rust I think :)
Re:Why did we choose Rust to develop TiKV? by readittwice on Wednesday September 27, 2017 @06:18AM (#15346336)
> that will be the end of Go and Rust

Will it? I don't think so, although I think Swift is great. IMHO Rust targets another market compared to Swift. Rust feels more low-level, e.g. Swift uses Reference Counting for everything. Swift also can't give you some of the nice guarantees you get in Rust.

Go also has some nice stuff compared to Swift: simplicity, goroutines or tracing GC. Go is also already widely used.

Swift is certainly great for Mac/iOS-Development, but I am somewhat skeptical for other platforms. I am afraid that non-apple-platforms will always feel a bit like second-class. It's just not Apple's main priority and most Swift-devs will always be paid by Apple. But who knows, I may be wrong.

Re:Why did we choose Rust to develop TiKV? by cyber1 on Wednesday September 27, 2017 @05:53AM (#15346237)
Swift can't replace Rust in system programming domain because he uses ARC for memory management but Rust gives you choices.
Re:Why did we choose Rust to develop TiKV? by zerr on Wednesday September 27, 2017 @06:25AM (#15346375)
I don't think ARC is an issue here - it's just a deterministic reference counting - a la implicit using of smart pointers. Besides, Swift also has some unsafe pointer types as well.
Re:Why did we choose Rust to develop TiKV? by cyber1 on Wednesday September 27, 2017 @06:37AM (#15346425)
Yes, you right according to "deterministic" but you forget about overhead. Rust gives you more safe control on memory management and in most cases, you can always write the fast and efficient safe program without the overhead. Rust give different smart pointers and even sometimes when you 100% understand what are you doing you can use unsafe raw ptr.
Re:Why did we choose Rust to develop TiKV? by zerr on Wednesday September 27, 2017 @06:50AM (#15346476)
Yes, there is a trade-off of course. I think Swift is in the middle on Usability - Safety axis (C++ being on the left and Rust on the right extremes).
Re:Why did we choose Rust to develop TiKV? by imtringued on Wednesday September 27, 2017 @11:39AM (#15348877)
For certain programs a GC can basically make a programming language completely useless (no shared libraries with C abi, no realtime audio, videogames with stutter) regardless how fast the programming language is. This is not the case for swift. It's merely slower than rust.
Re:Why did we choose Rust to develop TiKV? by pjmlp on Wednesday September 27, 2017 @02:18PM (#15350674)
Also to note that Swift has bindings to the 2D, 3D and real time audio APIs on Apple platforms.
Re:Why did we choose Rust to develop TiKV? by pjmlp on Wednesday September 27, 2017 @06:59AM (#15346529)
Apple thinks otherwise on the context of their OSes.
Re:Why did we choose Rust to develop TiKV? by abiox on Wednesday September 27, 2017 @11:40AM (#15348907)
> system programming

worth mentioning that this term has a broader meaning than how some rust evangelists use it.

Re:Why did we choose Rust to develop TiKV? by jdright on Wednesday September 27, 2017 @01:29PM (#15350141)
The Rust "evangelists" version of system is most of the time the broader meaning of it as Rust do not exclude an entire class of systems as some languages out there.
Re:Why did we choose Rust to develop TiKV? by abiox on Wednesday September 27, 2017 @01:51PM (#15350398)
apologies, but i don't quite follow. what do you refer to by 'class of systems'?

one common sentiment promulgated by rust evangelists is, for example, that go is 'not a systems language' because it has a GC. however, this definitional exclusion doesn't seem to align with (evidently broader) historical use of the term 'systems language'.

Re:Why did we choose Rust to develop TiKV? by jdright on Wednesday September 27, 2017 @03:52PM (#15351640)
Real real-time embedded systems, low-level operating system components, etc. are some kind of things that GC languages exclude completely, so by definition, the subset of "system programming" set is eliminated from use with ie. Go but not from Rust. Consequently, Rust has wider class of systems which makes it a true system programming language as C and C++.
Re:Why did we choose Rust to develop TiKV? by abiox on Wednesday September 27, 2017 @04:45PM (#15352151)
"system programming" is not composed entirely of things where GC presents a non-trivial problem.
Re:Why did we choose Rust to develop TiKV? by jdright on Thursday September 28, 2017 @11:13AM (#15357639)
But 100% > 50%.
Re:Why did we choose Rust to develop TiKV? by abiox on Friday September 29, 2017 @02:30AM (#15363206)
i don't quite follow what you're trying to say.
Re:Why did we choose Rust to develop TiKV? by jdright on Friday September 29, 2017 @11:31AM (#15366150)
Simple put: Go ISN'T a true systems programming language because it simple does not work for every and ALL type of systems.

Yes, it may work with some type of systems, but this does not make it a systems language. If you don't want to accept this fact, then you have bigger problems or you reality is narrow.

Maybe this can help you see through your bubble: https://github.com/CppCon/CppCon2017/blob/master/Presentatio...

Re:Why did we choose Rust to develop TiKV? by SAI_Peregrinus on Friday September 29, 2017 @01:55PM (#15367507)
Another way to say it: The set of systems programming tasks for which Rust can be used is a superset of that for which Go can be used. Go cannot be used for real time code, as it does not provide latency guarantees. Go cannot be used for many embedded (microcontroller) systems as the runtime is required.

I've gotten Rust code to run on an ATSAMD21G18 Arm Cortex M0 (Adafruit Feather board). That board has 256K flash and 32K RAM. Go executables can't even fit in the program flash! Considering the sheer number of systems that have microcontrollers in them somewhere it would be very hard to call a language that doesn't support them a "systems" language. Maybe "applications language" would be more appropriate.

Re:Why did we choose Rust to develop TiKV? by abiox on Saturday September 30, 2017 @01:28AM (#15371400)
oh, i see. so you were pointlessly making a some kind of fallacy argument. no "true" systems programming language, indeed.
Re:Why did we choose Rust to develop TiKV? by jdright on Saturday September 30, 2017 @07:42PM (#15375571)
Seriously? Fallacy? That is really not wanting to understand things how they are. You should really go back to textbooks and try to understand hardware.
Re:Why did we choose Rust to develop TiKV? by rf15 on Wednesday September 27, 2017 @05:29AM (#15346139)
while I think that that would be a good thing (I like what happened with C#), I see the languages specified and controlled by Microsoft, Google and Apple as second-class languages, since they are often lacking in community input and are usually designed with certain platform-specific goals in mind instead of being cross-platform. (or company-strategic goals when it comes to Google)
Re:Why did we choose Rust to develop TiKV? by hnlmorg on Wednesday September 27, 2017 @06:43AM (#15346454)
I can understand conservative choices when it comes to picking a language but what you describe is a potential risk for plenty other existing languages as well as any new language too. Rust wouldn't be where it is today if it wasn't sponsored by Mozilla. Java was Sun Microsystems baby and I remember all the concerns at the time with the Sun vs Microsoft fighting over control of the ecosystem. Plus even many of the non-corporate languages are still heavily dependant on a small subset of maintainers.

At the end of the day if a language proves popular enough in other domains outside of the area which is directly controlled by the language maintainers, then the community will usually find a way of taking over maintenance of it.

We've seen this with Pascal, various BASIC dialects (including Visual Basic), and to an extent Java too. The problem with Objective-C was that - as far as I'm aware at least - it wasn't widely used outside of Apple / NeXT's ecosystem so if Apple deprecate support for Objective-C on their own platforms then there's little incentive for the community to keep using language (much like the problems with Visual Basic - which is why few know about it's open source forks). But languages like C# and Go are used massively across a multitude of domains so even if MS/Google were to kill them tomorrow, the community would almost certainly find a way to keep language alive. Heck, Go might even become more popular if that happened since many of the complaints against it are down to the highly opinionated approach of the current leadership.

Let's also not forget that Go and C# tooling are open source so the community wouldn't have to reinvent the wheel like they did with Delphi / Object Pascal and Visual Basic.

Re:Why did we choose Rust to develop TiKV? by blub on Wednesday September 27, 2017 @05:37AM (#15346170)
Yes, there's something not quite right with these company languages.

Whoever is smart will take note of what happened to VisualBasic and is happening to Objective-C.

Re:Why did we choose Rust to develop TiKV? by pjmlp on Wednesday September 27, 2017 @07:03AM (#15346556)
You mean like C and C++ being developed at AT&T, nowadays designed at ANSI, with people on ARM, Google, Apple, Blommberg, Sony, IBM, Microsoft's payroll?
Re:Why did we choose Rust to develop TiKV? by bryanlarsen on Wednesday September 27, 2017 @08:48AM (#15347217)
Actually, C was a lot worse. For the first 9 years C was basically whatever AT&T wanted. In 78 K&R published The C Programming Language, creating a specification. In the next decade C was very much tied to Unix and non-Unix usages often had some oddities and interoperability issues. The last 3 decades have been good though.
Re:Why did we choose Rust to develop TiKV? by maelkum on Wednesday September 27, 2017 @08:34AM (#15347109)
You know... there's a difference between "(...) with people on ARM, Google, Apple, Blommberg, Sony, IBM, Microsoft's payroll?" and "people on Google payroll". In one case you have many companies cooperating, in the other - just one company.
Re:Why did we choose Rust to develop TiKV? by blub on Wednesday September 27, 2017 @07:39AM (#15346753)
Looking into the past can have some predictive value, but looking that far back and at a different company is of very limited value.

If one evaluates C# they should obviously look at what MS are doing. Same thing for Swift and Apple.

Re:Why did we choose Rust to develop TiKV? by pdimitar on Wednesday September 27, 2017 @08:08AM (#15346938)
I think what <pjmlp> is saying is that (1) these languages are too widely adopted to fail -- somebody is bound to take the ball and continue dribbling it even if the worst happens (company abandons language) and (2) to have a widely adopted language means you have to be a member of a number of committees -- because without standards you wouldn't become a widely adopted language in the first place.

In short, we're quite safe in terms of if C#, Swift and Go will live on. They will.

Re:Why did we choose Rust to develop TiKV? by blub on Wednesday September 27, 2017 @10:22AM (#15348026)
The issue with C# and Swift is that the Apple and MS dev communities enjoy having a ready made solution that they can pick up and work with immediately. Official support is very important.

C# and to some extent Swift are also two huge platforms, there are very few organisations out there that would be able to steer their development.

Finally, they are not standardised in any way. MS tried something with 2.0 and then gave up.

My impression is that these two live and die by the will of their corporate masters. I'm not saying they will kill them or anything, that would be pretty stupid of them to do.

Re:Why did we choose Rust to develop TiKV? by pjmlp on Wednesday September 27, 2017 @10:46AM (#15348278)
> Finally, they are not standardised in any way. MS tried something with 2.0 and then gave up.

They are standardized, you just need to look at the right place.

https://docs.microsoft.com/en-us/dotnet/csharp/language-refe...

https://docs.microsoft.com/en-us/dotnet/visual-basic/referen...

http://fsharp.org/specs/language-spec/

https://swift.org/documentation/

Re:Why did we choose Rust to develop TiKV? by blub on Wednesday September 27, 2017 @02:12PM (#15350609)
Documentation & specs is not standardisation, not in the C or C++ sense. But you already know that, so why are we having this conversation?
Re:Why did we choose Rust to develop TiKV? by pjmlp on Wednesday September 27, 2017 @02:19PM (#15350684)
I assume you know what a de facto standard is all about.
Re:Why did we choose Rust to develop TiKV? by pjmlp on Wednesday September 27, 2017 @07:51AM (#15346826)
If Google, Apple or Microsoft take their employees out of ANSI or from GCC/LLVM contributions, I can assure you they won't move much beyond the current state.
Re:Why did we choose Rust to develop TiKV? by blub on Wednesday September 27, 2017 @10:25AM (#15348053)
What are the odds that all big players would remove support for something that their platforms are built on? At the same time?

C++ is one of the healthiest languages in existance. It hits all the important checkboxes of standardisation, wide industry and platform support and large community.

Re:Why did we choose Rust to develop TiKV? by pjmlp on Wednesday September 27, 2017 @10:48AM (#15348313)
I imagine you never lived through the days when each C++ compiler had a different understanding what it meant to compile C++ code.

It is just like trying to compile the Linux kernel with clang instead of gcc, with the source code full of gcc extensions.

Re:Why did we choose Rust to develop TiKV? by pdimitar on Wednesday September 27, 2017 @08:04AM (#15346906)
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.

Re:Why did we choose Rust to develop TiKV? by sanxiyn on Wednesday September 27, 2017 @09:04AM (#15347350)
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.
Re:Why did we choose Rust to develop TiKV? by AYBABTME on Wednesday September 27, 2017 @11:13AM (#15348563)
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? by pjmlp on Wednesday September 27, 2017 @07:01AM (#15346543)
So I guess you also see C and C++ as second-class languages, given the employers of the people meeting at ANSI.
Re:Why did we choose Rust to develop TiKV? by hashmal on Wednesday September 27, 2017 @06:24AM (#15346363)
All three have different goals and solve different problems. While you can compare things like "they both have MATCH statements" or "unions are safe", deeper they have nothing to do with each other.

You would be crazy to use swift (or objc) in real-time stuff. You would be crazy to write a UI-heavy app in rust. (note: I'm talking about high level DOM-like manipulation, not about rendering engines)

Re:Why did we choose Rust to develop TiKV? by blaenk on Wednesday September 27, 2017 @01:56PM (#15350453)
> You would be crazy to write a UI-heavy app in rust. (note: I'm talking about high level DOM-like manipulation, not about rendering engines)

I think the jury is still out on that one. I agree with the current state of things but the potential to ease and facilitate this is tremendous through the use of syntax extensions (procedural macros) which can dramatically simplify that use case. In general I think procedural macros add a _lot_ of versatility/flexibility to the language. I anticipate that there will be a huge boom in that area once they stabilize, and it will catch many people by surprise.

An example of the versatility that they enable is the work-in-progress async/await [0], whereas in other languages they would usually have to be implemented in the language itself. Note that this does not preclude their implementation in the language itself, but since it's a work-in-progress they're able to experiment with them without having to implement them in the language from the beginning.

[0]: https://github.com/alexcrichton/futures-await

Re:Why did we choose Rust to develop TiKV? by hashmal on Thursday September 28, 2017 @02:02AM (#15354993)
I have to agree, things could change in the future. However, my guts tell me rust GUI libraries/frameworks won't be as great as say, Cocoa, although that's something I would love.
Re:Why did we choose Rust to develop TiKV? by pdimitar on Wednesday September 27, 2017 @08:11AM (#15346951)
Very true.

In the same lane of thought, I am in love with Go when it comes to microservices, network libraries/bridges and CLI tools but it's very ill-suited for web development. So I shrugged it off and only do web dev with Elixir.

Conversely, Elixir is awesome for a multitude of things but it absolutely can't compete with Go in its strong areas.

Language wars are pointless.

Re:Why did we choose Rust to develop TiKV? by geodel on Wednesday September 27, 2017 @10:41AM (#15348231)
Yes next version of Swift will be so awesome it will kill all programing languages.