sci

https://github.com/babashka/SCI - also see #babashka and #nbb
kwrooijen 2020-08-22T16:03:44.001300Z

Interesting find on Edamame: I copied Clojure's core.clj (about 8k LOC) and commented most of it out. When I tried (e/parse-string-all (slurp "core.clj") {:all true :auto-resolve '{:current clojure.core}}) I got the following error: Execution error (StackOverflowError) at clojure.tools.reader.reader_types.StringReader/read_char (reader_types.clj:51).

kwrooijen 2020-08-22T16:04:32.001900Z

It's not a problem for me, I'll just remove what I commented out. But should I open an issue for this anyway?

borkdude 2020-08-22T17:50:57.002500Z

@kevin.van.rooijen That's weird, since parsing clojure.core is part of the unit tests

kwrooijen 2020-08-22T17:51:27.003400Z

It only happens when I comment (most) of the code

borkdude 2020-08-22T17:51:57.003800Z

comment = ;; ?

kwrooijen 2020-08-22T17:52:01.004Z

Yes

borkdude 2020-08-22T17:52:14.004300Z

So less code and then a stackoverflow happens?

borkdude 2020-08-22T17:52:17.004500Z

That's even more weird

borkdude 2020-08-22T17:53:15.005200Z

If you can make the smallest repro possible we could take a look

kwrooijen 2020-08-22T17:53:32.005400Z

I'll take a look

kwrooijen 2020-08-22T17:56:14.005700Z

It happens at about 3k lines of comments

kwrooijen 2020-08-22T17:56:24.006Z

Not sure if it's memory bound or something

borkdude 2020-08-22T17:57:17.006600Z

aha, so maybe there's something with the comment parsing

kwrooijen 2020-08-22T17:57:26.006800Z

I think so yes

kwrooijen 2020-08-22T17:57:36.007100Z

Probably if there's x amount of comments in a row

kwrooijen 2020-08-22T17:57:54.007400Z

If I uncomment everything, it works as expected

kwrooijen 2020-08-22T17:59:15.007900Z

It's a real edge case though. Having 3k lines of comments doesn't happen very often

borkdude 2020-08-22T17:59:29.008500Z

ok cool. that's sufficient as a repro then, just post an issue and I'll take a look. what happens if you put one form in between?

kwrooijen 2020-08-22T17:59:32.008700Z

Also I just checked, it has to be 3k in a row

kwrooijen 2020-08-22T17:59:42.009100Z

If I put any expression in between it works as expected

borkdude 2020-08-22T17:59:48.009300Z

That's probably hitting at stack depth limit of 3k then

borkdude 2020-08-22T18:00:47.010300Z

You can try upping the stack limit to see if that helps: clojure -J-Xss4m

kwrooijen 2020-08-22T18:00:50.010400Z

I'll create an issue on GH. No rush from me whatsoever though

kwrooijen 2020-08-22T18:01:55.010900Z

Yeah, now it does work

borkdude 2020-08-22T18:04:16.011300Z

Can you try with be8fc889656668ffba61547ff58009ee090cb51b and the original stack depth?

kwrooijen 2020-08-22T18:06:49.011500Z

Let me try

kwrooijen 2020-08-22T18:07:25.011700Z

That seems to fix it

borkdude 2020-08-22T18:07:50.012100Z

PR welcome for a test: https://github.com/borkdude/edamame/issues/57

kwrooijen 2020-08-22T18:16:52.012500Z

@borkdude https://github.com/borkdude/edamame/pull/58

borkdude 2020-08-22T18:17:34.012800Z

Thanks! :)

kwrooijen 2020-08-22T18:22:20.013400Z

I wrote it as fast as I could, in the fear of you writing the test before me