Live data from Hacker News

JSX - a faster, safer, easier alternative to JavaScript

jsx.github.com

51–60 of 73 posts

Re: JSX - a faster, safer, easier alternative to JavaScript

#51

Earlier quoted context omitted.

The Gameboy color hardware can be simulated on a desktop computer in a browser, in javascript. Does that make desktop computers more primitive than Gameboys?

@viraptor and so we can see that we must take into account more than just whether one can be simulated on another, we must take into account /expressiveness/, or level of complexity as well! In theory, you could simulate prototypes with classes too. You have to be able to, or else it wouldn't be possible to write an interpreter for a language which supports prototypes. The question of "can" and "can't" then, in the c…

Anything I can do with a string, I could also do with an array. However, it would take extra work to make an array behave like a string, in the form of helper functions, etc.

If I really wanted to prove a point, I could make a string behave like an array. But that would take even more work because an array is a very flexible tool used for a variety of low level purposes.

Therefor, according to your argument, a string is a more primitive data type because it takes more work to make a string act like an array than it does to make an array act like a string. This goes in direct contradiction to the actual definition of a programming primitive.

Back to the original poster's quote, "JSX offers a solid class system much like the Java programming language, freeing the developers from working with the too-primitive prototype-based inheritance system provided by JavaScript."

He is quite clearly addressing a specific case here, which is programmers who want to use Java-like classes when developing in Javascript. A lot of extra work is required if you want to make a Javascript prototype behave like a Java class, with inheritance, etc. So in this context, it is obvious that Javascript prototypes are "too primitive" for the task at hand.

Similar to the way that strings are, in fact, arrays with lots of extra functions for frequently repeated, string-related tasks, JSX classes are JS prototypes with a lot of the oft-repeated boilerplate code done for you. I'm not sure how to make it more clear how the chain of "primitiveness" flows in this case.

Re: JSX - a faster, safer, easier alternative to JavaScript

#52
post #49
post #43

Earlier quoted context omitted.

Odd, I had no problem reading your comment. It also has an unusual clean-ness. Maybe period-less sentences are the future Throughout history english has already had many typological changes From a DRY stand-point capitalization and periods contain the same information payload Eliminating one of them would thus be good software engineering Right?

I didn't notice there were no periods till I finished reading and then had a "hey, wait a second" glance back This is an experiment worth trying out: just write everything in this style for a while The main problem I see here is figuring out whether a new sentence has been started when a Proper Noun or capitalized pronoun like "I" has been introduced I provide the current sentence as an example of that It's not so ha…

"... been introduced I provide the ..."

I'll admit that I did a triple-take when reading through your example. Let's keep periods. :)

Re: JSX - a faster, safer, easier alternative to JavaScript

#53

Earlier quoted context omitted.

@viraptor and so we can see that we must take into account more than just whether one can be simulated on another, we must take into account /expressiveness/, or level of complexity as well! In theory, you could simulate prototypes with classes too. You have to be able to, or else it wouldn't be possible to write an interpreter for a language which supports prototypes. The question of "can" and "can't" then, in the c…

@viraptor (i can't reply directly to messages sometimes for some reason. is it a karma thing?) , So, what you are saying is that if you want to simulate A in B, but B needs an abstraction layer to simulate A, while A can simulate B more directly and naturally, that makes A more primative? So then does that mean that C is more Primitive than Assembler?

Replying to replies to your messages has a cooling-down period built in on this forum. Give it 5 or so minutes, and the reply link appears.

Re: JSX - a faster, safer, easier alternative to JavaScript

#54

Earlier quoted context omitted.

@viraptor and so we can see that we must take into account more than just whether one can be simulated on another, we must take into account /expressiveness/, or level of complexity as well! In theory, you could simulate prototypes with classes too. You have to be able to, or else it wouldn't be possible to write an interpreter for a language which supports prototypes. The question of "can" and "can't" then, in the c…

@olalonde that's a bit of a cop out, of course I've read that article. That is why I'm baffled by the assertion that prototypes are more primitive than classes. It doesn't add up with the definitions of what amounts to being high level and low level. If you have something more specific to say I suggest you say it, but it's pretty lame to just wave your hands at a wikipedia article and tell me to figure out something…

I find it hilarious that olalonde appears to be turning your condescending use of socratic irony back on you by treating you as the "ignorant student" that you pretend to be, and then not only do you not pick up on it, you actually get offended! Brilliant.

Re: JSX - a faster, safer, easier alternative to JavaScript

#55
Is it weird that I'm happy this site doesn't have a lot of pretty gradients and fancy art? For whatever reason I'm a little tired of too pretty sites related to JavaScript or other client side development. I think the reason for this is because I get the impression that the contributors emphasize trivial features and care more about artificial things, like a really opinionated interface but not a lot of innovation in performance.

It's like the bike shed concept. Anyone can paint a bike shed, but it takes real skill and hard work to build a decent one. It's great to have a nice coat of paint, but the accomplishment wasn't picking the color. That's how I feel about ember.js's website, and the website for all these other client side things with fancy buttons, large web fonts and gratuitous use of space. It's probably a pretty coat of paint, but I doubt I can get efficiently achieve 200,000 datastore operations with speed.

Re: JSX - a faster, safer, easier alternative to JavaScript

#56

Earlier quoted context omitted.

@viraptor (i can't reply directly to messages sometimes for some reason. is it a karma thing?) , So, what you are saying is that if you want to simulate A in B, but B needs an abstraction layer to simulate A, while A can simulate B more directly and naturally, that makes A more primative? So then does that mean that C is more Primitive than Assembler?

Could you use the reply button when replying instead of using the @name notation? It's kind of hard to follow your responses.

I would have if I could have, but I didn't know the rules of when reply buttons appear.

Re: JSX - a faster, safer, easier alternative to JavaScript

#57
post #54

Earlier quoted context omitted.

@olalonde that's a bit of a cop out, of course I've read that article. That is why I'm baffled by the assertion that prototypes are more primitive than classes. It doesn't add up with the definitions of what amounts to being high level and low level. If you have something more specific to say I suggest you say it, but it's pretty lame to just wave your hands at a wikipedia article and tell me to figure out something…

I find it hilarious that olalonde appears to be turning your condescending use of socratic irony back on you by treating you as the "ignorant student" that you pretend to be, and then not only do you not pick up on it, you actually get offended! Brilliant.

There was no question that he was asking me to answer. He just told me that I was confused and pointed me at an article. He didn't say what he thought I was confused about. There was no obvious conclusion he was attempting to lead me to. There was no new evidence he was presenting. It's probably an mistake to read offense into text. There is no way for you to know whether I was offended or not. In this case I was not offended, I was pointing out that his reply was devoid of content, and lacking in effort. Likewise if you want to read condescension into my text, that's up to you, but has nothing to do with anything I wrote.

Re: JSX - a faster, safer, easier alternative to JavaScript

#58
post #51

Earlier quoted context omitted.

@viraptor and so we can see that we must take into account more than just whether one can be simulated on another, we must take into account /expressiveness/, or level of complexity as well! In theory, you could simulate prototypes with classes too. You have to be able to, or else it wouldn't be possible to write an interpreter for a language which supports prototypes. The question of "can" and "can't" then, in the c…

Anything I can do with a string, I could also do with an array. However, it would take extra work to make an array behave like a string, in the form of helper functions, etc. If I really wanted to prove a point, I could make a string behave like an array. But that would take even more work because an array is a very flexible tool used for a variety of low level purposes. Therefor, according to your argument, a string…

You're kind of stretching the metaphor a bit far here. In the javascript language interpreters, prototypes are implemented with classes. In JSX classes are implemented with prototypes. In C, strings are implemented as arrays. In shell scripting, arrays are implemented with strings. All we get out of this is that whether a programming construct is low level or high level is relative to how it was implemented, and is not an intrinsic quality of the construct itself. This doesn't make any sense to me.

Re: JSX - a faster, safer, easier alternative to JavaScript

#59

Is it weird that I'm happy this site doesn't have a lot of pretty gradients and fancy art? For whatever reason I'm a little tired of too pretty sites related to JavaScript or other client side development. I think the reason for this is because I get the impression that the contributors emphasize trivial features and care more about artificial things, like a really opinionated interface but not a lot of innovation in…

[deleted]

Re: JSX - a faster, safer, easier alternative to JavaScript

#60
post #54

Earlier quoted context omitted.

I find it hilarious that olalonde appears to be turning your condescending use of socratic irony back on you by treating you as the "ignorant student" that you pretend to be, and then not only do you not pick up on it, you actually get offended! Brilliant.

There was no question that he was asking me to answer. He just told me that I was confused and pointed me at an article. He didn't say what he thought I was confused about. There was no obvious conclusion he was attempting to lead me to. There was no new evidence he was presenting. It's probably an mistake to read offense into text. There is no way for you to know whether I was offended or not. In this case I was not…

Your arguments all tend to make sense when using the English common usage of the word primitive, because I believe that JS prototypes are possibly more advanced than Java classes.

However, speaking solely about the language Javascript, I think it's also fairly clear that in Javascript a prototype is a language primitive that you would use to build a Java-like class construct. Therefore in this context, according to the programming term primitive, prototypes are clearly "more primitive".

It doesn't matter what the Javascript interpreters are doing behind the scenes, because all we care about is Javascript as a language, and what building blocks are available there.

Your use of the word primitive does not seem to logically match the definition of the word provided in the Wikipedia article (admittedly not the best reference for programming concepts), which is why I believe the link was entirely warranted.

And just as a side note, it is entirely possible to be condescending without consciously intending to be.

Post reply on HN