Programming Language for Games, part 3

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Tue Nov 4 00:26:35 PST 2014


On 2014-11-01 12:31, bearophile wrote:
> Third part of the "A Programming Language for Games", by Jonathan Blow:
> https://www.youtube.com/watch?v=UTqZNujQOlA
>
> Discussions:
> http://www.reddit.com/r/programming/comments/2kxi89/jonathan_blow_a_programming_language_for_games/
>
>
> His language seems to disallow comparisons of different types:
>
> void main() {
>      int x = 10;
>      assert(x == 10.0); // Refused.
> }
>
>
> I like the part about compile-time tests for printf:
> http://youtu.be/UTqZNujQOlA?t=38m6s
>
> The same strategy is used to validate game data statically:
> http://youtu.be/UTqZNujQOlA?t=55m12s
>
> A screenshot for the printf case:
> http://oi57.tinypic.com/2m5b680.jpg
>
> He writes a function that is called to verify at compile-time the
> arguments of another function. This does the same I am asking for a
> "static precondition", but it has some disadvantages and advantages. One
> advantage is that the testing function doesn't need to be in the same
> module as the function, unlike static enums. So you can have the
> function compiled (separated compilation). Perhaps it's time for DIP.

LLVM has a JIT compiler, LDC uses LLVM. Perhaps time to see if it's 
possible to use the JIT compiler for CTFE.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list