Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 4
    Your last paragraph actually supports the exact opposite of what you are saying: V8 proves that you do not need classes in the language in order to compile to efficient class-based code.CommentedFeb 1, 2015 at 11:10
  • 4
    Yes, you don't need them - but the fact that V8 (and presumably Self, although I haven't read as much about the design of that system) effectively creates virtual classes means that starting from a language that natively uses classes is almost certainly easier, and would therefore probably end up with the JIT needing to spend less time compiling the code.
    – Jules
    CommentedFeb 1, 2015 at 11:19
  • 11
    Sure, and the fact that V8 effectively creates GOTOs and registers means that just giving up all abstractions and writing directly in assembly is almost certainly easier, and would therefore probably end up with the JIT needing to spend less time compiling the code. It's the job of a compiler to support higher-level abstractions.CommentedFeb 1, 2015 at 11:45
  • 1
    Yes, but its a trade-off, as the higher level abstraction is in most cases harder to implement and often has a run-time performance penalty, especially when working with a JIT rather than an AOT compiler. I suspect that many language designers pick a class-based structure for one or both of those reasons; I know that's why I chose classes with fixed members for the (otherwise dynamic) language I'm working on, but can only speculate about other languages.
    – Jules
    CommentedFeb 1, 2015 at 13:35
  • 2
    I'd argue that the only way programmers prefer "thinking in classes" is because that's how most of us are taught. I can definitely remember a lot of my fellow students in college who had trouble grasping and understanding some really fundamental Object-Oriented concepts for several years, though. It only seems obvious and easy in hindsight.
    – KChaloux
    CommentedFeb 2, 2015 at 16:40

close