I'm going to go out on a limb and guess that Mojolicious is lighter-weight (from the coding perspective) than anything that has ever been developed in Java. You can literally write the entire app in a single file, with nice descriptive REST URLs. You don't even need any directory structure.
Here's an example Mojo app that serves a Powerpoint/Keynote-like experience (including navigating the slides from a device the presenter is holding) out of a single HTML file that you pair with the controller.
Here's another single-file app (aside from served assets) that implements a multiplayer Asteroids game, currently hosted live at https://nrdvana.net/asteroids/. I showed that off for my presentation back in 2019 and then it uses so little resources I never bothered to turn it off. It uses 12MB of RAM currently, and lives in a docker container. (I also never bothered to finish it, as there are currently no asteroids or collision detection, heh. It's just a tech-demo of websockets)
Java has a strong need for "lighter weight" because their default framework stance is "500 layers of abstraction". I see Springboot's home page advertising "you don't even need any XML" and it made me chuckle. I did quite a lot of Java in college, and eventually grew to hate it because while the structure of the type system felt nice, it takes forever to get anything done, and you have to learn about each of those layers of abstraction. It would not surprise me if Catalyst (perl's heaviest web framework) was lighter to develop with than Spring. (again, I have no experience with Spring. Tomcat+Servlets were the lightest option at the time I stopped using Java)
It all comes down to what you want the framework to accomplish for you. Catalyst is a structured framework like Ruby on Rails, and by default comes with a directory layout and a config file (but you can technically still do single-file apps with it). Dancer and Mojo are lighter than that, and let you opt-out of most of the extras. Mojo is special in that it was designed for event-driven code, so you can have a single perl process serving lots of clients instead of a giant pool of Perl processes. It also has the event-friendly database drivers like Mojo::Pg. Plack is so light you can barely call it a framework. Whatever level of "lightweight" you want, Perl has it. But then you finish with "I would prefer not to cobble bits and pieces of disparate Perl technologies to build a microservice architecture" ... but then we come right back to the question: what do you expect the microservice architecture to accomplish for you? And if *more* features are your goal, then why are you averse to a normal web framework?
|