Shop OBEX P1 Docs P2 Docs Learn Events
Converting Prop C to Spin — Parallax Forums

Converting Prop C to Spin

I have a program written in prop c that I would like to convert to Spin. Can this be done and is it easy?

Comments

  • Have a look at [Dave Hein]'s CSPIN - A C-to-Spin Converter.

  • Why do you want to convert it to Spin? Is it so that you can use some Spin code with it (or to use some of its functions alongside Spin)? If so then you may want to look at FlexProp, which allows C and Spin (and BASIC) to all be used together. You can directly include a C file as a Spin object, for example.

    By default FlexProp produces PASM code, which is fast but large. Thanks to some nice work by @Wuerfel_21 FlexProp can now also emit Spin1 bytecode, which is much smaller (and still will be faster than the code produced by the "normal" Spin compiler).

  • I've converted lots of C (mostly Arduino) code to Spin. I find it best to do it by hand. While slower, it allows you to cleanly take advantage of Spin's unique features. And who's to say that the original C programmer had the best approach? :)

Sign In or Register to comment.