I’ve recently read Drew DeVault’s blog post, How I decide between many programming languages. I figured that I should write my own.
C
Pros
- Simple.
- Interoperable with almost all other languages.
- Direct access to system calls (well, for most system calls that I’d use, anyways).
- Good ecosystem, and most packages I’d use are in my system’s repositories. Using the system package manager is the only way to sanely manage dynamically linked libraries.
- Flexible macro system. Yes, there are pitfalls, but it’s flexible enough for my needs and it’s not that hard to remember to add parenthesis.
Cons
- Null terminated strings are objectively bad
- Footguns do exist, and there isn’t anything like borrow checking or automatic reference counting. These aren’t strictly necessary, but are obviously helpful.
errno
is bad. (My opinion holds that the proper alternative is multiple return values, though I also believe that the langugage shouldn’t make it easy to accidentally ignore errors, nor should error handling have too much boilerplate.)
Go
Pros
- Easy concurrency to write quick and relatively-scalable network services in.
- Well-designed standard library, and a generally good ecosystem (with an non-insane language-specific package manager, which I find acceptable since Go libraries are statically linked).
- The best garbage collector I’ve seen in garbage-collected languages.
Cons
- The way zero values are handled are really bad.
- I’m not a fan of the automatic conversion between pointers and values.
- Go’s error handling doesn’t sit right with me. (I am not for exceptions, just to be clear.)
Python
Pros
- Code is easy to write.
- Good-ish ecosystem.
Cons
- Code is hard to maintain.
- Really slow.
- The global interpreter lock guarantees that threading is a pain.
asyncio
also sucks, and there aren’t many libraries written fortrio
. - Dynamically typed, and no, mypy doesn’t magically solve everything.
Shell scripts
Pros
- Good for gluing my desktop together, automating day-to-day tasks (both on the desktop and administering servers), and generating Makefiles.
Cons
- A lot of bad advice on the web, and many people write disgusting scripts.
- Arrays are not available in standard POSIX shell, and life is a pain without them.
- A sufficiently complex shell script that interacts with the network is going to have remote code execution vulnerabilities.
- I wanted to say “dynamic typing” here. “No typing” is probably more appropriate.
Common Lisp
Pros
- Really flexible. Best for, well, list parsing.
Cons
#'i-still-dont-get-the-point-of-having-two-namespaces
.- Dynamic typing.
- Quicklisp confuses me.
))))))))))))))))))))))
Lua
Pros
- Probably the best general-purpose scripting language.
- Easy to use as an extension language.
- Lua tables are really versatile.
Cons
- The lack of real threads is a huge pain. No, coroutines are not threads. (Though, no other scripting language has sane multithreading, so… fair enough.)
- Generally lacking ecosystem.
- 1-based indexing sucks.
- I still prefer curly braces over
end
.
JavaScript
Pros
- None. I wouldn’t use it if there are saner alternatives in browsers, e.g. if WASM could access the DOM.
Cons
- Quirks surrounding automatic type conversion and equality testing.
- I don’t see any compelling reason for this language to exist outside web browsers, yet Node.JS exists.
- NPM.