Comments (9)
Probably the println
function involves some very-had-to-tree-shake core functionality. This is a well-known ClojureScript problem and the usual answer is that in case you will need to include core at some point and therefore you'll end up with more than 90kb, which is comparable to including jQuery.
This is the price we, as ClojureScript devs, are willing to pay for the the language we like but I am sure not everyone would agree 😃
from lumo.
There was also a tweet recently talking about that: https://twitter.com/p_cstl/status/1139790337742782466?s=20
from lumo.
90kb is still to bigger for many JavaScript developers if they think the size does not provide any actual features. We sometimes use Webpack to analyze the size in the project to see if we can reduce it. 90kb is definitely worthing looking into.
I'm fine for 90kb in my ClojureScript projects. But to be honest I have tens of small projects built with ClojureScript, and it might be like 90k * 20+
and in total 1800kb+
for me. Turned out Google Closure Compiler is not that powerful in some way. I would really like to try if there's some solution for reducing the number.
from lumo.
JavaScript developers if they think the size does not provide any actual features.
I think this would be the main point. For me a "feature" of ClojureScript is maintenability so I would also always make that trade-off. I understand though not everybody is on the FP+simplicity boat in which case they would not probably use ClojureScript to begin with.
from lumo.
It's trade-off. Meanwhile ReasonML is another example of functional programming language that we can compile to JavaScript with simplicity and maintainability with less time and get smaller size. Although the language is different and Clojure has too many features, I think the main factor is ClojureScript does not has its own code optimizer and Google Closure Compiler does not try to fit into the case of ClojureScript. One day when ClojureScript is compiled to WASM and there a powerful optimizer for WASM, ClojureScript would get a smaller size.
from lumo.
Meanwhile ReasonML is another example of functional programming
Agree it is tradeoffs, but there another interesting thing to point out - does ReasonML include persistent data structures? If so and it is smaller, then I would definitely like to know what they are doing and port it over to ClojureScript. See, for me maintainability comes directly from immutability as default (yes you can rarely escape but it is discouraged, like in Clojure). More specifically this is the trade-off worth making IMHO.
from lumo.
Also worth noting that things like https://github.com/santoshrajan/lispyscript exist folks that like lisp but don't need immutability as first class citizen.
from lumo.
Personally I don't have a strong opinion one way or the other regarding the design and trade-offs, but rather wondered if there was some overhead related to Lumo's implementation. Like injected code that introduced references that couldn't be shaken out.
from lumo.
I don't know in detail and OCaml turns out to have mutable Vectors somehow, this is a different from Clojure. But I do heard that they are doing lots of analysing and optimizing during compile time to generate smaller and faster code: https://github.com/BuckleScript/bucklescript/wiki/Why-bucklescript-matters-for-Javascript-platform#how-does-it-compare-with-other-transpilers
from lumo.
Related Issues (20)
- Improvements to exception messages and printing HOT 4
- Spurious toine in lumo banner HOT 1
- Make Google Closure Compiler implementation selectable
- coping directories HOT 1
- How to add libraries like andare to a lumo build? HOT 6
- Could Lumo not depend on glibc ? HOT 6
- require doesn't work inside of expressions HOT 2
- eval doesn't work on anything with #js literals
- Lumo 1.10.1 doesn't run in NixOS 19.09 HOT 9
- Different startup times for -e vs. stdin HOT 2
- Yarn error when building on Debian Buster x86 (32-bit) HOT 1
- jszip no longer available HOT 7
- Macro expand strangeness HOT 1
- Homebrew lumo package was deleted
- Subtract and divide operators accept zero args HOT 1
- brew install lumo fails HOT 1
- Question: How can I get fipp to work with lumo? HOT 1
- Build option :output-wrapper ignored
- Execution speed of lumo compared to Clojure
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lumo.