Chipmunk2D has been ported to the D programming language

Share your projects and Chipmunk enhancements.
Post Reply
drey08
Posts: 15
Joined: Mon Oct 28, 2013 10:55 pm
Contact:

Chipmunk2D has been ported to the D programming language

Post by drey08 »

There was already a previous port but which got out of date. In the meantime a new port has been created. Read all about it in the newsgroup post here:

http://forum.dlang.org/thread/mailman.1 ... emagic.com

The announcement above is copied here verbatim:

https://github.com/AndrejMitrovic/dchip

What is Chipmunk2D?
===================

Chipmunk2D[1] is a 2D rigid body physics library distributed under the
MIT license. It is intended to be blazingly fast, portable,
numerically stable, and easy to use. It’s been used in hundreds of
games across just about every system you can name. This includes top
quality titles such as Night Sky for the Wii and many #1 sellers on
the iPhone App Store.

Chipmunk2D is platform-independent and has no dependencies, other than
for its test-suite which requires the GLFW library.

[1] : http://chipmunk-physics.net/release/Chi ... test-Docs/

What is DChip?
==============

DChip[1] is a direct D2 port of the C library without any API changes.
This ensures the documentation and tutorials for Chipmunk2D can be
used with DChip with very little to no changes in code. See more
information and building instructions at its github[1] page.

Note: There was a previous effort at porting the Chipmunk2D library to
D called Chipmunkd[2], which was implemented by Stephan Dilly.
Chipmunkd targets an older v5.3.5 version of Chipmunk2D and can be
found at its bitbucket[2] page.

[1] : https://github.com/AndrejMitrovic/dchip
[2] : https://bitbucket.org/Extrawurst/chipmunkd

DChip targets the latest Chipmunk2D version (currently v6.2.1) and
includes its GLFW-based test-suite which was ported to D.

Why a port and not a binding?
=============================

There are a number of reasons why a port was made and why it can be beneficial:

- The C library is relatively small, clocking in at about ~11.000
lines, + ~8.000 lines of test-suite code.
- With a port there's no need to worry about exception propagation
across language barriers.
- Less dependencies on external binaries or the requirement to build C
code with another compiler.
- Potential inlining opportunity.
- A physics library could be a good test to benchmark the various D compilers.
- The D codebase can serve as starter code for someone wanting to
implement their own physics library in D. The permissive MIT license
allows anyone to use the code for whichever purpose they may have.

https://github.com/AndrejMitrovic/dchip

Cheers!
drey08
Posts: 15
Joined: Mon Oct 28, 2013 10:55 pm
Contact:

Re: Chipmunk2D has been ported to the D programming language

Post by drey08 »

drey08 wrote: - The C library is relatively small, clocking in at about ~11.000
lines, + ~8.000 lines of test-suite code.
Btw, I did not mean this in terms of how hard it was to implement the C library (it was a huge undertaking, no doubt about that). I've ported C codebases before in excess of 50K lines, so compared to those libraries Chipmunk2D was much easier to port for me.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Chipmunk2D has been ported to the D programming language

Post by slembcke »

Awesome work. (I got your fixes merged into mainline Chipmunk as well.)

Is the following link the one I should add to the Bindings and Ports page?
https://github.com/AndrejMitrovic/dchip
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
drey08
Posts: 15
Joined: Mon Oct 28, 2013 10:55 pm
Contact:

Re: Chipmunk2D has been ported to the D programming language

Post by drey08 »

slembcke wrote:Awesome work. (I got your fixes merged into mainline Chipmunk as well.)

Is the following link the one I should add to the Bindings and Ports page?
https://github.com/AndrejMitrovic/dchip
Yup. Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests