C!! — More Contract specifics...

A couple of friends pointed out that contracts really need to support true duck-typing to be useful in all circumstances. (Not everyone cares all the time about ultra-high performance code). Yet I still want to make sure that they’re high performance if you want to pass them around as types. So let’s see if we can find a happy medium.

(more...)

C!! — Mappings, Versioning and the Transformation Assignment operator in the C bang bang programming language

A mapping in C!! is the definition of a transformation between two types or two contracts (and, by extension, define mappings between two types that honor the contracts in the mapping). Boy, that’s a mouthful. Oh, and I’m not done figuring out the syntax for this – so beware, it’s going to be very rough around the edges.

So let’s say you have Type A (or Contract A) and Type B (or Contract B).

You can define a mapping between them like this:

struct A
{
int a;
string firstname;
string lastname;
string middlename;
}

struct B
{
float value;
string firstname;
string middlename;
string lastname;
string playaname;

}

loose * mapping A ==> B
{
value = (float)in.a;
}

loose * mapping B ==> A // this is the reverse mapping
{
a = (int)in.value;
}

(more...)

C!! — Contracts, Duck-Typing and the Transformation Assignment Operator in the C bang bang programming language

One of the features I’d like to add to C++ is duck-typing. In this case, what I mean is, if an object has all of the named methods or variables you care about, you can treat it as “one of those things”.

The way you specify what an object has to have for it to be of a given duck-type is through a contract. Here’s an example of one:

contract(loose) PhysicsComponentContract
{
   vector3 position;
   vector3 velocity;
   float mass;

   void UpdatePhysicsState( float deltaT );
}

(more...)

C!! — Striped Pointers, Structures-of-Arrays and Arrays-of-Structures in the C bang bang programming language

Let’s start this ballgame out with something close to my heart – structures of arrays versus arrays of structures.

It’d be great if there was a good way of implementing these in a nice, succinct, low-cost fashion. Preferably without having to define multiple different structures to do it, or jump through too many crazy hoops.

So what can we come up with?

(more...)

C!! — A C++ Variant For High Performance Programming (aka C bang bang)

So for a while now I’ve been talking about designing my own variant of C++ for videogames (in particular), but also for software development in general that targets heavy SIMD instruction use, is highly cache aware, and can be used to target specific processor architectures at compile time. The idea is to throw away some of the cruft from C++, and bring in some new features.

I started thinking about this in 2009 (the elements had all been there as far back as 2006, as I’d have long discussions with John Cuyle when we worked at Surreal about language design, and how C++ was basically hitting a wall unless it evolved – some of the features I wanted were really language features). I had a few discussions with Rebecca Heinemann, Adam Schaeffer, Kev Gee and David Tuft when we worked together in ATG about it, and Jason Weiler as well. And for a while I just let it simmer. About 5 years.

Some of this was spurred on by Jonathan Blow’s recent talk where he discussed some ideas that cross its path, and more still by Mike Acton’s recent CppCon talk. So I think it’s an idea whose time has come.

(more...)

#language design, #C++, #games programming, #high performance, #cache-aware, #C bang bang
This entry was posted under Software Development. Bookmark the permalink.

subscribe via RSS