Search code examples
programming-languageslow-level

Replacement language for C++?


When working on hobby projects I really like to program in low-level languages (in the sense that C and C++ are low level). I don't want to work with managed languages with garbage collection and whatnot that takes all the fun away (yeah, we're all different ;-) ).

Normally I use C++ for these type of projects. C++ is rather complex and not so elegant so I have been looking for a language to replace it. Anybody can give me suggestions?

Preferences (not requirements):

  • should be low-level (like C and C++)
  • compile to native code (kind of follows from the above but no harm in being explicit)
  • preferrably target win32/win64
  • object oriented
  • statically typed

I have looked at Objective C but I don't like it.


Solution

  • D? (Wikipedia page)

    The D language is statically typed and compiles directly to machine code. It's multiparadigm, supporting many programming styles: imperative, object oriented, and metaprogramming. It's a member of the C syntax family, and its appearance is very similar to that of C++. For a quick comparison of the features, see this comparison of D with C, C++, C# and Java.

    I think that covers everything in your requirements except Windows support, which it has too.

    Note that it has garbage collection, but your question seems to associate garbage collection with being managed - they're not the same thing. I believe garbage collection can be pretty tightly controlled in D.

    I should note that I have absolutely no experience in the language whatsoever :)