Originally posted by debianxfce
View Post
Announcement
Collapse
No announcement yet.
ToaruOS With Kernel Written From Scratch Is Still In Development
Collapse
X
-
-
Originally posted by Hi-Angel View PostWell, Rust would break quite a number of his arguments. It's not object-oriented, it doesn't have exceptions, and it would solve a number of common C errors.
Now that said is Rust a language designed to help you operate in OOP paradigms? Yes, actually. Its type system is a mutable graph as opposed to a static hierarchy, but talk is cheap... let's see some code (Note that I haven't checked to make sure any of this will compile or run, but the principles are there):
Code://rust trait Animal{ fn speak(&self) -> String; fn move(&self); } struct Dog{ } struct Cat{ } impl Dog{ fn New() ->Dog{ Dog{} } } impl Animal for Dog{ fn speak(&self) -> String{ "bark" } fn move(&self) { } } impl Cat{ fn New() -> Cat{ Cat{} } } impl Animal for Cat{ fn speak(&Self) -> String { "meow" } fn move(&Self){ } }
Code://C# public interface Animal{ String speak(); void move(); } public class Dog{ public Dog() { } public String speak() { return "Bark"; } public void Move() { } } public class Cat{ public Cat() { } public String speak() { return "meow"; } public void Move() { } }
Code:struct GermanShepherd{ _dog:Dog } impl GermanShepherd{ fn New() -> GermanShepherd{ GermanShepherd{ _dog : Dog::New()} } impl Animal for GermanShepherd{ fn Speak () -> String{ "WOOF" } fn Move(){ _dog.Move(); } }
Code:trait Canine{ fn dig(&Self); } impl Canine for Dog{ fn dig(&Self) { println!("Digging a big old hole"); } } impl Canine for GermanShepherd { fn dig(&Self) { _dog.Dig(); } } fn DogFunction<T>(&dog: T) Where T: Animal + Canine{ println!(dog.Speak()); }
[1] Yes all programs are "simply algorithms" but it's a methodology difference
- Likes 1
Leave a comment:
-
Originally posted by debianxfce View Post
If you make errors with C, do not program.
Leave a comment:
-
Originally posted by starshipeleven View PostNo, Torvalds is against the basic C++ features, C++14 isn't changing that.
Now grab some popcorn and read this (talking about C++ in git, but the same applies to kernel) http://harmful.cat-v.org/software/c++/linus
The relevant part:
In other words, the only way to do good, efficient, and system-level and portable C++ ends up to limit yourself to all the things that are basically available in C. And limiting your project to C means that people don't screw that up, and also means that you get a lot of programmers that do actually understand low-level issues and don't screw things up with any idiotic "object model" crap.
Now, I don't know Rust enough to extrapolate on his views, but he does have some very strict standards there.
- Likes 1
Leave a comment:
-
Rewritten kernel? Amazing.
And while I agree that maybe their time might be better spent on ReactOS, it's a different sort of project, they are circumwriting and re-writing the existing linux kernel with I assume a massive amount of backwards compatibility, ReactOS are shooting in the dark trying to guess at how to make the OS work like windows, it's harder, it's different, but even more amazing.
Leave a comment:
-
Originally posted by Hi-Angel View PostWell, let's not make of Linus a hated in the nation.
Now grab some popcorn and read this (talking about C++ in git, but the same applies to kernel) http://harmful.cat-v.org/software/c++/linus
The relevant part:
In other words, the only way to do good, efficient, and system-level and portable C++ ends up to limit yourself to all the things that are basically available in C. And limiting your project to C means that people don't screw that up, and also means that you get a lot of programmers that do actually understand low-level issues and don't screw things up with any idiotic "object model" crap.
Now, I don't know Rust enough to extrapolate on his views, but he does have some very strict standards there.
- Likes 1
Leave a comment:
-
Waste of C programmers time, they should help ReactOS kill windows someday.
Leave a comment:
-
Originally posted by Hi-Angel View PostLast I heard, It was compatible with neither of existing drivers. It's a proof-of-concept. I'd rather expect (and I'd hope for it) that Linux kernel would start accepting Rust code. But it's nice to have a working kernel written in Rust, because it would be an important point in the discussion about Rust's place in the kernel.
I think Rust needs this ASAP in order to become more widespread.
There's one, but it's very WIP and totally abandoned over a year ago...
[rust-dev] Rust testsuite (October 23, 2013
GCC mailing list: Rust front-end to GCC (December 3, 2013)
LWN: A Rust frontend for GCC (December 3, 2013)
Phoronix: Mozilla's Rust Language Gets A GCC Compiler Front-End (December 3, 2013)
[url=https://github.com/redbrain/gccrs]GitHub: Rust Front-end to GCC (July 17, 2015)[url]
Some people say that Rust is the new LLVM, but Rust uses LLVM itself and no other compiler supports it...
Leave a comment:
Leave a comment: