Fork me on GitHub
#beginners
<
2019-05-13
>
mjw01:05:15

@kari.marttila Since I’ve started using Clojure, I’ve tried finding ways to use REPLs in other languages since I now cannot imagine working any other way.

seancorfield01:05:27

The only other system I've ever used with anything approaching Clojure's REPL experience is Smalltalk @matt.wistrand

mjw02:05:58

I use the Node.js REPL all the time, but have found nothing close to Clojure’s REPL integration 😕

kosengan05:05:54

Which is the most commonly used IDE for Clojure?

seancorfield05:05:55

The most commonly used editor is Emacs @thegobinath

seancorfield05:05:16

Among traditional IDEs, I think Cursive / IntelliJ is the most common.

seancorfield05:05:27

Atom and VS Code are also popular.

kosengan05:05:35

How about spacemacs?

jumar05:05:04

that's a popular choice if you don't want to spend months fine-tuning handcraftet emacs setup

jumar05:05:07

I can only recommend it

seancorfield05:05:19

It's minority, but yes some folks use that.

kosengan05:05:21

yeah VS Code is the most favorable IDE for almost everything

kosengan05:05:56

And one can use it for Clojure as well

seancorfield05:05:58

If you're learning Clojure, my advice is: use whatever editor you're most used to, as long as it has a Clojure integration.

kosengan05:05:14

I saw lighttable

seancorfield05:05:15

The key thing is to develop a good REPL-based workflow.

kosengan05:05:23

Which is written in Clojure

kosengan05:05:35

But seems like the community is not active

seancorfield05:05:38

LightTable was very cool when it appeared but it has been abandoned.

seancorfield05:05:00

A new team is trying to get it going again but I'm not going to hold my breath...

kosengan05:05:42

It's not buggy in Ubuntu Mate

kosengan05:05:50

Sorry It's buggy

kosengan05:05:57

*Lighttable

seancorfield05:05:54

I used Emacs for years. Now I use Atom. At first I used Atom with ProtoREPL. Now I use Atom with Chlorine. Like I say tho', use whatever you're most familiar with as long as it has a Clojure integration.

4
👍 4
ejelome06:05:38

this could be old, I somehow stumbled with this small framework: https://coastonclojure.com What I like with it is it's opinionated and just uses a Makefile with deps.edn, this can be good intro to beginners who just wants to build something fast (and it's only afaik the framework that imitate rails' workflow, at least main parts of it).

penryu06:05:26

What @seancorfield said: use whatever editor you feel most comfortable; develop a REPL workflow; if something feels good or feels off, address it then.

penryu06:05:28

For Emacs, CIDER is solid. For IntelliJ, Cursive is solid. If you come from other IDEs/editors, use whichever extension/plugin has the best REPL support.

Ivan Koz06:05:48

@seancorfield why atom over emacs tho?

seancorfield15:05:21

I've written about it on my blog http://corfield.org -- editor choices are subjective by definition.

👍 4
Ivan Koz00:05:27

yeah sure, just looking for possibilities to improve my workflow

👍 4
penryu06:05:12

<holy-war>

ejelome06:05:33

Or use any editor that at least has syntax highlighting capabilities for Clojure and then just the terminal. Most of the time, you just want to code then run it, for exploratory purposes; immediately trying to jump using an advanced text editor just to try a language might actually hinder your progress (and enthusiasm) to try and use the language.

👍 8
Ivan Koz06:05:37

@penryu <genuine-interest>

penryu06:05:18

It's a holy war because it rarely (if ever) leads to objective info. :man-shrugging:

penryu06:05:32

I'm happy to be proven wrong, though.

penryu07:05:02

@nxtk What's your EOC?

Ivan Koz07:05:03

i'm fine with subjective info

👍 4
Ivan Koz07:05:17

@penryu currently Intellij, but i also can do evil emacs if needed

Ivan Koz07:05:54

however my intellij is keyboard only with help of action tree and patched awt

penryu07:05:56

Considering trying Atom?

Ivan Koz07:05:18

my current setup

penryu07:05:01

Hey, if you just wanna learn a new editor, I've got a few suggestions. 🙂

penryu07:05:01

That brings up a slightly different question: anyone had any issues going to a post-8 JDK?

jumar08:05:27

There was also some problem with earlier versions of leiningen (pre 2.8.0) I think

tabidots04:05:48

Oh I didn’t even realize this was possible. Cool 👍:skin-tone-2:

Ivan Koz07:05:07

clj-java-decompiler spits exceptions but i need it for learning, and haven't looked into fixing it yet.

penryu07:05:10

Thanks 🙂

penryu07:05:45

@nxtk What IDE is that?

penryu07:05:03

Cursive? Or something else?

penryu07:05:36

I'm happy with the keyboard only, but I've yet to find an ideal keymap for intellij

Ivan Koz07:05:14

yeah i've spent too much time creating my keymap 😄

kosengan07:05:11

Clojure+Dart/Flutter Any Idea?

kosengan07:05:30

I mean, like how you can write React Native Apps, in Clojure, is it possible to Write flutter apps in Clojure?

Frank Henard14:05:16

not certain, but I doubt it. I don't think there's any interop between dart in Java or Javascript

seancorfield15:05:21

I've written about it on my blog http://corfield.org -- editor choices are subjective by definition.

👍 4
seancorfield15:05:59

@penryu @nxtk the objective part recently is that I wanted editor integration with a socket repl rather than nrepl.

Kari Marttila17:05:05

It's easy to read environment variables but is there an easy way to set environment variable using Clojure? I'm testing certain things locally with one AWS_PROFILE and with the real AWS service with another AWS_PROFILE and it would be nice to dynamically change the value of that environment variable in REPL.

Lennart Buit17:05:12

I think(?) that environment variables are a snapshot of process creation

lilactown17:05:21

it sounds like the environment variable is being read by your Clojure program and then some behavior is changed? it would probably be easier to twiddle the value inside the Clojure program, rather than effecting environment variables

noisesmith17:05:44

you can set environment variables but it's not portable, you can portably set system properties though, and they have a similar utility

noisesmith17:05:08

if you are willing to restrict yourself OS wise, there are third party libs that let you change env vars

noisesmith17:05:26

but I agree with @lilactown, if you aren't doing something that needs an env var change (eg. host shell interop...), just use a layer of indirection that lets you tweak things at runtime

noisesmith17:05:59

eg. use a config map in a namespace, set it from env vars at startup but redefine as needed in the repl

lilactown17:05:21

@kari.marttila are you using the cognitect AWS API?

Kari Marttila17:05:15

@lilactown: yes, I'm trying Cognitect AWS API in this new experiment.

Kari Marttila17:05:22

@noisesmith: Your solution sounds good. I try that.

lilactown17:05:40

the docs leave a bit to be desired, but I’m pretty sure there’s a way to specify the profile to use programmatically

Kari Marttila17:05:03

... ah, except Cognitect AWS library reads the credentials from AWS_PROFILE env variable...

Kari Marttila17:05:37

Yep. I could do it like that.

noisesmith17:05:11

yeah, looks like getProperty is using a System property

ghadi17:05:17

(This is the same behavior as the java clients, fyi)

noisesmith17:05:23

(System/setProperty "foo" "bar")

Kari Marttila17:05:28

Now I got an idea. I use both of your suggestions...

ghadi17:05:46

env var is the top level override for profile

manutter5117:05:59

@kari.marttila Cursive will let you set environment vars in the REPL settings dialog

lilactown17:05:17

so I think you can do something like:

(aws/client {:api :s3 :credentials-provider (credentials/profile-credentials-provider "profile")})

Kari Marttila17:05:22

First I check the config.edn if there is a flag - local-dynamodb, if the flag is on, I ready credentials from config.edn. If not, I use AWS_PROFILE which points to real AWS env.

manutter5117:05:23

I use that for dev credentials a lot

Kari Marttila17:05:27

How about that?

Kari Marttila17:05:58

That way I can dynamically change the flag and use either local DynamoDB for testing or occasionally test using the real AWS DynamoDB...

Kari Marttila17:05:29

Yes, I have set the AWS_PROFILE in REPL settings but this way you can have only one AWS_PROFILE env var in the REPL.

Kari Marttila17:05:42

My wife wants to see the latest Game of Thrones episode. Got to go. 🙂

Drew Verlee01:05:35

dont do ittttt. Oh no, its too late

Kari Marttila08:05:43

It was actually pretty good. Some of the rare series I and my wife like together (I'm a big fan of scifi which she doesn't stand).

Kari Marttila08:05:11

But today after my corporate hours - the Clojure learning journey continues! Yihaa!