Live data from Hacker News

Ask HN: Great programming language features, other languages should steal?

news.ycombinator.com

1–10 of 44 posts

Ask HN: Great programming language features, other languages should steal?

#1
You cannot be fluent in all programming languages. But this also makes you blind for language features a particular language really got right, or killer libraries that are just amazing. Which are these widely unknown features, that you only get to know, when working with a language and its ecosystem? Example: I'm coming from Scala. Starting to develop a Flutter app with Dart, made me realize how great and safe the serialization ecosystem in Scala is. You can serialize types (and type hierarchies) with a convenient syntax that is completely decoupled from the type itself, while high-performance serialization code is generated at compile-time via macros. Libraries include: https://circe.github.io/circe/ https://github.com/suzaku-io/boopickle

Re: Ask HN: Great programming language features, other languages should steal?

#2
I really like the trait/struct/enum model of programming that you find in Rust. I'm a quant and I do a lot of higher math, and the trait method of programming is very very similar to how you might construct algebraic structure in the set=>group=>field etc way.

Re: Ask HN: Great programming language features, other languages should steal?

#7
post #5

My ideal language is something like F# but with HKTs, trait, macros, union types (without discriminator), basically most features dotty aka scala 3 introduced.

Its funny though, as I am personally switching to scala 3 for the features I mentioned. I find the features particularly handy for building distributed systems using Akka. And I wished they'd get tooling just right out of the bat. (sbt doesn't seem great)

Re: Ask HN: Great programming language features, other languages should steal?

#8
1. Pattern matching with destructuring a la scala, rust, ocaml, etc.

2. scoped threading a la kotlin and by using certain libraries, rust to a degree.

3. structs / records (i feel bad putting this since every language but java seems to have it).

4. macros of some kind

5. type inference

6. enums a la rust / sealed types in kotlin which are needed for pattern matching afaik

Re: Ask HN: Great programming language features, other languages should steal?

#9
R6rs scheme's (or even better Racket's) macro system. Recently similar systems have been making their way into other languages, but the AST-like syntax of lisps make it a fair bit easier to use.

Other than that? Delimited continuations. Guile-fibers, a parallel concurrent ML (which I would describe as a generalisation of go's concurrency model) for guile scheme is implemented using them as a scheme-only library. No low level voodoo. Just straight forward scheme.

Post reply on HN