C/C++ on the P2 and Nano FPGA ?

2»

Comments

  • mindrobots wrote: »
    There is node.js support for SQLite so it could use that in the embedded device just like your smartphone does. If you need to go off-device for BIG data needs, then you may as well go to some cloud server somewhere.

    How'd we get off on this tangent anyway??

    Oh, yeah Proploader written node/espruino/javascript/etc....cool, if it can be done, opens up a lot of platforms for proploading....the more proploading going on, the more props getting loaded and that's a good thing!!
    The Propeller loader for ESP8266 is alive and well. I just need to add a method of discovering ESP modules.

  • David Betz wrote: »
    Heater. wrote: »
    That's the thing. In the modern world a web site is not just some PC in a cupboard running a LAMP (Linux, Apache, MySql, PHP) stack.

    It's a distributed mess of machines, real and or virtual, running things like load balancers, web page servers, RESTful API servers, authentication servers, database servers, compute engines etc, etc, etc. Quite likely with different parts distributed over different data centres in different continents.

    At that point your realize LAMP is not going to cut it, especially with todays "web apps" with real-time data feeds. Node was built to exploit the event driven nature of JS to make all this much easier.

    Are there large web sites using node? Sure: ebay, Dow Johnes, LinkedIn, Uber. Here is a list https://github.com/nodejs/node-v0.x-archive/wiki/Projects,-Applications,-and-Companies-Using-Node









    I realize this is the case with larger servers but why would someone install node.js on an embedded device but put their database on a cloud server? Seems like an odd configuration.

    @David,

    the IoT thing for example. Embedded device can connect to the net and is available per browser. Or changes stuff in DB and DB is available for another web application.

    In the last couple of years I have not written any Desktop or console program anymore. All I do is web based and sometimes I even don't know where the actual server is.

    Except the Cobol stuff. That is mostly running on Mainframes.

    Alas there is a nice Open Source Cobol compiler named GnuCobol. It basically compiles Cobol source to C (or C++) and then uses GCC or Clang or Visual Studio to compile. Somebody even used Emscripten on it so you can run Cobol inside a webpage converted to JavaScript. Sort of cool but useless. I guess it will even be possible to run small Cobol programs on the P1, but PropGCC does not (yet?) support loadable modules so it will be to complicated for me to try it.

    P2 on the other hand should be able to run Cobol.

    Enjoy!

    Mike .

  • Davis Betz,
    I realize this is the case with larger servers but why would someone install node.js on an embedded device but put their database on a cloud server? Seems like an odd configuration.
    But that is what every embedded system I have worked on for two decades has done. That is what the whole IoT thing is about.

    Depends what you mean by "cloud" though. Back in the day the server was on closed local network within a factory, cell phone network or city say. Today there is a lot of use of "cloud" services which could be Google or Amazon servers anywhere.

    Anyway, node is just a run time for Javascript, like Python is for, err, Python, Or the Java Virtual Machine. You can put your storage where ever you like.
  • midrobots,

    Yes, we like Propeller loading.
  • Is youssefonline some kind of forum bot?

    It seems to just copy fragments out of threads and then post them to the thread as comments.
  • rjo__rjo__ Posts: 2,115
    edited 2016-01-19 (2:22 AM)
    looks like a school project.

    I wonder what happens when someone Googles "youssefonline?"
  • Heater.Heater. Posts: 21,233
    edited 2016-01-19 (9:34 AM)
    You mean like:

    "@youssefonline hasn't tweeted yet."

    Or

    "Thank you for visiting my profile page! i am who will build and promote your web site, Affiliate link or Amazon \ eBay item with bulk reviews \ feedbacks. Install your WP Site and more. Don't hesitate to contact us at any time!"
    From https://www.fiverr.com/youssefonline

    That could be our youssef.
  • David Betz wrote: »
    FYI, here is a script to download a program using the ESP module:
    FILE=$1
    SIZE=`ls -l $FILE | cut -c28-33`
    SIZE=${SIZE// /}
    ...
    

    The nonsense in the first couple of lines is my hack to get the size of the file in bytes which is needed by the second-stage loader.

    There's another way to get the size:
    SIZE=`du -b $FILE | cut -f1`
    

    Or the pedantic / better documented version, good for scripts:
    SIZE=$(du --apparent-size --block-size=1 -- $FILE | cut --fields=1)
    
  • Conga wrote: »
    David Betz wrote: »
    FYI, here is a script to download a program using the ESP module:
    FILE=$1
    SIZE=`ls -l $FILE | cut -c28-33`
    SIZE=${SIZE// /}
    ...
    

    The nonsense in the first couple of lines is my hack to get the size of the file in bytes which is needed by the second-stage loader.

    There's another way to get the size:
    SIZE=`du -b $FILE | cut -f1`
    

    Or the pedantic / better documented version, good for scripts:
    SIZE=$(du --apparent-size --block-size=1 -- $FILE | cut --fields=1)
    
    Thanks but neither of these seem to work on the Mac. :-(
    david-betzs-macbook-pro:esp8266-loader dbetz$ du --apparent-size --block-size=1 toggle.binary
    du: illegal option -- -
    usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] [-h | -k | -m | -g] [-x] [-I mask] [file ...]
    david-betzs-macbook-pro:esp8266-loader dbetz$ du -b toggle.binary
    du: illegal option -- b
    usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] [-h | -k | -m | -g] [-x] [-I mask] [file ...]
    

  • Has anybody looked into the feasibility of writing an LLVM backend for the P2? That would gain us C/C++ via Clang but also a wack of other languages, since they all use the same intermediate representation.

    I'm no expert on it and have never done it, but there seems to be some pretty good documentation on how to do it here:

    http://llvm.org/docs/WritingAnLLVMBackend.html

    I suspect for P2 it'd much more feasible than for P1.
  • porcupine wrote: »
    Has anybody looked into the feasibility of writing an LLVM backend for the P2? That would gain us C/C++ via Clang but also a wack of other languages, since they all use the same intermediate representation.

    I'm no expert on it and have never done it, but there seems to be some pretty good documentation on how to do it here:

    http://llvm.org/docs/WritingAnLLVMBackend.html

    I suspect for P2 it'd much more feasible than for P1.
    I've started looking into it but haven't gotten very far yet. Does anyone here already have experience working on LLVM backends?

  • I've never done it, and my LLVM experience is little and shallow, and I don't know the P2 instruction set... but would be willing to contribute where I can.
  • Heater...
    could be that or what that covers.
  • I don't have any contacts.
    They are all dead, but if I did, I would refer this for a closer looksee.
Sign In or Register to comment.