I don’t understand why is been so hard to make myself being clear.
Some of you understood the point, at the same time that you misunderstood it. I say this because some people have expressed some branching on their understanding of my question.
I’ll try to explain it by parts to see if I can make my question clearer:
- ClojureScript is implemented on itself, which is cool, but at the end of the day what gets executed on the browser and on node is just plain javascript
- Because what the CLJS compiler spits out is just javascript, the features needs to be implemented one way or another on the host language, which is javascript. So at the end of the day, a record is nothing but a javascript class and a map is just a javascript object.
With those first tow points in mind, some of the advanced features CLJS has should be implemented in javascript making use of what javascript provides. There are some features that has been added to the language recently which a) has better performance or b) has better features or both.
Some simple examples that I can think of (and some people already did) are sets, maps, weakSets, weakMaps, the new regex features, proxies which are awesome and that stuff.
Let’s say for example that a clojurescript set uses a js array under the hood, and each time you try to add something to the set it has to check if the element already exists on the set. Making such check on a JS array has bad performance, and clojurescript may have to do some obscure hacks. But if it could just use a normal JS set then things would be much more nicer and efficient.
In any case I tried to ask if I can use ES6 features inside ClojureScript, I took that for granted because the cool interop.
Someone said that ClojureScript compiles down to ES3, and someone else have said that you can specify the target JS version. I’m also interested o knowing if this is possible and how, along with my previous question.
Hope it is clearer now.