Announcement

Collapse
No announcement yet.

GnuCOBOL 2.2 Released To Let COBOL Code Live On As C

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • GnuCOBOL 2.2 Released To Let COBOL Code Live On As C

    Phoronix: GnuCOBOL 2.2 Released To Let COBOL Code Live On As C

    For those of you still maintaining COBOL code-bases, GnuCOBOL 2.2 is now available as what was formerly OpenCOBOL and also the project's first stable release in nearly one decade...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    So do you actually keep the C code or is it just intended to be a temporary form that's deleted as soon as the C compiler finishes? I can see some use for this even if it's just for combining C and Cobol code in the same project as it allows you to re-use old Cobol code while you're replacing it with something written in a less dead language or waiting on the budget to do just that.

    Comment


    • #3
      Code:
      [font=courier new]comment division.
      
      Express-thoughts.[/font][indent][font=courier new]move rising-excitemtn to feelings-area.
      Multiply future-outlook-of-cobol 100.
      Stop run.[/font][/indent]
      Last edited by bregma; 07 September 2017, 08:22 AM.

      Comment


      • #4
        Originally posted by L_A_G View Post
        So do you actually keep the C code or is it just intended to be a temporary form that's deleted as soon as the C compiler finishes? I can see some use for this even if it's just for combining C and Cobol code in the same project as it allows you to re-use old Cobol code while you're replacing it with something written in a less dead language or waiting on the budget to do just that.
        Usually you do not keep the C code, its just temporary, and you should modify the COBOL code, not the generated C code. You recompile code from the original COBOL code. The compiler outputs C code so GNUCobol will work on most platforms with a C compiler. Its just an intermediate phase. You can opt to have the compiler output the C code which you can store. However, normally, you just compile directly to binary and GNUCobol automatically runs the C compiler in the background to generate the binary. The C code generated is not source code, so you usually wouldn't save it, its really not useful and not very readable.

        Comment


        • #5
          Originally posted by jpg44 View Post

          Usually you do not keep the C code, its just temporary, and you should modify the COBOL code, not the generated C code. You recompile code from the original COBOL code. The compiler outputs C code so GNUCobol will work on most platforms with a C compiler. Its just an intermediate phase. You can opt to have the compiler output the C code which you can store. However, normally, you just compile directly to binary and GNUCobol automatically runs the C compiler in the background to generate the binary. The C code generated is not source code, so you usually wouldn't save it, its really not useful and not very readable.
          It's not that uncommon either... Gnome's Vala language works the same way. Basically, writing compilers - or plugins to compilers - is hard. It's much easier to write just a parser for your language, and transforming the resulting syntax tree into a language like C, which already has pretty good compiler support.

          For that matter, most of the Javascript alternatives work that way... browsers can't run Typescript, or use Javascript features that they don't yet support. But you can code in those languages, and convert them into a browser-acceptable form as a built step.

          Comment

          Working...
          X