Fork me on GitHub
#clojurescript
<
2019-07-21
>
samedhi02:07:41

I have a lot of code running (async/go ...) blocks that I am trying to illustrate with klipse. Unfortunately, I have a lot of these problems.

samedhi02:07:27

I would like the output to be: AWESOME SAUCE :done

carkh02:07:05

hum put the done in the go block ?

carkh03:07:34

well your first screenshot is in order

carkh03:07:52

this second one also, that's the channel returned by the go block

samedhi03:07:53

Yeah, first one was a bad example, I guess I am really asking is there a way to "capture" all the stdout within a code block and then print it at the bottom of the frame.

carkh03:07:50

i don't know if you can bind out in clojurescript, worth a try

samedhi03:07:11

I get why this is happening, and I understand that this is entirely expected behavior. But for the purpose of illustrating what goes on in the go block I would like everything to be in order and to always output in the current klipse frame.

samedhi03:07:37

If I have successive frames, I think the context has moved from this frame to the next and the output goes to those (if that makes sense).

samedhi03:07:05

Sorry, I didn't phrase that very well, I am looking to avoid this oddity (again, it makes total sense, just makes it kind of hard to illustrate a point when the standard out is in a different frame than the (go ...) code).

carkh03:07:47

oh i see, that's certainly an interesting problem =)

samedhi03:07:28

Yeah, sorry, that is a much better illustrating case.

carkh03:07:53

you could wait in the next frame for the end output of the go block in the preceding frame

samedhi03:07:24

But I can only await in a go block...

carkh03:07:57

or use the callback api

samedhi03:07:58

So I think the next frame would just be passing the buck forward in terms of the problem

carkh03:07:41

this might not help clarifying your code but, you can reset a global atom to the go channel, then use something like https://clojure.github.io/core.async/#clojure.core.async/take! in next frame ?

samedhi03:07:44

I was able to create a atom in frame 1, conj values into the atom in the go machine, and then print the atom in frame 2 with the "repeat=1000" thing set for klipse.

samedhi03:07:44

But this involves needing 2 frames for every code segment, with the second frame just being a @deref-the-atom-from-the-previous-frame snippet.

samedhi03:07:10

Which isn't great I feel (though best I have so far).

carkh03:07:10

that's some odd requirement, in order to demonstrate core.async, you have to work against it

carkh03:07:50

you could cheat and write your own go and friends

samedhi03:07:06

Haha, yeah, I feel like that is beyond me. 🙂

carkh03:07:42

i don't think that binding out would work

carkh03:07:07

do the waiting in the single frame

carkh03:07:50

(take! (go ... ) (fn [] (println :done)))

carkh03:07:49

this illustrate one of the problems with async, it's infectious

carkh03:07:11

might still pop in the next frames though

carkh03:07:43

most probably the klypse people have thought about this, there is the async form for testing, there must be something in klypse, at the very least they might be interested about hearing about this problem

samedhi03:07:23

Cool idea, yeah, still has that issue. I don't think there is any getting around the fact that I can spin up go blocks, but I can't control when they get run in the indeterminate future.

carkh03:07:33

they're using core.async under the hood it seems

samedhi03:07:54

Anyway, I appreciate your help @carkh, it is late for me and I should wind down for the night. Thanks for looking at this with me. 🙂

carkh03:07:06

post an issue !

John Collins04:07:08

Hello, I'm new to clojurescript, attempting to bring in an npm dep. Does anyone know if there's any way to compile a dep that I guess requires ECMASCRIPT2018 features? I'm getting this error on compilation: ERROR: JSC_LANGUAGE_FEATURE. This language feature is only supported for ECMASCRIPT2018 mode or better: object literals with spread

John Collins06:07:33

^ webpack alternative seems to magically work, even with :advanced optimizations. Disregard.

daslu08:07:54

On June 30th, @justalanm, @ezmiller77 and @vijaykiran interviewed @jsa-aerial about interactive data visualization with Hanami&Saite. Here is the video. https://youtu.be/ld5du3L-emM To me, it was really inspiring to listen to. We will have more of this kind. The idea is to allow people to share their workflows, working with data. It is not about the perfect toolset and practices, but about the search for those. * If you have any experiments and insights about the way you deal with code, editing, data, dataflow, data-visualization – then let us interview you about it. * If you wish to help as an interviewer, that would be great, too. The scicloj-tutorials stream at the Clojurians Zulip is a good place to talk about that. https://clojurians.zulipchat.com/#narrow/stream/187445-scicloj-tutorials

scknkkrer11:07:24

I want to learn about Clojurescript Compiler; How it works, how did it implemented ? Everything. I’m reading the https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/compiler.cljc Is this a good start-point ?

thheller12:07:15

@scknkkrer cljs.analyzer and cljs.compiler mostly yes

scknkkrer12:07:09

Thanks. Are there any Pre-required topic before dig deep down under the Clojurescript ? I have spent some time with Clj and Cljs. My goal is to embrace the whole technology and being the best contributer. 😂

thheller12:07:24

well yeah there is lots to learn but when it comes to compilers the CLJS one is actually relatively simple

scknkkrer12:07:36

Ok then. Is there a guide, or can you give me a start point that more effective then reading the solid compiler repo.

scknkkrer12:07:45

And by the way, I am thinking about creating a group to work on it. I hope I am not the only one to know more about this powerfull tool.

scknkkrer12:07:53

I’have looked at this fastly. I’ll look one more time.

dpsutton12:07:25

Check https://clojurescriptpodcast.com/ episode 5 with mike fikes. He patiently and thoroughly walks you through the compiler

💯 4
scknkkrer14:07:21

@U11BV7MTK, thank you. If there is something else that can help me, do not hesitate to share. I think I need to read A LOT. 😏

dpsutton14:07:04

listen to that podcast. @U04VDQDDY and the host do a fantastic job of walking through the different phases. After that figure out how to run the compiler and see a bit of output and then as @U05224H0W mentioned earlier, its quite a simple compiler. For sure look at the associated jira but you've got hours of intro stuff already that will give you enough to forge your own path in from there

scknkkrer14:07:54

@U11BV7MTK, I’m listening it now.

mfikes14:07:55

@scknkkrer There is a #cljs-dev channel where we discuss the implementation of the compiler

scknkkrer14:07:33

@U04VDQDDY, I want to be part of this community with a deep understanding of the language and it’s nature; and help the language grows. Thank you for your invitation.

mfikes14:07:24

@scknkkrer Cool! If you are interested in contributing to the compiler, one suggestion is to try to create patches for JIRA tickets. This essentially forces you to read compiler code, filling in areas that aren't clear to you.

scknkkrer14:07:52

@U04VDQDDY, this is an amazing suggestion! Thank you.

scknkkrer14:07:57

I was planning read SICP one more time. I think it was a bad idea. I have some background. I think I can do good things for this language.

mfikes14:07:03

@scknkkrer Cool. When you said "best contributor" it wasn't clear to me if you just meant contributing to the community or to the compiler itself.

scknkkrer14:07:23

@U04VDQDDY, The compiler itself.

Justin Duncan00:07:43

I'm interesting in learning the compiler also! If you do startup a group I'll join ya for sure 🙂

roman01la08:07:16

@scknkkrer @UJKA3UQAV I think good start might be to look for trivial tickets, @U04VDQDDY sometimes fills out tickets that includes possible solution in the description, so your job would be to just verify if that assumption holds and submit a patch 🙂

scknkkrer08:07:02

@U0FR82FU1 cool! Let me take a few warm-up tour with the source code. I’ll be ready in one-or-two days.

scknkkrer08:07:30

@UJKA3UQAV, wow! I’m reading the source right now. Because of my learning-curve. Send me a message when you available.

scknkkrer08:07:32

@U04VDQDDY, is it a good initiative to create a topic called before-cljs-dev or something to group-up and share everything we have got. I think, learning as a group is impactful.

mfikes11:07:37

Up to you 🙂