This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-05
Channels
- # admin-announcements (10)
- # beginners (18)
- # boot (29)
- # capetown (2)
- # cider (46)
- # cljs-dev (1)
- # cljsrn (69)
- # clojure (126)
- # clojure-android (9)
- # clojure-gamedev (3)
- # clojure-greece (16)
- # clojure-poland (13)
- # clojure-russia (45)
- # clojure-spec (27)
- # clojure-uk (21)
- # clojurescript (99)
- # cursive (1)
- # datascript (1)
- # datomic (42)
- # functionalprogramming (10)
- # hoplon (47)
- # instaparse (12)
- # jobs (5)
- # jobs-rus (9)
- # keechma (22)
- # lein-figwheel (8)
- # leiningen (5)
- # luminus (1)
- # mount (7)
- # off-topic (1)
- # om (15)
- # onyx (47)
- # other-languages (14)
- # planck (28)
- # proton (8)
- # re-frame (30)
- # reagent (15)
- # remote-jobs (3)
- # slack-help (2)
- # untangled (9)
- # yada (6)
I'm getting the following error when trying to build latest:
file.c:4:10: fatal error: 'unicode/ustdio.h' file not found
#include "unicode/ustdio.h"
^
1 error generated.
make[1]: *** [file.o] Error 1
@johanatan: Sorry about that. I was careful about all of the Unixes but forgot about OS X.
Do you know what the cause of this stack trace is?
goog.global.setTimeout is not a function. (In 'goog.global.setTimeout(cb, 0)', 'goog.global.setTimeout' is undefined)
cljs.core.async.impl.dispatch/queue-dispatcher (cljs/core/async/impl/dispatch.cljs:29:6)
cljs.core.async.impl.dispatch/run (cljs/core/async/impl/dispatch.cljs:33:4)
The problem is that setTimeout
is not part of JavaScriptCore. We inject it in under 1.x, but with the C-based 2.0 we need some sort of timer implementation to back it up.
Ahh, perhaps this would do it: http://man7.org/linux/man-pages/man2/timer_create.2.html
Looks like setitimer
is definitely supported on OS X so that may be the better option.
Yes. It is there, I believe. It is fairly limited, so difficult to program against. But it would suffice.
We could almost use timer_create
on Linux and perhaps something else on OS X, with #ifdef
s if easier.
Ya, that could work. Are you planning to do this soon? If not, I can do it if you show me where the code needs to be hooked in. <-- @mfikes
@johanatan: No, I probably won’t get to it right away. There is a TODO on the Wiki that you could put your name next to if you’d like to pursue it. Also, there is stuff in 1.x which could be used as inspiration on how the general mechanism works. (It is just another global function like the PLANCK_*
functions, just with the name setTimeout
.) It turns out we already need timers in the bit of code that “hops” the cursor back after typing a closing delimiter like ]
or )
, and in that code you can see that we simply burn a thread that sleeps in order to crudely implement a timer. Planck 2.0’s initial setTimeout
implementation could actually be implemented using the same strategy, just go get something in the codebase that works (thus allowing core.async
to work, etc., and we can figure out a better implementation using timer_create
, setitimer
, or even kqueue
.
This https://github.com/mfikes/planck/blob/master/planck/PLKClojureScriptEngine.m#L168 and perhaps this https://github.com/mfikes/planck/blob/edbf005f1da9d9b38573a04a8218ab3c90112ef6/planck-c/cljs.c#L302
In other words @johanatan I think that var global = this;
might have a consequence that var setTimeout = …
being automatically hooked into goog.global
. (But, I’m not a JavaScript expert.) I know I got that from Nolen: https://github.com/omcljs/ambly/commit/da21de24f63e11d6faf93e47d1e6a2e0b75091d6
And that setTimeout
came from this SO: http://stackoverflow.com/questions/21100190/using-setinterval-settimeout-in-javascriptcore-framework-for-objectivec/21170761#21170761 (it has been in use in Planck for quite a while now.)