This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-20
Channels
- # aws (7)
- # bangalore-clj (2)
- # beginners (64)
- # boot (34)
- # cider (1)
- # cljs-dev (8)
- # cljsrn (22)
- # clojure (268)
- # clojure-greece (2)
- # clojure-italy (8)
- # clojure-quebec (1)
- # clojure-russia (5)
- # clojure-spec (7)
- # clojurescript (7)
- # consulting (1)
- # cursive (184)
- # data-science (1)
- # datascript (18)
- # datomic (54)
- # dirac (1)
- # emacs (17)
- # graphql (1)
- # klipse (2)
- # leiningen (1)
- # off-topic (17)
- # onyx (10)
- # pedestal (2)
- # reagent (16)
- # spacemacs (4)
- # untangled (3)
- # vim (28)
- # yada (3)
so @kzeidler I've run into this problem before and the best workaround I've found is to create a project on the command line using lein
and then new project from existing sources
in intellij
I realize that's not a definitive answer or even addressing the underlying cause but it seems to work for me 😅
@goomba that did the trick! Do you happen to know if new project from existing sources
is a valid option from the IntelliJ init popup? (Or even better: how to disable that f$*&ing popup? 😬)
😅 no it's a bit of dark magic for me and depends on whether I properly exit or rage quit
I always go through the menu just b/c it's the only way I know how
although IIRC there is a way to do it from the popup
The only available context for selecting that option (that I'm aware of) is File > New, but the application tabs aren't available until you open something... :face_with_rolling_eyes:
ohhh I see what you mean
I think the "import project" would probably do the trick
from the popup
heh yeah. I've looked this up before because it also prevents opening directories from command line. I didn't find a promising lead though 🙂
yeah that seems to work
hehehe no worries 😄 it's all these little hangups that prevent actual code writing... I spent six hours yesterday tearing my hair out trying to get datomic running until someone pointed out I wasn't escaping an ampersand in my shell command 😳
and let's not even talk about kubernetes... 3 months later and I'm still not too much further with that
well I was editing on emacs soooo.... no 😛
also, I have almost no idea how to use emacs
sometimes I'm amazed people pay me money
Heh realtime error highlighting is one of those small things that I've noticed several editors really struggle with (cough coughATOM cough)
I actually started with PyCharm and good lord it made me seem like a genius compared to folks using other IDEs if for no other reason than alt+enter
, error highlights, and code cleanup
I've dabbled with writing a few plugins... it's not easy. 🎩's off to @cfleming for crushing it with cursive... must've been madness
I am. so. mad. I didn't know about IDEs when I was taking CS, everyone else had a sixth sense for solving all the endless strange errors of the JVM meanwhile I was using sublime and perpetually lost
as a lisper I'm always partially thinking about what sort of environment macros would make my life more pleasant
ohhh yeah that's rough
what are you bash scripting for? deployments or what?
I've been using ansible for some of that stuff. It's a pretty good trade off between learning curve and usefulness... way better than just plain 'ol bash scripting so far
the other day I was trying to figure out a way to associate only the most recently modified file in a directory with a particular variable
there might be multiple ways of doing it, but I ultimately just wrote a bash alias to return the absolute path of the most recently modified file in a particular dir, and just called that from Python
ohhhh
haha yeah 😅 I end up doing a lot of bash/Python interop for that file system stuff
at least you're in good company... that's pretty standard these days for sysadmin stuff
I've asked like half a dozen elder programmers how it was that bash came to be the lingua franca of the shell scripting languages, and scheme did not
well after I started learning Clojure I was like "why the hell did we adopt C if we had LISP around in 1960?"
the answer, at least as far as I can tell, is LISP in the 60's was nothing like Clojure today
I actually heard Dick Gabriel talk about this a few years ago (one of the OG creators of Lisp)
oh yeah? what did he have to say about it?
In his assessment the beauty of Lisp was also its downfall, and the ease of extending the primitive base functions led to speciation between the various universities using Lisp, making their programs impossible to decipher outside the local context
ah, yeah. that's a thing
Basically it cleaved into a bunch of local DSLs, see Common Lisp vs. 100s of other lisps
that's also in general what I've heard described as the "downfall" of LISP in general... it's so much fun to write everyone wants to write everything from scratch
The entire interview is actually one of my favorite programming-related things ever http://www.se-radio.net/2008/01/episode-84-dick-gabriel-on-lisp/
whereas in other languages it's so painful everyone relies on shared code to a much greater extent
cool! thank you!
He's fascinating, just the kind of person you would imagine might have invented Lisp one day
great intro music
whoa... MFA in poetry
didn't see that one coming
whoa... the way he talks about the initial thought of LISP is exactly why I became interested in Clojure... code that constructs code
Totally. Sometimes in 2017 I forget to remember that the base mechanism of lisp is beautiful and a nice idea, despite circular dependencies and bizarre errors thrown from external sources 🙂
happily I don't know enough about it yet to worry about those problems
although so far my experience with dependencies has been much nicer than Python
I can see now why folks coming to Python as a second language find it maddening
I know their pain... for what it's worth, once I switched to anaconda I stopped having strange dependency issues
Ahhh.... yeah anaconda introduces other issues though
really the only way to do it without fubarring everything is to use VMs and containers for Python (or else virtual environments (which I think are dumb))
wow, I just instinctively closed out nested parenthesis
it's too late for me
bwahaha
so with anaconda... if you want new packages you should use the conda
tool
if you're trying to use pip
or easy_install
and you're not careful you can install to the wrong place and it's not obvious
really the only issue I've had with conda is certain libs like Tensorflow don't seem to be able to compile themselves to your individual machine, and supposedly would be a lot faster if installed directly via Pip
you running a windows machine?
if so anaconda is really the only way to go
weird. What's the defined behavior exactly when 'pip' is called in a conda environment?
it seems arbitrary
I find that libraries that are installed using anaconda tend to install to anaconda
which is fine until it's not
again I just skirt the issue with containers/VMs
and voodoo
lol and now I'm starting to do a lot of Python/Clojure interop
Haha I do run into periodic issues with the permissions of like, python development header files especially
basically the only things I won't do in Clojure anymore are sysadmin/devops stuff and anything I need numpy
for
but they usually go away once i do something horrible like chown all my python paths and chmod them so everyone and their mother is invited to use them
ahhaaahaaaaaa
I'm so glad I'm not the only one who does that
f*ck it chmod -R 777 .
actually I've done chown -R 777 .
and that's not fun
my dev environment is a total house of cards and yes I live in constant fear of it toppling 🙂
you know before I became I programmer I assumed all programmers were like Dick Gabriel
oh snap, haha does that do what I think it does? Give your files to someone named 777?
now that I've seen the man behind the curtain ... every profession I once assumed was full of competent people has been called into question
oh, sorry
other way around
chmod -R app .
changes everything to ????????? <file-name>
when you run ls -l
suddenly nothing works
yeah with sudo
I remember before I was doing automatic deployments I botched a deployment pretty badly and had to go in and modify the live production system and did that
heheheh
double botch
btw, the solution for the issue we discussed earlier appears to be: left click your project.clj > add project to leiningen (or something like that), it should then start reindexing everything and when finished you should be able to specify a valid run configuration for the REPL
and the recursion unwinds 😄 wonderful!
@goomba No, I’ve been meaning to fix that but right now you have to use the “evaluate expression” popup you found.
@timgilbert There isn’t, I’m afraid - that’s a fundamental part of parinfer (see https://shaunlebron.github.io/parinfer/#downsides)
I’m halfway through thinking about/planning a parinfer-like thing which only works locally, and would not suffer from this problem.
@kzeidler Phew - read all that. I think the issue is how you’re creating your projects. For a simple one-`project.clj` project, the easiest way is just File->Open… and select either the project.clj
or the containing directory.
If you want to create a new project from within IntelliJ, File->New…->Project, then select Leiningen and you should be good to go.
@kzeidler There’s some doc about this here: https://cursive-ide.com/userguide/leiningen.html. It’s slightly out of date since it was written against an older IntelliJ version, but it should still help.
Thanks again boss @cfleming, my hero as always!
@cfleming Looking forward to the day I can try your new take on parinfer. I've temporarily gone back to emacs, in large part because I'm really liking parinfer, and Cursive's implementation of parinfer is too quirky for my tastes. I've mentioned this before, but in case it's fallen off your radar, I'll say that my three big issues with Cursive's parinfer were: 1) there is no "paren" mode, and parinfer really relies on being able to toggle back and forth between paren and indent mode. Cursive offers parinfer's indent mode, but Cursive's plain editing mode isn't really an adequate substitute for paren mode, IMHO. 2) I had files corrupted when Cursive's parinfer relocated parens based on indentation without asking for permission or formatting the file first (as a consequence, for example, of jumping to definition triggering another source file to be opened). 3) Undo interacted in strange ways with parinfer.
@puzzler Thanks. After that recent thread I’m motivated to try to make Cursive more beginner-friendly again.
@cfleming The other thing I'm really liking in emacs is how trivial it is to start up both a clojure and clojurescript repl for a mixed-code project. In pretty much every other respect, I'd prefer to be using Cursive. I'm sure I will be back on Cursive at some point in the future.
And yes, cutting/pasting was another thing that interacted oddly with parinfer at times. I had forgotten about that.
Just tried out 2017.1.2, and with it, "Jump to namespace" dialog often immediately disappears after a fraction of second. Not an issue with 2016.3.2
@rauh Yeah that's a minor gripe I have with IntelliJ itself. I've always had that problem, I think it's an IntelliJ quirk (also any changes to my tooltips' delay parameter do... nothing, I think)
I have a dream, which may or may not be possible. But I bet it is possible: I'd like to have two simultaneous REPL run configs in the same project, one synced with the project.clj, and the other synced with some provisional staging REPL that I can use to hack on libraries that I'm considering introducing to the main build config.
I know with leiningen it's mandatory to restart the repl after introducing a new dependency, which can be a headache. I'd like to minimize the number of times I have to stop/rebuild/reboot the main REPL process while I'm still flirting with a bunch of different libraries that I may or may not end up using
@kzeidler You can load deps at runtime: http://z.caudate.me/give-your-clojure-workflow-more-flow/
I've never used "start repl" from Cursive, I only ever connect to the NREPL that I start on the command line.
Hmm... I'm a little timid about introducing a dynamic dep fetcher/loader into my project at this point. I'm still a little scarred from using Boot a few months ago... I ended up retreating back to Javascript for a while
So for your case, you can start 2-3 REPLs on the command line and send forms to the REPL where you want to try out a library
Innnteresting... I'm trying to picture this, but I'm having trouble visualizing how that even works
So you start and NREPL, lein with-profile dev-clj repl :start :host localhost :port 23134
So the primary REPL basically... broadcasts the input to some slaves or something on the slave ports?
I can even REPL in my Clojurescript macro namespaces. IMHO that should really be the recommended way, easier and more powerful
I've spun up a remote REPL before... that's just a REPL listening on a network port right? Is there anything more to it than that?
With the workflow you can even load new clojurescript libraries onto the classpath at runtime without ever restarting figwheel or any REPL
Haha and they just chat with each other and debate the interpretation of language expressions indefinitely. Neat.
Is there a practical limit on how many remote REPL processes you can run concurrently?
but these handsome bastards seem to require about 1GB of ram while the processes are actively working
Actually I can see how that would make sense... remote repl doesn't remotely execute anything, it's just remotely listening. Is that right?
It's hard to say for sure, but it looks like there should be a way to implement multiple remote repls in the run config menu itself (no dependencies required)
In the run config menu there's an option to spin up a remote REPL at a designated host, port, from a designated "context module file"
Though, the objects living in the processes will still all add up. But you can restrict the JVM and it'll stay leaner
currently I only have the option of selecting one context module, which aligns the current project's project.clj namespace/version number
(e.g., a dummy project clj that just loads a new library that I want to play with, maybe some utilities from the current project but not the whole running server part)
You mean so Cursive knows about your deps? Yeah for that I merge all my deps from the REPLs into one for Cursive to read.
@rauh: you wouldn't happen to know if defining those satellite REPLs as named build profiles (so the alternate dependency sets are scoped to the main project.clj) might be another way to implement this? Would building a project with multiple profiles compile down to one self-contained "context module" thingy per profile? Struggling a bit to get this off the ground, but from what I gather this looks like maybe the preferred way to deal with multiple environments
@rauh: sure, so if the following defines the project.clj, and building the project.clj produces a my-namespace.core-v.1.0.0-SNAPSHOT object, and a SNAPSHOT object is required to initialize the Remote repl via run configs, is there some way to easily instantiate one of either the :dev, :secondary, or :tertiary environments in the run config? `(defproject ring_to_curl "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "http://example.com/FIXME" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.6.0"] [cheshire "5.4.0"]] :profiles {:dev {:dependencies [[com.cemerick/austin "0.1.5"] [com.cemerick/piggieback "0.1.4-SNAPSHOT"] [ring-mock "0.1.5"]] :plugins [[com.keminglabs/cljx "0.5.0"] [com.cemerick/austin "0.1.5"] [lein-cljsbuild "1.0.3"]] :test {}} {:secondary {:dependencies [...other deps] ... other plugins }} {:tertiary {:dependencies [...and so on]}}})`
I'm assuming that the motivation for partitioning the different environment profiles like this is basically what I'm trying to do too... share whatever definitions ought to be shared, and enforce separation between the parts that need to be separated. But I'm quite over my head 😅
@kzeidler Here's how my project.clj looks like, it works nicely with Cursive: https://gist.github.com/rauhs/d5bb47c239b58cbf54e1d3d1de221031
@cfleming what controls when cursive can lookup a symbol that cannot be resolved in the current file and find it in another file. So if I have foo/bar
sometimes it will pop up the intention (?) "Do you mean bar
in namespace x.y.z.foo
"? And create the appropriate require
for foo
so that the symbol can be resolved. But I can't seem to figure out why sometimes it doesn't.
Is there a canned configuration available that'll be comfortable to folks with finger memory from Emacs Live or similar environments? The way paredit works in Cursive is different enough that I find it quite unwieldy (as in, gave up and switched back to Emacs the last two times I tried it).