Hacker News new | past | comments | ask | show | jobs | submit login
Extending COBOL with Scheme and Brainfuck (opencobol.org)
16 points by wingo on July 6, 2011 | hide | past | favorite | 3 comments



APL extensions for OpenCOBOL sounds like a grand idea.

Just built the newly GPL'ed version of JSoftware's J announced by Eric Iverson. I'll give it a try.

Ok, first cut. Don't know enough APL (J) yet to get output to prove it's working, but it inits and evaluates 1 + 1 without any error codes.

      *> ***************************************************************
      *> Author:    Brian Tiffin
      *> Date:      20110711
      *> Purpose:   Attempt calling a J sentence. APL in COBOL.
      *> Tectonics: cobc -x callj.cob -lj
      *> ***************************************************************
       identification division.
       program-id. callj.

       data division.
       working-storage section.
       77 jptr usage pointer.
       77 result usage binary-long.

      *> ***************************************************************
       procedure division.
       call "JInit" returning jptr end-call
       display jptr end-display

       call "JDo"
           using by value jptr
           by content z"a =. 1 + 1"
           returning result
       end-call
       display result end-display

       goback.
       end program callj.
 
       $ cobc -x callj.cob -lj
       0x00007f06912bf010
       +0000000000
Life can be a lot of fun.


Extending COBOL with Brainfuck is wonderfully twisted, but you know what I want? A Brainfuck-to-COBOL interpreter implemented as a Turing Machine. Now, there's a nice weekend project for somebody....


No APL? Now that would be an awkward marriage…




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: