Re:A statically typed scripting language that transpiles to ...
by ketralnis on Friday March 25, 2022 @12:31PM
(#30804160)
That's not a given, think typescript compiling to minified javascript. Some compilers like coffeescript do put in some effort to have the output be readable but I wouldn't assert that it should be a goal for everyone
[ Parent
| on HN ]
Re:A statically typed scripting language that transpiles to ...
by eyelidlessness on Friday March 25, 2022 @01:05PM
(#30804638)
> typescript compiling to minified javascript
This is an odd example. TypeScript compiles to readable JavaScript for nearly everything except the odd runtime behavior (eg enums) and “downleveling”, which is increasingly unnecessary. Minification is still a separate step AFAIK (if you’re using tsc; obviously ESBuild and SWC are another story, as will be Bun).
Re:A statically typed scripting language that transpiles to ...
by ketralnis on Friday March 25, 2022 @06:46PM
(#30807729)
You caught me, I've never written typescript. I don't think that changes my claim though
Re:A statically typed scripting language that transpiles to ...
by eyelidlessness on Friday March 25, 2022 @08:47PM
(#30808336)
I think I have varying and stronger feelings about it depending on context. Personally if I were to use this or any compile-to-shell thing, I’d probably prefer it produces unreadable output. I don’t want to ever read bash if I can help it. If I have to, it’s a good sign I’m already beyond my preferred scope for using bash in any way.
Whereas if I’m compiling TypeScript/CoffeeScript/anything to JS, it’s pretty likely I already have JS as a built in constraint and I probably want to be able to read the output so I can debug it.