planck

Planck ClojureScript REPL
2017-03-22T00:30:17.821852Z

I was able to reproduce the failure in VirtualBox. It is really puzzling. @richiardiandrea ported some of clj code under self-host, but he forgot to port this one function: https://github.com/binaryage/env-config/blob/b8f6484073c37719cfb73be1b109ff1f9232f45f/src/lib/env_config/impl/helpers.cljc#L25 for some reason planck does not complain, neither lumo does

2017-03-22T00:31:27.832103Z

I don’t understand why it works in lumo and in planck on other systems than Ubuntu 14.04 (trusty)

mfikes 2017-03-22T01:54:46.511109Z

@darwin env-configs unit test work for me with Planck in Ubuntu 14.04

vagrant@vagrant-ubuntu-trusty-64:~/env-config$ uname -a
Linux vagrant-ubuntu-trusty-64 3.13.0-112-generic #159-Ubuntu SMP Fri Mar 3 15:26:07 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
vagrant@vagrant-ubuntu-trusty-64:~/env-config$ lein with-profile +self-host tach planck self-host-test-build
Testing env-config.tests.main

Ran 4 tests containing 16 assertions.
0 failures, 0 errors.

Error encountered performing task 'tach' with profile(s): 'base,system,user,provided,dev,self-host'
Suppressed exit

2017-03-22T01:55:32.517089Z

@mfikes thanks for trying, let me point you to some older tip of the branch, I have fixed it since my original posts

2017-03-22T01:56:51.527616Z

this might be also related to java/clojure/webkit versions, maybe?

mfikes 2017-03-22T01:57:03.529207Z

@darwin Oh. And the core of the failure is that Planck (and Lumo) fails to emit a diagnostic for the missing string-starts-with?

mfikes 2017-03-22T01:57:23.531906Z

I'll clone that version and take a peek

2017-03-22T01:58:26.540207Z

there are probably two issues: first that inconsistency between plancks on different systems should be tracked down, and second why both planck and lumo were silent on some systems

2017-03-22T01:59:18.547107Z

the fact that tests passed might be just a coincidence, the function probably always returned true in that invalid case and my tests never test false case

mfikes 2017-03-22T02:01:38.566770Z

Interestingly, I get it to fail for that older tip in the same way on OS X (10.10 Yosemite)

2017-03-22T02:04:40.589944Z

interesting, btw. I also tested it under Ubuntu 16.04 and it passed all tests there (silently)(

mfikes 2017-03-22T02:12:05.644700Z

@darwin I know why Planck behaves differently on different platforms. JavaScriptCore evolved and at some point added .startsWith. I encountered the same inconsistency with Andare https://github.com/mfikes/andare/issues/1

mfikes 2017-03-22T02:13:14.653070Z

So if you try (.startsWith "abc" "a") in Planck it might fail or work, depending on how old JavaScriptCore is.

2017-03-22T02:13:30.655090Z

I see, makes sense

2017-03-22T02:16:41.679394Z

unrelated question, do you have any trick how to write portable try-catch code?

2017-03-22T02:17:00.681864Z

my problem is (try ... (catch #?(:clj Throwable :cljs js/Error) e …)

mfikes 2017-03-22T02:17:19.684252Z

No, Bloom suggested :default for Clojure. There is a JIRA on the books for it.

mfikes 2017-03-22T02:17:41.686984Z

http://dev.clojure.org/jira/browse/CLJ-1293

2017-03-22T02:17:42.687217Z

yep, that would help

2017-03-22T02:17:58.689118Z

I wanted to help myself with a small macro, but that didn’t fly

2017-03-22T02:18:24.692599Z

catch is part of try-catch special form and I cannot write a macro just for catch part

mfikes 2017-03-22T02:18:42.694962Z

Ahh, right

2017-03-22T02:18:58.696972Z

something like (catch-all e …) would expand to (catch #?(:clj Throwable :cljs js/Error) e …)

2017-03-22T02:19:25.700313Z

I would have to write smart macro expanding whole try-catch form

mfikes 2017-03-22T02:19:45.702827Z

Yeah, that's a tricky one

2017-03-22T02:20:06.705465Z

and that is a lot of work I’m not going to do right now, aren’t you aware of some library trying to ease writing portable code?

2017-03-22T02:20:50.711185Z

I don’t like how reader conditionals sprinkled in the middle of my code look 😉

mfikes 2017-03-22T02:21:02.712585Z

I suppose if you are the one throwing, you always use ex-info to at least have some consistency there.

mfikes 2017-03-22T02:21:13.713974Z

I wonder if you can reliably catch that one in the same way portably