Thread: Any transpilers for alternative C/C++ syntax?

  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    204

    Question Any transpilers for alternative C/C++ syntax?

    What I mean is a language with equivalent functionality, but different syntax. Basically, something that transpiles into C/C++. Are there any that are ready for production code?

    I've been using Python recently. It uses indentation instead of curly brackets, and there is no ";" at the end of lines. It makes it easier to type, and a C/C++ transpiler to handle such syntactic feature should be relatively easy to implement.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by thetinman
    What I mean is a language with equivalent functionality, but different syntax.
    You would need to define equivalent functionality. You probably don't mean Turing completeness, but perhaps you mean language features, but does that mean that the language in question must have the exact same feature set? Seems unlikely to me.

    Quote Originally Posted by thetinman
    Basically, something that transpiles into C/C++.
    There is no language called "C/C++". This odoes not matter if it is understood by context that you are talking about both C and C++, e.g., in terms of the shared heritage, cross referenced standards, community, compatibility, etc, but here it is unclear: do you want the result to be C, C++, either one, compilable as both, or what?

    Quote Originally Posted by thetinman
    Are there any that are ready for production code?
    A quick search brings up Nuitka, if you would be satisfied with C rather than C++.

    Quote Originally Posted by thetinman
    I've been using Python recently. It uses indentation instead of curly brackets, and there is no ";" at the end of lines. It makes it easier to type, and a C/C++ transpiler to handle such syntactic feature should be relatively easy to implement.
    Python is so much more than the use of indentation to denote scope and other minor differences in syntax.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Array Syntax Versus Pointer Syntax
    By LyTning94 in forum C++ Programming
    Replies: 6
    Last Post: 12-06-2011, 10:56 AM
  2. Any alternative?
    By sCandal2 in forum Windows Programming
    Replies: 4
    Last Post: 01-11-2006, 04:30 PM
  3. gets() alternative
    By Mastadex in forum C Programming
    Replies: 5
    Last Post: 12-12-2004, 12:28 AM
  4. what type ??? ... alternative?
    By beely in forum C Programming
    Replies: 2
    Last Post: 01-18-2003, 11:02 AM
  5. alternative to cin
    By Unregistered in forum C++ Programming
    Replies: 18
    Last Post: 06-25-2002, 05:14 PM

Tags for this Thread