by Slackwise · 8y ago · 0 comments
Yes, it gives some compile-time-only type safety in certain places, but it doesn't provide state safety like ClojureScript. I'm more worried about state/reference-based bugs creeping into my code versus type related issues, which I'll be checking via unit tests anyway. On top of that, it doesn't protect you from the usual JavaScript pitfalls since it's backwards compatible, including the bad parts.
Or am I missing something here? Is it popular because it lets you directly upgrade existing JavaScript files? I can see that being a big draw. Small and gradual improvement, yeah?
For example, it couldn't mean atoms/CAS because it's already single-threaded.
Also, you'd consider upgrading to Typescript because static-typing was on your wishlist. ClojureScript isn't really a competitor.
In fact, I ultimately found that "I still want a dynamically-typed language but with some technical improvements" is the weakest reasoning for switching away from Javascript which is why I ended up dropping ClojureScript. Meanwhile I've found something like Elm goes far enough to make the switch more worthwhile (static typing, built-in front-end architecture, etc).