Conversation
Notices
-
@ninjawedding @verius @maiyannah Reminds me a bit of how !tcl chooses different in-memory representations of an object depending on how you use it.
-
"Array Layouts for Comparison-Based Searching": https://arxiv.org/pdf/1509.05053.pdf
One thing that I've had to repeatedly struggle with in gamedev is the importance of keeping the CPU fed with data. This usually means predictable memory access patterns and contiguous data structure layouts.
Unfortunately some very useful data structures -- maps, for instance -- are usually implemented in a way that are non-contiguous and don't have predictable access patterns. What do? Well, the easiest (and often quite sufficient) way is to maintain a array of (key, value) tuples, sorted on key, and binary-search it. There are other methods, though, and this paper is a neat survey of those methods.
Bonus: Section 2, "Processor Architecture Considerations", seems to me to be a pretty good overview of just how badly memory latency will slow your code down and the methods employed by CPUs to overcome that latency.
-
@ninjawedding @maiyannah http://wiki.c2.com/?AlternateHardAndSoftLayers is a time-honored tradition.
I haven't played with Lua, but it I were to use Lua and interface with C libraries, I would have a look at http://terralang.org/ , which looks very interesting.
I have to say though that Python's ctypes, which supposedly were inspired by Lua's C integration, work surprisingly well, at least for simple things. For the less-simple things, we have written a Dwarf parser at work, which can dynamically create the types by introspecting the debug data of the C code.
-
And by !tcl I mean !tcltk .