wasp icon indicating copy to clipboard operation
wasp copied to clipboard

Transparent support for different languages and runtimes

Open sodic opened this issue 2 years ago • 2 comments
trafficstars

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.

sodic avatar Mar 21 '23 17:03 sodic

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.

Martinsos avatar Apr 03 '23 10:04 Martinsos

Connected with https://github.com/wasp-lang/wasp/issues/1940 .

Martinsos avatar Jun 13 '25 11:06 Martinsos