pathom

wilkerlucio 2023-08-22T13:57:30.549849Z

3
sheluchin 2023-08-22T21:19:00.027579Z

Is it possible to expose Pathom in some way that applications outside of the Clojure world can communicate with it?

sheluchin 2023-08-30T17:06:43.796939Z

@favila @souenzzo 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.

favila 2023-08-30T17:10:33.993249Z

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)

favila 2023-08-30T17:14:24.869509Z

https://imgflip.com/i/7xgxr9

👍 1
sheluchin 2023-08-30T17:19:47.477289Z

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.

favila 2023-08-22T21:53:06.423499Z

In principle: consume some query format and translate it to EQL?

favila 2023-08-22T21:53:31.031459Z

Depends on what you mean by “outside” and “communicate”. Do you have something in mind?

sheluchin 2023-08-22T21:54:16.750709Z

Some way to to run queries against Pathom from Python and/or JS.

favila 2023-08-22T21:55:21.108639Z

Does it have to be in-process, or is IPC fine?

favila 2023-08-22T21:56:41.526399Z

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

favila 2023-08-22T21:57:02.267369Z

Pathom runs on clojurescript, so I guess in theory you could call it from js code in-process

sheluchin 2023-08-22T21:57:43.129289Z

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.

favila 2023-08-22T22:03:05.303899Z

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.

favila 2023-08-22T22:06:12.927419Z

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)

souenzzo 2023-08-23T10:23:50.564169Z

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.

souenzzo 2023-09-01T14:19:29.311729Z

about @favila 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)

souenzzo 2023-09-01T14:21:31.804319Z

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)