Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
wtf:
"You can consider it to be a superset of c which compiles to clean c."
The example code showing main looks nothing like c. -
Just read a blog about this on dev.to today. See someone on the comment says that they wish that there is compiled Python than a compiled language with the Python-like syntax.
-
@inawhile that's a non-issue. If you look at Haskell, 0 is inferred to be a bunch of different things based on context. And in C++ "auto x = 0;" will generally infer to int, but can be different (also since there are a bunch of different 0s, like 0u, 0.0f, 0.0, and longer variants). Haskell type classes and C++ concepts are excellent ways to constrain the family of things inferred as long as they behave "similarly".
Type inference and generics aren't all that interesting when dealing with basic plain old data stuff like ints and floats and so on, it really gets cool when you have complex code and generic algorithms. If you're working on close to hardware stuff you probably will never have a use for it, if you're working on large scale software it can be pretty useful. If you judge all programming by the standards of low-level/embedded "portable assembler" code you're going to end up spending a lot of time uselessly hating a lot of things. Inference is also useful for verification and when refactoring (does the compiler/verifier agree with what you've done? If not there just might be a bug).
Of course C++ and Rust bring all this to low level code too, but it's still a lot less useful there than elsewhere. That said I've personally had great success with C++ and Rust programming low level stuff with advanced programming techniques like TMP and iterators which are enabled in large part by features like generics and type inference, but I use C when appropriate as well.
Just wow...
https://github.com/swallow-lang/...
random