Fork me on GitHub
#off-topic
<
2016-01-16
>
debug16:01:19

Clojure newbie here, what is the preferred flow for development? Where I'm from its write, compile, verify, debug. :P

jaen16:01:28

IMO the basic workflow is similar, but the feedback loop is tighter.

jaen16:01:46

Mainly because of inherent reloadability Clojure has.

jaen16:01:47

For example with Cursive (or Emacs, or somesuch) you can run a REPL in the background, write the code in the editor and then sync the code with REPL

jaen16:01:51

So you can immediately test it.

jaen17:01:03

How it behaves, if it does what you expect and so on.

jaen17:01:47

Most people say they don't really debug Clojure, but I for one am really grateful for Cursive's debugger support - I tend to use a debugger in Clojure quite often and it's a Godsend.

debug17:01:06

Can REPL entries be dumped to source?

jaen17:01:33

You mean something like Smalltalk-ish program image or in another way?

debug17:01:39

I'm not sure, that something that came to mind. That is, say I'm experimenting firsthand in the REPL and I get things right. Is it possible to write the inputs to source? Copy-pasting from terminal would be an obvious way.

jaen17:01:27

Oh you mean something in reverse to the above? So you can sync a function you wrote in the REPL back to the file?

jaen17:01:17

I'm not sure if you can do that, at least in Cursive. Maybe someone else knows better.

jaen17:01:55

But in general you can either copy&paste what you wrote into the REPL, or try to learn to write the code in the file (since with editor support it's cheap to sync that into REPL) and only do the testing in the REPL.

jaen17:01:04

That way you won't ever have to copy REPL -> file.

jaen17:01:06

I think.

debug17:01:52

That's true.

debug17:01:23

Do you recommend any plugins?

debug17:01:38

Installed autoload as the first one today.

jaen17:01:30

Plugins for what? vim?

jaen18:01:28

Ah, I don't really use any plugins with REPL TBH. What Cursive provides me is entirely satisfactory

nashio18:01:10

@jaen what else does Cursive offer for clojure, besides parenthesis matching, repl,

jaen18:01:07

Debugger (that can also step into Java if need be). That is basically a killer feature right there.

jaen18:01:19

Source navigation is pretty nice too, but I think emacs can do that too.

nashio18:01:10

cool, does it return tooltips with type errors etc in real time?

nashio18:01:35

I’m using vim-fireplace right now, which is not bad, but I might try that

jaen18:01:18

Well, there's not much in way of "type errors" you can statically verify in Clojure, but yeah - obvious things like arity, missing symbols and such have their tooltips.

borkdude18:01:11

squiggly-clojure has it too in emacs

nashio19:01:21

I tried to get into emacs and was so overwhelmed with the stuff you have to do to setup, I stayed with VIm

nashio19:01:31

but I’ve seen the benefits , its crazy cool

borkdude19:01:42

no problem, imho clojure should not dictate what editor you use

shanekilkelly19:01:47

have you tried spacemacs? I’ve been using it for a while. As a vim->emacs convert it is not only the best vim-alike experience you can have in emacs, but also the best editor/ide setup I’ve ever experienced.

sveri19:01:07

I'd also advise cursive. No need to install anything but the cursive plugin and you are ready to go (of course you need leiningen and a JDK, but I take that as given).

borkdude19:01:58

I think you don't even need to install leiningen with Cursive

borkdude19:01:07

but always handy if you do

sveri19:01:18

Yea, I am not sure about that,

borkdude19:01:33

with Counterclockwise (Eclipse) this is also the case

jsa-aerial20:01:18

@debug :wrt to flow, have a look at this https://www.youtube.com/watch?v=Tb823aqgX_0&amp;list=PLZdCLR02grLrl5ie970A24kvti21hGiOf&amp;index=13, its a very good description/presentation/discussion of what I think is a very important thing to grasp

jsa-aerial20:01:22

@debug: wrt copy/paste repl/file stuff. Yes, copy and pasting from repl to file is done, but I tend not to use the repl directly so much as experiment in a file - which with any decent editor support, allows you to evaluate any expression, including individual expressions within a nested expression

jsa-aerial20:01:07

As long as we are dumping out possible ide/editors for beginners, there is nightcode. One stop shop. A single jar that has build, dependency mgt, editing, interactive repl, multiple file buffers, full set of templates for graphics to web dev (including cljs), dbs to desktop apps, etc altogether. Just need JDK

meow21:01:53

#C0GCNE3B3

nashio21:01:19

is IntellliJ community enough for Cursive

jaen21:01:27

Sure it is.

nashio21:01:09

I’ve seen others recommend light table

nashio21:01:12

but for cljs