Interesting pivot! I've never seen a framework for one language pivot into another like this. I like this approach, too often good frameworks just die with the language.
I hope its an opportunity for the Mojolicious team to do things they just couldn't do their Perl framework due to legacy constraints etc and they get to take on fresh new ideas and see them through! I've heard good things on the peripherals for years about Mojolicious
Being able to use features like async/await consistently has definitely opened many doors for the port and made a lot of APIs more elegant. It's also quite fun trying to make more parts of the framework compatible with WHATWG APIs.
I'd never heard of mojolicious, and now wishing this had existed 20 years ago! It is quite elegant, but looks like the first release was dropped in 2015.
The Mojolicious homepage https://mojolicious.org actually looks almost like the Mojo.js homepage (or the other way round). So much that I first suspected some kind of parody until I realized they were indeed the same people.
It has been interesting watching this develop, if for no other reason that Express is somewhat stuck after TJ left to make koa[0] and hasn't changed much since 2014. Express 5 has had no commits for 9 months - it's not dead, but it's not exactly thriving either. While there are alternatives to Express, none seem to have huge amounts of traction or do far more than a backend framework (nextjs, sveltekit), so maybe there is room for another framework.
I'll never forget seeing this tweet[1] - what I considered a core pillar of the perl community discovered that after a short period of familiarization, a perl developer of many years could write code that is many times faster just by switching from perl to js. No deep voodoo, no special tricks - just write code in JS and handle 3x as many reqs/s. I'm glad to see that the rest of the mojo ecosystem is coming along - Minion is a really nice, simple job queue that can piggyback on your existing postgres database without depending on redis or anything. Would be awesome to see a dynamodb backend someday. Hmmm.
Unfortunately I'm not sure who the target market is - a typescript web framework selling itself as "Perl-grade" anything is not a good look for 99% of JS/TS devs. Maybe it's positioning itself as the logical migration path for companies moving away from perl?
"Software supply chain attacks around NPM are a hot topic right now. And it can be quite problematic to audit your whole dependency tree. Thankfully, while the Perl version has no dependencies at all, in JavaScript we only have 23 trusted third party dependencies. And we are prepared to replace every single one of them if necessary, with a port of the battle-tested Perl implementation."
I’ve been slowly working on a 0 dependency framework in Bun for similar reasons. The size of the average package-lock.json is absurd and nerve wracking.
Hi, Mojolicious founder here. The "Perl grade" is meant to be a cheeky callback to Perl's famous backwards compatibility (you can run pretty much any Perl code written in the past 30 years with the latest Perl unchanged...yada yada). Perhaps it is a bit too subtle.
Back when i started with Node, one of the first problems i constantly ran into was some NPM module deep down in my node_modules folder breaking its API in a minor version bump and causing hours of cleanup work. So pretty early on avoiding this issue became a priority for the mojo.js port, and i see it as one of the main niches for us to corner. You want to write a fast JS/TS web service that still works in 10 years? Use mojo.js!
Maybe you've got a suggestion for how to better communicate this idea?
I know there is still a tendency to choose Express as a de-facto standard, but I have been using Adonisjs more thesedays. For me it feels more familiar since it follows much of the Laravel principles and patterns, but I also like it because it does come with a lot of boilerplate stuff filled out, but not enough to overwhelm you.
It looks interesting. Some observations/metrics of the repo I use for a preliminary judgment of a project:
- comparatively large community
- only a handful of open issues while approximately a thousand issues have been closed
- on the downside it seems driven (and developed) by a single person (same as with Nest.js) which imposes a comparatively high risk in my opinion
- includes a lot of "first party packages" for things that already exist in the ecosystem, such as their own Lucid ORM. Depending on your point of view might be a good (less dependency on NPM ecosystem) or bad (NIH)
Wow, that's a reference i've not seen in a long time. :) I think that Austin Powers joke has not existed anymore in the parent framework for like 8 years!
The first thing I consider when looking at Express-alternatives is if the API is fully compatible because almost every other 3rd party library/package (e.g. sentry) expects the Express object. This doesn't look like the case as I have no idea what the mojo context object is.
On a side note, I'm surprised to see frameworks trying to use benchmarks against Express as a key feature. Framework overhead is insignificant when requests delays are mostly due to the database/network.
> Framework overhead is insignificant when requests delays are mostly due to the database/network
It really depends. When every part of your app is concerned with performance, it tends to hum along. When every part of your app tends to think, “the bottleneck is the database, so this doesn’t matter”, you get modern systems.
In the case of Express vs alternatives benchmarks, you're looking at differences in the sub 1ms range as these benchmarks simply test how much "hello world" you can return per second
Express middleware support is on the planned feature list for 2.0 and beyond. Could also be implemented as a 3rd party plugin using the existing hook API though. https://github.com/mojolicious/mojo.js/issues/66
I was really excited with the first benchmarks but I ended writing a new APIs using nestJs instead. maybe if mojo.js goes towards zero deps and start running in bun, we could use it on microservices where speed is really important but don't want to add another language on the stack (eg: go/rust)
I actually feel kinda sorry for the perl, I've been programming it for 10 years now (lots of projects with mojo and catalyst) and after a while getting use to not so good ORM (like dbic is) I'm no longer interested in writing any new perl for brand new code. typescript with the static type check is too good
24 comments
[ 0.28 ms ] story [ 69.8 ms ] threadI hope its an opportunity for the Mojolicious team to do things they just couldn't do their Perl framework due to legacy constraints etc and they get to take on fresh new ideas and see them through! I've heard good things on the peripherals for years about Mojolicious
https://metacpan.org/pod/Mojolicious
https://github.com/mojolicious/mojo/blob/main/Changes#L4345
Now I feel ROMO, though (Regret on Missing Out :)
I'll never forget seeing this tweet[1] - what I considered a core pillar of the perl community discovered that after a short period of familiarization, a perl developer of many years could write code that is many times faster just by switching from perl to js. No deep voodoo, no special tricks - just write code in JS and handle 3x as many reqs/s. I'm glad to see that the rest of the mojo ecosystem is coming along - Minion is a really nice, simple job queue that can piggyback on your existing postgres database without depending on redis or anything. Would be awesome to see a dynamodb backend someday. Hmmm.
Unfortunately I'm not sure who the target market is - a typescript web framework selling itself as "Perl-grade" anything is not a good look for 99% of JS/TS devs. Maybe it's positioning itself as the logical migration path for companies moving away from perl?
[0]https://github.com/expressjs/express/issues/2844 [1]https://twitter.com/kraih/status/1392405140406210560
https://mojojs.org/news/mojo.js-1-released
Among other things I find this quite interesting:
"Software supply chain attacks around NPM are a hot topic right now. And it can be quite problematic to audit your whole dependency tree. Thankfully, while the Perl version has no dependencies at all, in JavaScript we only have 23 trusted third party dependencies. And we are prepared to replace every single one of them if necessary, with a port of the battle-tested Perl implementation."
Back when i started with Node, one of the first problems i constantly ran into was some NPM module deep down in my node_modules folder breaking its API in a minor version bump and causing hours of cleanup work. So pretty early on avoiding this issue became a priority for the mojo.js port, and i see it as one of the main niches for us to corner. You want to write a fast JS/TS web service that still works in 10 years? Use mojo.js!
Maybe you've got a suggestion for how to better communicate this idea?
[0] https://adonisjs.com
- comparatively large community
- only a handful of open issues while approximately a thousand issues have been closed
- on the downside it seems driven (and developed) by a single person (same as with Nest.js) which imposes a comparatively high risk in my opinion
- includes a lot of "first party packages" for things that already exist in the ecosystem, such as their own Lucid ORM. Depending on your point of view might be a good (less dependency on NPM ecosystem) or bad (NIH)
On a side note, I'm surprised to see frameworks trying to use benchmarks against Express as a key feature. Framework overhead is insignificant when requests delays are mostly due to the database/network.
It really depends. When every part of your app is concerned with performance, it tends to hum along. When every part of your app tends to think, “the bottleneck is the database, so this doesn’t matter”, you get modern systems.
I actually feel kinda sorry for the perl, I've been programming it for 10 years now (lots of projects with mojo and catalyst) and after a while getting use to not so good ORM (like dbic is) I'm no longer interested in writing any new perl for brand new code. typescript with the static type check is too good