#5834 - Switch to Typescript (Deno)

Identifier #5834
Issue type Feature request or suggestion
Title Switch to Typescript (Deno)
Status Open
Handling member Deleted
Addon core
Description This is going to be a controversial and perhaps pie-in-the-sky issue. However, I think it needs bringing up.

PHP has been in decline for a long time. It is still the standard for hosting out-of-the-box web applications, but people increasingly are not using out-of-the-box web applications, and instead either hiring developers to make things using components or using some kind of SaaS solution. And such developers/systems are rarely using PHP nowadays. PHP has popular frameworks, particularly Laravel and Symfony, but the popularity is nothing like what now exists around other programming languages.

See attached graph that shows the decline of PHP, compared to the rise in Node and Go. It was hard to be scientific about this, as search terms specific enough to narrow down to webapp development were not indexed enough to give statistically significant results. Regardless, you can see clear trend lines.

I looked at a number of programming languages:
- Go. Popular for web development (and here's a framework: https://github.com/ankorstore/yokai). Down-side is it is compiled and linked, so I think users would struggle to use it for Composr sites due to the extensive toolchain that would be needed to recompile and redeploy any application updates.
- Python. This is actually mostly being used for scientific and AI stuff, rather than web development. You can see the trend line is quite flat.
- Ruby. This had only a relatively short time in the spotlight, and people migrated to Node due to the similarity.
- Typescript. This is where the industry is gone. If we would switch to a JS-world thing, I'd want us to switch to the best which would be Typescript on Deno, as opposed to Javascript on Node. Deno is the successor to Node, written by the same guy originally. In fact, when I was interviewing for jobs last year at least two of my interviews involved companies who were migrating from PHP to Deno and/or Node. Note on Deno if a source file is changed you do need to restart the web server, unlike PHP. A big downside of Javascript/Typescript is the language is just as messy as PHP, so we would not be gaining a lot technically - in fact, there's no core function library like PHP has, so you introduce a "dependency hell" situation.
- Kotlin. I always considered the idea of switching Composr to Java, but it never quite made sense. Kotlin is a more modern alternative that runs on the JVM. But it is not winning when it comes to web development. Unlike Go, compilation doesn't involve a linker, so dynamically changing files wouldn't be as hard - would still require a dev toolchain on production servers though, and the need for automatic recompiles and reboots - definitely not ideal.
- Rust. Mostly being used for system programming, and would be an uphill struggle with all the problems of Go. Even though I like the idea of us using such a nice modern language.

Typescript/Deno is the clear winner. Not only is it now the dominant tool for webapp development, it also would be the most practical for us. While it does have "dependency hell", so does everything else except PHP and possibly Kotlin.

For all this to work we'd obviously have to automatically port our code to Typescript and make a whole lot of changes. And it would be extremely disruptive. And we'd risk dependency hell and possible performance problems. So for that reason most likely it would never happen. You may ask then, why even bring this up? Well, the concern is that eventually the PHP core development might grind to a halt. PHP salaries, generally speaking, are terrible compared to other programming salaries, and there's not a lot of incentive for people to invest themselves in PHP. So at some point it may actually become the practical thing for us to switch, especially if porting tools improve, and Deno got some kind of competitive core library.
Steps to reproduce

Funded? No
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".

Rating

Unrated