Banner Image

All Services

Programming & Development Math / Algorithms / Analytics

ChatGPT and programming languages

$25/hr Starting at $25

  1. A few weeks ago, I took a look at using ChatGPT to write the same routine in a dozen of the most popular programming languages. But as a programming language geek, I wondered just how far ChatGPT would go. Would it program in a language from the 1950s? Would it program in a language that used its own character set? Could it write code in one of the languages that wrote its code?

And so, I dove in. I've used many of the languages I'm spotlighting here, so I'll take a little walk down memory lane and include some stories about my experience with those I've used.


While I haven't run the code itself, I've read through all the generated programs. Most look right, and show the appropriate indicators telling us that the language presented is the language I asked for.

I'm telling you this because the headers on all the screenshots are wrong. Most are listed as SQL. For some reason BAL is shown as VBNet, and Prolog is listed as Rust. ChatGPT didn't make this error last time, but it made today, for all the languages shown here.

And with that, let's dive in.


Fortran

Fortran (or FORTRAN, as it was depicted back then) stands for Formula Translation. It was developed primarily for scientific and engineering calculations. Even though it dates back to the 1950s, it was often the first language taught to engineering students in the 1970s and 1980s.

For me, it was my fourth programming language, after BASIC, PDP-8 assembly language, and PDP-8 binary (yes, I wrote binary code so I could toggle it in on the front panel of an early minicomputer). My Dad generously drove me the hour down to Newark College of Engineering (now NJIT) so I could take their first-year programming course while I was still a sophomore in high school.

Fortran was never a favorite, although it would get most calculation-oriented jobs done. A variation of Fortran is still in use today, but it's pretty limited to specialty scientific work since many other modern languages do Fortran-level analytics, and do it better.


Here, because of the use of the implicit keyword, it looks like ChatGPT is depicting code written in the Fortran-77 variant.


COBOL

I was a teenaged COBOL programmer. I didn't know COBOL at the time, but somewhere around 1980 I saw a want ad for a COBOL programmer at the Northeast Regional Data Center of International Paper in Denville, NJ. It was about 40 minutes from my parents' home, and I needed a summer job. As soon as I managed to schedule an interview, I ran to the local bookstore and spent a weekend chowing down on all the COBOL reading material I could find.

COBOL was meant for business-oriented processing. Today, the same type of customers would be SAP or Salesforce users. But COBOL, as you can see from the COBOL-88 code below, was functional, but it sure wasn't elegant.


As it turns out, they wanted a full-time employee. But since I aced their test (apparently my weekend of study beat out the scores of the professionals who applied), they decided to put me to work for the summer. To say there was a cultural mismatch was an understatement. These were the very early days of microcomputers (think pre-PC) and I gloried in that stuff. Meanwhile, these folks were all about the suits and ties and giant data centers. I almost immediately picked up the nickname "Trouble." Hey, I was still a kid.

The defining moment for me came when one of the more seasoned programmers at the company took me aside to explain, and I quote, "COBOL is life." I took that message to heart and decided that I didn't want my life to be about COBOL. That summer was the last time I programmed anything in COBOL.


RPG (Report Program Generator)

No, it's not a rocket-propelled grenade or a role-playing game. RPG was a program for creating reports. You can see the evolution in the language (and computer language thinking, in general) between the two versions shown below. RPG II dates back to the late 1950s. RPG IV was updated in the 1990s, and is considerably more modern (but still definitely dated).


I did write a few RPG III programs for the AS/400 as a side gig while in college, but it was never anything I followed all that closely.


Lisp

I have a long love affair with Lisp. Lisp, named for LISt Processor, was sometimes described as Lots of Insipid Stupid Parentheses. For some reason, those parentheses clicked in my brain. Lisp was my gateway drug into AI programming, and as we've learned from ChatGPT's processing of language, knowledge can be represented as strings of words, or lists.

Back in the 1980s, I was a product manager for a RISC-based Common Lisp implementation, and coded in it for a while. Based on the defun greeting and let syntax generated by ChatGPT, it looks like the code below is also Common Lisp, a later variation of John McCarthy's original Lisp implementation of the late 1950s. McCarthy was one of the founding fathers of AI research, so it's only fitting that an AI should write in his language.


Algol

ALGOL (ALGOthymic Language) was ahead of its time. It allowed the passing of functions as parameters, and allowed the use of recursion. These are two key components of modern programming that were absent from popular languages like Fortran and COBOL, which were popular at the same time of ALGOL's introduction.


If Fortran, BASIC, and assembly language taught me top-down programming, ALGOL taught me how to structure my code. It was a foundational language that set the stage for my use of C, Pascal, Java, JavaScript, and most of the modern structured languages we use today.


Simula

Simula, as you might imagine, was developed for simulation and modeling. Like ALGOL, Simula was also ahead of its time, supporting the use of objects and classes. Object oriented programming has since become fundamental for many of today's most effective programming languages.


The use of the keyword OUTFIX tells me that ChatGPT probably wrote the following code in Simula-67.

About

$25/hr Ongoing

Download Resume

  1. A few weeks ago, I took a look at using ChatGPT to write the same routine in a dozen of the most popular programming languages. But as a programming language geek, I wondered just how far ChatGPT would go. Would it program in a language from the 1950s? Would it program in a language that used its own character set? Could it write code in one of the languages that wrote its code?

And so, I dove in. I've used many of the languages I'm spotlighting here, so I'll take a little walk down memory lane and include some stories about my experience with those I've used.


While I haven't run the code itself, I've read through all the generated programs. Most look right, and show the appropriate indicators telling us that the language presented is the language I asked for.

I'm telling you this because the headers on all the screenshots are wrong. Most are listed as SQL. For some reason BAL is shown as VBNet, and Prolog is listed as Rust. ChatGPT didn't make this error last time, but it made today, for all the languages shown here.

And with that, let's dive in.


Fortran

Fortran (or FORTRAN, as it was depicted back then) stands for Formula Translation. It was developed primarily for scientific and engineering calculations. Even though it dates back to the 1950s, it was often the first language taught to engineering students in the 1970s and 1980s.

For me, it was my fourth programming language, after BASIC, PDP-8 assembly language, and PDP-8 binary (yes, I wrote binary code so I could toggle it in on the front panel of an early minicomputer). My Dad generously drove me the hour down to Newark College of Engineering (now NJIT) so I could take their first-year programming course while I was still a sophomore in high school.

Fortran was never a favorite, although it would get most calculation-oriented jobs done. A variation of Fortran is still in use today, but it's pretty limited to specialty scientific work since many other modern languages do Fortran-level analytics, and do it better.


Here, because of the use of the implicit keyword, it looks like ChatGPT is depicting code written in the Fortran-77 variant.


COBOL

I was a teenaged COBOL programmer. I didn't know COBOL at the time, but somewhere around 1980 I saw a want ad for a COBOL programmer at the Northeast Regional Data Center of International Paper in Denville, NJ. It was about 40 minutes from my parents' home, and I needed a summer job. As soon as I managed to schedule an interview, I ran to the local bookstore and spent a weekend chowing down on all the COBOL reading material I could find.

COBOL was meant for business-oriented processing. Today, the same type of customers would be SAP or Salesforce users. But COBOL, as you can see from the COBOL-88 code below, was functional, but it sure wasn't elegant.


As it turns out, they wanted a full-time employee. But since I aced their test (apparently my weekend of study beat out the scores of the professionals who applied), they decided to put me to work for the summer. To say there was a cultural mismatch was an understatement. These were the very early days of microcomputers (think pre-PC) and I gloried in that stuff. Meanwhile, these folks were all about the suits and ties and giant data centers. I almost immediately picked up the nickname "Trouble." Hey, I was still a kid.

The defining moment for me came when one of the more seasoned programmers at the company took me aside to explain, and I quote, "COBOL is life." I took that message to heart and decided that I didn't want my life to be about COBOL. That summer was the last time I programmed anything in COBOL.


RPG (Report Program Generator)

No, it's not a rocket-propelled grenade or a role-playing game. RPG was a program for creating reports. You can see the evolution in the language (and computer language thinking, in general) between the two versions shown below. RPG II dates back to the late 1950s. RPG IV was updated in the 1990s, and is considerably more modern (but still definitely dated).


I did write a few RPG III programs for the AS/400 as a side gig while in college, but it was never anything I followed all that closely.


Lisp

I have a long love affair with Lisp. Lisp, named for LISt Processor, was sometimes described as Lots of Insipid Stupid Parentheses. For some reason, those parentheses clicked in my brain. Lisp was my gateway drug into AI programming, and as we've learned from ChatGPT's processing of language, knowledge can be represented as strings of words, or lists.

Back in the 1980s, I was a product manager for a RISC-based Common Lisp implementation, and coded in it for a while. Based on the defun greeting and let syntax generated by ChatGPT, it looks like the code below is also Common Lisp, a later variation of John McCarthy's original Lisp implementation of the late 1950s. McCarthy was one of the founding fathers of AI research, so it's only fitting that an AI should write in his language.


Algol

ALGOL (ALGOthymic Language) was ahead of its time. It allowed the passing of functions as parameters, and allowed the use of recursion. These are two key components of modern programming that were absent from popular languages like Fortran and COBOL, which were popular at the same time of ALGOL's introduction.


If Fortran, BASIC, and assembly language taught me top-down programming, ALGOL taught me how to structure my code. It was a foundational language that set the stage for my use of C, Pascal, Java, JavaScript, and most of the modern structured languages we use today.


Simula

Simula, as you might imagine, was developed for simulation and modeling. Like ALGOL, Simula was also ahead of its time, supporting the use of objects and classes. Object oriented programming has since become fundamental for many of today's most effective programming languages.


The use of the keyword OUTFIX tells me that ChatGPT probably wrote the following code in Simula-67.

Skills & Expertise

AlgorithmsProgram DevelopmentProgrammingR ProgrammingTyping

0 Reviews

This Freelancer has not received any feedback.