Ask HN: Great programming language features, other languages should steal?
11–20 of 44 posts
Re: Ask HN: Great programming language features, other languages should steal?
#12I like how Erlang handles binary and bitstring data. Extremely useful if you're doing any sort of protocol implementation.
Re: Ask HN: Great programming language features, other languages should steal?
#132. There was one new language that I don't remember the name, its data structures automatically turned to thread-safe upon concurrent access. That's smart. I wish all languages do that. Less data structure names people have to remember.
3. The compiler can cross-compiles to many different architectures similar to Go or Zig. This makes deployment story much simpler.
4. The compiler produces single binary by default. This also makes deployment story simpler.
5. This is year 2020. Every language must have an event loop so that they can have async I/O routines. Preferably in the form of CSP (green threads + channels).
As you can see I care about the ergonomics and tooling outside the language itself.
Re: Ask HN: Great programming language features, other languages should steal?
#141. Python's list slicing and indexing is the perfect mix of simplicity, intuition and power. It is surprising how few languages have similar implementations. 2. Currying like in Haskell.
Re: Ask HN: Great programming language features, other languages should steal?
#15 let foo = if some_condition {
"condition is true"
} else {
"condition is false"
};
let bar = match x {
0 => "string",
1 => "another string",
_ => "default"
};
It's not super significant but I think it's an elegant syntactic feature.Re: Ask HN: Great programming language features, other languages should steal?
#16Go tries to be a syntax minimalist so that the writers can make what's there the best rather than building the world of fancy new PL features. It also means there are fewer days of doing the same thing and most people's code looks the same. <- this is such a difference maker
Re: Ask HN: Great programming language features, other languages should steal?
#17[1] https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node317.html
[2] http://gigamonkeys.com/book/beyond-exception-handling-condit...
Re: Ask HN: Great programming language features, other languages should steal?
#181. Python's list slicing and indexing is the perfect mix of simplicity, intuition and power. It is surprising how few languages have similar implementations. 2. Currying like in Haskell.
Python list/set/dict comprehensions too
Re: Ask HN: Great programming language features, other languages should steal?
#19Re: Ask HN: Great programming language features, other languages should steal?
#20This is pretty minor but I like how in Rust you can use constructs like if-statements and match-statements as expressions. For example: let foo = if some_condition { "condition is true" } else { "condition is false" }; let bar = match x { 0 => "string", 1 => "another string", _ => "default" }; It's not super significant but I think it's an elegant syntactic feature.
But in lisp it's more than just a syntax trick that only works for a few predefined cases.