Writing WebApps with Monkey

Monkey Archive Forums/Monkey Projects/Writing WebApps with Monkey

maverick69(Posted May) [#1]
Hi,

the last couple of weeks I've experimented with Monkey to write webapps in an ImmediateMode-like way (very different to classic webdev or how frameworks like Angular, Vue, React are designed).

Here is a video (timeshifted) how I re-write the TodoMVC App with it (and added a small Backend Module for User Login/Registration):

https://www.youtube.com/watch?v=vCZrwElun_Y

Advantages:
- ImmediateMode like programming style! (Check out that video if you want to learn more about it: https://mollyrocket.com/861)
- Real HTML (no derivative like JSX)
- ...but still uses the performance-advantages of a virtual DOM
- Statically Typed Source Code
- Same Language for Front-End and Back-End (Monkey-X), so you can use shared code between Server- and Backend
- Autogenerated Message-Objects (statically typed with fixed communication direction: Client2Server, Server2Client, BothDirections)
- Small & Fast (Unoptimized Prototype: Backend C-Server: 260kb, Javascript-Client: 95kb (but with optimizations we can aim for 8-10KB I think))
- You don't have to use messed up languages like Javascript and badly designed and bloated frameworks like Angular/React/Ember...

What do you think of it?


Soap(Posted May) [#2]
Really interesting!!


slenkar(Posted June) [#3]
if you could get the backend to convert to javascript and have a node.js backend it would make it hostable on shared hosting,
even more if the backend was php, but thats not possible (?)

BTW what are you using for a database?


maverick69(Posted June) [#4]
Hi,

@slenkar: I think a nodeJS or PHP backend is possible with some effort but I decided to use a C++ Backend because I think it has a much lower memory footprint and is way faster (but haven't made any benchmarks).

You're right on the shared hosting thing but today virtual servers or even root servers aren't that expansive any more and I think with some effort by putting it in a Docker container or something you can host it on providers of Cloud Services as well.

For the database I just use a custom and very simple File based Key/Value Storage for the demo. The OS nowadays are doing a pretty good job on file caching, so for lots of cases this is way faster than one might think. However I've also tested it with Redis and it worked great. So if you need a more robust/scalable this is probably a good way to do it. I haven't wrapped MySQL/MariaDB RDBMS yet, but should also be possible of course.


slenkar(Posted June) [#5]
interesting thanks