Fork me on GitHub
#clojurescript
<
2015-07-17
>
dnolen00:07:35

@mfikes a lot is perceptual since all of Clojure has to load before you get the prompt

dnolen00:07:59

So Planck has better UX in this regard

mfikes00:07:54

Yes. iOS apps appear to launch quickly by employing static launch images that look like the initial UI in order to deceive and give an impression of faster launch. Planck is employing that trick.

mfikes00:07:42

Of course, this won't help when you actually have to evaluate (for a script).

dnolen00:07:08

@mfikes: still 20-30% faster as well is nothing to sneeze at :)

mfikes00:07:48

@dnolen: yeah. I was also trying to think of ways to optimize further. If that could be achieved, then it becomes even more relevant to scripting.

dnolen01:07:13

@mfikes I'm really not sure what more you could. Pretty sure that's just parsing time.

mfikes01:07:52

I’m able to unleash Intruments on it. I see that it is doing JIT optimizations. simple_smile

mfikes01:07:11

I can see big swaths of CPU being used to build the JS AST

dnolen01:07:13

It better be!

coyotespike02:07:25

So, a couple hours ago I released my first ClojureScript/Clojure app to Heroku! However, Bootstrap's Carousel runs locally after I run lein uberjar, but not on Heroku. I'm curious about why they're behaving differently, as I figured Heroku used uberjar. Does anyone know why the difference?

nberger02:07:53

@coyotespike: just to be sure, after lein uberjar, are you running the jar locally in the exact same way as you have in your Procfile?

coyotespike02:07:41

huh... my Procfile has web: java $JVM_OPTS -cp target/myapp.jar clojure.main -m myapp.server, but I run my local jar with java -jar target/myapp.jar

coyotespike02:07:56

Should I do that differently?

nberger02:07:10

no, that's fine

coyotespike02:07:27

@nberger - I've reproduced a second error locally - a navbar dropdown menu has stopped working. So that's something.

nberger02:07:16

@coyotespike: bootstrap navbar is just css, isn't it? the html is being generated correctly?

coyotespike02:07:45

Yes, the html looks all right. The pictures just don't scroll.

pre03:07:13

@dnolen: I was able to get cljc working with cljs.build.api repls

dnolen03:07:14

@pri: so something weird with your full setup?

pre03:07:54

I had to start clj repl, then cljs repl, clear cache in order etc.,

pre03:07:38

If anyone’s interested in using cljs repls without any deps, I just released 0.2.1 of a tiny library that might be easier simple_smile

pre03:07:14

@dnolen: it’s basically putting all your scripts into functions so they can be fired as tasks simple_smile

pre03:07:23

from the repl

pre03:07:35

cljc also works nice with cider 0.9.1

pre03:07:54

@dnolen: I’d be happy to send pull requests to your lein templates

dnolen03:07:23

@pri: I’m not really taking any more PRs for my templates

dnolen03:07:36

mies is what it is and I’m not going to make any more enhancements

dnolen03:07:45

people should make their own template and promote them

dnolen03:07:22

Max OSS maintenance long ago achieved for me, too busy even for reviewing PRs these days sadly.

pre03:07:23

No worries, Cljs is going to new places now, thanks to you and the contribs

mfikes03:07:18

@pri: I tried it and it worked for me. (At least for Node.) I’ve never seen build output right in the REPL… that’s new for me. Sometimes my terminal would be a little funny (erasing on its own to the left)—perhaps that a consequence of build output interleaving.

mfikes03:07:05

Otherwise, changing the hello.core ns to define new symbols, (require .. :reload) worked, etc.

mfikes03:07:57

Having all of those top level commands can make things easier.

pre03:07:07

cider 0.9.1 seems to be loaded ns automatically

mfikes03:07:54

Ahh… I don’t even have emacs… well maybe it is batteries included simple_smile

pre03:07:54

could be their cider-repl/nrepl-0.2.10

pre03:07:19

Are you in Cursive?

mfikes03:07:35

Nah, I was using stock Terminal on OS X

mfikes03:07:26

I’ll throw up a ScreenFlow if you’d like to see what I’m describing.

mfikes03:07:26

I’ll put it on youtube and send link

pre03:07:30

that’d be great.

pre03:07:22

Thanks for the great work on ios/repl integration!

mfikes03:07:24

@pri: It is when I manually type a (require at this point in the video https://www.youtube.com/watch?v=mp3cfgI0Yvc#t=00m044s

wildermuthn03:07:22

planck is very nice

mfikes03:07:38

By the way, there is now Reply, Replete, Replicator, Replify.

mfikes03:07:00

@wildermuthn: Thanks… it may lead to something useful.

mfikes03:07:23

I suppose one advantage of wrapping JavaScriptCore yourself is: If you need it to do anything, then it is up to you. I suspect the same may be true for Node.js, but I don’t know.

mfikes03:07:50

For example, I was able to add some simple filesystem I/O.

wildermuthn03:07:35

You have a gist or github?

mfikes03:07:09

What do you mean? Are you curious about the filesystem I/O?

wildermuthn03:07:17

Yeah, that’s what I meant

wildermuthn03:07:34

I don’t know much about JavaScriptCore

mfikes03:07:00

That injects a global JavaScript function into JavaScriptCore named PLANCK_SLURP_FN that accepts a single string argument and returns a string.

wildermuthn03:07:03

ah, the slurp and spit?

wildermuthn03:07:17

I see, very interesting!

mfikes03:07:36

There are probably many ways to skin that cat.

wildermuthn03:07:47

Clojure is ready to conquer every platform. I love it.

mfikes04:07:09

But the JavaScriptCore bit you were interested in is the context variable on the fist line I linked to.

wildermuthn04:07:53

That’s blowing my mind a bit, cljs -> js -> objectiveC

mfikes04:07:59

This REPO has an interesting mixture of Java and JavaScript all essentially in the same process as well: https://github.com/swannodette/jsx-fun

mfikes04:07:34

Yeah, it is kind-of “doubly” hosted, if you will.

mfikes04:07:13

ClojureScript is hosted on JavaScript, but then JavaScript could be thought of as hosted in a sense in another container environment that may be in another language.

mfikes04:07:39

Replete has ObjC and Swift simple_smile

mfikes04:07:50

(And JS of course)

mfikes04:07:59

Thanks! (It was one of those things that, once I realized it could be done, it had to be done.) That seems to be happening frequently lately.

escherize07:07:36

@mfikes: God damn, amazing man! Is there a donate button anywhere?

andrewmcveigh07:07:52

@shaunlebron: Still a WIP, don’t think I’ve got the right abstraction with http://cljs.node.io

ul08:07:18

I get ERROR: JSC_DUPLICATE_PARAM. Parse error. Duplicate parameter name "default_option" in :advanced compilation mode because I have both default_option and default-option names in my function. Is it documented anywhere that names diffing only in underscore/hyphen should be avoided? Will such use lead to unexpected/erroneous behavior in compiled code?

mcgivernsa08:07:50

these are arguments to the function? when I try that, compilation fails

mcgivernsa08:07:29

same with (defn foo [param! param-BANG-] ...)

ul10:07:57

one is argument, second introduced in let form inside fn body

ul10:07:22

it emits Closure error, but finish up compilation

colin.yates10:07:38

in advanced compilation mode am I supposed to provide goog/base manually? I thought it would be included in main.js?

colin.yates10:07:16

I have a cljsbuild for dev with optimisations: none. If I change that to :advanced it can’t find goog/base.

colin.yates10:07:37

First time I have tried to use anything other than :none so I fully expect this is me being a numpty...

andrewmcveigh10:07:00

@colin.yates: It should be included

andrewmcveigh10:07:34

Can you show your compiler config?

colin.yates10:07:55

sure:{:dev {:source-paths ["src/cljs" "src/cljc"] :compiler { :output-to "resources/public/out/main.js" :output-dir "resources/public/out" ;; figwheel needs this to be none :optimizations :none :source-map true}} :prod {:source-paths ["src/cljs" "src/cljc"] :compiler {:output-to "resources/public/out/main.js" :optimizations :advanced}}}

colin.yates10:07:25

javascript errors:

colin.yates10:07:35

Uncaught TypeError: (void 0) is not a function(anonymous function) @ main.js:26618(anonymous function) @ main.js:34585(index):2 Uncaught TypeError: goog.require is not a function

mcgivernsa10:07:54

@ul if I've understood you correctly, when I try that it works just like regular shadowing, so if you need two different names with two different values, you won't get the expected result

andrewmcveigh10:07:39

@colin.yates: Are you using cljsbuild?

colin.yates10:07:58

latest versions of all libs as well

colin.yates10:07:15

this is a re-frame app if that helps

andrewmcveigh10:07:06

Can you check the js file? TBH, it looks to have too many lines to be an advanced compiled js file

andrewmcveigh10:07:41

If you can read function names, it’s not minimized.

colin.yates10:07:05

876K of my cljs

colin.yates10:07:32

everything looks like obfuscated source code used to so I assume that is minimised

andrewmcveigh10:07:47

Ah, ok that seems right.

andrewmcveigh10:07:58

So, I’m kind of guessing here… but maybe goog.require has been minimised?

colin.yates10:07:38

ah hang on - I am still including the figwheel connection code in the JS - let me remove that first...

andrewmcveigh10:07:48

Yeah, that could be it.

andrewmcveigh10:07:12

If you’re trying to call goog.require from static js, maybe it got minimized

colin.yates10:07:12

simple is 4.8M BTW

colin.yates10:07:11

I am using google closure (for dom events for example) in cljs. I assumed the closure lib would be externed already so I am not doing anything special there

andrewmcveigh10:07:05

Yeah, it should be. But, often you’ll have goog.require lines in your page, for repl stuff

colin.yates10:07:42

Searching for goog.require in my cljs has 0 hits

colin.yates10:07:30

removing figwheel hasn’t helped. Assuming it is the same error in simple and advanced I will try simple and see if that provides more context

andrewmcveigh10:07:15

Yep, if you try simple mode, the error will go away if it’s a minimising issue.

dnolen10:07:51

@ul seems like a minor edge case - file a bug. Don’t really have any good ideas about solving that one at the moment. Thanks.

dnolen10:07:24

@colin.yates: this is why you never wait to do advanced builds simple_smile

dnolen10:07:34

do ‘em early do them relatively often.

dnolen10:07:04

Your issue is absolutely typical. To fix it enable :pseudo-names true :pretty-print true compiler options. You should be able to see what got renamed that you didn’t expect.

colin.yates10:07:03

good advice @dnolen. I have incorrectly assumed advanced was only about filesize and given this app is on a low latency internal LAN I wasn’t really that concerned. Now I understand it has performance benefits I thought I would take a look. But yes, fail early indeed.

colin.yates10:07:06

It is failing at the figwheel code, but I don’t understand why. I have #_ the figwheel fragment in my cljs although the (:require [figwheel..]) is still there. I am surprised any figwheel code made it into my main.js?

colin.yates10:07:50

I assumed dead-code elimination would remove it - #_ is equivalent to deleting the code in cljs isn’t it?

dnolen10:07:18

@colin.yates: that's not how dead-code eliminations works

dnolen10:07:34

compiler needs to be able to prove code is dead or it’s useless

dnolen10:07:44

as in unusable

colin.yates10:07:57

ah ok, I see.

colin.yates10:07:22

is it sufficient to #_

colin.yates10:07:53

so flip me - wow. Now it works it is significantly faster!

dnolen10:07:55

@colin.yates: I would probably split out figwheel into a different build profile so you don’t have to comment out code to make a production build simple_smile

colin.yates10:07:55

yes, indeed simple_smile Once again I am pleasantly surprised at how easy these sort of things are to do in Clojure and horrified at how many unfounded assumptions I make simple_smile

colin.yates11:07:09

any nifty tricks for removing (.log js/console …) from production builds? I could use a wrapper fn or maybe macro - any tricks?

andrewmcveigh11:07:21

@colin.yates: we use a macro to check an env var, and omit based on that

ul11:07:14

ha-ha, slack does not updated preview after message edit

ul11:07:27

not tower, but timbre

andrewmcveigh11:07:34

(defmacro dev-only [& body]
  `(when-not (= (System/getenv "APP_ENV”) “production”)
      (do ~@body)))

andrewmcveigh11:07:46

^^ something like that

borkdude11:07:50

@colin.yates: in production I do this: (set! cljs.core/print-fn identity), but that's just for disabling println

borkdude11:07:32

@colin.yates: check out the configuration of this project for different dev and prod config: https://github.com/borkdude/lein2boot

colin.yates11:07:46

thanks all - great ideas.

rauh11:07:23

@colin.yates: If you want more control over what logging goes intro production. Check out the macros file from my project: https://github.com/rauhs/klang#with-deployment-to-clients In fact, I stole the whitelist/blacklist stuff from timbre.

mfikes13:07:45

If curious: There have been 81 downloads of the Planck binary, getting bootstrapped ClojureScript some direct exposure to people. Unknown how may have tried Joel's Node and web variants. A total of 123 beta testers of Replete currently. Excited to see where this leads when Replete, and later, Replicator are available in their respective stores. simple_smile

dnolen13:07:15

@mfikes: I think there’s huge potential for Planck in the long view particularly its embeddability over Node.js.

mfikes13:07:46

Yes, Planck (I can’t spell it either simple_smile hah!) could evolve into something actually pragmatic and useful

mfikes13:07:45

For educational purposes (schools with Macs or PCs), it would be interesting to have something free in the MAS (or equivalent Windows store)

mfikes13:07:33

(I really think Clojure is an understandable language for students, over the complexity of Java or even Python.)

dnolen13:07:13

@mfikes: something to think about re: embeddability

dnolen13:07:25

bootstrapped :simple gzipped is 300K

dnolen13:07:37

that would be 200K of binary + 300K of gzipped JS source

dnolen13:07:45

I just benchmarked unzip, 63ms

dnolen13:07:30

at least under OS X platform where you can link to JSC.Framework, that’s a pretty sweet small thing.

mfikes13:07:48

Nice. I was even thinking that the reader/analyer/parser could even be :advanced in a separate JSC instance just to be used as a local compiler service. But achieving that would be a bag of hurt right now. And questionable for future maintenance.

dnolen13:07:26

@mfikes: advanced would actually be pretty problematic, it makes looking up core stuff way harder

Chris Bidler13:07:29

mfikes: I certainly agree re: Clojure (or a LISP generally) being a suitable language for students

mfikes13:07:37

:simple kicked my butt… maybe I’ll revisit it

borkdude13:07:38

I agree too.

dnolen13:07:38

I would consider :simple the bound for bootstrapped thing

borkdude13:07:45

I have taught clojure to students

mfikes13:07:18

For students (with Macs) a MAS free app that comes with a canvas would be interesting.

dnolen13:07:27

@mfikes: if you had a self contained JSC + ClojureScript bootstrapped you could probably expose some kind of simple API for C/C++/Objective-C a la RT.java for Clojure?

borkdude13:07:28

it's maybe not the best, because it's hosted and it's always handy to know something about the hosting enviroment

Chris Bidler13:07:28

I recall in college really getting the initial courses in Scheme, and then when we wanted to e.g. start working with files or (gasp) network sockets the answer was “well that’s kind of …a pain, how about you do that project in your data structures class (taught in Java) instead"

Chris Bidler13:07:04

the idea of having a LISP-for-teaching that is also able to get out to the impure world of “actually doing things with the computer” is brilliant IMO simple_smile

mfikes13:07:40

@dnolen: Hmm… trying to let that one sink in simple_smile

borkdude13:07:42

I wonder how kids nowadays pick up programming. Do they open the browser console and try things, like I just tried GW Basic once I discovered it on my brothers PC?

borkdude13:07:34

too off topic for this channel, maybe something for #C03RZGPG3 simple_smile

colin.yates13:07:32

my 9 year old has been using https://scratch.mit.edu for the past couple of years and picked it up really quickly.

mfikes13:07:50

@borkdude: All I can remember at that age was BASIC was in the ROM!

mfikes13:07:05

Easy and simple

colin.yates13:07:15

I started with the ZX Spectrum - the best machine ever. I still miss the ‘music’ of loading from tape!

Chris Bidler13:07:24

+1 for scratch, my daughter was able to pick it up pretty fast

dnolen13:07:27

another interesting ticket for the would-be ClojureScript compiler hacker http://dev.clojure.org/jira/browse/CLJS-1343

mfikes13:07:39

There was a recent Cognicast where Craig Andera was discussing that it turns out learning FP first can be natural

mfikes13:07:18

@dnolen: Sorry I marked that ticket as newbie without reading what it was. Maybe that one isn't

mfikes13:07:24

And people interested in the ClojureScript compiler, here are tickets with patches that could be tried out: http://dev.clojure.org/jira/secure/IssueNavigator.jspa?mode=hide&amp;requestId=10707

dnolen14:07:40

@mfikes definitely not a newbie one simple_smile

mfikes14:07:34

A part of me wants to one day see the technical stunt of having bootstrapped ClojureScript compile the compiler. (It will have reached its fixed point.)

dnolen14:07:18

@mfikes: that’s probably not so far off simple_smile it’s pretty close to compiling the standard library

dnolen14:07:06

@mfikes: back to my point about Planck, this just seems to me to be a really nice way for interacting with C based systems if the size of JSC isn’t a concerning factor. While I sympathize with Clojure-C and similar ventures, with JSC you’re getting the world class GC and JIT you’d never have the time to write yourself.

lazy-lambda14:07:09

@dnolen: Compiled JSC is 17 MB

cfleming14:07:33

@borkdude: I volunteer at our local CoderDojo, teaching kids to program. We start with http://code.org, then move to Scratch. We’re looking into the next step now.

cfleming14:07:22

One candidate is Snap! (http://byob.berkeley.edu/), which is basically Scheme implemented with a block-based UI.

cfleming14:07:40

It includes first-class continuations!

colin.yates14:07:40

@cfleming: nice - I was wondering how to amuse 4 kids for the next 7 weeks. The 3 year old is probably a bit too young still.

cfleming14:07:18

@colin.yates: Yeah, my daughter is 17 months so it’ll probably be at least 6 months before I get her programming simple_smile

dottedmag14:07:29

colin.yates: I'm going to test http://www.robotturtles.com/ on 3yo

cfleming14:07:59

@dottedmag: Nice, I have a copy at home waiting for the right moment, I bought it off the KickStarter.

colin.yates14:07:41

@dottedmag: nice. I am surprised this market isn’t being more exploitive. It seems ripe for a bit of disruptive technology to make a killing….

colin.yates14:07:47

@cfleming: they make the best testers at that age though!

colin.yates14:07:11

dribble, crumbs, randomly hitting the keyboard etc. Great stuff.

dnolen14:07:13

@lazy-lambda: yeah not that big for 2015 simple_smile

mfikes15:07:37

@lazy-lambda: I wonder, if you use a WebView on Android, what JavaScript engine is in it? Is it JSC?

lvh15:07:09

@mfikes: In current-generation Android releases, there's a pretty tight link between WebView and Chrome for Android

lvh15:07:19

@mfikes: So, on anything that isn't many years old, V8.

mfikes15:07:33

Ahh, WebKit + V8 maybe

lvh15:07:42

mfikes: Blink

lvh15:07:14

mfikes: On 5.0+, it's a separate package, so you can find it under apps somewhere

lvh15:07:56

But yeah, still practically WebKit mostly simple_smile

mfikes15:07:55

So, if React Android becomes very popular (used in multiple apps on a given user’s device), then there would be multiple copies of JavaScriptCore. I guess that’s no big deal.

lvh15:07:33

Probably not simple_smile

lvh15:07:00

It'd be nice if some of it can be shared, but there's also downsides to that

lvh15:07:09

Specifically, you can't really have multiple versions installed

lvh15:07:33

So it becomes way harder to test your app

lvh15:07:49

Since you're now targeting a 3 year window worth of JSC releases

mfikes15:07:41

Yeah. I was thinking of memory (RAM) sharing of the JSC code pages. I dunno if that happens for JSC on iOS, but it could make launch quicker. But then, again, mobile devices are getting so darn fast these days.

borkdude15:07:24

does anyone have an example of sticky table header and column using reagent/react?

arnaudsj15:07:25

hi, any recommendations for a minimalistic clojurescript lib to persist state to a server/database for reagent/om?

benedek16:07:46

@robert-stuttaford: @dnolen wrt clj-refactor and cljs support of advanced features needing an AST: what is basically missing is plugging in tools.analyzer.js and see if it produces an AST we can work with. loads of stuff implemented in emacs-lisp works even now of course

borkdude16:07:30

I got what I need now wrt sticky headers

mfikes16:07:30

@dnolen: Awesome. Oliver Hunt. :)

dnolen16:07:01

@mfikes: yeah, they do really work hard on the JSC bridging stuff

dnolen16:07:14

I think they’re probably surprised people aren’t pushing it further it works really well

dnolen16:07:35

@mfikes: I’m trying to remember where the docs are for pushing C structs into JSC ...

mfikes16:07:48

Dude this is so cool. Talking to Facebook and Apple engineers. Nice.

colin.yates16:07:00

@arnaudsj: I don’t have any code to show but I use edn to transfer over the wire and then stick it in the DB - trivial and works for us.

henrik17:07:21

There’s probably something basic I’m missing here:

(ns test.core
  (:require [cljs.nodejs :as nodejs]))

(nodejs/enable-util-print!)

(println "First try")
(->> ["one" "two" "three"]
     (map println))

(println "Second try")
(->> ["one" "two" "three"]
     (map println)
     println)


(defn -main  [& args])

(set! *main-cli-fn* -main)
The output of this is:
First try
Second try
one
two
three
(nil nil nil)
Why does the code under “second try” print while the code under “first try” does not? (Both work fine in a repl) This is on the latest versions of cljs and io.js.

pbostrom17:07:11

henrik: laziness; the first try just creates a lazy sequence that does not get realized, the second try passes that lazy sequence to println which forces it to be realized; similarly running in a repl forces it to be realized. You could use doall instead of println to force it as well

henrik17:07:19

@pbostrom, doh, of course. Thank you. It’s like I have to learn everything all over again when I haven’t been programming for a while.

robert-stuttaford17:07:44

benedek: awesome simple_smile

samedhi17:07:38

Is there any way in chrome to quickly see the original .js version of a file from the .cljs source-mapped version? I am aware that I can globally enable and disable source maps, but was wondering if I could quickly peek at the .js from the .cljs?

mfikes17:07:07

@samedhi: not a direct answer, but if you want to see code for a fn, evaluate it in a REPL to see its unreadable firm. Also, :repl-verbose is handy

exupero17:07:30

@samedhi: There's a file tree under the "Sources" tab that includes both .cljs and .js files. You can view the .js files directly.

dnolen18:07:36

I've pondered this before but I'm wondering if a periodic ClojureScript developers Google Hangout might not be a good thing

dnolen18:07:50

seems like a good way to get the overview in my brain out to people and to highlight issues that need working on

jonas18:07:19

@dnolen: I would definitely be interested in that.

colin.yates18:07:32

@dnolen: +1 I find a high-level overview invaluable in getting started

Lambda/Sierra18:07:41

What's the preferred way to write Number.MAX_VALUE in ClojureScript?

dnolen18:07:42

@stuartsierra: there is no reliable way to write that other than writing out the literal

Lambda/Sierra18:07:56

Number/MAX_VALUE does't work. js/Number.MAX_VALUE ? (.-MAX_VALUE js/Number) ?

dnolen18:07:33

none of them will work, just doesn’t exist

dnolen18:07:54

well reliably anyway, I think ES2015 may have added something

Lambda/Sierra18:07:19

Oh, you mean the MAX_VALUE constant is not always available?

Lambda/Sierra18:07:33

Ah, JavaScript.

Lambda/Sierra18:07:25

It doesn't have to be an integer. I just want a number bigger than any other number.

dnolen18:07:08

@emil0r: look at browser compat matrix at the bottom

emil0r18:07:22

yeah i know simple_smile. but there was a number in there

emil0r18:07:31

but maybe infinity

emil0r18:07:34

would work

Lambda/Sierra18:07:54

@dnolen I am talking about Number.MAX_VALUE, which is standard JavaScript, not MAX_SAFE_INTEGER

dnolen18:07:56

@stuartsierra: ah k, so working with double

Lambda/Sierra18:07:30

yeah, a floating-point number is fine. This is just for a default value to use in a compare

dnolen18:07:14

@stuartsierra: weird then js/Number.MAX_VALUE works for me

dnolen18:07:21

at least in Node.js REPL

Lambda/Sierra18:07:36

Yeah, that works. I just wanted to know if it's correct. simple_smile

dnolen18:07:59

@stuartsierra: the later two are correct

dnolen18:07:10

far as I can tell js/Number.MAX_VALUE must always work

Lambda/Sierra18:07:33

OK, good. I haven't developed an intuition about dotted literals in ClojureScript.

dnolen18:07:09

@stuartsierra: yeah basically ClojureScript supports a property access form that Clojure does not

dnolen18:07:20

it’s been that way for a long time, and now far too late to change it

shaunlebron19:07:53

Infinity can be used on its own, read by tools.reader

samedhi19:07:19

thank you @mfikes and @exupero, gets me close enough; though I still wish there was a more direct way to do it.

shaunlebron19:07:50

@dnolen: a google hangout would be great

dnolen19:07:08

@shaunlebron: yeah just figuring out a good time is the main problem. I mostly work through JIRA on Fridays. Not everyone can do OSS on Friday’s though and not everyone is EST time zone.

shaunlebron19:07:16

I think I remember hangouts having a record button for youtube uploads?

shaunlebron19:07:49

if not, someone attending can record and upload

shaunlebron19:07:53

I’d volunteer for that

shaunlebron19:07:57

maybe poll for available times on mailing list

dnolen19:07:18

yeah recording it definitely not an issue

shaun-mahood19:07:32

@dnolen: I would love it if you could do a hangout with @mfikes and chat with him about all the awesome cljs repl stuff that's going on these days. Seems like every day there's something new and awesome.

mfikes19:07:50

I’d join in!

dnolen19:07:31

@shaun-mahood: right would also be a way to get people talk about cool ClojureScript related things being worked on

shaun-mahood19:07:04

That would be really great. So much good stuff going on right now.

lazy-lambda19:07:34

I’d love to join.

meow19:07:24

+1 on the Google Hangout idea

meow19:07:56

is there a way to get the name of the function from within a function definition for use in place of code like this:

(defn start-rendering! []
  (console/info "start rendering")

dnolen20:07:37

@meow: there isn’t, to do it correctly would require reflective machinery not present in the host

meow20:07:36

@dnolen: okay, cool. Was looking at goog.debug/getFunctionName but figured I'd ask first

dnolen20:07:19

@meow: seems to be testing only thing

meow20:07:03

I'm just trying to be lazy

meow20:07:35

if I had a nickel for every hour I've spent trying to be lazy...

mfikes20:07:06

New post: What is Bootstrapped ClojureScript? (this one is short and sweet): http://blog.fikesfarm.com/posts/2015-07-17-what-is-bootstrapped-clojurescript.html

meow22:07:30

What is going on? I'm getting clojure.lang.ExceptionInfo: No such namespace: goog.async, could not locate goog/async.cljs, goog/async.cljc, or Closure namespace "goog.async" at line 1

meow22:07:52

I'm using lots of stuff from goog and in my :require I've got

[goog]
   [goog.async]
   [goog.async.AnimationDelay]

meow22:07:22

I just added [goog.async] to start using goog.async/nextTick and now I get this error. Should be something simple, I just don't see it.

meow22:07:18

looks like I have to require [goog.async.nextTick] even though its just a function

meow22:07:07

wish I knew how goog.async is not a namespace but goog.dom is

rauh22:07:56

@meow: THis is really just google closure. You always have to require the namespace of where the function is actually at

rauh22:07:10

Classic example is the format require: goog.string.format which is required even is you require the goog.string namespace.

meow22:07:47

@rauh: I see now. So with async they only do goog.provide('goog.async.nextTick');

meow22:07:02

they don't do goog.provide('goog.async');

meow22:07:02

Now I understand why, I just don't understand why the inconsistency. Oh well.

dnolen23:07:42

@meow: it’s a wart in Google Closure Library itself, not much we can do about that. It’s for this reason we added :import

dnolen23:07:55

(:import [goog.async nextTick]) is what you want

mfikes23:07:36

On the subject of Planck timing perception and UX, in Replete, when you evaluate a form, there is actually a 50 ms artificial delay added before the form is sent for evaluation. Otherwise both the entered form and the result animate out at the same time, which results in this odd feel that is at odds with the notion that you are having a “dialog” with the evaluator. (You have to try it without the small delay to see it—strangely adding a delay can change the feel of the UX.)

mfikes23:07:56

It is odd the way human interfaces work out—telephone handsets playing your own voice back, etc.

lazy-lambda23:07:25

@dnolen: Is there a wiki about the pros and cons and roadmap of bootstrapped cljs ?

mfikes23:07:41

There is a roadmap page

meow23:07:24

@dnolen: now I understand :import

meow23:07:04

hmm, what does letfn return - not the defined function, I guess

dnolen23:07:09

@lazy-lambda: nothing about pros and cons, mostly because the cons right now are pretty obvious

dnolen23:07:19

using it means zero tooling support

meow23:07:35

probably because letfn takes a vector

meow23:07:54

and can define multiple functions

meow23:07:09

okay, so I just need to explicitly return the one I want

meow23:07:17

So, something is off because I'm getting intermittent fps values of like 333 and 500 that are way beyond what you expect, which is around 60 or less, but this version has no atoms!!!

(defn measure-fps!
  [callback previous]
  (letfn [(step
           [timestamp]
           (let [previous (or previous (- timestamp 17))
                 elapsed (/ (- timestamp previous) 1000)
                 fps (->> (/ 1 elapsed) (.floor js/Math))]
             (if (callback fps)
               (request-animation-frame (measure-fps! callback timestamp)))))]
    step))

(defn listen-fps!
  "Executes callback at every frame returning the frames-per-second."
  [callback]
    (request-animation-frame (measure-fps! callback nil)))

meow23:07:48

That was for you, @gtrak simple_smile

meow23:07:33

I think that can be made into one function with multiple arities...

dnolen23:07:06

taste of the future

dnolen23:07:17

this is how complicated bootstrapped ClojureScript will be

dnolen23:07:28

just a :require