Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ClojureScript and size for Mobile app

I just have a generall concern. I wrote a simple viewpager in html/css/javascript that allows me to swipe between "pages" like you do using a viewpager in android and/or iphone. The required javascript for this was less than 1kb. When I converted this to ClojureScript, the resulting code with optimizations and lack of pretty printing, ended at around 62kb.

What I'm concerned with, is that ClojureScript is so big and does so much more than regular javascript, that for a full fledged mobile application, it will be to slow.

Can anyone put my mind at ease? Anyone have experience with this?

like image 764
Robin Heggelund Hansen Avatar asked Mar 22 '23 20:03

Robin Heggelund Hansen


1 Answers

There's quite a bit of Clojure's data structures and core library functions that have to get compiled into JS, which is probably most of that 60kB. I wouldn't worry too much about JavaScript size since in most mobile apps other assets (i.e., images) dominate the size. As for speed, the usual rules apply: be careful with DOM manipulations and layout/repaint.

For what it's worth, The Weathertron iOS application is written with ClojureScript + Angular.js and performs just fine.

like image 73
Kevin L. Avatar answered Mar 28 '23 21:03

Kevin L.