5 ms·
Sounds easier to just use some other compile to js languge, its not like there are no other options out there.
by phplovesong 11mo ago
Sounds easier to just use some other compile to js languge, its not like there are no other options out there.
- petejodo 11mo agoAgreed. Gleam is a great one that targets JavaScript and outputs easy to read code
- phplovesong 11mo agoYup. Also rescript if your not a fan of the elm architecture.
- k__ 11mo agoI'm still mad about Reason/ReScript for fumbling the bag here.
- phplovesong 11mo agoRescript/reasonml is still in development, and a more seasoned dev team can easily pick it as an better alternative to typescript. Its a bummer haxe did not promote itself more for the web, as its a amazinlgy good piece of tech. The languge shows age, but has an awesome typesystem and metaprogramming capabilities. That said, haxe 5 is on the horizon.
- k__ 11mo agoWhile TS allows easy integration with JS, this doesn't work well with other languages that compile to JS. You lose all type benefits of libraries that are written in TS.
- phplovesong 11mo agoIts quite rare to see interop between compile to js languages tho. Also rare to see projects using more (if not in the middle of a rewrite/port) than one compile to js language. YMMV.
- iLemming 11mo ago> Its quite rare to see interop between compile to js languages tho js interop in Clojurescript is dead simple. Moreover, you can have shared logic between different runtimes. The promise of Nodejs for code re-use, in practice turned out to be not as straightforward, even though you have js runtime in both places. With Clojurescript, you can have the shared logic in the same namespace - it's mindblowing, you can have functions that work on both - JVM and JS.
- phplovesong 11mo agoIm not talking about X->JS->X interop, but X->Y->JS->Y->X interop, where X,Y = compile to JS language. > it's mindblowing, you can have functions that work on both - JVM and JS Thats basically what you could do long before Nodejs (that made server/client code sharing popular) came out in Haxe. You could target a huge number of targets from a single codebase.
- iLemming 11mo agoAre you saying that getting two different compile-to-JS languages to interoperate is messy and you have to go through multiple transpilation layers to make them talk to each other? The Clojurescript way isn't about transpiling between different compile-to-JS languages. It's simpler: write once in Clojure, compile to both JVM and JS directly. No intermediate language chains needed. And you are free to use whatever js and java libs directly. Yes, sure - valid point about Haxe, you're right, it actually did this before Clojurescript or even before Node existed. IIRC Haxe could compile a single codebase to multiple targets. That multi-target approach tho required writing in a lowest-common-denominator lang. Cljs practical in the sense that you get the full power of Clojure on the JVM side and reasonable JS semantics on front-end - without compromise. Haxe often meant sacrificing language features to stay compatible across all targets. Clojurescript is surprisingly pragmatic in that sense and works well. The downside - you can use Cljs on its own, but it truly shines when paired with Clojure, but JVM, despite being amazing piece of tech has a marketing problem - people hear JVM and immediately think Java.
- vips7L 11mo agoScalaJs!
- Too 11mo agoRust compiles to wasm right?
- epolanski 11mo agoNot if you want to use typescript.
- phplovesong 11mo agoTypescript is the obvious choice if all you know/want to learn is JS. But the languge is still garbage because of "valid js is valid ts". And yes, i know that is what made it popular.
- pjmlp 11mo agoIt is also how C++ and Objective-C got users from C land. The examples on the JVM and CLR got it through, targeting the same bytecode, and Swift even if imposed from above, also had to make interop with Objective-C first class, and is now in the process to do the same for C++. Turns out adoption is really hard, if a full rewrite is asked for, unless someone gets to pay for those rewrites, or gets to earn some claim to fame, like in the RIG and RIR stuff.
- epolanski 11mo agoThis is some criticism that lacks any depth or insight. I've deployed projects in Elm, Scala, Clojure, Purescript and TypeScript has many great qualities that the others don't have. It's an incredibly powerful language with a great type system which requires some effort in understanding, (e.g. 99% of candidates don't even know what a mapped type is, it's written in the docs...) and minimal discipline to not fall in the js pitfalls. On top of that you have access to tons of tools and libraries, which alternative ecosystems either don't have (e.g. no compile-to-js language) or have to interoperate with at js level (anything from Reason to Gleam) anyway. Beyond that, there's other important considerations in choosing a language beyond its syntax/semantics and ecosystem, such as hiring or even AI-friendliness. Stricter TS is absolutely a valuable effort to chase.
- koakuma-chan 11mo ago> 99% of candidates don't even know what a mapped type is, it's written in the docs Please don't ask shit like that during interviews. For the love of god.