wasp-lang / wasp

The fastest way to develop full-stack web apps with React & Node.js.
https://wasp-lang.dev
MIT License
13.53k stars 1.18k forks source link

Transparent support for different languages and runtimes #1074

Open sodic opened 1 year ago

sodic commented 1 year ago

This is a very abstract and way-into-the-future idea, but what if Wasp could be used like this (I'll adapt the current syntax for simplicity purposes):

query getFoo {
  fn: getFoo in "foo.py"
  entities: [Foo]
}

query getBar {
  fn: getBar in "bar.ts"
  entities: [Bar]
}

action mergeFooAndBar {
  fn: merge in "merge.rs"
  entities: [Foo, Bar]
}

Users could define their operations on a high level and write the implementations in any language they Want.

Wasp would ensure to install whatever's necessary to execute what the users need. It would also take care of all the necessary plumbing required for different runtimes to communicate with each other (e.g., RPCs, message queues, etc.).

This idea can extend beyond operations: Wasp could be the ultimate full-stack glue platform.

Martinsos commented 1 year ago

Ah yes I love it :D! Maybe the trickiest part is using Prisma in non TS languages. It is doable, but might be quite some work, due to lack of official support at the moment. There might be unnoficial packages though, or we could implement some of our own.

What could be interesting is having a TS operation call e.g. Rust code, or vice versa. In that case we might want to play with the concept of queries calling other queries, and actions calling other actions or queries. This is something that I always thought might make sense, but it wasn't a priority so far.