Earlier quoted context omitted.
That's a weird thing to think. If you can simulate classes with prototypes, but you can't simulate prototypes with classes, what is the natural conclusion you can come to about which is more expressive or primitive?
When talking about programming languages, "primitive" usually means low level. For example, primitive data types ( http://en.wikipedia.org/wiki/Primitive_data_type ).
JSX - a faster, safer, easier alternative to JavaScript
21–30 of 73 posts
Re: JSX - a faster, safer, easier alternative to JavaScript
#22Earlier quoted context omitted.
That prototypes are overly complex. You can't simulate most imperative programs with functional ones because writing in a functional language eliminates a vast majority of bugs due to incomplete reasoning about memory barriers and other really hard to duplicate issues like race conditions. CHESS is an amazing piece of software precisely because it CAN simulate race conditions and reproduce them, however, if these thi…
I'm not saying you're wrong, but isn't this a bit like saying that files are overly complex because they can be used to simulate sockets?
I do think that prototypes have useful properties, but I'm not sure that a prototype isn't a form of an open class. I tend to think that the biggest problem with prototypes in js is the interface.
Re: JSX - a faster, safer, easier alternative to JavaScript
#23Re: JSX - a faster, safer, easier alternative to JavaScript
#24Earlier quoted context omitted.
When talking about programming languages, "primitive" usually means low level. For example, primitive data types ( http://en.wikipedia.org/wiki/Primitive_data_type ).
So given that, how do you come to the conclusion that prototypes are more primitive than classes?
Re: JSX - a faster, safer, easier alternative to JavaScript
#25Earlier quoted context omitted.
I'm not saying you're wrong, but isn't this a bit like saying that files are overly complex because they can be used to simulate sockets?
It is, but on the other hand if you write code to work with sockets then you get a performance boost on spinning disks because your IO is sequential. And many other benefits like trivial cache prediction, buffering, etc. I do think that prototypes have useful properties, but I'm not sure that a prototype isn't a form of an open class. I tend to think that the biggest problem with prototypes in js is the interface.
Re: JSX - a faster, safer, easier alternative to JavaScript
#26Earlier quoted context omitted.
So given that, how do you come to the conclusion that prototypes are more primitive than classes?
Just as you said yourself: classes can be simulated with prototypes and are therefore higher level than prototypes. In other words, prototypes are lower level (more primitive) than classes.
Re: JSX - a faster, safer, easier alternative to JavaScript
#27Re: JSX - a faster, safer, easier alternative to JavaScript
#28Earlier quoted context omitted.
Just as you said yourself: classes can be simulated with prototypes and are therefore higher level than prototypes. In other words, prototypes are lower level (more primitive) than classes.
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?
Actually it's a rule of hacks, isn't it? If it can exist... https://www.youtube.com/watch?v=QsZrD622qf0
Re: JSX - a faster, safer, easier alternative to JavaScript
#29function foo(bar : string) : string... Why, why do we need unnecessary tokens?! Get rid of the stupid :'s.
Re: JSX - a faster, safer, easier alternative to JavaScript
#30Earlier quoted context omitted.
It would seem as though prototypes are the more expressive option if you can use them to simulate classes. In fact, one could argue that this is essentially what Python does. ...but the OP seemed to indicate that prototypes were "primitive", and it sounds like you agree with him. Are you trying to say something that I'm missing?
That's not what expressiveness means. Classes can be simulated in assembly but assembly isn't very expressive.