Programming Languages

Programming Languages

You choose a language for day-to-day programming based on its libraries, documentation, tools support, OS integration, resources, and a host of other things that have very little to do with how computers work, and a whole lot to do with how people work. - Steve Yegge

Languages shape the world. Dumb languages make for dumb worlds. - Steve Yegge

Familiarity breeds contempt in most cases, but not with computer languages. You have to become an expert with a better language before you can start to have contempt for the one you’re most familiar with. - Steve Yegge

A language that doesn’t affect the way you think about programming, is not worth knowing - Alan Perlis

Evolution

Coding has a rich history of The Olds saying that The Youngs have it too easy. That’s assembly to C and it’s C to Java, and it’s Java to Ruby.

If you go back to the rise of C, you can find assembly language programmers lamenting the loss of granular memory management. If you go back to the rise of Python/Ruby, you can definitely find C programmers lamenting the loss of manual memory management. If we lament all the things you lose from vibe coding – is it the same thing? Are we the old person yelling at the tides?

Features to look for when looking to learn a new programming language

This will give an overview of the practicality of the language.

Questions to ask about the language:

  1. Is it easy to use?
  2. Is the language empowering?
  3. Is it rewarding to share with others?
  4. Would you suggest to other people to learn and use it?
  5. How does the language handle garbage collection?
    1. Not just theoretically?
  6. How does it compare to other languages like C++, Java, Haskell in a production environment?
  7. Write some examples to get a feel for the language
  8. Implement using custom ssl certificates. See the differences in the ways this is handled by various languages. This process is handled graciously in some languages and it is a painful process in other languages.
  9. Verify concurrency
  10. How good is the cloud support for these languages? For example, CloudFoundry offers good (in some cases, custom support) support for Java and NodeJS based applications. What happens if we want to use other languages for applications?
  11. How are the tools for this language? Look at the tooling for those languages
    1. Docker images
    2. Working with pipelines
    3. Deployments
    4. Monitoring/Observability
    5. Testing
      1. Integration tests (with databases and other backend services)
      2. Unit tests and Code coverage reports

Feature comparison tables

Between OCaml and Haskell

Feature OCaml Haskell
Expression-oriented syntax
Immutability by default
Higher-Order Functions (HOFs)
Anonymous functions (lambdas)
Algebraic Data Types (ADTs)
Pattern Matching
Parametric Polymorphism
Type Inference
Monadic Syntax Sugar
Garbage Collector
Multithreading
GADTs
Purity by default
Composable laziness
Type classes
Higher-Kinded Types
Opt-in language features
First-class modules
Polymorphic variants
Objects
Classes and Inheritance
Ergonomic mutability

Tooling comparison tables

Between OCaml and Haskell

Tool OCaml Haskell
Compiler ocaml ghc
REPL utop ghci
Build tool dune cabal, stack
Package manager opam cabal
Package repository opam Hackage
Toolchain installer - ghcup
Linter zanuda hlint
Formatter ocamlformat, topiary fourmolu, stylish-haskell, hindent, ormolu
Type Search Sherlodoc Hoogle
Code search Sherlocode Hackage Search
Online playground TryOCaml Haskell Playground
LSP ocaml-lsp HLS

226 156 133

Learning resources

github.com/janestreet - They seem to be doing a lot of interesting stuff with OCaml. It would be worth spending time looking at their stuff if we need to get a better understanding of Ocaml.


Links to this note