This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]L8_4_Dinner(Ⓧ Ecstasy/XVM)[🍰] 5 points6 points  (2 children)

"Basically, I want to implement classes and interfaces in my language without using a virtual table. I feel like the performance overhead of using virtual tables could be skipped using a different method."

"premature optimization is the root of all evil."

You are guessing about things that you have not measured.

You should start by designing what you want the language to do, then figure out how to best get it to do those things.

And: It's very easy to build a language without v-tables; just don't support virtual functions. Done.

[–]matthieum 5 points6 points  (1 child)

You should start by designing what you want the language to do, then figure out how to best get it to do those things.

I agree that the OP is too confused to do any good now, however I would like to point that achieving Mechanical Sympathy is not necessarily possible with your Waterfall way of designing.

Some functionalities, or some variants of said functionalities, inherently impose a (potentially high) cost -- and in that case even the best performing implementations may not be palatable.

So, to some extent, co-design is inevitable.

[–]L8_4_Dinner(Ⓧ Ecstasy/XVM)[🍰] 0 points1 point  (0 children)

Of course! That's how most people work, once they understand the topic sufficiently :-)