News for hackers. Stuff that matters.
Re:TruffleC: A C implementation on top of JVM (2014) by chrisseaton on Friday August 12, 2022 @05:06AM (#32436104)
A class wrapping a long value with the pointer address in it.
Re:TruffleC: A C implementation on top of JVM (2014) by sitkack on Friday August 12, 2022 @05:25AM (#32436215)
Ha! Your paper is a "highly influential citation"

https://www.semanticscholar.org/paper/TruffleC%3A-dynamic-ex...

Re:TruffleC: A C implementation on top of JVM (2014) by chrisseaton on Friday August 12, 2022 @06:17AM (#32436473)
The side-bar says 'highly influential' but the badge lower down says 'highly influenced' which sounds like a bad thing doesn't it?
Re:TruffleC: A C implementation on top of JVM (2014) by forgotpwd16 on Friday August 12, 2022 @02:24PM (#32442190)
Probably meant as "[this paper has] highly influenced [citing paper]".
Re:TruffleC: A C implementation on top of JVM (2014) by sitkack on Friday August 12, 2022 @05:19PM (#32444047)
Semantic Scholar is calling out when it thinks the researchers were using drugs.
Re:TruffleC: A C implementation on top of JVM (2014) by MaxBarraclough on Friday August 12, 2022 @05:12AM (#32436137)
How is the C memory modelled? One big Java array, or are there multiple data-structures?

For instance, what happens when you call a function-pointer?

Re:TruffleC: A C implementation on top of JVM (2014) by chrisseaton on Friday August 12, 2022 @06:11AM (#32436436)
> How is the C memory modelled?

Using a combination of native memory and JVM managed memory, depending on what the memory is needed for.

> For instance, what happens when you call a function-pointer?

This is a good example - because TruffleC can inline-cache a function-pointer, inlining the called function!

All this is in the linked paper, of course.

Re:TruffleC: A C implementation on top of JVM (2014) by aardvark179 on Friday August 12, 2022 @05:41AM (#32436288)
It can be done in a few different ways. Native memory can be managed as plain native memory (under the hood you can use Unsafe to access that memory) but the real advantage is that pointers to many objects can be kept as managed pointers and not converted to a native value most of the time. For example Ruby C extensions often use VALUEs to refer to Ruby objects which are normally tagged pointers. In TruffleRuby we use ValueWrapper objects to represent these, and maintain a fast map between native values and these objects when necessary.