Clojurians
#parinfer
<
2017-07-28
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

cjhowe04:07:44

is there any reason to use parinfer over paredit if i'm already used to paredit?

mattly04:07:27

@cjhowe I think they complement each other nicely

cjhowe05:07:12

you can use both?

cjhowe05:07:27

maybe i'll try it then

doglooksgood09:07:28

It's there any plan to make parinfer-codemirror an ide or feature-rich editor for clojure?

shaunlebron15:07:41

@cjhowe in theory, as long as paredit operations result in properly indented code (according to our inference thresholds), it should work fine.

cjhowe15:07:20

parinfer doesn't have things like slurp and stuff right? that seems like the main benefit to me

shaunlebron15:07:28

I’ve seen some people graduate from parinfer to paredit, and that’s more of what I expect

shaunlebron15:07:36

parinfer is to get people in the door

shaunlebron15:07:15

in some cases, parinfer behaves like that, but it’s not as granular as paredit slurp/barf

cjhowe15:07:27

so is paredit's and parinfer's indentation compatible? are there any reports of teams using both?

shaunlebron15:07:41

i only used on paredit on vim, and I can’t remember how it behaved in terms of indentation

shaunlebron15:07:57

does emacs-paredit auto-indent code after operations?

shaunlebron15:07:59

@cjhowe I’d love to have help looking into paredit/parinfer compatibility. I’m guessing it will be editor-specific since implementations might differ

cjhowe15:07:16

yes it auto-indents

cjhowe15:07:47

in my experience it's compatible with those two rules

shaunlebron15:07:51

it might be easiest just to try it, I’ve heard of folks using them together though

cjhowe15:07:05

i'll try it, then!

cjhowe15:07:35

i would consider myself a paredit beginner honestly, but there are some functions i use regularly that i don't want to lose

cjhowe15:07:39

so i think it's a good fit

shaunlebron15:07:59

cool, thanks for asking, looking forward to hearing how it works :slightly_smiling_face:

shaunlebron15:07:10

@doglooksgood codemirror is used by LightTable. I don’t know of other clojure editors that use it

shaunlebron15:07:54

I don’t have plans to turn it into one. I am aware of some sites that use it for small editors and REPLs

shaunlebron15:07:37

I mainly created it for the parinfer home page and demo editor, so it could be a proper environment for showing canonical behavior

cjhowe15:07:51

oh, there's an online parinfer repl?

doglooksgood15:07:04

I'm always searching for a good Clojure development environment, but never satisfied with any of them.

shaunlebron15:07:50

@cjhowe and in case you don’t know, this is the demo editor for playing with: http://shaunlebron.github.io/parinfer/demo

cjhowe15:07:16

the online demo is actually really useful because there's a lot of online clojure challenges that don't have a good text editor (like codefights)

shaunlebron15:07:59

i was in an interview the other day where I could choose my language of choice

shaunlebron15:07:11

the clojure editor was so bad, I had to switch to js

shaunlebron15:07:02

so yeah, parinfer-codemirror could help there

doglooksgood15:07:38

we can see a lot of shining ideas in all kinds of Clojure development tools, but there's no one make people feel perfect.

doglooksgood15:07:21

I recently use Emacs, but it has almost no support for Java and JavaScript.

cjhowe16:07:43

well, there's http://jdee.sourceforge.net/ if you're into that

shaunlebron16:07:55

do you have an example of a perfect environment in another language?

cjhowe16:07:51

tbh cider is by far the closest i've found to perfect for any functional language

dominicm17:07:48

@shaunlebron were you using their provided editor or something?

shaunlebron17:07:08

what do you mean?

rgdelato17:07:20

Atom + Parinfer + Proto REPL has been pretty good for me, but I'm also in Clojure beginner-land

rgdelato17:07:26

and Proto REPL still needs quite a bit more work on the CLJS side of things

rgdelato17:07:08

(P.S. I wrote a set-up guide: https://clojurescript.org/tools/atom ...but things that work in CLJ like saved values, autocompletion, and jump-to-definition still don't work in CLJS)

shaunlebron17:07:22

@dominicm oh, it was an online collaborative editor, I can’t remember which

shaunlebron17:07:07

@rgdelato I’m excited about shadow-cljs for that reason—better tool integration

shaunlebron17:07:31

it exposes the analyzer data for things like that

dominicm17:07:15

Floobits is the only good one afaik :)

shaunlebron17:07:49

i talked to thomas heller for several hours about all the things it could do and agreed to help him write documentation to get more people involved with it

dominicm17:07:54

Oh interesting, I wonder if we should look at shadow for our translation needs if it exposes that info.

dominicm17:07:11

My current plan was to write to a file every time the macro expanded.

shaunlebron17:07:12

I’m stretched too thin on cljs stuff though

shaunlebron17:07:19

wow, goog hangout video chat while screensharing, i want to try that

rgdelato17:07:28

I've heard of it, but haven't given it a good look. I'll take a closer look at shadow-cljs

shaunlebron17:07:05

it might be hairy trying to look into it, but he’s got very ambitious goals and I’m excited for it

dominicm17:07:17

@shaunlebron I hadn't even thought of mentioning it to you as a code streaming thing: yah you can use it for that.

dominicm17:07:33

Better than twitch because I can jump around files. Less viewers though.

dominicm17:07:42

I the viewer.

shaunlebron17:07:42

he has fundamental disagreements over what should be in cljs core vs separate tooling. he still uses cljs.analyzer, cljs.compiler, but replaces cljs.closure to control how it creates files to support better options and deterministic build things

shaunlebron17:07:08

his latest server thing allows instant subsequent startup times, and a code analysis UI viewable on browser, and eventually visual stuff like we did in cuttle: https://github.com/oakmac/cuttle

shaunlebron17:07:14

it’s had support for figwheel-like hotloading for years, and solves a lot of small problems he’s encountered over the years—like warnings only showing up on the most recently saved file

shaunlebron17:07:57

and he cares about easy integration of cljs into existing js projects

dominicm17:07:08

I'm mostly waiting on native boot support before switching.

shaunlebron17:07:59

i put that together for him after chatting with him, and then @rgdelato had to distract me with the Smart Mode idea :wink:

rgdelato17:07:17

even if I don't understand how it really works under the hood, if I can understand -enough- to intergrate it with ProtoREPL, that would be awesome

shaunlebron17:07:47

he’s been using it for production-level stuff for years

shaunlebron17:07:30

my only worry was that it was too far from native cljs compiler, but it uses the same stuff and only replaces the file creation, so it stays in sync with latest stuff from core

shaunlebron17:07:30

i’ll actually put that in a PR on readme, and try to connect folks who want to help

shaunlebron17:07:46

the downside right now is that he is changing it all the time, but he will probably stabilize the interface a bit more if more people start using it

rgdelato17:07:03

man, Smart Mode is so nice, I can't wait for it to actually be out in Atom

shaunlebron17:07:47

drafting the communication of new parinfer stuff

dominicm18:07:49

You've built a really nice tool there. Must have taken some time.

shaunlebron18:07:38

@dominicm it was kinda scary ripping out some of that code for a standalone parinfer-codemirror, but I’m glad that it worked out because the recording code got a little crazy and edge-casey

shaunlebron18:07:37

codemirror reports on changes pretty well, and I just playback the change and parinfer does its normal processing after it is applied

mattly20:07:28

@shaunlebron looks good! I think they illustrate the concepts clearly

rgdelato20:07:56

"snap" and "compromise" animations look good. "indent" animation feels a little off and I'm not sure why. (maybe because it begins and ends with invalid code?)

shaunlebron20:07:42

@rgdelato yeah I think I agree

shaunlebron20:07:10

I’ll try a second pass, will take suggestions too

shaunlebron20:07:18

thanks for looking!

shaunlebron20:07:11

“safeguards” is hard to show