Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

ML and Haskell are statically typed, and have tuples as you describe them. For instance, the tuple

  (42, "foo", fun x -> x+3)
has type

  int * string * (int -> int)
in ML. It would probably be a serious extension to C++'s type system, though, and for limited benefit: you're asking for yet another way to do Cartesian product. Structs already do that. What's sorely lacking is sum types:

  type 'a option = Some of 'a
                 | None

  type 'a list = Cons of 'a * 'a list
               | Empty

---

Integrating the STL at a syntax level gives a special status to the standard library, preventing users from writing effective replacements or analogies. Also, C++ has precious little orthogonality left, let's not destroy it.

---

What kind of modules are you talking about? C++ has compilation units, classes, and namespaces. What capability do you want that they don't already provide?

---

Good luck on the fast compilation front. That one will likely require removing things from the language, or making some major compatibility-breaking changes in the syntax (to make it easier and faster to parse), and possibly a rework of the template system. No. Way.



If I understand correctly, Go is the "removing things from the language" approach to fixing the fast compilation issue.


Yes. Namely templating.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: