View Issue Details

IDProjectCategoryView StatusLast Update
5834Composrcorepublic2024-08-04 14:46
ReporterChris Graham Assigned ToGuest  
PrioritynormalSeverityfeature 
Status newResolutionopen 
Summary5834: Switch to Typescript (Deno)
DescriptionThis 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.
TagsNo tags attached.
Attach Tags
Attached Files
Time estimation (hours)3000
Sponsorship open

Sponsor

Date Added Member Amount Sponsored

Relationships

related to 5836 Not AssignedGuest API-first development 

Activities

PDStig

2024-08-01 23:01

administrator   ~9063

Last edited: 2024-08-01 23:02

I would argue Typescript / Deno doesn't have dependency hell if you don't want it to. Just like we natively code a lot of utility functions in PHP for Composr which are available as libraries in Composer, the same can be done in Typescript. Typescript is also capable of being procedurally coded (function-based). It still does use objects at its core but you can avoid classes where / when you want to (except when defining types; I believe TS is class-based in that regard but I could be wrong).

Currently anything Node / Deno is significantly more difficult to set up on a server for the average user than a dependency-free PHP application like Composr. There are also more points of failure that can bring the entire server down if you don't have proper redundancy / process management. So from our personal demographics, I'm not keen on switching to a Deno / Node solution, at least not right now or anytime soon (let's say in the next 5 years). Granted PHP will die at some point, that's a given. But by then hopefully by then there will be a solution as easy if not easier to use than PHP.

Chris Graham

2024-08-03 15:38

administrator   ~9064

Sure, we could code - or hopefully find - some kind of base library providing a bit more parity with PHP. Think md5, etc.

Regarding setup, I would like us to take the direction of moving away from the legacy hosting industry, as I have had nothing but problems dealing with consumer webhosts: the industry is largely a race to the bottom and stagnated. See 3792, or just the general notion of getting a cloud instance. People would be encouraged to set things up via some kind of easy scripting process, rather than the current install process. We wouldn't expect to run in an environment where the user has a hosting control panel anymore. That's the way the wider industry has gone anyways.

I agree we should stick with PHP while we can. I hope PHP doesn't die, but I am concerned that there are going to be increasingly few developers who know the language. Think Perl.

Add Note

View Status
Note
Upload Files
Maximum size: 32,768 KiB

Attach files by dragging & dropping, selecting or pasting them.
You are not logged in You are not logged in. This means you will not get any e-mail notifications. And if you reply, we will not know for sure you are the original poster of the issue.

Issue History

Date Modified Username Field Change
2024-08-01 22:41 Chris Graham New Issue
2024-08-01 22:41 Chris Graham File Added: Firefox_Screenshot_2024-08-01T22-23-56.902Z.png
2024-08-01 22:43 Chris Graham Description Updated
2024-08-01 23:01 PDStig Note Added: 0009063
2024-08-01 23:02 PDStig Note Edited: 0009063
2024-08-03 15:38 Chris Graham Note Added: 0009064
2024-08-03 22:20 Chris Graham Relationship added related to 5836
2024-08-04 14:46 Chris Graham Description Updated