[dev] alternatives to C: Ada, Rust, Pascal
Warm greetings to my fellow programmers and lovers of elegant simplicity. I wrote the sbase cal program in Pascal for fun, learning, experimentation. I have also written it in Rust and Ada, for the same reasons.
I recently started re-learning Pascal (which I learned in high school) using Free Pascal Compiler (fpc). By the way, I haven't tried the IDE or Lazarus, but I might later--right now I am just using vi editor and fpc command. I really really like it. It is not nearly as complicated as Rust or Ada. The source code is very easy to read and understand if you know C or Ada or similar language. It has quite a few safety and ease-of-use features that are very easy to use. I especially like the compiler switches Co, CO, Cr, Ct, and gh. During development I use
fpc -Cort -gchlw -vewniq
Pascal has the great advantage of being very mature. FPC supports several different dialects, some much simpler than others.
I am not a fan of C because of problems like buffer overflows; weakly typed arrays; lack of (built-in) range checking for enumerations, numeric types, arrays; lack of overflow checking; string handling being too complex. Basically what you might call "safety and ease issues." I am not comparing C to garbage-collected languages because they are different domains. I am comparing to other compiled and high-performance languages that lack garbage collection.
I have looked into numerous language: Rust, Pascal, Ada, V, Hare, Zig, D, and others I am probably forgetting. I have not become an expert in these languages but read tutorials. And I have written small programs (like cal) in a few.
Ada has a lot of nice safety features and it can also be fairly low level (specifying bits and bytes for storage). However, it is very big (especially the later versions) and comprehensive and has a great deal of features. It lacks simplicity (compared to C).
Rust also has some good safety and ease-of-use features. It is very big and complex with a lot of features (compared to C).
Received on Fri Jun 21 2024 - 16:45:01 CEST
This archive was generated by hypermail 2.3.0
: Fri Jun 21 2024 - 17:24:08 CEST