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.

7 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. ^.^;

3 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

Wow! I was also thinking like @AstonJ. I’m happy that I was wrong.

2 Likes

Once I said this about web technologies, and now I have the same feeling about programming languages.

2 Likes

How do you think I’ve been able to keep up with my goal of learning well (to at least an advanced level) at least 3 programming languages a year for 30 years now, there’s a LOT of language, lol.

2 Likes

How many languages do you know now ODL? I don’t think I know anyone who knows as many as you :lol:

2 Likes

Uhhh, too many, most are a blur since I learned them, absorbed the interesting useful bits to apply elsewhere, and then merged them into the blurry whole of “know but don’t use” sets of things, lol.

2 Likes

Wow! So many languages.

What is your method of learning a language to advance level so quickly? How do you recommend tackling this task today?

2 Likes

Honestly, once you know a good set of combinations then picking up any other is generally as simple as learning syntax as most languages don’t add anything new (to be blunt and honest).

One of my go-to things is writing a compiler, I generally like to make some hindley-milner typed language as it exercises a ton of the language features!

But most often I just write a lot of tools in it.

I’d really recommend only learning no more than 1 or so really “foundational” language a year, such a language being one that introduces very large new concepts for you, common examples being:

  • FORTH
  • LISP (CommonLisp may be the ‘best’ lisp I think, but Racket is far more easily used nowadays)
  • Assembly of some form (writing raw LLVM is pretty fun actually even though it’s an SSA assembly language, or like 8086 or so, programming a nintendo or something).
  • C
  • Fortan (pre 89 version, try not to use the 90’s or higher versions as they broke a few concepts).
  • Erlang
  • OCaml
  • Haskell
  • Maybe even Rust nowadays, its trait style is really illuminating as a modern form of witnesses that are explicit in ocaml and implicit dispatch in haskell.

No doubt missing others, lol.

3 Likes

Thank you for the detailed and valuable reply! :slight_smile:

2 Likes

My brain melts. Takes a strong will to be committed and consistent.

2 Likes