Fork me on GitHub
#clojurescript
<
2015-11-11
>
johanatan02:11:44

hi, anyone here using natal/ambly on ios?

mbertheau07:11:57

Should I use cljs.reader/read-string or js/parseInt to convert numeric user input after sanitization to an integer?

johanatan07:11:48

I would suggest the latter as read-string can read many more things than you may want to allow/accept.

deas08:11:51

Brace yourself - here comes a stupid question.

deas08:11:47

I understand we are not quite there yet, but still: What needs to be done to get an nrepl server running in node?

joelkuiper14:11:44

this will probably sound stupid (today is not my best day …) but is there something like an inserted sorted set in cljs?

dm314:11:04

what would the "inserted" part do?

dnolen14:11:41

@cfleming: btw, the sooner you can get to Socket REPL support the better

dnolen14:11:00

turns out ClojureScript doesn’t need to do anything at all, the clojure.core.server is generic enough

dnolen14:11:33

5 lines of code

mfikes15:11:35

(Thinking about mobile :) )

dnolen15:11:09

@mfikes well this is about starting REPL servers, so you won’t be able to do that on mobile

mfikes15:11:15

Maybe one use case for Socket REPL is to wrap Ambly so Cursive can drive it.

dnolen15:11:18

@mfikes: yep that’s the primary use case, tooling

dnolen15:11:33

this gives us a unified simple way to talk to Clojure & ClojureScript REPLs

dnolen15:11:43

you can start as many as you want in the same JVM process etc. etc.

mfikes15:11:36

Cool. I need to put some thought into cleaner initialization of Ambly with respect to its discovery “choose device” phase.

thheller15:11:22

@dnolen for tooling to work we'd need :repl/attach. is that already supported? can't find it

thheller15:11:52

ah nevermind .. just using one node/repl-env anyways

thheller15:11:05

the keyword driven API is weird. did I miss the dev discussion on socket REPL?

dnolen15:11:18

@thheller: yeah it’s been going on for at least 6 months or something

dnolen15:11:24

since before 1.7.0

dnolen15:11:54

unlikely to see further changes I suspect at this point but you can check in with @alexmiller

mfikes15:11:04

@dnolen: Sweet. Socket REPL works just fine with Ambly. I’ll write up a short blog post note on it. No surprises… good thing is that the discovery phase works fine over the socket.

minimal16:11:45

nice british socket

dnolen16:11:36

@mfikes that was quick simple_smile

mfikes16:11:58

Thanks to @alexmiller (or whoever was involved), that was trivial simple_smile

dnolen16:11:51

yep I thought I would have to do something special but happily we just adopted the clojure.main approach earlier this year

dnolen16:11:57

now all this stuff just composes

thheller16:11:31

hmm just a few things come to mind

thheller16:11:37

but I have to test some stuff

thheller16:11:45

can't get this stuff to run

thheller16:11:57

ClojureScript Node.js REPL server listening on 54882 java.lang.AssertionError: Assert failed: (or (file? x) (url? x) (string? x))

bhauman16:11:29

@dnolen: Excellent we are going to converge on a good general setup. So exciting.

bhauman16:11:48

re: Socket REPL

thheller16:11:31

one concern that comes to mind is that there is no framing of messages

thheller16:11:47

can't differentiate between out, err or eval result

thheller16:11:24

things are once again targetted at humans not tools

dnolen16:11:38

@thheller: no it’s targeted at composition

dnolen16:11:51

irrespective of humans or tools

dnolen16:11:43

there’s already examples of how to get the nREPL style stuff out of this design if that’s your cup of tea

dnolen16:11:06

but nREPL has demonstrated how uncomposable that stuff actually is

thheller16:11:58

yeah just concerned that the REPL is still built on RPC semantics

thheller16:11:10

clojure can do that just fine since you have blocking for everything

thheller16:11:18

eg. require can block

thheller16:11:35

node/browser-repl that is async

thheller17:11:17

still a tools needs to be able to identify that require finished

thheller17:11:30

in clojure you get an exception if something goes wrong

thheller17:11:54

cljs that exception is async

dnolen17:11:59

I think you’re missing the point

dnolen17:11:05

this is just communication over a socket

dnolen17:11:11

who cares about async or not async

dnolen17:11:26

REPL’s can arbitrarily nest over standard IO

dnolen17:11:42

nothing says you cannot send EDN frames to clojure.core.server or whatever

dnolen17:11:37

the point is you can layer that stuff over something primitive

dnolen17:11:48

trying to get something primitive out of a fancy thing like nREPL is a disaster

thheller17:11:02

totally agree that nREPL isn't great

dnolen17:11:10

and nothing like it will be

dnolen17:11:24

ship the smallest composable thing, people can layer over whatever they need

dnolen17:11:36

sounds kinds of like … the Internet

thheller17:11:15

well .. most things have protocols

thheller17:11:40

but I get your point .. socket REPL is just a socket. the rest is up to the tool

boz18:11:45

@dnolen: I’m trying out om.next, using the quick start. Seems like I have to require om.core to use js/ReactDOM.render but the quick start examples don’t. Is it just me? (I’m almost at the point where I’ll use add-root! so I expect I won’t need om.core for long.) … and thanks for the great stuff! simple_smile

dnolen18:11:09

@boz you probably have something wrong with your deps

dnolen18:11:17

@boz also there is an #C06DT2YSY specific channel

mfikes18:11:06

Cool @shaunlebron is topping HN with Parinfer

noonian18:11:20

wow Parinfer feels like magic

jaen19:11:10

Wow, looks neat, considerably better than having to remember paredit shortcuts. Now someone just needs to get it into Cursive : D

donmullen19:11:03

Given the pace @cfleming works…. that might be sooner than most would think.

lucaska19:11:13

Oh cool, working on it for Atom? Noice.

chrisoakman19:11:38

the Atom extension is mostly working; you can try it out right now

chrisoakman19:11:59

let me know if you run into anything simple_smile

lucaska20:11:21

Nice. I’m a bit of a Clojure n00b, but I’m not grokking paredit, so I’ll give it a spin.

chrisoakman20:11:41

you are precisely the target audience for Parinfer then simple_smile

lucaska20:11:26

Haha awesome

cfleming20:11:31

@dnolen: Cool, it’s on the post-conj shortlist

cfleming20:11:55

Parinfer looks really nice, I’ll have to take a look at how it works.

lvh20:11:09

nice; I’m a total smartparens/paredit nerd but this is obviously so much better ux

lvh20:11:25

And it doesn’t really mess with splice &c

ordnungswidrig20:11:06

What about slurp and barf within a single line? I guess you would still need hotkeys for that, right?

halcyon20:11:40

@ordnungswidrig: from the example on the project’s page it looks like inserting and deleting parens can automagically trigger a slurp/barf

ordnungswidrig20:11:01

Yes but not necessarily where I want it in a long line?

halcyon20:11:49

it determines where to slurp to based on where you choose to insert a closing paren

halcyon20:11:23

and it does a similar operation based on where you choose to delete an opening paren

ordnungswidrig20:11:20

I was thinking about (+ a b) => (+ (or a 1) b)

ordnungswidrig20:11:57

parinfer: (+ |a b) insert [ => (+ (a b))

ordnungswidrig20:11:16

I see when I insert the ) it corrects it

lvh21:11:18

ordnungswidrig: wait, why does that do ( instead of [

darwin22:11:07

I’m generating some cljs sources and got an interesting problem. Some names clash with cljs.core stuff: "WARNING: update already refers to: cljs.core/update being replaced by: …" I would like to use :refer-clojure :exclude, but how to reliably know list of symbols defined in cljs.core? so I can mention only clashing ones. Clojure’s :refer-clojure :only would solve my problem beautifully, but it does not seem to be supported under clojurescript 😞

lucaska22:11:12

Is there a solution for compiling Scss with Lieningen or Figwheel, or somethin?

roberto22:11:02

I’ve never used it

roberto22:11:10

never used scss

lucaska22:11:12

Cool, thanks!

roberto22:11:28

I hope it helps

kevinmershon22:11:08

I had decent luck with that on a project a couple weeks ago

lucaska22:11:12

@kevinmershon: So it would auto build it, and inject the resulting css with figwheel?

kevinmershon22:11:31

I don't think I got figwheel to watch for changes, no. I was running a second terminal with lein recompiling scss to do it if I remember correctly. Not as clean as it should be

lucaska22:11:23

Yeah, I guessed that was the way to use it, but definitely seems clunky. Thanks though.

kevinmershon22:11:56

Ah no, I was using lein-sass 0.3.7 not lein-scss.

lucaska23:11:58

Might still be the same haha

lucaska23:11:28

I’m not super familiar with Leiningen/Figwheel yet, so I dunno what is possible, but not many front end devs write pure CSS anymore…at least not in my experience.

kevinmershon23:11:11

My best guess would be to use figwheel's :notify-command and add your sass/scss path to the watched folders

puppybits23:11:33

is there a way to slurp json files at build time in clojurescript?

johanatan23:11:32

So, are these slack channels and the corresponding irc ones mirrored?

johanatan23:11:20

to answer my question: it appears not. bummer.

tavistock23:11:09

I can’t get externs to work on my project. I want to export some functions that are on the window. how do I do that

johanatan23:11:31

Don't want to leave those old-timers in our dust

johanatan23:11:23

Can any of our admins make installing that bot happen?