Hacker News new | past | comments | ask | show | jobs | submit login

I interviewed at SpaceX and asked them what they use to write code that runs in the rocket. It's all plain C and everything must be declared before hand - in other words, there are no dynamic allocations anywhere in the code.



This is typical for embedded software in cars, planes etc. Most of that C code will be generated though.


What would you be generating the C from? Are there any open-source tools that generate this kind of C?


Features will almost always be modelled in a tool like Matlab/Simulink, which has a C generator specifically aimed at automotive software. Similar tools that are used by EEngs, MechEngs etc. have the same functionality.

The support software underneath (equivalent to the OS kernel, OS libraries, frameworks etc. you would use to run desktop apps) is typically configured in one or more AUTOSAR[1] tools. The exchange format for AUTOSAR is .arxml, which is a horrible adaption of XML. These tools will also take .armxl files as input and generate the source files that contain the standard components, the drivers, the glue code for inter-component communication etc.

Only the software components that are not covered by the AUTOSAR standard or handed down by the car manufacturer as standard components will typically be written by hand, though even for those we will increasingly often write generators in e.g. Python. That's because different versions of the same car, different target plattforms (that is car models) etc. will often use different subsets of features, different internal networking, different messages etc. and since everything has to be set statically before compile time, we need to generate different versions.

TBH I doubt that much of that is open-source. There is a reference implementation of AUTOSAR and there are some code generators that are FOSS as part of the genIVI project. But practically all tools you would actually want to use are closed source and super expensive. That's one of the major reasons why the push for open-sourcing automotive software is not going to lead to anything.

[1] AUTOSAR is an international standard for automotive software architectures and components/APIs/etc. that is aimed at making software modules more or less plug'n'play between different SW vendors, car manufacturers etc. All of this is statically "linked" at generation time! The software will not even compile if things don't match exactly. The first version of a Linux-based Adaptive AUTOSAR that basically works like Android has been released recently, though.


Matlab Simulink, typically (maaybe LabView, but not really)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: