7 ms·
Curiosity was built with 2.5 million lines of C
- rbanffy 14y agoI found it fascinating that the most productive C programmer on the team was a Python script. Go Python! ;-)
- edge17 14y agoproductivity != kloc's autogenerated C is used sometimes for complex conditional nestings. in some failure situations it is programmatically more efficient or easier to trace issues if every condition is enumerated
- rbanffy 14y agoI know that, of course. That's why I used a winking smiley. In any case, programs that generate code is, at least for me, a code smell.
- robomartin 14y agoI frequently use a couple of custom tools I created in Excel (for ease of data entry) to generate and maintain complex state machines and even-driven loop callback C code in embedded systems. That does not mean that the embedded systems were written in Excel. In this case Excel is simply leveraged as a productivity tool as I suspect might be the case for the use of Python scripts to generate chunks of code in the JPL case.
- jebblue 14y agoIn the late 70's Viking had about 12 KBytes RAM (6000 WORDS) and 5 MBytes (40 MBit) tape storage. http://en.wikipedia.org/wiki/Viking_program http://en.wikipedia.org/wiki/Viking_program
- EdiX 14y agoMost of it automatically generated, therefore it is not written in C.
- edge17 14y agohuh? it is auto-generated C as described in the post
- jfoutz 14y agoBy that logic, it's written in machine code.
- edge17 14y agono, autogenerated C code means someone (maybe a build script) runs a Python script that generates a bunch of C files, and then the C compiler picks up those files. Those C files exist in the file tree and may be human readable. C files are being generated, not machine code, by some script. Fairly common practice in large C projects that have complex/heavily conditionals where you're less likely to introduce incorrect conditions if you let program logic printf your code to a file
- EdiX 14y agoYou can tell gcc to keep around the assembly files it generates and it is human readable, does it mean that C code compiled with gcc is actually written in assembly? Is the litmus that they are caching the intermediates of the compilation on disk instead of throwing them away and regenerating them every time?
- sgrove 14y agoI feel this is an interesting story to read alongside the OP: http://www.flownet.com/gat/jpl-lisp.html http://www.flownet.com/gat/jpl-lisp.html
- eliben 14y agoThere will always be someone lamenting that language X (insert Lisp, Smalltalk, Haskell or anything else here) is not being used instead of the horribly terribly utterly broken C, C++ or Java (yes, I'm being sarcastic). But in the end, pragmatic concerns win. Nobody works in vacuum, even if they really want to. I'm a big fan of functional and otherwise dynamic language, but if I had to write my own Mars-landing controller, I would use C. No doubt there.
- roma1n 14y agoI wouldn't. I would go with spark ada. No doubt C has better tooling, though.
- ballooney 14y agoAnd more people who can write it or prefer writing in it? Technical problems being people problems 90% of the time or whatever it was the fella said.
- eliben 14y agoThe problem with Ada is not only the lack of tooling (although it's a huge problem - relatively to C, the tooling is scarce and horrible), it's also the people that know the language. I prefer C code written by a good programmer than Ada code written by a poor programmer any day, and finding good C programmers is much easier than finding good Ada programmers.
- gtani 14y agoDetailed account of using Spark and PVS theorem prover in such an app http://www.cs.virginia.edu/~jck/publications/Xiang.Yin.dissertation.pdf http://www.cs.virginia.edu/~jck/publications/Xiang.Yin.disse...
- mgurlitz 14y agoPrevious discussion: http://news.ycombinator.com/item?id=4344945 http://news.ycombinator.com/item?id=4344945
- kbronson 14y agoI don't believe that. It most probably be made of FPGAs, that are "programmed" in VHDL or Verilog or other programmable logic languages. It may have some parts made in C, but surely not the big part.
- xmpir 14y agoWhy are people discussing this for so long? Does it make a difference whether it was 500k or 2500k lines of code? It was a huge project and that's it.
- cbs 14y agoWhy are people discussing this for so long? Because it's fascinating. Its not the same old bullshit minutiae over-hyped as the latest and greatest thing, it's honestly a feat of human achievement. It means different things to different people. Creating inspiration, awe, and wonder. It shapes opinions on humanity, tech and life. But forget all that for a second, and the intimate technical details of how things come together are still interesting to techy people. Even the logistics and implementation of traffic lights can tickle our curiosity. This thing is on another planet! You sound like someone who has never built anything for just for fun.
- StewartRen 14y agoIt was written in MSDOS Q-Basic
- ANH 14y agoPoint of interest: In one of the press conferences yesterday they said they're planning to push an update to the rover's software soon after they get the X-band antenna deployed (which should have happened already).
- robomartin 14y agoWell, the farther you abstract away from executable machine code the greater the inefficiencies introduced into the resulting machine code. Object oriented programming is there for the benefit of the programmer, the machine couldn't care less. The trouble is that any OO language will introduce unnecessary code into any given program. What I mean by "unnecessary" is that, if you were coding the solution in assembler you would, in all likelihood, not produce such code. C let's you code at a level that is extremely close to the underlying machine language. If you are an experienced embedded developer you'll know exactly what code you are producing for the particular processor you happen to be working with. I would not venture a guess, but I would not be surprised if the overwhelming majority of real-time, mission-critical systems out there are coded in C. The only other language I would consider would be Forth --which I have used extensively. I have played with the idea of going to something like C++. I have never found it to make sense in the context of a resource and horsepower-limited embedded system. I don't know where the distain for C comes from. Yes, I am aware of the issues on can run into by writing unsafe code. Isn't part of our job to write safe code? I certainly do.