Only 7% slower seems amazing. To me at least.
The JVM runtinme is not easy to beat performance-wise for what it does, wonder how many man-hours have been put by Sun, Oracle et al into the platform itself.
TruffleC: A C implementation on top of JVM (2014)
11–20 of 93 posts
Re: TruffleC: A C implementation on top of JVM (2014)
#12Re: TruffleC: A C implementation on top of JVM (2014)
#13How are pointers implemented in a language that doesn't support them?
Re: TruffleC: A C implementation on top of JVM (2014)
#14Earlier quoted context omitted.
The JVM runtinme is not easy to beat performance-wise for what it does, wonder how many man-hours have been put by Sun, Oracle et al into the platform itself.
The JVM is an absolutely beautiful constructed software and protocol. I hope it stands for millennia, just like the colosseum, even if not in active use.
Re: TruffleC: A C implementation on top of JVM (2014)
#15Earlier quoted context omitted.
The JVM runtinme is not easy to beat performance-wise for what it does, wonder how many man-hours have been put by Sun, Oracle et al into the platform itself.
The JVM is an absolutely beautiful constructed software and protocol. I hope it stands for millennia, just like the colosseum, even if not in active use.
With projects like loom, valhalla, graalVM, JVM/Java is everything a modern language/runtime needs, plus a lot lot more.
I frankly believe the only other commercially viable language that has similar philosophy to JVM development, is Rust.
Opinions?
Re: TruffleC: A C implementation on top of JVM (2014)
#16Re: TruffleC: A C implementation on top of JVM (2014)
#17How are pointers implemented in a language that doesn't support them?
I would hope that there's a much more efficient way to do it, this idea is just evidence that it could be done in principle. But I don't see what that more efficient way would be. You certainly need to keep a secret reference to each JVM object somehow because C doesn't require you to keep any pointer to an object e.g.
intptr_t x = (intptr_t)malloc(sizeof(int));
*(int*)x = 99;
bool did_subtract_50 = false;
if (x > 50) {
did_subtract_50 = true;
x -= 50;
}
// Now there is no pointer or even integer that contains the address
// ... later ...
// Retrieve the address and use and free it
int* y = (int*)(x + 50 * did_subtract_50);
printf("value: %d\n", *y);
free(y);Re: TruffleC: A C implementation on top of JVM (2014)
#18Earlier quoted context omitted.
The JVM runtinme is not easy to beat performance-wise for what it does, wonder how many man-hours have been put by Sun, Oracle et al into the platform itself.
The JVM is an absolutely beautiful constructed software and protocol. I hope it stands for millennia, just like the colosseum, even if not in active use.
Re: TruffleC: A C implementation on top of JVM (2014)
#19How are pointers implemented in a language that doesn't support them?
A class wrapping a long value with the pointer address in it.
https://www.semanticscholar.org/paper/TruffleC%3A-dynamic-ex...