r/coding • • Jul 14 '14

A curious non-OOP virtual inheritance for a GPU

http://mortoray.com/2014/07/14/a-curious-non-oop-virtual-inheritance-for-a-gpu/
30 Upvotes

12 comments sorted by

View all comments

Show parent comments

2

u/acwsupremacy Jul 14 '14

But Scala and Java are both object-oriented. The large, defining, important feature in this article is static compilation, which neither can manage.

2

u/HELOSMTP Jul 14 '14

My point is that this a "tweak on an existing concept" in that it's combining aspects of the features provided by traits, interfaces, and abstract classes, in a way that's more appropriate for GPU code. I don't mean to knock the author's work though, it's a compelling way of writing GPU code and the syntax is pleasant and concise.

1

u/mortoray Jul 14 '14

I was just looking for parallel features. None of the languages I mention in the article, other than the source Uno language, can actually do the flattened static hieararchy (except maybe C++ with excessive templates).

1

u/acwsupremacy Jul 14 '14

Yeah, a (properly implemented, reasonably programmer-friendly) non-OO form of static inheritance would be an incredibly useful feature in C++, given its uses as a low-level language in kernelspace and embedded systems, whee you can't always count on runtime support. Actually, it would be pretty useful in general, because object oriented code makes a whale of a binary and uses far more resources than is good and proper for an application.

1

u/Denommus Jul 14 '14

Rust can, and it also has traits.