Occasionally an off hand remark, perhaps even one said with a snide and “challenge” tone to it, will cause me to wonder. And dig, maybe just a tiny bit…
One of those happened a week or three ago.
I was telling a computer engineer friend about the Raspberry Pi and some of the things you could do with it. Probably a bit effusive, but as I’m generally criticized for being too “bland” or “reserved” (thanks Mum…) it’s rare that I’m “effusive” about anything. But in the case of the R.Pi I was happy with it, so may have been…
Don’t remember exactly what I was “effusive” about. I’d gotten Samba and file shares going, a Torrent Server (that’s humming still), and a caching DNS server. I think we’d been talking about his use of Arduino for teaching robotics and I was suggesting the R.Pi might be fun for kids to program too… He was talking about learning Java, as a lot of Arduino projects are heading that way (and kids seem to learn Java easily) or some such. I made some comment about languages on the R.Pi, and that I’d gotten FORTRAN running easily. He then challenged with something like “What, no COBOL?” (in that mocking kind of tone…)
Now both of us learned FORTRAN as our first computer language at the same school and from the same instructor. (Old college roomie… ) He’s an Engineer by degree, training, and career; and has used FORTRAN. So it was a bit of a ‘dig’ to have him slamming me with COBOL… ( I had one COBOL class that I hated… and did some minor maintenance on COBOL programs when out of school… but it’s really a horrid wordy cumbersome language with arcane rules about reading file and writing records or maybe the other way around… in any case, the structures you read are different from those you write, for the “same thing”. )
Well, time passes. And the “slight” fades. But sometimes not the “I wonder…”
So I found this:
OpenCOBOL is an open-source COBOL compiler. OpenCOBOL implements a substantial part of the COBOL 85 and COBOL 2002 standards, as well as many extensions of the existent COBOL compilers.
OpenCOBOL translates COBOL into C and compiles the translated code using the native C compiler. You can build your COBOL programs on various platforms, including Unix/Linux, Mac OS X, and Microsoft Windows.
The compiler is licensed under GNU General Public License.
The run-time library is licensed under GNU Lesser General Public License.
Since it’s a translator to C, and C runs on the R.Pi; it’s pretty much guaranteed this will work on the Raspberry Pi.
Though I don’t know if I can be that cruel to the Raspberry as to force it to do COBOL…
It is already under general Debian:
For Debian, it’s
apt-get install open-cobol
So it ought to be there… Dare I?
The VM with Emulator with…
Unrelated… it seems that early on with hardware scarce and memory more limited, some folks wanted to do a load of development (and likely compiling a lot of Debian… perhaps even Open COBOL) and made a Virtual Machine to do so. This is complicated by the fact that the R.Pi is an ARM chipset and most folks have an Intel computer. So they used an ARM emulator inside the virtual machine…
Now on a high end quad core or more box with a couple of dozen GB of memory, you can still get a heck of a lot of performance boost by using a Virtual Machine (OpenBox) with an emulator inside of it… though for the rest of us it does look just a tiny bit cruel.
Take a chip set designed to make things fast and efficient by having the minimal instructions needed (the definition of RISC Reduced Instruction Set Computer…), and run it via emulation on a CISC (Complex Instruction…) that is not a real CISC CPU but is in fact a Virtualized CPU on virtual hardware inside a software wrapper running the Linux operating system… that is then hosted on a multi-threaded multi-CPU CISC monster with pipelining and threading and… all running under MicroSoft Windows.
Now that’s cruel Raspberries if anything is…
But then, to install Debian Linux on that emulated chip in that virtual CISC under a Linux OS, inside a core of an Intel CPU, wrapped in MicroSoft Windows and, then, in a fit of fancy, to compile, port, install and run COBOL via a translator to C. Well… I’m sure someone will do it, but I don’t have to watch.
How to do the VM / qemu stuff:
You Know I Pull Wings Off Flies?
From the “burning ants with lenses and pulling wings off flies department”…
you know I’ve got to “go there”, don’t you?:
pi@dnsTorrent ~ $ sudo apt-get install open-cobol Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: autotools-dev libcob1 libcob1-dev libdb-dev libdb5.1-dev libgmp-dev libgmp3-dev libgmpxx4ldbl libltdl-dev libncurses5-dev libtinfo-dev libtool Suggested packages: db5.1-doc libgmp10-doc libmpfr-dev libtool-doc ncurses-doc autoconf automaken gcj The following NEW packages will be installed: autotools-dev libcob1 libcob1-dev libdb-dev libdb5.1-dev libgmp-dev libgmp3-dev libgmpxx4ldbl libltdl-dev libncurses5-dev libtinfo-dev libtool open-cobol 0 upgraded, 13 newly installed, 0 to remove and 250 not upgraded. Need to get 2,977 kB of archives. After this operation, 8,298 kB of additional disk space will be used. Do you want to continue [Y/n]? y Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libgmpxx4ldbl armhf 2:5.0.5+dfsg-2 [20.6 kB] Get:2 http://mirrordirector.raspbian.org/raspbian/ wheezy/main autotools-dev all 20120608.1 [73.0 kB] Get:3 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libgmp-dev armhf 2:5.0.5+dfsg-2 [552 kB] Get:4 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libgmp3-dev armhf 2:5.0.5+dfsg-2 [13.7 kB] Get:5 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libltdl-dev armhf 2.4.2-1.1 [203 kB] Get:6 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libtinfo-dev armhf 5.9-10 [89.6 kB] Get:7 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libncurses5-dev armhf 5.9-10 [202 kB] Get:8 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libtool armhf 2.4.2-1.1 [618 kB] Get:9 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libcob1 armhf 1.1-1 [87.6 kB] Get:10 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libcob1-dev armhf 1.1-1 [111 kB] Get:11 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libdb5.1-dev armhf 5.1.29-5 [775 kB] Get:12 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libdb-dev armhf 5.1.6 [2,256 B] Get:13 http://mirrordirector.raspbian.org/raspbian/ wheezy/main open-cobol armhf 1.1-1 [228 kB] Fetched 2,977 kB in 33s (88.3 kB/s) Selecting previously unselected package libgmpxx4ldbl:armhf. (Reading database ... 61520 files and directories currently installed.) Unpacking libgmpxx4ldbl:armhf (from .../libgmpxx4ldbl_2%3a5.0.5+dfsg-2_armhf.deb) ... Selecting previously unselected package autotools-dev. Unpacking autotools-dev (from .../autotools-dev_20120608.1_all.deb) ... Selecting previously unselected package libgmp-dev:armhf. Unpacking libgmp-dev:armhf (from .../libgmp-dev_2%3a5.0.5+dfsg-2_armhf.deb) ... Selecting previously unselected package libgmp3-dev. Unpacking libgmp3-dev (from .../libgmp3-dev_2%3a5.0.5+dfsg-2_armhf.deb) ... Selecting previously unselected package libltdl-dev:armhf. Unpacking libltdl-dev:armhf (from .../libltdl-dev_2.4.2-1.1_armhf.deb) ... Selecting previously unselected package libtinfo-dev:armhf. Unpacking libtinfo-dev:armhf (from .../libtinfo-dev_5.9-10_armhf.deb) ... Selecting previously unselected package libncurses5-dev. Unpacking libncurses5-dev (from .../libncurses5-dev_5.9-10_armhf.deb) ... Selecting previously unselected package libtool. Unpacking libtool (from .../libtool_2.4.2-1.1_armhf.deb) ... Selecting previously unselected package libcob1. Unpacking libcob1 (from .../libcob1_1.1-1_armhf.deb) ... Selecting previously unselected package libcob1-dev. Unpacking libcob1-dev (from .../libcob1-dev_1.1-1_armhf.deb) ... Selecting previously unselected package libdb5.1-dev. Unpacking libdb5.1-dev (from .../libdb5.1-dev_5.1.29-5_armhf.deb) ... Selecting previously unselected package libdb-dev:armhf. Unpacking libdb-dev:armhf (from .../libdb-dev_5.1.6_armhf.deb) ... Selecting previously unselected package open-cobol. Unpacking open-cobol (from .../open-cobol_1.1-1_armhf.deb) ... Processing triggers for man-db ... Processing triggers for install-info ... Setting up libgmpxx4ldbl:armhf (2:5.0.5+dfsg-2) ... Setting up autotools-dev (20120608.1) ... Setting up libgmp-dev:armhf (2:5.0.5+dfsg-2) ... Setting up libgmp3-dev (2:5.0.5+dfsg-2) ... Setting up libltdl-dev:armhf (2.4.2-1.1) ... Setting up libtinfo-dev:armhf (5.9-10) ... Setting up libncurses5-dev (5.9-10) ... Setting up libtool (2.4.2-1.1) ... Setting up libcob1 (1.1-1) ... Setting up libcob1-dev (1.1-1) ... Setting up libdb5.1-dev (5.1.29-5) ... Setting up libdb-dev:armhf (5.1.6) ... Setting up open-cobol (1.1-1) ... pi@dnsTorrent ~ $
So now I’ve gone and done it…
I’ve installed COBOL on my Raspberry Pi. It’s no longer just a DNS server / Torrent Server / Samba – M.S. File Server / FORTRAN Climate Codes port station… it’s now also a COBOL workstation. Sigh.
Guess what I’ll be telling the “Old College Roomie” tomorrow?
I guess next thing I need to do is learn how to remove packages.