New project? The opinionated flowchart you need to chose a language.
So you are going to start a sweet new project? You need to pick a programming language, obviously, and that language should be:
- Compiled
- Memory Safe
- Type Safe
- Not white-space delimited
- Have a native and robust package management system
- Have a healthy community
Notice that I didn’t say “performant” or “one you know” or “one your friend TJ likes.” Instead, follow this diagram:
Yup, that’s opinionated.
Let’s be real, you probably don’t even need the flowchart; just default to Go unless you have a reason to switch to Rust. If neither works for your special snowflake case then it’s worth following the lines.
Okay, let’s here your objections…
But, but, no Python??
If you are starting a new project with Python as the base language, you are wrong. The only redeeming quality about that interpreted, overprevalent, inefficient, dynamically typed, white-space delimited programming language is its use in data science.
If you are using a Python data science or machine learning framework as part of your application, make it modular and use a real programming language to call it with an API, get what you need, and keep hoping that a better SDK comes around.
You left out a use case!
Yeah, if you are a game developer or are unfortunate enough to have to develop a Windows app, I assume you know what language to use.
I’m also a fan of VHDL, but didn’t bother to put it up there.
I have to work within an existing ecosystem!
If you are worried about that then it sounds like your system is not Simple, Modular, Composable. Rather than spending time tacking on complexity to the mess, consider true improvement to the architecture so that you can use API calls from a proper programming language (see chart above).
C gives me more precise control.
And with that control you are going to make mistakes. Lots of them. Some of them (probably memory related) will introduce serious security vulnerabilities.
Unless you are putting an application on an embedded system that Rust doesn’t yet support, don’t use C. Or C++. It isn’t that much better.
I can’t read the tiny text in the PNG!
The full-sized gist available here! Medium’s mermaid embed doesn’t seem to work…
Or here’s the raw mermaid code for the flowchart:
flowchart TD
Start(Choosing a programming langauge)
JVM{Do you need to run in a JVM?}
GC{Can you tolerate garbage collection?}
Mobile{Is this for a mobile app?}
MobilePlatform{Which mobile platform?}
WebDev{Is this for frontend web development?}
Embedded{Is this for embedded systems?}
Rust
Go
Kotlin
Dart
Swift
TypeScript
C_CPP[C/C++]
Start ==> Embedded
Embedded ==> |Yes| C_CPP
Embedded ==> |No| JVM
JVM ==>|Yes| Kotlin
JVM ==>|No| GC
GC ==> |Yes| Mobile
GC ==> |No| Rust
Mobile ==> |Yes| MobilePlatform
Mobile ==> |No| WebDev
WebDev ==> |Yes| TypeScript
WebDev ==> |No| Go
MobilePlatform ==> |Android| Kotlin
MobilePlatform ==> |iOS and Android| Dart
MobilePlatform ==> |iOS| Swift