Shop OBEX P1 Docs P2 Docs Learn Events
Programing language advise: Spin or C? - Page 5 — Parallax Forums

Programing language advise: Spin or C?

1235»

Comments

  • David BetzDavid Betz Posts: 14,516
    edited 2014-02-16 16:09
    RossH wrote: »
    Yes, Catalina has a very rich set, and more get added regularly. But the point is not the C wrapper, as much as making the PASM component common to any language (not just Spin and C). That way, the Spin version can stay in the OBEX, and all high level languages can make use of any of them - they don't have to (as we both do now) create and maintain our own slightly modified copies.

    With the inclusion of a simple preprocessor in Spin (courtesy of openspin), this should now be even easier.

    Ross.
    I suppose it ought to be possible to use the Catalina wrappers in PropGCC as well. I guess I should try it. We could benefit from your work in porting OBEX objects.
  • RossHRossH Posts: 5,462
    edited 2014-02-16 16:28
    David Betz wrote: »
    I suppose it ought to be possible to use the Catalina wrappers in PropGCC as well. I guess I should try it. We could benefit from your work in porting OBEX objects.

    I don't think this is feasible, since the Catalina wrappers usually involve the registry (which you don't have). Even if the actual communication technique is a simple shared memory buffer, in Catalina the address of that buffer is found by interrogating the registry (usually only once, on package initialization). Once you have that address, the C code to actually use it can be a fairly trivial line-by-line translation of the Spin methods to C functions.

    I don't know what mechanism propGCC uses to do the same job - do you have fixed memory map somewhere? Does this have to be updated every time you add a new device?

    Ross.
  • David BetzDavid Betz Posts: 14,516
    edited 2014-02-16 16:33
    RossH wrote: »
    I don't think this is feasible, since the Catalina wrappers usually involve the registry (which you don't have). Even if the actual communication technique is a simple shared memory buffer, in Catalina the address of that buffer is found by interrogating the registry (usually only once, on package initialization). Once you have that address, the C code to actually use it can be a fairly trivial line-by-line translation of the Spin methods to C functions.

    I don't know what mechanism propGCC uses to do the same job - do you have fixed memory map somewhere? Does this have to be updated every time you add a new device?

    Ross.
    I guess the difference is that you load the COG PASM drivers before you start the C code. Is that correct? We typically just load the COG drivers as part of the initialization of the C wrappers. This is the way the Spin code typically works as well. Given that we don't need a registry. I knew you used the registry for HMI drivers but I guess I didn't know you used it for every driver.
  • RossHRossH Posts: 5,462
    edited 2014-02-16 17:25
    David Betz wrote: »
    I guess the difference is that you load the COG PASM drivers before you start the C code. Is that correct? We typically just load the COG drivers as part of the initialization of the C wrappers. This is the way the Spin code typically works as well. Given that we don't need a registry. I knew you used the registry for HMI drivers but I guess I didn't know you used it for every driver.

    I use the registry for every cog - driver, library or kernel, and whether I load them from Spin during run time initialization or later from C.

    Ross.
  • David BetzDavid Betz Posts: 14,516
    edited 2014-02-16 17:32
    RossH wrote: »
    I use the registry for every cog - driver, library or kernel, and whether I load them from Spin during run time initialization or later from C.

    Ross.
    I guess consistency is good. So are you saying you have to modify OBEX code to include code to maintain the registry before you can use it with Catalina?
  • RossHRossH Posts: 5,462
    edited 2014-02-16 18:02
    David Betz wrote: »
    So are you saying you have to modify OBEX code to include code to maintain the registry before you can use it with Catalina?

    Not necessarily. If the PASM code is already "well behaved" (according to Catalina's definition) and uses a well-specified mechanism to communicate (e.e. via a buffer that is passed to it on initialization of the PASM) then Catalina can usually do all the necessary registry stuff itself, without changing the PASM - essentially, just by discarding the existing Spin initialization code and methods and replacing them with either new Spin code or equivalent C code (this depends on whether I need to make the plugin dynamically reloadable or not).

    However, many OBEX objects are not "well-behaved" (e.g they start another cog, or expect to be able to write to fixed locations in Hub RAM, or Spin VAR or DAT segments). This is not the fault of the original author, of course - in most cases they had no idea that anyone would eventually want to use them from anything but Spin! Such objects would generally require some minor modifications.

    Or you can do what we currently do, which is maintain multiple versions of essentially the same object - one in the OBEX, the others outside it.

    Ross.
  • David BetzDavid Betz Posts: 14,516
    edited 2014-02-16 18:08
    RossH wrote: »
    Not necessarily. If the PASM code is already "well behaved" (according to Catalina's definition) and uses a well-specified mechanism to communicate (e.e. via a buffer that is passed to it on initialization of the PASM) then Catalina can usually do all the necessary registry stuff itself, without changing the PASM - essentially, just by discarding the existing Spin initialization code and methods and replacing them with either new Spin code or equivalent C code (this depends on whether I need to make the plugin dynamically reloadable or not).

    However, many OBEX objects are not "well-behaved" (e.g they start another cog, or expect to be able to write to fixed locations in Hub RAM, or Spin VAR or DAT segments). This is not the fault of the original author, of course - in most cases they had no idea that anyone would eventually want to use them from anything but Spin! Such objects would generally require some minor modifications.

    Or you can do what we currently do, which is maintain multiple versions of essentially the same object - one in the OBEX, the others outside it.

    Ross.
    So I guess it's this registry idea that is the main difference between the Catalina runtime environment and what we've setup for PropGCC. I guess that makes it difficult to share much of anything without adding a bunch of ifdefs to the code.
  • RossHRossH Posts: 5,462
    edited 2014-02-16 18:11
    David Betz wrote: »
    So I guess it's this registry idea that is the main difference between the Catalina runtime environment and what we've setup for PropGCC. I guess that makes it difficult to share much of anything without adding a bunch of ifdefs to the code.

    Or PropGCC could adopt Catalina's registry! :smile:

    Just think how simple that would make everyone's life!

    Ross.
  • David BetzDavid Betz Posts: 14,516
    edited 2014-02-16 18:16
    RossH wrote: »
    Or PropGCC could adopt Catalina's registry! :smile:

    Just think how simple that would make everyone's life!

    Ross.
    Probably not right away. We don't have any problems that it solves at the moment. Maybe we'll come to it eventually.
  • RossHRossH Posts: 5,462
    edited 2014-02-16 18:28
    David Betz wrote: »
    Probably not right away. We don't have any problems that it solves at the moment. Maybe we'll come to it eventually.

    You don't - but the original author of this thread does. As do many other people. Isn't that the point?

    Ross.
  • jazzedjazzed Posts: 11,803
    edited 2014-02-16 18:34
    RossH wrote: »
    Or PropGCC could adopt Catalina's registry! :smile:

    Just think how simple that would make everyone's life!

    Ross.

    Very funny. :) LOL. I can tell you're glad to have some attention again.
  • RossHRossH Posts: 5,462
    edited 2014-02-16 18:46
    jazzed wrote: »
    Very funny. :) LOL. I can tell you're glad to have some attention again.

    If you are feeling the lack, try contributing something to the discussion yourself.
  • David BetzDavid Betz Posts: 14,516
    edited 2014-02-16 19:04
    RossH wrote: »
    You don't - but the original author of this thread does. As do many other people. Isn't that the point?

    Ross.
    You can already use "well behaved" OBEX objects with PropGCC. What we're lacking is decent documention about how to do that. To be honest, I was hoping that Parallax would help with that. They're known for their great documentation. I guess they're too busy creating the SimpleIDE/SimpleLibrary educational material though.
  • RossHRossH Posts: 5,462
    edited 2014-02-16 19:14
    David Betz wrote: »
    You can already use "well behaved" OBEX objects with PropGCC. What we're lacking is decent documention about how to do that. To be honest, I was hoping that Parallax would help with that. They're known for their great documentation. I guess they're too busy creating the SimpleIDE/SimpleLibrary educational material though.

    So can Catalina. So the answer to the original poster is that the world is all good provided the only OBEX objects he wants to use are "well behaved" (by somebody's definition). And if it is not, then tough luck.

    We are just going round in circles now, and as usual we come to the conclusion that the users who keep raising these annoying questions don't actually matter enough to provide them even the hope of an eventual answer.

    *sigh*
  • David BetzDavid Betz Posts: 14,516
    edited 2014-02-16 19:21
    RossH wrote: »
    We are just going round in circles now, and as usual we come to the conclusion that the users who keep raising these annoying questions don't actually matter enough to provide them even the hope of an eventual answer.

    *sigh*
    I don't believe that users needs don't matter. I'm just tired of putting a lot of effort into things people think they want but then when get them they still aren't satisfied. I guess I need to concentrate on making things that I want and not worry about whether anyone else cares or not.
  • RossHRossH Posts: 5,462
    edited 2014-02-16 19:26
    David Betz wrote: »
    I don't believe that users needs don't matter. I'm just tired of putting a lot of effort into things people think they want but then when get them they still aren't satisfied. I guess I need to concentrate on making things that I want and not worry about whether anyone else cares or not.

    Amen to that.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-02-16 20:08
    David Betz wrote:
    I guess I need to concentrate on making things that I want and not worry about whether anyone else cares or not.
    If Parallax is going to rely solely for their offical dev software on unpaid labor, I guess that's the best we can hope for! ;)

    -Phil
  • David BetzDavid Betz Posts: 14,516
    edited 2014-02-16 20:12
    If Parallax is going to rely solely for their offical dev software on unpaid labor, I guess that's the best we can hope for! ;)

    -Phil
    I think we're now seeing why other companies charge for their dev tools. It's expensive to develop them. Parallax has not entirely relied on unpaid labor though. I believe they have invested a fair amount of money on PropGCC and I've been paid for a little of the work I've done. It isn't fair to say they've entirely relied on unpaid labor. It's just that developing a toolchain is a big job. Ross has done an amazing job over the years developing Catalina. I hope a lot of people have donated money in support of it!
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-02-16 20:45
    David Betz wrote:
    It isn't fair to say they've entirely relied on unpaid labor.
    My bad, then. But it's the impression that I got from other posts in this thread.

    -Phil
  • RossHRossH Posts: 5,462
    edited 2014-02-16 22:25
    David Betz wrote: »
    Ross has done an amazing job over the years developing Catalina. I hope a lot of people have donated money in support of it!

    Thanks.

    You can't charge for LCC-derived compilers under the terms of their "open source" license (they have another commercial license, that I believe ImageCraft may have purchased).

    I used to charge for the Catalina Optimizer, but in the end that became more trouble than it was worth, so I stopped. It made me enough money to buy more Propeller boards, but that's about it ... so in the end I guess Parallax made a profit from that, not me! :lol:
    My bad, then. But it's the impression that I got from other posts in this thread

    Hmmm ... I wonder if I am the only unpaid labour in the "getting C onto the Propeller" effort! :lol:

    Ross.
  • David BetzDavid Betz Posts: 14,516
    edited 2014-02-17 04:26
    RossH wrote: »
    You can't charge for LCC-derived compilers under the terms of their "open source" license (they have another commercial license, that I believe ImageCraft may have purchased)..
    That's interesting. I didn't know that ImageCraft had used LCC as the basis for their product.
  • Heater.Heater. Posts: 21,230
    edited 2014-02-17 04:41
    RossH,
    ... I wonder if I am the only unpaid labour in the "getting C onto the Propeller" effort!
    No, ImageCraft didn't get any money either !

    And don't forget Zog:)
  • RossHRossH Posts: 5,462
    edited 2014-02-17 12:06
    Heater. wrote: »
    RossH,

    No, ImageCraft didn't get any money either !

    And don't forget Zog:)

    :lol:
  • David BetzDavid Betz Posts: 14,516
    edited 2014-02-17 12:10
    Heater. wrote: »
    RossH,

    No, ImageCraft didn't get any money either !

    And don't forget Zog:)
    I liked ZOG. It is where I first started experimenting with what became propeller-load.
  • Heater.Heater. Posts: 21,230
    edited 2014-02-17 12:53
    David,
    I liked ZOG. It is where I first started experimenting with what became propeller-load.
    I'm really glad that effort had some useful outcome.
Sign In or Register to comment.