please just use rescript it addresses every problem with js/ts and is simpler and you get a sound type system please.
I took a look at rescript's facillities for migration from JS and at step 1 ( https://rescript-lang.org/docs/manual/latest/converting-from... ), it tells you: > First, copy the entire file content over to a new file called src/Main.res by using our %%raw JS embedding trick: > %%raw(`const school = require('school'); etc. `) I stopped reading there - I'm sorry but that is horrifying. Wrapping JS in in a big backtick s…
CoffeeScript for TypeScript
71–80 of 143 posts
Re: CoffeeScript for TypeScript
#72Way back in the early 2010s I was very "excited" about coffee script and similar projects. They sounded like they should be great for productivity. When I actually tried to write a project in coffee script, the results were the opposite of what I expected. The code was harder to read, harder to modify, harder to understand, harder to reason about. There's something about removing stuff from syntax that makes programm…
Re: CoffeeScript for TypeScript
#73Re: CoffeeScript for TypeScript
#74Hello! I created Civet ask me anything. Or just curse me for keeping the dream of CoffeeScript alive :P
Re: CoffeeScript for TypeScript
#75Hello! I created Civet ask me anything. Or just curse me for keeping the dream of CoffeeScript alive :P
Hey Yahivin! I love the idea and would love to use it and spread it. I think the best way to jumpstart that is a VS Code extension that allows Civet to be used as an Emmet style tool for the modern developer - write code really quickly and have it convert to production grade typescript following all your eslint / prettier rules, and use it as a personal speed up tool for just writing. When your coworkers start asking…
Re: CoffeeScript for TypeScript
#76Earlier quoted context omitted.
+1 for tofeescript. 'Civet' certainly implies your code is being processed, but I'm not sure the connotation is desirable. And all IMHO of course, but significant-whitespace is the worst idea ever.
> significant-whitespace is the worst idea ever Hear hear! I never heard a single argument for significant invisible characters that makes sense, ever. Who would want to have a program that fails because you used invisible character X instead of invisible character Y?
Re: CoffeeScript for TypeScript
#77If I were going to do this, I’d probably go all the way to using ReScript, but it’s a nice idea. I’m quite surprised it’s not called ToffeeScript though.
+1 for tofeescript. 'Civet' certainly implies your code is being processed, but I'm not sure the connotation is desirable. And all IMHO of course, but significant-whitespace is the worst idea ever.
Re: CoffeeScript for TypeScript
#78Earlier quoted context omitted.
I didn't mind the coffeescript experience, but it's deeply hurtful to productivity to dev in a platform that doesn't end up winning.
Is it? I find most of the "winning" tech deeply unproductive. Have you tried developing in a project with Webpack and Redux? It's kind of its own little hell. Everything is way too slow and complicated. Tasks that should take 20 minutes take 3 hours.
Re: CoffeeScript for TypeScript
#79Under "Everything is an Expression": items = (() => { const results = []; for (const item of items) { if (item.length) { results.push(item.toUpperCase()); } else { results.push(" "); } } return results; })(); Seems like they are purposely making the JS version extra long. It could be: items = items.map(x => x.length > 0 ? x.toUpperCase() : ` `) Edit: Just realised the code on the right is the compiled code, not the "…
Given than in JS an empty string is a falsy value you can go even shorter: items = items.map(x => x.toUpperCase() || ` `)
This even more terser code will fail if `x.toUpperCase()` fails with an exception (such as when x is not a string).
Re: CoffeeScript for TypeScript
#80Hello! I created Civet ask me anything. Or just curse me for keeping the dream of CoffeeScript alive :P