2015-10-11 at 7:12 AM UTC
Anyone here ever written web code in a language that uses javascript as a compile target? Do you have a favorite? Is it always best to just work in JS? What did you think about what you tried? For me:
Coffee Script: I like python so I actually like no braces and significant whitespace but I feel like the only benefit you get out of coffee script is marginally better syntax and the headaches of source mapping, even with modern tooling, just don't justify it to me. The object-literal syntax is pretty questionable in my mind and while I'll grudgingly admit I prefer classical inheritance it's not that hard to work around in vanilla JS and considering it's just not feasible to use coffeescript and never have to dive into actual JS I feel that it's not a significant benefit to anyone.
Clojurescript: I love clojure and clojurescript is a great idea. It's a total joy to write. Issues arise in 1. the heavy weight setup process and considerable ceremony every project requires and 2. the weight of the runtime is something that weighs heavy on my conscious. It's a perfect system for a large industry-strength application but for one-offs or small projects it's often hard to justify the massive support machinery that's required for a cljs project.
Typescript: I've never actually used it but the idea is cool. I expect the implementation is shit since it came from MS but I shouldn't judge until I try. I'm actually not a huge fan of static typing but I've suffered greatly and many times over the wild-west "anything goes" policy in vanilla JS and I've had a good number of problems that never would have happened with type checking. I think the world is still ripe for popular/good implementation of gradual typing and when it arrives we'll realize it's just the right thing in much the way we came to understand high level languages are the right thing, but until then if I can have a typechecker blow up in the face of the nigger who's trying to pass a square argument into a circular function I'll count it as a win. Funny enough typescript is kind of the opposite of coffee script in that it fixes a fundamental issue with JS (weak typing and a tendency to leak bad types downstream) without fixing the syntax while CS "fixes" the syntax without addressing the fundamental issues with the language.
2015-10-11 at 2:41 PM UTC
aldra
JIDF Controlled Opposition
lol, compile
what is even the point?
2015-10-14 at 11:26 PM UTC
I've never used any of these but I've heard of CoffeScript. I would just stick to JavaScript rather than compiling to it. Unless there is some other benefit to doing so.