This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-22
Channels
- # announcements (13)
- # babashka (22)
- # beginners (22)
- # biff (17)
- # calva (6)
- # clerk (20)
- # clj-kondo (25)
- # clj-together (5)
- # clj-yaml (20)
- # cljdoc (16)
- # cljs-dev (1)
- # clojure (42)
- # clojure-brasil (1)
- # clojure-europe (26)
- # clojure-nl (6)
- # clojure-norway (24)
- # clojure-turkiye (3)
- # clojure-uk (5)
- # clojurescript (37)
- # core-async (7)
- # core-logic (2)
- # datalevin (7)
- # datomic (43)
- # events (2)
- # fulcro (7)
- # gratitude (1)
- # hyperfiddle (7)
- # java (7)
- # jobs (3)
- # lsp (4)
- # off-topic (16)
- # pathom (18)
- # polylith (1)
- # portal (27)
- # reitit (4)
- # releases (3)
- # shadow-cljs (47)
- # tools-build (14)
- # tools-deps (16)
- # yamlscript (11)
Is it possible to expose Pathom in some way that applications outside of the Clojure world can communicate with it?
Depends on what you mean by “outside” and “communicate”. Do you have something in mind?
IPC is the approach I just mentioned: expose some endpoint that accepts some data format you can translate in and out of eql and clojure data
Pathom runs on clojurescript, so I guess in theory you could call it from js code in-process
I don't have any real requirements right now, I'm just trying to understand how one might approach it and whether there's been anything already built to this end.
If you just want to use pathom to implement a service called from elsewhere, it’s no different than e.g. a webapp that has a sql database--no one needs to know, you just implement your own interface. But if you want to actually use pathom as pathom it depends pretty heavily on edn data and namespaced keywords as the language of the system--anything that exposes it to other languages is going to have to cross that hurdle.
maybe just dealing with it as a wire format is possible. E.g. you could use an edn or transit implementation in another language (js and python definitely have those)
It could be possible to have a nice integration with JS
imagine to expose "smart-maps" as a raw javascript object, for example:
https://blog.wsscode.com/alternative-to-clj-js/
But currently, it is all in our imagination.
@U09R86PA4 @U2J4FRT2T thank you both for your comments. I understand how Pathom's use of Clojure's namespaced keywords makes it difficult to use Pathom without Clojure, but I was hoping someone came up with something. I'd just love to be able to leverage its power in other ecosystems - I think it would be a great tool for introducing Clojure.
FWIW not having field-level concept-name disambiguation mechanisms is my biggest frustration with the entire information system computing ecosystem. Namespaced fields are so obviously a necessary idea, and whenever I have to touch architectures that don’t have them from clojure it’s a huge pain (e.g. sql, json, graphql, etc etc etc). The only mainstream thing that has something like it is xml and things that inherit that legacy, like RDF. (arguably not mainstream)
Yeah, namespaced keywords are a very underrated idea and it would be nice if something similar existed outside of Clojure. The closest thing I can think of is some of the ideas from the Glom library https://glom.readthedocs.io/en/latest/tutorial.html#access-granted but it's still a bit of a stretch to draw strong parallels.
about @U09R86PA4 meme:
(defn print-name [user] (println (:org.user/name user)))
package org
class User {
String name
}
// another file
import org.User
void printName(User user) {
println(user.name)
}
many languages, like java, actually uses namespaced names.
it just do it in a complex and scattered way.
The org.user.name
field in java is splitted between the import + type + field)Languages that uses "qualified keywords": https://en.wikipedia.org/wiki/Nominal_type_system Languages that uses "simple keywords": https://en.wikipedia.org/wiki/Structural_type_system (as clojure can do both, you can decide which tool is better for your problem)