Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

truss and its dependents won't load in Planck #10

Open
atroche opened this issue Apr 27, 2018 · 2 comments
Open

truss and its dependents won't load in Planck #10

atroche opened this issue Apr 27, 2018 · 2 comments

Comments

@atroche
Copy link

atroche commented Apr 27, 2018

You're probably already aware, but just in case:

~/c/planck-scatch> plk -D "com.taoensso/truss:1.5.0"
ClojureScript 1.10.238
cljs.user=> (require 'taoensso.truss)
WARNING: Use of undeclared Var taoensso.truss.impl$macros/Throwable at line 23 taoensso/truss/impl.clj
Could not eval taoensso.truss.impl in file taoensso/truss/impl.clj
Assert failed: Argument to resolve must be a quoted symbol
(core/and (seq? quoted-sym) (= (quote quote) (first quoted-sym))) at line 80 taoensso/truss/impl.clj

Mike Fikes has a good explanation here: planck-repl/planck#734

@ptaoussanis ptaoussanis added bug and removed blocked labels Dec 13, 2022
@ptaoussanis ptaoussanis self-assigned this Dec 13, 2022
@ptaoussanis ptaoussanis added bug? and removed bug labels Dec 13, 2022
@ptaoussanis
Copy link
Member

@atroche Hi Alistair, thanks for the heads-up - and apologies for the long delay replying.

I'm not familiar with Planck. Could you explain your use case a bit?
You want to use Truss's assertion macros in Planck code?

I'll need to wrap my head around how macros would work for something like Planck.

@ptaoussanis
Copy link
Member

Quick update: from a quick skim of Planck's docs, it does appear to me that adding support for Planck might unfortunately be non-trivial.

A couple potential issues:

  • Macros apparently cannot call other macros during expansion without modifying the namespace file structure.
  • Getting macros to work well with Clojure, tools like shadow-cljs, and Planck all together seems like it could be troublesome? From what I can tell, Planck wants macros in .clj/c files but will process only :cljs conditional branches. So it seems like macros in .cljc files need to choose between a :clj conditional (which is preferred by shadow afaiu, and helps to reduce build times and the risk of unnecessary output) and an unconditional macro (which seems to be necessary for Planck).

There seems there may be a fair amount of complexity here to sort out, I'd need to spend a fair chunk of time understanding the details to really judge the viability here.

The ideal would be if there were some guidelines for library authors with some examples to show how to satisfy Planck's requirements without negatively impacting other builds/tooling. I suspect that's probably possible with the right approach, it's just unclear to me how much such an approach would impact my usual patterns / workflow.

Planck looks really cool, would be great to support it if possible. But realistically, would need either some clear guidance on the above - or a strong motivation (e.g. wide user demand) to try dig further and experiment.

If you or others are strongly interested in this, please share any details you can re: intended use cases!

Cheers :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants