Has anyone looked into Jai?

For other topics related to the FreeBASIC project or its community.
anonymous1337
Posts: 5494
Joined: Sep 12, 2005 20:06
Location: California

Re: Has anyone looked into Jai?

Postby anonymous1337 » Jan 10, 2019 19:07

caseih wrote:Of course one could dynamically allocate memory and fill it with the table values at run time, but maybe that is too costly. I dunno.

It is 100% too costly. You're trying to run a game at 30 - 60 FPS that has buffers and caches for a ton of different things. You might have thousands upon thousands of entities going in and out of memory at once.

Much easier to just allocate a fixed-sized buffer for all of these things and take up slots or remove slots from that pre-allocated memory as available. Also, the same similar data is processed, it is often a huge optimization for them to be in the same linear memory sequence. Reduced lookups and allocations.

And you do something like clear this bank at the end of every engine loop cycle. That has a cost, but it's apparently way less than the cost of dynamic allocation in the middle of processing critical execution frames.
marcov
Posts: 3011
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Re: Has anyone looked into Jai?

Postby marcov » Jan 10, 2019 19:47

Even in static languages this happens. E.g. most of the more serious Delphi expression evaluators generate code for the equation and then jump to it (repeatedly) for evaluation.

It does Πss off antivirusses though. I assume many of the JIT languages also allow to call the JIT to compile an assembly to memory.

Metaprogramming comes back every few years as a the next big thing, just like functional languages, but with even less success.

I agree with Caseih, with something to look at and benchmark it is not worth the attention. The fine points of language designs are in the details and balancing, not in grandiose statements and principles
caseih
Posts: 1536
Joined: Feb 26, 2007 5:32

Re: Has anyone looked into Jai?

Postby caseih » Jan 11, 2019 1:05

anonymous1337 wrote:It is 100% too costly.
Poor choice of words on my part. I'm not talking about allocating and releasing memory constantly. I'm talking about the populating of the table values. Memory could very well be statically allocated. Except for the setup time, everything else would be same performance-wise. In other words, what does compile-time execution actually buy us? What are the use cases for this feature? That's what I was getting at.

Return to “Community Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests