Live data from Hacker News

Ask HN: Is there a simple and minimal language like C but without its footguns?

news.ycombinator.com

21–30 of 41 posts

Re: Ask HN: Is there a simple and minimal language like C but without its footguns?

#26

GNU's GCC has added Ada and NetBSD has that in a package. Space Technology uses Ada and Forth.

I’m not sure if Ada counts as “simple” as C (maybe so, maybe not depending on where you find complexity, but I find it funny at at this point the Ada spec is smaller than the C++ spec.

Ada is definitely more complex than C, but not as complex as C++. If you can draw the parallel between .h/.c and .ads/.adb files, you're halfway to using Ada-as-C. If you then learn the basic procedural syntax and just enough about packages to be dangerous, you can use Ada as a moderately safer C.

You have to learn the type system, task and protected types, and a few other things to really get the advantages of Ada, though. While those aren't hard, they aren't "simple" in the same way that C is simple. But you can learn them piecewise, which is good, as it permits incremental learning of the language.

Re: Ask HN: Is there a simple and minimal language like C but without its footguns?

#27
I encourage you to reconsider the idea that C has footguns. Having written quite a lot of C, I no longer fear the rougher edges of C. Avoiding them takes time to get used to, but they're the price you pay for the ultimate simplicity of C.

Re: Ask HN: Is there a simple and minimal language like C but without its footguns?

#28

"Java is far from minimal" My web servers run with like 300MB of RAM and work fine on t2.nano serving thousands of users?? And also Java gives you full access to primitive types if you don't like OOP

I think he means that Java is not a small language, rather than it doesn't take up much space in RAM.

Personally, I still think that C is a very good compromise between size (both of the language and of its RAM usage) and it's level of abstraction.

The size of a language can be judged by the size of a definitive text on learning the language. Compare how small the K&R book "The C Programming Language" is [230 pages] compared with (say) the O'Reilly book "Learning Python" [1200 pages].

Re: Ask HN: Is there a simple and minimal language like C but without its footguns?

#30
post #5

> Does not have the footguns of C. > Simple like C. You have to pick one, or give in on both and find a happy medium between the two. The way you get safety in a language is by abstracting over the simplicity. I personally would suggest biting the bullet and going with C++, you can stick to a reasonably sane subset of the language but it definitely won't be C.

Though a lot of the footguns in C are not due to its lack of safety but rather due to the decades of historical baggage it carries.
Post reply on HN