from Hacker News

Ask HN: What features would you add in a computer language?

by brlebtag on 9/18/18, 6:45 PM with 2 comments

I was having a discussion with my co-workers about cool features to add in a computer language. I want to know what features would you guys add in a computer language?

I would add:

* traits * PHP's magic functions * coroutine * C/C++ family syntax * Java's OOP * Erlang/Elixir's concurrent model * Elixir's pattern matching * C++'s templates * C++'s operator overload * python's slice * Erlang/Elixir's preemptive green threads * package manager * C#'s property * async/await

What about you guys?

  • by RNeff on 9/18/18, 7:02 PM

    Assertions, pre and post conditions,invariants, strong typing, lots of self checking features, design by contract. Features to make it easier to write correct programs.
  • by wfwefwef32 on 9/18/18, 7:07 PM

    c++ static_if but for class members:

    template<class Type> class A {

    if constexpr (std::is_same<Type, int>::value) { int a; }

    }