picocDS - C programming on the go! (DS Entry)

Discussion in 'NDS - Emulation and Homebrew' started by asiekierka, Feb 26, 2011.

Feb 26, 2011
  1. asiekierka
    OP

    Newcomer asiekierka Advanced Member

    Joined:
    Sep 26, 2007
    Messages:
    83
    Location:
    Poland
    Country:
    Poland
    So I am working on a proper port of picoc to the DS as my Homebrew Bounty project. I only started working on it today, though.

    picoc is a C interpreter with 99% of the ANSI C standard supported. That's right, it's an interpreter.

    CURRENT PORT FEATURES:
    - a quick port of the picoc interactive shell
    - most C standard functions supported
    - DS-specific functions added (with more coming!)

    HOW TO USE:

    Self-explanatory, really. Just input C code into the shell.

    Code:
    starting picoc v2.1
    picoc> char inbuf[80];
    picoc> gets(inbuf);
    hello!
    picoc> printf("I got: %s\n", inbuf);
    I got: hello!
    Sometimes in interactive mode you want to change a function or redeclare a variable. You can do this using the "delete" statement:

    Code:
    starting picoc v2.1
    picoc> int fred = 1234;
    picoc> printf("fred = %d\n", fred);
    fred = 1234
    picoc> delete fred;
    picoc> char *fred = "hello";
    picoc> printf("fred = '%s'\n", fred);
    fred = 'hello'
    You may want to load C files that you've prepared before. Let's assume you want to load test1.c, which is located in the main directory of your SD card. To do that, do this:

    Code:
    picoc> load "/test1.c";
    picoc>
    You can now use functions and code from that C file!

    Works in both DS and DSi mode, and it's quite fast!

    For more information please consult the README or the picoc wiki.

    MILESTONES (bXX - build XX):
    M1 (done at b02)
    - Have it work (b01)
    - Most standard C functions working (b02)

    M2 (done at b04)
    - Add some of the NDS-specific functions (began at b03, still in progress)
    - Add loading C files (b04)

    M3
    Idk. Maybe integrate a text editor?

    I fixed the links now
    DOWNLOAD:
    build 04 (20110326) - binary
    build 04 (20110326) - source
     
  2. Vigilante

    Member Vigilante TempLurker

    Joined:
    Jan 1, 2010
    Messages:
    1,555
    Location:
    CyberSpace IQ:OVER 9000
    Country:
    Philippines
    Wow why is it most of the entiries things that people use to program isnt it suppose to be thing people can just go and play and use with
     
  3. asiekierka
    OP

    Newcomer asiekierka Advanced Member

    Joined:
    Sep 26, 2007
    Messages:
    83
    Location:
    Poland
    Country:
    Poland
    You don't use this to program FOR the DS.

    You use this to program ON the DS. In C.
    And it should compile on a normal PC, too!

    Coding on-the-go is quite awesome in my opinion, that's why I'm working on a port of picoc to the DS.

    Also, adding a milestone list to the first post.
     
  4. Frederica Bernkastel

    Member Frederica Bernkastel WebPerf and PWA advocate; @antoligy on Twitter

    Joined:
    Jan 31, 2008
    Messages:
    3,145
    Location:
    Hinamizawa
    Country:
    United Kingdom
    Nice work asiekierka
    Even if it were, what exactly would be the problem with additional tools for developers?
    Just because it may not be useful to you, does not make it useless to everyone else.
     
  5. TehSkull

    Member TehSkull Living the life

    Joined:
    Nov 29, 2009
    Messages:
    2,700
    Location:
    Louisiana
    Country:
    United States
    This is a cool concept, but I don't see it being very commonly used.

    Coding C on a DS just sounds like a pain.

    Python or something similar would be a much better fit.
     
  6. asiekierka
    OP

    Newcomer asiekierka Advanced Member

    Joined:
    Sep 26, 2007
    Messages:
    83
    Location:
    Poland
    Country:
    Poland
    https://www.develer.com/trac/dspython/

    Already done about 3 years ago. It even wraps a lot of libnds.
     
  7. TehSkull

    Member TehSkull Living the life

    Joined:
    Nov 29, 2009
    Messages:
    2,700
    Location:
    Louisiana
    Country:
    United States
    Well nevermind then, lol. Still, your idea is one I've wished for in the past, so gg. [​IMG]
     
  8. The Pi

    Member The Pi Lurker

    Joined:
    Mar 18, 2010
    Messages:
    1,638
    Location:
    Scotland
    Country:
    United Kingdom
    Sounds good, I'll try this later. [​IMG]
     
  9. SmokeFox

    Member SmokeFox Jesus Christ is the Lord

    Joined:
    Dec 27, 2010
    Messages:
    537
    Location:
    Brazil
    Country:
    Brazil
    Me too.
     
  10. asiekierka
    OP

    Newcomer asiekierka Advanced Member

    Joined:
    Sep 26, 2007
    Messages:
    83
    Location:
    Poland
    Country:
    Poland
    I finally updated!

    NEW in build 4:
    - getTouchX() and getTouchY()
    - You can now load C files LIKE A BOSS
     
  11. ecko

    Member ecko GBAtemp Regular

    Joined:
    Nov 28, 2009
    Messages:
    261
    Country:
    Afghanistan
    on the fly syntax checking would be awesome for this
     
  12. asiekierka
    OP

    Newcomer asiekierka Advanced Member

    Joined:
    Sep 26, 2007
    Messages:
    83
    Location:
    Poland
    Country:
    Poland
    well it does, kind of
    when you input a line, or a procedure, it will syntax check it when you're done!
    the downside is you have to rewrite everything all over again
     
  13. Hyperlisk_

    Member Hyperlisk_ GBAtemp Regular

    Joined:
    Jan 30, 2008
    Messages:
    187
    Country:
    United States
    Bump for awesome. This is something I've wanted for awhile. Your thoughts about a builtin text editor are spot on. Definitely add it. I think you should expose the frame buffer (Just because it'd be easy), perhaps with functions such as drawPixel, drawLine, etc.
     
  14. RodrigoDavy

    Member RodrigoDavy GBAtemp Maniac

    Joined:
    Feb 9, 2011
    Messages:
    1,453
    Country:
    Brazil
    I liked your project, but for some reason the download link is not working for me.
    Is the link broken?
     
  15. corenting

    Member corenting Insert random cool title here

    Joined:
    Jul 17, 2008
    Messages:
    288
    Location:
    Paris
    Country:
    France
    Yes, 404 error [​IMG]
    I wanted to test this too...
     
  16. asiekierka
    OP

    Newcomer asiekierka Advanced Member

    Joined:
    Sep 26, 2007
    Messages:
    83
    Location:
    Poland
    Country:
    Poland
    links fixed. sorry!
     

Share This Page