5 ms·
I think some of your frustrations might stem from your workflow. You really have to use the REPL to get the most out of Clojure development. For example, you s
by yogthos 10y ago
I think some of your frustrations might stem from your workflow. You really have to use the REPL to get the most out of Clojure development.
For example, you should never change a bunch of code in different files and then try to run it and hope it works. Clojure workflow would be to change a particular function, send it to the REPL, see that it does what you want, then change the next function, and so on.
ClojureScript equivalents to GraphQL would be Om Next http://hueypetersen.com/posts/2016/02/13/om-next-from-a-relay-graphql-perspective/ http://hueypetersen.com/posts/2016/02/13/om-next-from-a-rela... and and Posh with Reagent https://github.com/mpdairy/posh https://github.com/mpdairy/posh It's the same concept expressed in a Clojure idiomatic way.
I would highly recommend using Vim fireplace, Cursive, or Atom to start learning Clojure. Emacs is a very complex editor that takes a lot of time investment to be productive in. There's no reason to try and learn it while also learning Clojure. I've been developing Clojure professionally for the past 6 years and I've never used Emacs for that.
- dfischer 10y agoI appreciate your tip. However the error is still problematic that you can't find your stepping on what to fix. Second, I can't embrace Clojure specific idioms that remove other platforms. That's why GraphQL is amazing, it standardizes across platforms for many types of clients. I embrace a polyglot engineering structure and there will be teams that use and consume GraphQL on languages outside of Clojure. I'm comfortable with Emacs (just in VIM mode ;)). Edit: to add, momentum is important in my eyes as well. It's hard to put down the momentum of GraphQL and it's adoption for something niche specific unless the pros heavily outweigh the current momentum. Which is definitely possible (why I'm investing this much energy to discover the viability of Clojure/Script/idioms) but I get very skittish when I see the current issues of community size, errors, and the lack of momentum compared to other technologies (Clojure looks like it's popularity has somewhat peaked unfortunately). If a company/team can leverage Clojure and it's niches as a secret weapon despite it's smaller momentum then that's a huge win. But that means it has to be that big of a win compared to alternative technologies that do the same thing with a larger amount of people familiar with it.
- nickik 10y agoOm next is not really Clojure specific, you could use the same query/transaction model in other languages as well. The server part is can be used with any database. As I understand, that is much harder with GraphQL.
- gkya 10y agoEmacs is not complex at all, but it's easy to mess up if you don't do the C-h t tutorial and read the Emacs Lisp Intro. And if writing a couple lines of lisp to set up Cider is to difficult for someone, what will he do with Clojure? The thing with Emacs is that it's a programming environment in which you're supposed to program. People want it to work like they want out-of-the-box, but that's like asking the Ruby interpreter to write your RoR application for you. With Emacs you don't reach median productivity on day one but maybe after a week or so, but then on your productiviry will increase and increase. But with other tools maybe you reach the median productivity on day one or two, but you stay thereabouts thereafter. And they eat up all your ram.
- DigitalJack 10y agoTo say emacs is not complex is absurd. Still my favorite editor though.
- mrkgnao 10y agoI'd go further and say it's not complex, but rather complicated. In the same way that (forgive the example) the Vim command language is complex, but the Vim source code (gasp) is, well, very complicated. I use Emacs (Spacemacs, so maybe that doesn't count!), though, and I'm willing to live with this if it means it can do what it does! :)
- gkya 10y agoSpacemacs adds a whole lot of packages and subsystems, and a lot of complexity (layers, etc.). Emacs itself is really not complex if you take it as a programming environment. If you take it as an editor, and ignore its Lisp parts, then it's again not complex at all.
- DigitalJack 10y agoThanks for luminus btw. I only use the repl for exploratory-figure-this-out type work. Once I have it figured out, I rewrite the function and reload the environment. I find it is too easy to have a messed up environment (state) when tooling around with the repl.
- dfischer 10y agoAlso more to your point on REPL - do you know of community docs of how to use the repl more effectively? I got the basics down but really want to see how a wizard does it.
- puredanger 10y agoA search for "clojure repl" on youtube will bring up lots of examples.
- Jach 10y agoI think if you only want to see how wizards do it, you'll have to fully master emacs. As a non-wizard and vim-forever guy, who only occasionally writes Clojure for hobby projects, here's my advice. For a long time I got by with creating a split-screen terminal with 'screen', and then used vim-slime (https://technotales.wordpress.com/2007/10/03/like-slime-for-vim/ https://technotales.wordpress.com/2007/10/03/like-slime-for-...). It doesn't have to be split, I just like it that way, but the idea is you have essentially two views talking to the same screen session. In one you launch a repl (with lein, or even a ruby/python repl if you want) and on the other half you open vim and type things like ctrl+c etc. to send fragments from vim to the repl. More recently I've been using slimv (https://kovisoft.bitbucket.io/tutorial.html https://kovisoft.bitbucket.io/tutorial.html and https://github.com/kovisoft/slimv https://github.com/kovisoft/slimv -- and if you want my three vimrc prefs http://pastebin.com/VjwrEJJQ http://pastebin.com/VjwrEJJQ) after using it for Lisp, which uses swank, and found I could also do some of this for Clojure's repl (https://github.com/technomancy/swank-clojure https://github.com/technomancy/swank-clojure). Unfortunately it's kind of outdated, that's not where the community is going (and I haven't really bothered to figure out exactly where that is, though that project's readme gives hints, nor have I really tried Fireplace recently enough to say if I still dislike it). But it works for me, for now, unless I want to use ClojureScript. I'd say give it a shot, you might like it.
- WildUtah 10y agovim-fireplace is much improved. I had been using a heavily hacked version matched to my own preferences for years but recently upgraded. What you really want is just to run lein repl in your repository and then fire up another terminal and edit code with Vim. Then you should send whole top-level forms to the repl with :Eval from Vim and it should just work. You can then test them in the repl. (I alias C-c C-c to :Eval (:no <C-c><C-c> :Eval<cr>) because I'm used to the old vim-slime) And it should all work automatically. With the new versions of vim-fireplace it does just work automatically. I'll write a 'process-data function in Vim, send it with :Eval, and then test it in the repl with (process-data {:some "data", :more "other data"}) and it all just works. There's a little reading up on namespaces necessary once your projects get complicated, but it works on a bare repl right out of the box, too.
- bootload 10y ago"I think some of your frustrations might stem from your workflow. You really have to use the REPL to get the most out of Clojure development." Are there any good HOWTO, tutorial or documents that explain how? (ahh "clojure repl" on youtube) what about text? Looks like I'll search. One hint as to the maturity of a language ecosystem, is official docs that show these kinds of things.