Electronic Design
  • Resources
  • Directory
  • Webinars
  • CAD Models
  • Video
  • Blogs
  • More Publications
  • Advertise
    • Search
  • Top Stories
  • Tech Topics
  • Analog
  • Power
  • Embedded
  • Test
  • AI / ML
  • Automotive
  • Data Sheets
  • Topics
    - TechXchange Topics --- Markets --AutomotiveAutomation-- Technologies --AnalogPowerTest & MeasurementEmbedded
    Resources
    Electronic Design ResourcesTop Stories of the WeekNew ProductsKit Close-UpElectronic Design LibrarySearch Data SheetsCompany DirectoryBlogsContribute
    Members
    ContentBenefitsSubscribeDigital editions
    Advertise
    https://www.facebook.com/ElectronicDesign
    https://www.linkedin.com/groups/4210549/
    https://twitter.com/ElectronicDesgn
    https://www.youtube.com/channel/UCXKEiQ9dob20rIqTA7ONfJg
    promo.gif
    1. Markets
    2. Automotive

    Learning from an Ada Neophyte

    Dec. 14, 2016
    Technology Editor Bill Wong recently judged the “Make with Ada” competition and found some interesting feedback that will intrigue embedded developers.
    William Wong Blog
    Related To: Electronic Design

    >> Website Resources
    .. >> Library: TechXchange
    .. .. >> TechXchange: Embedded Software
    .. .. .. >> Topic: Ada and SPARK

    Electronicdesign Com Sites Electronicdesign com Files Adobe Pdf Logo Tiny
    Download this article in .PDF format This file type includes high resolution graphics and schematics when applicable.
    Electronicdesign Com Sites Electronicdesign com Files Uploads 2016 12 09 Software Code

    Delivering an application that does what it was designed to do is the goal of most developers. One way to accomplish that is to use tools that enhance the development process. Using MISRA coding standards is one approach to improving C/C++ development. Another method is to use SPARK, a subset of Ada designed for safe and secure applications.

    Of course, taking on a new programming tool is not something to do lightly. I recently served as one of the judges for Adacore’s “Make with Ada” competition. Stephane Carrez of Issy Les Moulineaux, France took first place with a network-traffic monitoring tool called EtherScope. In second place was German Rivera of Austin, who developed an Autonomous Car Framework for the NXP cup race car. But what I want to highlight is the feedback from the third-place winner, Shawn Nock from London, Ontario, who developed a Bluetooth Beacons “iBeacon” using Ada.

    The reason is that Shawn is a C programmer who had not used Ada before competing. “Developing the beacon in Ada (a language I don’t know well) took roughly the same time as the similar functionality in C,” he wrote in his blog, “and I have more confidence in the Ada code.” This came down to a few simple factors:

    “I find Ada’s syntax to be intuitive. I’ve done a fair amount of work in Python, so I found the block notation and indentation to be comfortable immediately. Unlike Python, Ada retains semicolons as statement delimiters [making] me all warm and fuzzy.

    “I found it natural to draft my interfaces in spec files. In C, I’ve acquired the bad habit of writing code and interface at the same time in .c files and back-filling header files when my compiler complains. I could have always done this better in C, but the context switch to Ada allowed me to see the advantage clearly.

    “More opinionated compiler—I’ve run external linters and static analysis tools in my VCS commit hooks for ages, but there are 90 ways to write C and a thousand tools... having the compiler express strong opinions and enforce them at compile time saved me time. From syntax checking to style checking; I didn’t find myself needing to spend time search [sic] out good tooling to start writing decent code. I imagine that when working on a team, it’s easier to agree on (and enforce) a list of compiler flags than a whole ecosystem of tools.

    Electronicdesign Com Sites Electronicdesign com Files Uploads 2016 07 14 E Dpullquote260px 17

    “GNAT—It’s a part of the GCC. This is perhaps a downside for some embedded engineers... but I enjoy working with GCC. It’s consistent, available on nearly every platform, well maintained, and free. With GNAT, I only needed to add a single tool to my development ecosystem to get started on Ada.

    “I didn't spend anytime [sic] in the debugger. Once I convinced GNAT of my intentions on with some pretty intense compiler flags (-gnatg -gnatp -gnatn2 -gnatwa -gnatQ -gnatw.X); my software tended to Just Work.”

    Most of the projects targeted microcontrollers like STMicroelectronics’ 32-bit STM32 family, which includes Cortex-M4 and Cortex-M7 solutions.

    This type of feedback is not limited to individuals in a competition. I recently hosted Adacore’s webinar, “Building High-Assurance Software without Breaking the Bank,” where Protean Codes’ Rod Chapman talked about a number of projects that utilized SPARK. The bottom line was that the safety-critical projects presented were completed on time with fewer errors, thereby reducing the amount of testing required. This reduced project costs.

    Static- and dynamic-analysis tools are being used for C, C++, and Java applications to improve code quality. Unfortunately, they fall short compared to SPARK. C and C++ will remain the primary tools for embedded applications for a number of reasons, but if you’re searching for that edge, SPARK may be worth a look.

    Electronicdesign Com Sites Electronicdesign com Files Source Esb 1
    Download this article in .PDF format This file type includes high resolution graphics and schematics when applicable.

    >> Website Resources
    .. >> Library: TechXchange
    .. .. >> TechXchange: Embedded Software
    .. .. .. >> Topic: Ada and SPARK

    Continue Reading

    Arm Unveils Its Most Compact AI-Capable Cortex-M CPU

    Rust is Ready for Prime Time

    Sponsored Recommendations

    Designing automotive-grade camera-based mirror systems

    Dec. 2, 2023

    Design security cameras and other low-power smart cameras with AI vision processors

    Dec. 2, 2023

    Automotive 1 TOPS vision SoC with RGB-IR ISP for 1-2 cameras, driver monitoring, dashcams

    Dec. 2, 2023

    AM62A starter kit for edge AI, vision, analytics and general purpose processors

    Dec. 2, 2023

    Comments

    To join the conversation, and become an exclusive member of Electronic Design, create an account today!

    I already have an account

    New

    Securing Data in the Quantum Era

    Celebrating Field Engineers: The Unsung Heroes of Innovation

    Checking Out the NXP Hovergames NavQ Plus

    Most Read

    eBook: How Material Selection Can Make or Break your PCB

    Mask Mandates, 2FA, and ChatGPT: What to Believe

    Observability Framework Exposes DDS


    Sponsored

    Encryption: The Key to Embedded Security

    PMP22817

    TIDA-010232

    Electronic Design
    https://www.facebook.com/ElectronicDesign
    https://www.linkedin.com/groups/4210549/
    https://twitter.com/ElectronicDesgn
    https://www.youtube.com/channel/UCXKEiQ9dob20rIqTA7ONfJg
    • About Us
    • Contact Us
    • Advertise
    • Do Not Sell or Share
    • Privacy & Cookie Policy
    • Terms of Service
    © 2023 Endeavor Business Media, LLC. All rights reserved.
    Endeavor Business Media Logo