Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Yes... <a href="http://clang.llvm.org/" rel="nofollow">clang</a>. C++ has everything on your list except for list comprehensions. It is also the flagship LLVM language.</p> <p>"Are statically typed"</p> <p>Yup</p> <p>"Use type inference"</p> <pre><code>// local type inference auto var = 10; // type inference on parameters to generic functions template &lt;typename T&gt; void my_function(T arg) { ... } my_function(1) // infers that T = int // correctly handles more complicated cases where type is partially specified. template &lt;typename T&gt; void my_function(std::vector&lt;T&gt; arg) { ... } std::vector&lt;int&gt; my_vec = {1, 2, 3, 4}; my_function(my_vec) // infers that T = int </code></pre> <p>"Are functional (i.e. lambda expressions, closures, list primitives, list comprehensions, etc.)"</p> <p>Lambdas in c++ look like <code>[capture_spec](arglist...) { body }</code>. You can either capture closed over variables by reference (similar to lisp) like so: [&amp;]. Alternatively you can capture by value like so: [=].</p> <pre><code>int local = 10; auto my_closure = [&amp;]() { return local;}; my_closure(); // returns 10. </code></pre> <p>In C++ map, zip, and reduce are called std::transform and std::accumulate.</p> <pre><code>std::vector&lt;int&gt; vec = {1, 2, 3, 4}; int sum = std::accumulate(vec.begin(), vec.end(), [](int x, int y) { return x + y; }); </code></pre> <p>You can also rig up list comprehensions using a macro and and a wrapper around std::transform if you really want...</p> <p>"Have first class object-oriented features (inheritance, polymorphism, mixins, etc.)"</p> <p>Of course. C++ allows virtual dispatch + multiple inheritance + implementation inheritance. Note: mixins are just implementation inheritance. You only need a special "mixin" mechanism if your language prohibits multiple inheritance.</p> <p>"Have a sophisticated type system (generics, covariance and contravariance, etc.)"</p> <p>C++ templates are the most powerful generics system in any language as far as I know.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload