←back to thread

611 points LorenDB | 1 comments | | HN request time: 0s | source
Show context
choeger ◴[] No.43912866[source]
All this has been known in the PL design community for decades if not half a century by now.

Two things are incredibly frustrating when it comes to safety in software engineering:

1. The arrogance that "practitioners" have against "theorists" (everyone with a PhD in programming languages)

2. The slowness of the adoption of well-tested and thoroughly researched language concepts (think of Haskell type classes, aka, Rust traits)

I like that Rust can pick good concepts and design coherent language from them without inventing its own "pragmatic" solution that breaks horribly in some use cases that some "practitioners" deem "too theoretical."

replies(4): >>43913128 #>>43915349 #>>43916215 #>>43917609 #
Ygg2 ◴[] No.43913128[source]
> I like that Rust can pick good concepts and design coherent language from them without inventing its own "pragmatic" solution that breaks horribly in some use cases that some "practitioners" deem "too theoretical."

I've thought Rust picked some pretty nifty middle ground. On one side, it's not mindfucking unsafe like C. It picked to remove a set of problems like memory safety. On the other side, Rust didn't go for the highest of theoretical grounds. It's not guaranteeing much outside of it, and it also relies a bit on human help (unsafe blocks).

replies(1): >>43913258 #
eptcyka ◴[] No.43913258[source]
As per the article, Rust has benefits beyond the ones afforded by the borrow checker.
replies(1): >>43913710 #
Ygg2 ◴[] No.43913710[source]
Sure, but it is pragmatic in other ways as well :)

It takes ADT, but not function currying, and so on.

replies(2): >>43913760 #>>43913876 #
andrepd ◴[] No.43913876[source]
I don't think currying is that big a deal, it's just syntactic sugar that might or might not make things easier to read, unlike ADTs or closures which are important core concepts.

I'd love to have a syntax like

    { foo(%1, bar) }
standing for

    |x| { foo(x, bar) }
though. I'm not aware of any language that has this!
replies(10): >>43914073 #>>43914288 #>>43914655 #>>43914762 #>>43914803 #>>43915598 #>>43916123 #>>43920249 #>>43922459 #>>43925563 #
1. _flux ◴[] No.43925563[source]
I think currying is an important concept and not sugar at all, as it means each function takes exactly one parameter, i.e. in OCaml foo bar baz is equal to (foo bar) baz. Of course, some other languages can try to emulate the use of currying and the original original idea no longer exists there.

I'm relatively sure there exists such a language you are looking for, but I've forgotten its name :(.

There was a syntax extension pa_holes for OCaml (which you perhaps know, as it is natively currying) that worked like

    (\ foo \1 bar)
and it would become

    fun x -> foo x bar
I'm sure the extension was inspired by some other language.. And the pa syntax extension extension mechanism for OCaml has been replaced by ppx a long time ago already; maybe the new system doesn't enable such succinct extensions.