yawaramin / re-web

Experimental web framework for ReasonML & OCaml
https://yawaramin.github.io/re-web/re-web/index.html
MIT License
261 stars 8 forks source link

Tierless web development #23

Closed ozanmakes closed 4 years ago

ozanmakes commented 4 years ago

Since there are some big ideas like Reweb.Response.Live in the issue tracker, I wanted to throw this one out there too.

I want to be able to write a Reason module for a feature and have backend and frontend (BuckleScript) code auto-generated. It would be type-safe, and API calls would simply be function calls. Under the hood it could be some RPC mechanism, or GraphQL for an API that's available outside of this stack. Ideally, the frontend would get compiled with BuckleScript.

Some prior art would be

What do you think?

yawaramin commented 4 years ago

There's also https://udash.io/ (Scala) and http://opalang.org/ (new language but implemented in OCaml).

Personally I see ReWeb as backend-only. As far as I can tell, the tierless frameworks are all using custom-written languages or language extensions. I would like to stay in the vanilla OCaml world as far as possible :-)

ozanmakes commented 4 years ago

This was something I kept wishing to have over the years, had to try :). Good points, keep up the great work!

ozanmakes commented 4 years ago

I guess even with a PPX, editor and tooling support would be hell. My primary wish is trivially defining type-safe RPC and calling backend functions that return promises by name, and dealing with ser/de without creating a REST API. I'm sure this could be achieved without going full-on tierless.