Fork me on GitHub
#spacemacs
<
2018-07-15
>
Chase23:07:07

i had a similar question to reaper. i'm starting clojure for the brave and true. I have a little bit of experience with Spacemacs. My question is when I do "Cider jack-in" and it starts a repl, how is this different than when I am in a terminal and use "lein repl"? Are they interchangable so if a tutorial is talking about lein repl, can I instead just use Cider and all instructions will work the same?

👍 4
ag23:07:05

The whole notion of "REPL-driven development" can be extremely confusing for a beginner. I was really surprised to hear all the time "startup time is not a problem", "you don't really need to restart the repl", etc. Maybe go through @U07FP7QJ0’s excellent guide https://lambdaisland.com/guides/clojure-repls ?

ag23:07:47

I hope it doesn't confuse you even more.

Chase23:07:01

thank you! I'm on the multi year stay patient plan just scratching an intellectual itch so it's all good.

ag23:07:45

oh, no... the concepts are pretty simple to grasp. it's just hard to jump from "oh I know how to do simple things in REPL" to "I need to build a web-app, with it's own server and websockets, with Figwheel, and clojurescript advanced compilation"

ag23:07:49

and if you like the guide and free videos, I can't recommend enough to get to paid content on http://lambdaisland.com. Arne is awesome.

ag23:07:25

he doesn't waste your time with trivial things you can get from readmes. he digs much deeper.

ag23:07:05

the only other person (I know) who creates videos of similar, advanced level is @U054W022G

ag23:07:39

try his Clojure Pills episodes on youtube. They are very educational

Chase00:07:21

awesome. i'm not ready to commit to something like that yet. i've been super flighty in checking out different languages and such. all the lisp family languages intrigue me so much though so I'm trying to keep it to just fiddling with clojure, racket, and common-lisp now and seeing where it takes me.

Chase00:07:16

and elisp i guess. I'm worried I'm handicapping myself with spacemacs but it but setting up my own emacs + evil setup seems far more overwhelming than it was setting up my far more minimal vim config.

ag00:07:18

I'm a die-hard Vimmer. I spent months and years trying to set my own Emacs config that I would happy with. Over and over I would announce init file bankruptcy and would start everything from scratch. I guess I just lacked the knowledge. Everything seemed to be so... overwhelming. And then I tried Spacemacs. I have discovered so many things. It turned out that the hardest part is simply to know what Emacs can offer and where to start digging when you encounter a problem or want to change something. Spacemacs simply made things more discoverable.

👍 8
ag00:07:12

With Clojure it's I think similar. The hardest part for me is the core library. Just learning what's in there takes time.

Chase00:07:28

i can empathize with that for sure. I think i would have been on the same path. I would never use something like spacevim over my own simpler vim config that i grasp really well but with emacs it is just different. spacemacs spoiled me to where I was just going to try and create my own version of it on my own with maybe just cutting out all the stuff I won't be using it.

Chase00:07:15

my concern is i hear it is hard to learn how to add your own config to it. not sure if that is true or if it is just a different approach in configuring spacemacs than vanilla emacs but still possible.

ag00:07:09

No, that's not true. Spacemacs is still as much configurable as vanilla Emacs if not more.

Chase00:07:29

that is good to hear!

Chase00:07:37

i think it comes down to Spacemacs is emacs. it's all elisp config just the same. I just need to learn it and the spacemacs docs seem well done and the gitter channel is there to help

ag00:07:46

I'd suggest try out Spacemacs's default distribution (with batteries included). See what it has to offer. Learn things like Layers and Layouts. Try to create your own custom layers. Whenever something bugs you try to find the way to change it. Use describe- functions. Explore layers included with Spacemacs. Remove packages you don't need by setting dotspacemacs-excluded-packages.

ag00:07:34

And after a few months if there are still things that you don't like - you can always switch to Spacemacs-base and add layers À la carte

Chase00:07:32

definitely. i've come to the same conclusion and just decided to embrace it fully and not fight it.

Chase00:07:54

thanks for the chat!

ag00:07:10

Of course, my pleasure. You don't have to "embrace it". Emacs lets you do crazy things. It's up to you how crazy you want them to be.

Chase00:07:04

I'm excited for all this lisp programming fun. i think clojure could be my main general purpose language but also am excited to learn common lisp and enough elisp to be useful. my main concern with clojure is the error messages. i've played with elm and rust and the compiler error messages are so good. i feel it's helping me learn programming but i want to play with more dynamic languages. lisp seems to be the pinnacle of dynamic langs.

Chase00:07:44

but i don't really have much of an interest in java at all. i hear clojure error messages can be a little java-ish. something about stack traces

ag00:07:56

Clojure is a hosted language. Scala's error messages for example aren't less hideous. When in Clojurescript repl it shows you javascript error stacktraces. Maybe someday it will be hosted on something other than JVM and JS

ag00:07:17

and we would be like "aww... man... these error messages are so nice"

Chase00:07:47

definitely. it seems the benefits of being on the jvm far outweigh my error message concerns. every time i see a Clojure talk or project hit something like hacker news it just seems very high quality. i'm excited for it's future. and to be able to go full stack with clojurescript. it's awesome.

Chase00:07:42

let me ask you one quick repl question and i'll leave you alone and go rtfm. say i'm inputting a multiple line function in the repl. the pareninfer or whatever has already thrown in all my ending parenthesis so when i hit enter it tries to run the function before i've entered the rest of the lines. how do you work around this? do you just delete the ending parenthesis? I hope that wasn't too confusing

ag00:07:48

yeah. it ain't a silver bullet though. nothing is. at the end of the day what matters is: "it simply works". I have tried almost every popular way not dealing with javascript. I've tried Babel, Traceur, Coffeescript, Typescript, Livescript, Gorillascript, Fay, Haste, GHCJS. I haven't really tried Elm, Purescript or Reason. Simply because I got "stuck" with Clojurescript. It just works. It makes sense. And until it stops making sense I will happily use rather it than anything else.

ag00:07:20

When you say "REPL" what exactly do you mean? Repl in Terminal? CIDER-Repl?

Chase00:07:07

mostly cider. when i use a terminal repl it is not automatically closing my parens so it is not a problem there.

ag00:07:43

try rebel-readline it does

ag00:07:43

if you have cider jacked in, you don't have to type things into repl. You can evaluate things in a file directly. Or you can open cider-scratch buffer and type things and eval them there

ag00:07:26

try commands like eval-last-sexp or cider-pprint-eval-last-sexp

Chase00:07:45

cool. i will keep playing around with it. i'm not seeing something like eval-current-sexp for like where my cursor currently is. time to do some exploring!

ag00:07:43

put your cursor after the last paren in a form (in insert mode), press C-x C-e

ag00:07:48

or mark some region then press , e r (eval-region)

ag00:07:16

there are bunch of ways to evaluate things

Chase00:07:34

it's so cool!

Chase00:07:53

alrighty, i need to head off. thanks again for all your help tonight. it's been fun

4
_rj_r_02:07:54

So I also just found this... I just started going through it, so not sure how good it will be, but it has been interesting thus far: http://cestlaz.github.io/stories/emacs/ Walks through writing an emacs config file for vanilla emacs. Might be of some use so I figured I'd drop it here 🙂

ag06:07:53

Those are good. Some prefer something written instead of videos. For that I can recommend Mike Petersen's blog and the book "Mastering Emacs". Buy it. It's worth every single penny. I bought it twice (forgot that I did buy it once already). Never bothered asking for refund. It was worth it. I can send you a copy (it might be outdated though). I read it when I already learned bunch of things. Still, I found a few gems in there that I didn't know before.

ag06:07:04

People not familiar with Emacs often question our sanity. "Is it really worth spending that much time learning a frigging editor?". However, I honestly never met anyone who gave Emacs honest, heartfelt try of a few months and ever regretted learning it or thought it was waste of time. I honestly think - as long the keyboard input stays relevant - Vim and Emacs will never become obsolete. It's hard to predict where technology takes us. But I think probably keyboard input stays. For at least next couple of decades.