0

What's your reaction to this new programming language?

https://github.com/odin-lang/Odin

22nd May 2018, 7:20 PM
Alihuseyn Kengerli
Alihuseyn Kengerli - avatar
6 odpowiedzi
+ 3
@Max why use Rust over C++?
22nd May 2018, 8:17 PM
Maxwell Anderson
Maxwell Anderson - avatar
+ 3
Max I'm aware of Rust type safety, but these mistakes are easily avoided with C++ still being faster, more stable, and has more libraries.
23rd May 2018, 1:16 AM
Maxwell Anderson
Maxwell Anderson - avatar
+ 1
Why is it better than c, why shouldn’t I just use c++ or rust or other well established languages? These things are not clear from the read me. Why is it fast at about the same level as c/c++ or rust even though it’s compiler is probably way less optimized and doesn’t perform as many optimizations(LLVM backend?)? What new paradigms does it bring to the table? I don’t have time and don’t want to watch a one hour video on it just to find out answers to these questions. Why is this stuff not on top of the read me
22nd May 2018, 7:45 PM
Max
Max - avatar
0
@Maxwell Anderson The rust type system stops you from making a lot of memory management errors while still giving you the option of doing whatever you need to do(even kernel developement) it does this using the so called borrow checker that at compiletime checks if your Code adheres to a well thought out system of variable ownership. See this thread on stackoverflow ( https://stackoverflow.com/questions/14063791/double-free-or-corruption-but-why ) to understand some of the easy mistakes one can make in c++(this one is related to deep and shallow copying). These types of mistakes(and others) others get avoided in rust by the typesystem automatically which makes programming multithreaded applications much easier as it avoids data races.i often describe rust as: c if c were Haskell. Of course a c++ expert can avoid these problems but an additional pair of eyes is very nice and rust has also a lot of nice stuff like tuples, destructuring and pattern matching I would also describe it as part of a wave of programming languages that have learned from c/c++ and try to incorporate some of the things that have been going on in Haskell. I think swift and go are in some sense also part of this wave
22nd May 2018, 8:25 PM
Max
Max - avatar
0
@Maxwell Anderson i disagree about these errors being easily avoidable, they are the reason why c++ is a notoriously hard language, this specific error might be avoidable using the rule of five but these types of errors lead to a lot of of the security vulnerabilities and bugs we see today in major native applications, especially in open source applications with many contributors ( of which most are probably awful at c++) having an type system that catches many common bugsources is a big advantage especially for maintainers. I have done quite a bit of reverse engineering before and have seen many off these bugs, so people can’t be to aware of these error sources.
23rd May 2018, 1:56 AM
Max
Max - avatar
0
@Maxwell Anderson I quite like the direction that modern c++ is taking but I also think that by wrapping everything in unique_ptr and using std::move and other newer constructs a lot the code gets extremely verbose. Rust is a great systems programming language for people that are new to systems programming because they don’t have to worry about memory as much as with c++ and with the rise of webassembly we will see an influx of JavaScript developers to c/c++ and also rust and i think because of the lack of experience that these developers have in regards to memory bugs and because they expect a package management system like npm or yarn they will prefer rust since it brings cargo to the table, so we will see a big explosion in the rust ecosystem. The LLVM framework makes compiler developement comparatively easy and I think that we will see performance improvements in rust in the near future. Off course c++ compilers are incredibly optimized, but as far as I can tell a lot of gains can still be made with relatively simple optimizations so I think large performance differences will be a thing of the past in the near future(even though c++ will probably stay faster). I never claimed that rust is superior to c++ and I don’t view it as replacement to c++ i see it as something that fills a niche that c also occupies and I think that it will explode in popularity with web assembly and the introduction of higher kinded types. But again I just brought up rust because it seems kind of similar to this new programming language and is a great example of a programming language in that space that gained a lot of popularity in the last few years
23rd May 2018, 1:58 AM
Max
Max - avatar