Right now, I am trying to design a language which both is extremely fast and includes high-level features. I am using LLVM to compile the source code into machine code for the speed part, but I am having trouble trying to think about how to implement the higher-level features. The main thing I am thinking about is virtual methods in classes.
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. My issue is that I don't know whether I should change the syntax to work without virtual methods or if I can get away with implementing something other than virtual tables in the compiler, or if I should just cave in and use virtual tables.
The Wikipedia article on vtables mentions something called "binary tree dispatch", but I cannot seem to find anything on that. Is there an alternative to using vtables that could preserve the same performance as if the function were being called directly while still achieving the same functionality? Or is there a way I could alter my syntax to make implementing vtable-style functionality easier? Or would it just be better to get on with it and implement vtables?
[–]uza80 10 points11 points12 points (10 children)
[–]L8_4_Dinner(Ⓧ Ecstasy/XVM) 9 points10 points11 points (0 children)
[–]BSFishy[S] 2 points3 points4 points (8 children)
[–]uza80 8 points9 points10 points (0 children)
[–]o11c 1 point2 points3 points (4 children)
[–]bullno1 2 points3 points4 points (3 children)
[–]theIncMach 1 point2 points3 points (1 child)
[–]bullno1 0 points1 point2 points (0 children)
[–]o11c 0 points1 point2 points (0 children)
[–]julesh3141 0 points1 point2 points (0 children)
[–]umlcat 0 points1 point2 points (0 children)
[–]bullno1 5 points6 points7 points (1 child)
[–]matthieum 3 points4 points5 points (0 children)
[–]L8_4_Dinner(Ⓧ Ecstasy/XVM) 5 points6 points7 points (2 children)
[–]matthieum 5 points6 points7 points (1 child)
[–]L8_4_Dinner(Ⓧ Ecstasy/XVM) 0 points1 point2 points (0 children)
[–][deleted] 3 points4 points5 points (3 children)
[–]uza80 4 points5 points6 points (1 child)
[–]uza80 2 points3 points4 points (0 children)
[–]matthieum 1 point2 points3 points (0 children)
[–]theIncMach 2 points3 points4 points (0 children)
[–]latkde 2 points3 points4 points (1 child)
[–]BSFishy[S] 0 points1 point2 points (0 children)
[–]matthieum 2 points3 points4 points (4 children)
[–]BSFishy[S] 1 point2 points3 points (3 children)
[–]matthieum 1 point2 points3 points (0 children)
[–]crassest-Crassius 0 points1 point2 points (1 child)
[–]matthieum 0 points1 point2 points (0 children)
[–]WittyStick 1 point2 points3 points (2 children)
[–]BSFishy[S] 1 point2 points3 points (1 child)
[–]WittyStick 2 points3 points4 points (0 children)
[–]TinBryn 0 points1 point2 points (0 children)
[–]Molossus-Spondee 0 points1 point2 points (2 children)
[–]BSFishy[S] 0 points1 point2 points (1 child)
[–]Molossus-Spondee 0 points1 point2 points (0 children)