Hacker News new | comments | show | ask | jobs | submit login

I can't speak to ClojureScript, but in my experience, CoffeeScript is primarily used by people who already know JavaScript. You can't use CoffeeScript effectively without understanding JavaScript. Most of us who use CoffeeScript instead of JavaScript appreciate CoffeeScript's syntactic shortcuts, which for us makes it quicker to write and improvise with new ideas, as well as its enforced whitespace, which makes it easier to write maintainable code.

Otherwise, as someone whose first and second strongest languages are Python and Javascript, I agree with you. JavaScript is a beautiful language that accommodates a variety of programming styles. As you mention, JavaScript is also much more performant than Python, which makes me questions whether Python would ever be a viable replacement for JavaScript in the browser. Add to that JavaScript's excellent webworker API compared to Python's choices for parallel programming.

Now, Lua, on the other hand, would be an excellent browser language (specifically the LuaJit implementation). Lua is close enough to JavaScript that folks could easily pick it up, and its blazing fast. But it will never happen.

Besides, there are so many great JS libraries now that in most cases, I wouldn't want to switch to Lua in the browser and face re-inventing the wheel (same reason why I generally use Python instead of Lua elsewhere). But its fun to think about.




> JavaScript is also much more performant than Python

This is not true. Some Javascript _implementations_ are definitely faster than some Python _implementations_, but nothing about either language makes one inherently faster than the other.

And in the Brython case, the Python is being translated to Javascript, so it is getting the same benefits out of a fast, JIT-compiled implementation that Javascript normally gets.


> nothing about either language makes one inherently faster than the other

You can't make such a statement confidently unless you examine the specs of both languages.

For example, Python integers promote to bigints automatically while JS numbers don't. For one more, in Python you can overload attribute access, while in JS you can't. Both of these are language features rather than implementation details, and both potentially affect performance. There are probably others.


> makes it quicker to write and improvise with new ideas,

I've never thought about that but could make sense.

> as well as its enforced whitespace, which makes it easier to write maintainable code.

This is something I've never understood and where I tend to disagree. When starting with "whitespace" languages like Coffee, Ruby or Python people initially are please with clean and tidy looking code but in the long run this code is not maintainable since all the white space makes the code looking not distinctively enough. In contrast, bracket based languages like C or JS give much better orientation. I can quickly see where code blocks start or I can immediately recognise functions etc.

> Lua, on the other hand, would be an excellent browser language

Totally agree


"in the long run this code is not maintainable since all the white space makes the code looking not distinctively enough."

Where do you get this? The only instance where I see Python becoming unreadable due to whitespace is when a developer abuses whitespace where it's not needed e.g. a = [ 'a', 'list' ]

Another example could be chaining method calls Java-style, but all of this is alleviated by just following PEP8.

The significance of whitespace has no effect on the readability of a language.


Ruby is not a significant indentation language. do not comprehend how Indentation is not visually distinctive.


I didn't mean the indentation, I meant leaving away brackets.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: