planck

Planck ClojureScript REPL
johanatan 2016-06-21T02:37:58.000081Z

@mfikes: ^

mfikes 2016-06-21T02:40:27.000082Z

@johanatan: Line 28 is commented out in master https://github.com/mfikes/planck/blob/master/planck-cljs/src/planck/repl.cljs#L28

johanatan 2016-06-21T02:40:46.000085Z

do i need to pull?

mfikes 2016-06-21T02:40:53.000086Z

I think so, yes

johanatan 2016-06-21T02:41:00.000087Z

ok

mfikes 2016-06-21T02:41:34.000088Z

@johanatan: The root cause of this is that I had Planck in dev set to use HEAD of the ClojureScript compiler, which changed.

johanatan 2016-06-21T02:41:47.000089Z

ahh, interesting

mfikes 2016-06-21T02:41:56.000090Z

It is now set to use a fixed version of the compiler

johanatan 2016-06-21T02:41:59.000091Z

cool

johanatan 2016-06-21T02:54:12.000092Z

so, are the cljs parts of planck-c zipped up and placed in bundle.c ?

mfikes 2016-06-21T02:54:57.000094Z

Yes, essentially planck-cljs produces a bunch of JavaScript which ends up being bundled in bundle.c

johanatan 2016-06-21T02:55:12.000095Z

ahh, nice. so the cljs parts are constant between 1.0 and 2.0 ?

mfikes 2016-06-21T02:55:35.000096Z

Yes. It hasn’t changed a bit 🙂 Only the native half.

johanatan 2016-06-21T02:55:51.000097Z

ok 🙂

mfikes 2016-06-21T12:24:39.000098Z

@tord: The crash you mentioned should now be fixed on master. https://github.com/mfikes/planck/issues/326

tord 2016-06-21T13:36:25.000101Z

Cool, thanks, @mfikes!

johanatan 2016-06-21T23:29:47.000102Z

@mfikes: unfortunately shell exec in plain C is more compliated than it needs to be due to popen not allowing stderr to be read as a pipe

johanatan 2016-06-21T23:30:12.000103Z

probably going to have to end up with a solution like the last code sample from this page (which only returns stderr instead of both stderr and stdout): http://stackoverflow.com/questions/280571/how-to-control-popen-stdin-stdout-stderr-redirection

johanatan 2016-06-21T23:30:28.000105Z

i.e., the one posted by kangear

mfikes 2016-06-21T23:30:46.000106Z

wow

johanatan 2016-06-21T23:30:50.000107Z

lol

johanatan 2016-06-21T23:31:23.000108Z

it would've been like a few liner if I could've used system() or if popen() supported stderr

johanatan 2016-06-21T23:31:43.000109Z

as it stands now, it looks like it will be roughly the same number of lines as the obj-c one (give or take)

johanatan 2016-06-21T23:58:39.000110Z

@mfikes: just discovered a perhaps simpler way. use popen() in 'r' mode to get stdout. also use freopen() to redirect the parent process' stderr (which is where the child's stderr output is sent) to a tmp file. then read stderr from the tmpfile and freopen() back to original stderr stream.

johanatan 2016-06-21T23:58:47.000111Z

does that sound acceptable to you?

johanatan 2016-06-21T23:59:45.000115Z

[this would be far less code but a bit more complex in that a tmp file is involved]