This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/MSP430FR5969: C versus FORTRAN. RATFOR versus C++

Part Number: MSP430FR5969


Tool/software: TI C/C++ Compiler

Hello! I am finding it impossible to comprehend C++. I want to write large programs, so C is not ideal, and C++ is supposed to be better. However I cannot cope with the C++ learning curve.

Does the TI C/C++ compiler have RATFOR/FORTRAN inside, buried under a lot of sugar? FORTRAN, the FORmula TRANslator, is designed for ultimate efficiency, and the RATFOR preprocessor adds programmability. Neither are kludges as I feel the Cs are. I would far rather learn RATFOR than attempt to learn C++.

Allan

  • I'm sorry, the TI compiler does not support any flavor of FORTRAN. There is a GCC compiler for MSP, and many versions of GCC support FORTRAN, but I don't know if the GCC for MSP does.
  • The MSP430 GCC compiler does not support Fortran.  Unfortunately, I am not aware of any Fortran compiler for MSP430.

    Thanks and regards,

    -George

  • What does this have to do with an MSP430? They don't lend themselves to "large programs"
  • Microcontrollers are getting larger ! I think this is largely due to code bloat. However the MSP430FR 5969 has 64K of user programmable memory which is certainly a large task to program and especially to debug fully. I hope this answers your question.
  • While I agree about C++ being bloated confusion-ware, using C with separate source files and what Sedgewick calls "Abstract Data Types", which are essentially lightweight classes. (i.e., they are enforced by the programmer, not the compiler), can work out very well at the scale of an embedded processor.
  • I'm not familiar with RATFOR -- my Fortran experience is 35+ years ago and was Fortran-66 -- but all computer languages implement the same concepts; they just differ in which actions they make easier or harder to express.

    Assignments are assignments, loops are loops, IFs are IFs; only the syntax differs between C and Fortran. There's no real need to get into esoteric C++ features until you have a situation that they make easier. BTW, there's a book entitled "C++ for FORTRAN Programmers" that might be useful.
  • While what you say is true in a general sense, language differences can affect compiled code. The lack of pointers means that Fortran can be much freer to do aggressive optimizations.