If you, like me, belong to the group of people who likes to have a large toolbox, then I bet you've been thinking these thoughts at least some times: "If only langauge X had this feature Y, that langauge Z have..." Real examples include

  1. "If only C++ had lambdas like JavaScript."
  2. "If only C++ had modules like Python"
  3. "If only C++ had garbage collection like Java/C#"
  4. "If only C++ had list comprehensions like Python"
  5. "If only C++ had fixed types like Java"
  6. "If only C++ had modern syntax like Java/C#"
  7. "If only C++ had more predictable symbol lookup like every other langauge known to man."
  8. "If only Java had pointers like C++"
  9. "If only Java had performance like C++"
  10. "If only C# had constness like C++"
  11. "If only C# had metaprogramming like C++"
  12. "If only C# had better access to memory like C++"
  13. "If only C# had memory footprint like C++"
  14. "If only java/C# had embeddability like C++"

When you already know exactly what tool to use for a given problem, it can be rather frustrating to discover it's missing from your toolbox in the given environment.

Proven concepts

For this reason, Cosmos attempts to gather proven language design concepts from its competition, while recognizing it is unnecessary to cover all bases.

While Cosmos does have a larger number of concepts to pick from, they have been weighed according to what benefits they give, versus how easy it would be to achieve similar functionality. Deciding what ideas to bring into a language, and which ideas to leave on the bench, is certainly one of the most significant challenges in the design of Cosmos.

Shoot that foot

An important point to Cosmos, is that no feature is designed to prevent the user from doing certain things. Cosmos is made for at least somewhat skilled programmers, who are capable of deciding among various ways to solve a given problem. If you want to use "goto", it's probably because you find it to be the right tool for the particular problem. In fact, Cosmos give you even more dangerous tools to play with, when it's required.

Imagine a butcher with a dull knife, only to prevent him from cutting himself!

Cosmos is designed for basic safety though, just like a knife doesn't abruptly blow up in your face if handled responsibly, the features of Cosmos has also been designed to be relatively easy to reason about.