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:
- Is it easy to use?
- Is the language empowering?
- Is it rewarding to share with others?
- Would you suggest to other people to learn and use it?
- How does the language handle garbage collection?
- Not just theoretically?
- How does it compare to other languages like C++, Java, Haskell in a production environment?
- Write some examples to get a feel for the language
- 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.
- Verify concurrency
- 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?
- How are the tools for this language? Look at the tooling for those languages
- Docker images
- Working with pipelines
- Deployments
- Monitoring/Observability
- Testing
- Integration tests (with databases and other backend services)
- 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.