From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!border3.nntp.dca.giganews.com!backlog3.nntp.dca3.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 27 Aug 2014 08:07:36 -0500 From: Dennis Lee Bieber Newsgroups: comp.lang.ada Subject: Re: STM32F4 Discovery, communication and libraries Date: Wed, 27 Aug 2014 09:08:07 -0400 Organization: IISS Elusive Unicorn Message-ID: <5kkrv9hejn2qhdckkeo8lidkbh3bkme1gn@4ax.com> References: <60a42dc6-d8d0-4432-ae5a-86de18b82840@googlegroups.com> X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 108.79.223.240 X-Trace: sv3-Edb+zvvbIDdH0vIhwvfhVUWqAhH9uUZnoxxj+0VHvdHOk1f4CJNEYPFZ1DYdozQ/HZxJUt5pENoY8/F!bFzQnBWptMvdCwedo8s7UAzS/PkiVUACLjdHHMjzhiRDTmn3naF9klLu/qdsgKlCRkHF1c+WtZRv!+7jzMzHAywPP7iZ1N0Q2Njs9ybR8 X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 5206 Xref: news.eternal-september.org comp.lang.ada:21930 Date: 2014-08-27T09:08:07-04:00 List-Id: On Tue, 26 Aug 2014 15:38:33 -0700 (PDT), roy.emmerich@gmail.com declaimed the following: >I don't have experience in C/C++ but I do have a lot of experience in Java, python, structured text (read PLCs) and a few other bits and pieces. I REALLY don't want to develop in C. From what I can make out it looks like a nightmare once the code reaches any substantial size, which mine will. I've started quite a few beginner C books and never got very far before throwing in the towel. However what I've read about Ada has certainly caused me to sit up! > Do you have any experience with assembler (any) -- since so much of C mapped to the PDP series instruction set (pre/post increment/decrement operators, for example). C, itself, is a fairly small language -- it's main feature being also its main problem: it assumes the programmer knows what they are doing and offers easy access to (mis)treating data as addresses in memory. If you are familiar with Java AND with disciplined software development, a copy of the K&R book for C should be all you need to learn the language itself (in my world, it was the even smaller first edition K&R with my experience of FORTRAN, COBOL, Pascal, and Assembler -- circa 1982). C++, OTOH... THAT is a nightmare language to pick up... Do NOT think of it as just a more powerful C. >So far I have investigated the following high level language alternatives: > >1. www.espruino.com (JavaScript) Interpreted... And not even full Java... I've not looked at the link -- JavaScript is the "native" language for the BeagleBone Black, as I recall. >2. www.micropython.org Interpreted (byte-code)... >3. www.eluaproject.net Based on LUA?, probably interpreted. All will require you to have an interpreter running on the board (you are entering the world of the old BASIC Stamp and PICAxe chips -- PIC variants with a byte-code interpreter running as the program, and your program loaded into data memory; the Parallax Javelin didn't last long -- it had a Java interpreter on the chip, supposed to run regular Java byte code). >but I see dragons on the horizon. Here are a few: > >1. It is not hard real-time Few interpreted languages are... Especially if they have dynamic behavior (that is, you can modify class methods on the fly). "Real-Time Systems and Programming Languages" covers Ada, C with a POSIX Real-Time package, and something titled "Real-Time Java"... Might be of interest... > >For Ada to be a viable option for my project, this is what I think I need [with Mike's comments]: > >1. [IN PROGRESS] Easy communication: SPI, I2C, Serial, Ethernet, > >[Mike] >I know that AdaCore is working on comms libraries for the ARM Cortex M parts, but I don't know anything about the projected availability. > >[Roy] >If they want adopters then they'd better get a move on! > >2. [UNSOLVED?] Libraries/examples: MODBUS RTU/Eth at the very least > >I have yet to find a repository of libraries covering the major protocols (e.g. MODBUS, CAN, one-wire). There are quite a few in C. Would it be viable to just wrap these in Ada? It seems like a great short term solution but if we are using Ada to make things more stable, it hardly makes sense to use it merely to wrap (flakey) C libraries ;) > I suspect a lot of those are being developed by companies for proprietary products, possibly using some internal core "OS" for interfacing between application code and the board support layer. As a result, even if one got their hands on the driver source, one would have to replicate the OS environment to make use of it. At work, I believe the common route is to use IOCTL() calls to manipulate the hardware specific drivers, leaving a common POSIX (?) interface to C, and wrapping the C calls for Ada (if not directly wrapping the assembler entry point to the same functionality). -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/