Chipmunk2D has been ported to the D programming language

Share your projects and Chipmunk enhancements.

Chipmunk2D has been ported to the D programming language

Postby drey08 » Sun Nov 03, 2013 3:23 pm

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

Re: Chipmunk2D has been ported to the D programming language

Postby drey08 » Sun Nov 03, 2013 3:27 pm

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.
drey08
 
Posts: 15
Joined: Mon Oct 28, 2013 10:55 pm

Re: Chipmunk2D has been ported to the D programming language

Postby slembcke » Tue Nov 05, 2013 6:13 pm

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/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Chipmunk2D has been ported to the D programming language

Postby drey08 » Tue Nov 05, 2013 9:01 pm

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!
drey08
 
Posts: 15
Joined: Mon Oct 28, 2013 10:55 pm


Return to Community Creations

Who is online

Users browsing this forum: No registered users and 1 guest

cron