This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-20
Channels
- # alda (2)
- # beginners (6)
- # boot (25)
- # cider (10)
- # clojars (5)
- # clojure (81)
- # clojure-brasil (1)
- # clojure-dev (2)
- # clojure-russia (19)
- # clojure-spec (21)
- # clojure-uk (69)
- # clojurescript (23)
- # code-reviews (15)
- # cursive (3)
- # datavis (1)
- # datomic (8)
- # euroclojure (3)
- # events (5)
- # flambo (15)
- # hoplon (17)
- # jobs-rus (13)
- # lambdaisland (50)
- # mount (5)
- # off-topic (3)
- # om (1)
- # parinfer (72)
- # proton (1)
- # protorepl (1)
- # re-frame (17)
- # reagent (59)
- # videos (1)
none are perfect
i’d recommend atom and cursive
I think vim’s implementation is also good, though I haven’t checked in a long time
and I think something like aggressive-indent-mode
in emacs is necessary? otherwise some case I have adjust indent manually.
atom’s support for indentation is pretty bad
it relies on regex grammar for some reason, which makes it pretty hard to get indentation right on newline
i bet nightcode works really well
i can’t speak for other clojure features, but parinfer’s implementation has been limited a lot by editor APIs
they’re just not prepared for the fine control it needs
there are other problems that are not the editor’s fault too, some design problems I overlooked in the initial design
why not write a editor with built-in ast support? I mean save code as ast instead of plain text? I saw someone made demo, but they didn't continue their work.
Cirru I think is a leading example of that idea
he’s building an AST editor http://cirru.org/
it just won’t be popular in the clojure community because he’s getting rid of parens to do so
and the problem with outputting AST is that people still want text files for collaboration
convert plain text to AST after reading file, and convert AST to plain text before saving file
oh, i guess it’s possible if you save spacing information
it uses a minimal one that tries to be compatible with different lisp dialects
like, it has a paren stack, knows about comments and strings and escaped characters, I think that’s it
it does a fast read over the whole file everytime it’s processed
is that your question?
yeah, it would be impossible otherwise
parinfer would preserve that, but not because it’s tracking it
it only modifies close-parens, with exception to some trailing spaces behind them
let me correct what i said about AST
it doesn’t remember the AST at the end of the run, it’s like a reader state that is mutated after every line
so It doesn't have to parse code to AST, instead it just mutate the state when typing?
for example, if the reader is currently at line 180 of the file, it had to parse lines 0-179
but the paren stack could be empty at 180
it doesn’t remember the states of the paren stack before then
it doesn’t track an AST, but it still reads and remember what it needs from the file
the former paren stack is irrelevant to it, so it doesn’t produce an AST
we’ve run perf tests in both js and jvm
it seems really fast
i forget the numbers, but the repos have the perf commands documented if you want to try
I'm thinking about a editor written in React, with built-in AST support, for each command, simply modify the AST, let React redraw the code in UI. as it rendering code according to clojure indent guide style, so we will never have to indent code manually.
you mean it would aggressively apply cljfmt? https://github.com/weavejester/cljfmt
It seems there are many indent style in clojure. I saw a git repo https://github.com/bbatsov/clojure-style-guide the indentation is really complex, and editors such as nightcode, lighttable are not indent this way.
reason sort of has a tool like that: https://facebook.github.io/reason/tools.html
> It seems there are many indent style in clojure. I agree, people tend to favor different styles
(something foo
bar)
(something foo
bar)
the clojure style guide is not necessarily a complete description, but it does specify a lot
batsov’s is very opinionated, some of the rules are pretty restricting
I’m currently fighting atom
I came from macvim
i’ve never given emacs an honest chance
I write js at my job, and cljs on side
I don’t use fancy editor debugging or nrepl integration in my editors though
i write python in the past, use vim without any debugging, completing. perhaps I should keep it simple, write clojure just with a REPL.
cursive’s features are pretty compelling though!
good night