r/ProgrammingLanguages • • Mar 03 '19

I made a "programming language" based on COBOL syntax

First of all, I'm sorry. I'm deeply sorry.

A few months ago, talking with some friends, we had the idea of developing a programming language just for the sake of it. We talked a little about it, design by committee got out of control and, a few days later, we abandoned the project completely without having written a single line of code.

I, though, have wanted to make a programming language my whole life and thus I kept trying to push the project forward by myself. I created a syntax loosely based on that of COBOL, made the worst compiler possible, wrote a somewhat slow "virtual machine" and released LDPL as a joke. Even the name is a pun on older, business oriented languages with BIG-CAPITAL-LETTER-NAMES. Again, like COBOL.

Fast forward a little and the joke got out of control.

I kept working on the language on my free time - pushing the not-very-ortodox but easy to code compiler forward - and the language got pretty usable. I mean, it's not a language you'd like to work with. It can't do everything. It's quite slow. It doesn't have any scoping nor functions (it does have sub-procedures, though) nor lambdas nor objects nor fancy data structures. Think of it more of an esolang than a serious language.

But what it lacks in efficiency and features, it makes up by having a cute dinosaur logo (poorly drawn as a joke on other mascots like the GCC gnu), unicode support, a full standard, comprehensive documentation, fancy examples and a half-written tutorial to be finished in the next days. It's also very portable, with binaries available for Linux amd-64 and ARMv8, Windows 64 bits and even Mac OS X for PowerPC processors!

So, if you are curious, bored or want to try something useless and new, download the LDPL source code or grab a precompiled binary for your operating system and code away.

I'm sure you won't hate it that much.

Edit: thank you so much for the gold, the silver, the comments and the upvotes! This is now the highest voted post ever in this subreddit, I can't be more thankful and impressed. Thank you, thank you, thank you!

Edit 2: I've made an LDPL subreddit so if you are interested in talking about LDPL, coding some LDPL for fun and whatnot, come join us me at r/ldpl!

347 Upvotes

97 comments sorted by

View all comments

11

u/modrup Mar 03 '19 edited Mar 03 '19

that is far more readable than cobol.

next time make sure you start every line with a line number, then optional label (for your goto command) and follow a verb-noun syntax.

edit - the version of Cobol I used was forked off in the 1950s. I've no idea what modern things arrived later but I did find using those languages backed me into learning Assembler because they aren't particularly high level.

4

u/lartu Mar 03 '19

As far as I know, the latest COBOL standards even have OOP support. Very, very strange. But yes, this is far more readable and maleable than COBOL. At first it was some rigid, verbose garbage but as I started to realize this could actually be used for toying around a little I made the syntax a little easier to read and write (allowing, for instance, lower case characters).

You don't even have to write specific characters on specific columns if you don't want to! haha!

4

u/jeff_coleman Mar 03 '19

Wow, I had no idea they were still updating that language. I looked it up, and discovered the latest COBOL standard was finalized in 2014.

7

u/shawnhcorey Mar 03 '19

FYI: The latest Cobol standard is called Cobol, not COBOL. Similarly, FORTRAN is Fortran and BASIC is Basic.

7

u/0x0ddba11 Strela Mar 03 '19

People finally realised that shouting does not get your point across.

2

u/shawnhcorey Mar 03 '19

It was the style back then for programming languages to be in all caps and have silly acronyms.

5

u/vanderZwan Mar 03 '19

Then we went through a recursive acronym phase, i.e. "Pine Is Not Elm"

EDIT: Oh wait, that's not a programming language... do any programming languages qualify for this actually?

4

u/wengemurphy Mar 03 '19

PHP: Hypertext Processor

in b4 "PHP is not a programming language"

0

u/[deleted] Mar 04 '19

[deleted] — view deleted comment

2

u/[deleted] Mar 04 '19

PHP is Not a Programming language

→ More replies

2

u/HiddenKrypt Mar 04 '19

It was originally "Personal HomePage", the recursive backronym came later as it became more than just a handful of .cgi scripts for setting up Lerdorf's homepage.

2

u/OctoBanana Mar 04 '19

I built a small toy language called Pine for my first interpreter! It's not a recursive acronym, although, if we overlook some spelling, it could be 'Pine Is Not Essembly'.

3

u/vanderZwan Mar 04 '19

Recursive backronyms are the best!

2

u/wallefan01 Mar 05 '19

I would have called that NQA (Not Quite Assembly) to go alongside NQC

1

u/Timbit42 Mar 03 '19

It is common for acronyms to be capitalized like USA, FBI, CIA, NSA, etc.

2

u/jeff_coleman Mar 03 '19

Good to know.

3

u/modrup Mar 03 '19

There is an awful lot of Cobol in the world and if you have 100 cobol developers you keep using Cobol. For batch work it is 'fine'.

5

u/vanderZwan Mar 03 '19

Yeah, but there is a difference between developers who maintain Cobol code, and developers who implement new Cobol standards. Who are the people who do that? Sounds like a person worth interviewing for a programming article at least!

2

u/modrup Mar 03 '19

I think in a modern context writing a cobol compiler is an interesting challenge as it seems like a language more suited to interpreting. Assembler on mainframes is not much different in terms of being a high or low level language.

1

u/jeff_coleman Mar 03 '19

I get that, but I didn't think maintaining old code necessitated a continually evolving standard. I guess it makes sense, having new features that gradually become available in order to make maintenance easier.

1

u/modrup Mar 03 '19

I don’t have any recent exposure but I know in the 90s COBOL was extended because Windows started being used as a client and I’m pretty sure a lot of this now is driven by vendors adding feature to their versions which they roll back into the standard.

E.g. web services mean you can directly call your old code from java

1

u/lartu Mar 03 '19

Yes, it's very surprising. I've heard there are no compilers that support every feature in the standard though. Don't know how much truth there's to that.