POV-Ray : Newsgroups : povray.off-topic : Games programmers : Re: Games programmers Server Time
10 Oct 2024 15:16:16 EDT (-0400)
  Re: Games programmers  
From: Invisible
Date: 12 Sep 2008 03:55:36
Message: <48ca2078$1@news.povray.org>
>> I prefer the Eiffel way, where the compiler looks at your program and 
>> automatically decides which things can be bound statically (with all the 
>> optimisations that follow), and which things actually require dynamic 
>> binding.
> 
>   That's incompatible with precompiled and dynamically loadable libraries.

It's certainly incompatible with dynamic loading. I don't see a problem 
with precompiled code though. (Provided the precompiled code isn't just 
a blob of executable data but actually contains enough metadata.)

>   I have always wondered why so many "fancy" languages seem to completely
> disregard the idea of dynamically loadable libraries.

Because it's a tricky thing to get right? IDK.

Certainly the Java guys love to scream and shout about how easy this is 
in Java. Which is amusing, because actually it *isn't* especially easy. 
You still have to write a heap of code yourself to make this possible...

As an aside... does anybody here know anything about how Windoze DLLs 
actually work?

>> Does it actually build a seperate copy of the function for each data 
>> type, or just build one generic version that works with all of them?
> 
>   How could it use one generic function for all possible data types,
> given that the data types can have different sizes and even have completely
> different implementations for their operators, etc?

Plain ordinary OOP manages to do this without difficulty. (Argue 
amoungst yourselves about how *efficient* it is, but it works.)

>   One common misconception people have about templates is that they
> increase the size of the executable because the functions are created
> for each used type. However, this is only true in some cases.
> 
>   If they were template functions, however, the ones which are never
> called are never instantiated.
> 
>   Inlining can also help reducing the size of the executable, besides
> making the program faster.
> 
>   The great thing about templates is that the compiler is able to optimize
> the code on a per-type basis.

...so templates are like a kind of less-stupid macro expansion system?

(Everybody *talks* about how great templates are, or how much templates 
suck, but few people ever say what they *are*.)

>>>   Yes, debug checks are nice. They are nicer if you can turn them off
>>> for a final release.
> 
>> There is certainly something to be said for that.
> 
>> The problem is that, certainly with C anyway, there's no switch to turn 
>> it ON in the first place. :-(
> 
>   It depends on the compiler. Some compilers do insert checks in debug
> mode.

Mmm, OK. Well my only experience with writing C is Borland's C compiler 
for MS-DOS. (Actually, that's a lie. It was a C++ compiler, but we only 
wrote C.)

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.