Does lumo support defmacro??
I understand clojurescript doesn’t (except through clojure & :require-macros
)
Oh just seen this issue opened the other day… which seems to be related to what I’m doing: https://github.com/anmonteiro/lumo/issues/377
Interesting… Evaluating following in lumo:
13:02 $ lumo
Lumo 1.8.0
ClojureScript 1.9.946
Node.js v9.2.0
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Exit: Control+D or :cljs/quit or exit
cljs.user=> (defmacro foo [form] (println "macro executing with form: " form))
#'cljs.user/foo
cljs.user=> (foo {:some :form})
macro executing with form: nil
nil
looks like macro args are passed as nil
@rickmoynihan I think if you'd like to define macros in the repl. you have to do so in the pseudo macros namespace
see the comment of mfikes here: https://github.com/anmonteiro/lumo/issues/301
@dnolen: sorry this has got split across channels but related to my question in #clojurescript and to round off my understanding… what is up with defmacro
in lumo?
I understand in classic cljs macros are only supported in clj (and refered in via :require-macros
but curious why defmacro
doesn’t error sooner.
@rickmoynihan the macro won't work like this. You have to put it in .clj/c file and require it, so that lumo can compile it into cache. Runtime macros like in clojure don't work in clojurescript. It's hard to know with figwheel etc, then it gets compiled on save. But it's same when I start node repl with piggyback, shadow-cljs or planck
also I don't think dnolen is on this channel
So, you fundamentally need defmacro
to not blow up when compiled as ClojureScript so that self-hosted can work.
So I recently got new computer, installed nixOs on it, and was planing to start lumo now. @mfikes you were useing nixos some time ago right?
Perhaps of interest are https://dev.clojure.org/jira/browse/CLJS-2015 and https://dev.clojure.org/jira/browse/CLJS-2636
@hlolli Well, I have a build environment that I try to test Planck in. https://github.com/mfikes/planck/tree/master/build-envs
makes little sense to install it via npm on nixos, just need to make a derivation for lumo and push it to nixpackages 🙂 but I'm learning this slowly
ah you make nix-shell
Yeah, it seems that it is not possible to get away with the "single Linux binary" when it comes to nixOS
For the Planck build environments, they are bona-fide distros, just run via Vagrant
good thing about nixos is that we could make derivation that builds lumo in sandbox, with all dependencies in environment, and it should work easy for all users
If you are into nixOS, fix clj
for it while you are at it 🙂
cool, my friend is deeply in it, I can mention this to him and we can take a session adding these derivaitons.
going to meet him this weekend
you say fix, is there already something started for clj
on nixos?
Well, you can't even install it via https://clojure.org/guides/getting_started#_installation_on_linux
I suppose this is off-topic for #lumo sorry. But someone should probably file a JIRA for this, fix it etc
hm yes, this shell script will never work properly on nixos, the bin path is immuteable and declareative, it would just get deleted I guess after restart or rebuild 🙂 but should be easy, I say as nix noob, to make a nix derivation out of this.
@hlolli are you planning to use nixos for dev? I am interested in listening to your experience report as I was thinking about that as well. At the moment I use only the package manager. About lumo, there was for sure an issue open for that
@richiardiandrea yes I remember ticket being about that and static linking for lumo, but I think that's very un-nix-ish approach to solveing this. I'm useing nixos for dev, first week I regretted it, then, I accepted it, now I'm realizing that it's probably going to save me headaches in the long run. One doesn't have to configure absolutely everything in nix like some users to, enough to rely on system packages, and for example emacas, I still use use-package to be declareative. But the pro would be to get 100% replica of ones environment just with configuration file, and it will work.
Yeah that is the aspect I am most interested in. I keep my conf files in a repo so that I can apply them to any (for now Ubuntu-based) distro. The next approach is better because I could have a custom package derived from system or something, dunno
Still looks like a lot of work though 😃
good example last weekend I had to uninstall pulseaudio and nvidia dirvers, I could uninstall and install, and everything worked still. In fedora for example I would have to uninstall xserver if I uninstall pulseuadio. So every dependency is "sandboxed", it's really mind blowing.
Yeah that is cool
Thanks will try later
Can you use cljs libraries from lumo?
@michaelwfogleman yes you can, you need to resolve them first, then you can call lumo -D lib-name:version
aka, they need to be in .m2
if you get exceptions though, it probably means that they are not self-host compatible (yet)
@anmonteiro I just mentioned in DM’s with @richiardiandrea that I would be willing to contribute to making a “Lumo Shell Scripting 101” type document, with some assistance here. Is that something you’d be open to?
totally
I’d love that
submit a PR adding a .md
file to a docs/
folder
we’ll take care of formatting it later
so is this PR on hold right now? https://github.com/anmonteiro/lumo/pull/313
@richiardiandrea Is this a blocker for the work I mentioned?
No I don't think so, we can also write on the lumo wiki
I seem to recall that anmonteiro wants to self host - but that may not be true.