Shop OBEX P1 Docs P2 Docs Learn Events
Parallax seeking contractor to convert Spin/ASM to C/ASM for Scribbler 3 Robot — Parallax Forums

Parallax seeking contractor to convert Spin/ASM to C/ASM for Scribbler 3 Robot

Ken GraceyKen Gracey Posts: 7,392
edited 2016-09-23 23:04 in General Discussion
Parallax Seeks Coder for Spin/PASM to C/PASM Conversion for S3 Robot

We are seeking a contractor who would complete a direct and feature-equivalent port from Spin/PASM to C/PASM for the S3 robot code base. The BlocklyProp system for programming the S3 would stay the same on the surface but we would modify the blocks to support equivalent C code generation on our demo system. To see the top-level Spin code created by Blockly, create an S3 program in blockly.parallax.com and click on view - code. All of the underlying Spin/PASM files used are the “Scribbler Default V2579.zip” listed in the S3 Open Source Files download link below. The inclusion of the PASM code would be directly included in the C environment. The translated Spin to C code base would be fully tested and included as part of our Simple Libraries distribution and of course be used in the Blockly system.

When finished and integrated into Blockly, customers would be able to copy their C code from Blockly and edit it in Simple IDE (provided their Simple IDE libraries match what’s hosted on the Parallax Blockly server). In the future, Parallax may also have a cloud editor for C programming that connects with Blockly (managing the libraries on a single location in a server ensures a functional experience all the time).

Additional Requirements:
- All work would be done in the open in our S3 robot GitHub library.
- Project start date by second week of October; completion by end of October.
- Parallax to provide one or two staff for feedback along the way.
- Parallax to provide a sample S3 robot.
- Experience with Parallax’s C and Spin programing environments.
- Experience programming the Propeller Multicore Microcontroller.
- Submit your time and materials estimate to be provided to Parallax with a +/- 20% accuracy.
- USA domestic or international applicants are welcome.
- Progress payments of 50% accepted on weekly invoices; paid in full upon successful completion of the project.

Resources:

Submit your qualifications and interest to Ken Gracey kgracey@parallax.com by September 30, 2016. Title your e-mail “Spin/PASM to C/PASM for S3 Robot”. We will make a decision and communicate with interested parties by the beginning of the following week.

Thanks,

Ken Gracey
«134

Comments

  • Ummm... proposals need to be submitted by October 30th but the work is to start in the second week of October and be finished by the end of October? Did you mean to say September 30th for proposals?
  • Yes! I shall edit that. Thank you David! KG
  • DavidZemonDavidZemon Posts: 2,973
    edited 2016-09-24 00:31
    Post redacted. I see Spin2Cpp is even listed as a resource.

    So what specifically are you looking for that is not provided by Spin2Cpp? I would bet it took you longer to write the above post than it would have taken to run Spin2Cpp.
  • jmgjmg Posts: 15,173
    DavidZemon wrote: »
    So what specifically are you looking for that is not provided by Spin2Cpp? I would bet it took you longer to write the above post than it would have taken to run Spin2Cpp.

    I suspect Ken is looking for testing and proof of operation ?

    All Translators are rarely 100.00%, but such a project may also allow improvements in Spin2Cpp, and sometimes it can also reveal rules to apply to the originating source, that helps reduce editing.

  • Are we sure he expects the job to be done with spin2cpp? Maybe he wants the sources hand-translated so they are more readable and maintainable. I know spin2cpp does a pretty good job but maybe they're looking for more?
  • David Betz wrote: »
    Are we sure he expects the job to be done with spin2cpp? Maybe he wants the sources hand-translated so they are more readable and maintainable. I know spin2cpp does a pretty good job but maybe they're looking for more?

    That's a big part of what I was wondering. I would imagine he carefully chose not to request that the developer use Spin2Cpp so that the choice is left up to the developer. But that means Spin2Cpp is at least an option. And if it's an option, then I want to know what kind of improvements (if any) will be expected. I would think Ken or Andy or someone else at Parallax could run Spin2Cpp over the source code in less time than it took to write this forum thread, and then all they'd need to do is spend 15 minutes playing with the S3 to make sure all the features still work. All in all, it'd take less of Parallax's time to do it themselves than to read a few proposals, file the paperwork for a 1099 contractor, and review the proposed solution.

    But I also know that no one at Parallax is so naive... so clearly there is something bigger that they are expecting a contractor to do for them, and that's what I want to know.
  • 4 weeks barely seems long enough for that kind of project ... If it were me, I would charge no less than $29k a month ... that's roughly $120 per hour for 30 days @ 8 hours a day. Because it's contract, nearly half of that goes away in taxes anyway.
  • Ken,

    Does this project include modifying the Blockly blocks to generate C/C++ code in addition to Spin or is that part of the project being handled by someone else?

    Thanks,
    David
  • Translator or not? Your choice.

    We will handle the Blockly details.

    No need for enhancements - just a straight translation. There is nothing else needed beyond what we requested above.

    Ken Gracey

  • Ken Gracey wrote: »
    Translator or not? Your choice.

    We will handle the Blockly details.

    No need for enhancements - just a straight translation. There is nothing else needed beyond what we requested above.

    Ken Gracey
    Thanks for the update. Now I guess we just need to wait to see if anyone bids less than Beau's $29K! :-)

  • Ken,

    Is C++ conversion okay, or are you expecting pure C?
  • DavidZemon wrote: »
    Ken,

    Is C++ conversion okay, or are you expecting pure C?
    I would think that C++ would match the Spin better.

  • ercoerco Posts: 20,256
    David Betz wrote: »
    Thanks for the update. Now I guess we just need to wait to see if anyone bids less than Beau's $29K! :-)

    $28,999.99! :)
  • I don't know if we want pure C or C++ yet. If you are interested in providing an estimate for this project is this a detail you'd like us to resolve at this stage?

    Thanks, Ken Gracey
  • Ken Gracey wrote: »
    I don't know if we want pure C or C++ yet. If you are interested in providing an estimate for this project is this a detail you'd like us to resolve at this stage?

    Thanks, Ken Gracey
    I assume everyone knows that, in spite of its name, spin2cpp can convert Spin to either C++ or C.

  • DavidZemonDavidZemon Posts: 2,973
    edited 2016-09-24 21:29
    Ken Gracey wrote: »
    I don't know if we want pure C or C++ yet. If you are interested in providing an estimate for this project is this a detail you'd like us to resolve at this stage?

    Thanks, Ken Gracey

    Yes. I won't be submitting a proposal if it is required to be done in C. This would be a "just for fun" thing for me, and it wouldn't be as fun in C.
    David Betz wrote: »
    Ken Gracey wrote: »
    I don't know if we want pure C or C++ yet. If you are interested in providing an estimate for this project is this a detail you'd like us to resolve at this stage?

    Thanks, Ken Gracey
    I assume everyone knows that, in spite of its name, spin2cpp can convert Spin to either C++ or C.

    Probably. I haven't tried using the C option yet, but I have confirmed that Spin2Cpp is not able to convert the source as provided. Bugs reported here.

    I worked through those issues and attempted a compile and am getting more errors (using a version of PropGCC 4 from March of this year)
    /opt/parallax/bin/propeller-elf-gcc       -o CMakeFiles/scribbler.dir/scribbler.cpp.obj -c "/home/david/Desktop/S3 Open Source/Software/scribbler.cpp"
    /tmp/cceRuv1f.s: Assembler messages:
    /tmp/cceRuv1f.s:1822: Error: bad expression
    /tmp/cceRuv1f.s:1822: Error: missing ')'
    /tmp/cceRuv1f.s:1822: Error: junk at end of line, first unrecognized character is `D'
    /tmp/cceRuv1f.s:549: Error: attempt to move .org backwards
    /tmp/cceRuv1f.s:837: Error: attempt to move .org backwards
    /tmp/cceRuv1f.s:1319: Error: attempt to move .org backwards
    

    So, I'm updating spin2cpp and PropGCC, and I'll try using the version of PropGCC shipped with SimpleIDE too.... but I'm starting to understand why Parallax hasn't done this themselves already :)
  • We haven't done this because we're all booked, not because we figured it wouldn't be possible. We realize, though, that there's always more to the project than running the code through a converter. - Ken
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2016-09-24 21:44
    erco wrote:
    $28,999.99!
    $28,999.98! Heck, for that much even I could hold my nose to write C code! :)

    -Phil

    Edit: No, not really. Work has to be fun as well as remunerative.
  • I'd like to make an offer that involves little or no money but a donation of a bunch of S3 robots to my local school. I guess I'll have to figure out first how to find out if they would be able to make use of them and how many they would need.
  • We're looking for straight C for this project. Blockly is already configured for C and we're not ready to explain the difference to very first-time programmers.

    You guys sure talk a lot about this little project - let's see some action!

    Ken Gracey
  • Latest version of spin2cpp and PropGCC 4 from my build server still do not compile. Combine that with the C regulation and I'm out. Good luck all and have fun :)
  • The field is narrowing already? Should we launch another project to get spin2cpp repaired?

    I received one reply with an estimate already, but that person didn't even look at the Spin code base. How could anybody come up with a very approximate cost (+/- 20%) without even knowing how much code conversion is required?

    We just may have to award this project to Beau Schwabe for $30,000 after all.

    Ken Gracey
  • Ken, I'll send you an email with my proposal in a few minutes.
  • Ken,

    Honestly that rate is not unreasonable for contract work ... I just took what I charge and propagated that out to 30 days at 8 hours a day.

    I have two contract jobs right now that I am charging the same $120 per hour rate. After taxes and everything else, a contractor will only see about half of that amount anyway.
  • I have two contract jobs right now that I am charging the same $120 per hour rate.
    Dang! I'm working too cheap. Haven't changed my rates in years. I'm still not "worth" what lawyers charge, though. :)

    -Phil
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2016-09-25 04:47
    Ken,

    Honestly that rate is not unreasonable for contract work ... I just took what I charge and propagated that out to 30 days at 8 hours a day.

    The hourly rate is quite common, but too high for most work we hire out especially when a contractor/Parallax relationship is new.

    Just to clarify - I have the impression some may think the 30 days of work is based working full time on this project for the duration of the window I provided. The schedule I provided is intended to accommodate a contribution from people who are likely already committed. Usually, capable engineers and coders are already productive, employed, and wouldn't allocate 30 days of full time work when a new project is sprung on them as we have done.

    Ken Gracey
  • I have two contract jobs right now that I am charging the same $120 per hour rate.
    Dang! I'm working too cheap. Haven't changed my rates in years. I'm still not "worth" what lawyers charge, though. :)

    -Phil

    And because you are reasonable and very productive we also have many projects together.

    Ken Gracey
  • Ken's project description says that the job will start in the second week of October and be finished by the end of October. That is three weeks so it seems Beau's calculation is wrong since 3 * 5 * 8 * $120 = $14,400 not $29k. Also, a month is not 30 work days unless you plan to work weekends as well. Of course, that could be necessary on a project with a tight schedule.
  • A very interesting thread :). Thanks to @DavidZemon for reporting the spin2cpp problems he encountered. I've fixed some of those in the current master branch in Git, and scribbler.spin compiles now with spin2cpp and the default settings. Using --gas to preserve the PASM code does not work yet, nor have I actually tested that the code converted without --gas works (I don't have a robot to test with).

    That said, spin2cpp could only be a starting point. Its output isn't the high quality C code that Parallax and its customers would expect. The results of spin2cpp is designed mainly to be correct, and only secondarily to be idiomatic C. I think there are at least the following failings that anyone planning to produce educational materials from the spin2cpp output would need to correct:
    (1) Without --gas, DAT sections are turned into binary blobs
        (not maintainable)
    (2) With --gas:
        (a) Comments in PASM code are lost
        (b) Only one .org is allowed per DAT
        (c) CON defines are repeated in the assembly code rather
            than being re-used from the header
    (3) Code only uses one type (int32_t) cast to pointer as necessary;
        idiomatic C would use pointer types from the start
    (4) Some code (e.g. for starting a cog with Spin method) relies on
        features of more recent GCC + libraries, and will have to be ported
        to SimpleIDE's older version
    (5) case statements should be translated to switch/case if all labels
        are constant, instead of if/then/else as spin2cpp does
    (6) Access to labelled data in DAT section is awkward from C (lots of
        weird casts). It would be better if the DAT came out as a struct.
    (7) Local variable names get lost when spin2cpp decides it has to
        force the variables into a local array (for example if the address
        of a local variable is taken)
    
  • WhitWhit Posts: 4,191
    Excited about this idea!
Sign In or Register to comment.