It's not what programming languages do, it's what they shepherd you to

It’s not what programming languages do, it’s what they shepherd you to.
How many of you have listened, read or taken part in a discussion about programming languages that goes like the following: Person A: "Pro…

Read in full here:

This thread was posted by one of our members via one of our news source trackers.

3 Likes

Corresponding tweet for this thread:

Share link for this tweet.

2 Likes

Yes! This! This this this this this!

And this is why languages like Haskell and Rust are good languages, especially to learn from, because they “shepherd” the programmer to doing things correctly.

6 Likes

Which one of the Rust, OCaml and Haskell do you like the most?

2 Likes

For learning, hmm… Haskell is great for a lot of the concepts it gives you, but Rust has a lot of them as well (though not all), however the Rust ability to actually teach you good ownership models is one of the most valuable things that you could learn in any language, that combined with its great error message probably means I’d pick Rust as the best to learn of all of those.

As for what I actually “like” best, well “that depends” on what I’m doing, lol. OCaml I most like as, say, a python replacement, I’d never pick python over ocaml unless I need a specific library, OCaml is fantastic for whipping stuff up. Rust for most else. Haskell is more of a fun thing but doesn’t really gain much in terms of productivity over OCaml or Rust.

3 Likes

When I was younger I would have definitely preferred a language that lets you do what you want (like C, C++ or Python) instead of one that shepherd you on what you can do. Now I would say that a stricter language like Rust or definitely better especially for team work and large code bases in general.

3 Likes

Ah, this is enough for me to motivate myself to learn Rust.

2 Likes

Same. I struggled with C++ and Java when I started coding but really found my stride with dynamic languages, namely Python and Ruby.

Fifteen years later I’m finding myself preferring types and schemas wherever I can get them — but still a big fan of the fast cycles provided by either REPLs or a dev-speed-first language like Go.

Particularly into protoc, cuelang, and openapi-generator for language-independent support.

2 Likes

OCaml, it’s about as succinct as python, compiles even faster than Go, and is as strongly typed as haskell (though no monads or typeclasses or so, it has more compilation friendly variants of such things, it’s a workhorse language, not an academic language), has a repl and interpreter or can compile to native code on par with C in speed with no external runtime needed at all, is also wonderfully easy to bind to external C API libraries too! Plus, it ‘had’ a GIL like python so concurrency was python-like, but now multicore is finally landing so that restriction is gone and it now has what I say is the utterly most fascinating concurrency primitives that I’ve seen in any language anywhere! ^.^

But still, learning ownership is incredibly important, no matter your language, and OCaml can still bite you with ownership bugs 99% of the time as with most languages. ^.^;

2 Likes

This might be a bit off-topic for this thread, but I hear people (well ODL mostly!) really like OCaml but I wonder why it’s never really ‘taken off’ or become more mainstream? What do you think it is lacking or what is preventing that? (Maybe we need a dedicated thread for that :lol:)

1 Like

It’s pretty well taken off long ago actually. Big companies from Jane Street to Facebook have a substantial part of their tooling made in it to a surprising number of programming language’s first compiler are written in it (like Rust, lol). It’s far more active than you’d think, it’s one of those quiet giants, like erlang (though even bigger and far more used than erlang).

1 Like