Using COBOL to make a video game!

preview_player
Показать описание

0:00 Intro
0:42 Simple example
3:39 Generated C code
5:01 Source columns
5:47 Variables and memory
6:32 Game code and paragraphs
7:22 Copybooks
8:54 Helper C file for SDL access
9:38 My own generated data files
10:00 Build commands
10:43 Game demo
11:10 Utility subprograms
12:10 Text formatting
13:09 Syntax and core language features
14:06 Game loop event processing
14:57 Hierarchical field levels, especially level 88
16:49 Emulating struct definitions
18:15 Frame animation with level 88
19:15 Takeaways
20:40 Outro
Рекомендации по теме
Комментарии
Автор

i'm glad you did this so i don't have to go through the effort of satisfying the morbid curiosity of "could i make a game with cobol?"

enirya
Автор

Cobol is the business language of choice for business people to do business things.

jeanjcl
Автор

this feels more like Homework: The programming language.

ayoubbelatrous
Автор

When looking at this code I instantly get the smell of old paper in my nose from ancient programming handbooks that I borrowed a thousand years ago from my local library and never returned.

guckstift
Автор

I learned COBOL MANY years ago. First job out of college was maintaining COBOL business systems on IBM 3090. Later did work on using Microfocus (and an early version of the OO transpiler later added to MF COBOL) on Unix and PC platforms. You did an amazing job organizing and explaining this work, and it was really cool seeing COBOL integrated with SDL. So few really understand how much COBOL still exists in production environments.

chuckbenedict
Автор

9:13 "[B]ecause I really wasn't always sure exactly what was going on in my COBAL code."
That pretty much sums up the COBAL experience, I guess.

stevenhe
Автор

Don’t know if this or getting my testicles twisted is worse.

obinator
Автор

I haven't even started to watch and I already feel the pain

thfsilvab
Автор

Seeing the transpiled C source generated from COBOL was pretty cool.

Bobbias
Автор

Regarding the direct call to SDL in C: I just encountered this in C/C++ libraries recently - basically, if your executable does not directly access symbols from within a dynamic library, that library will never be loaded because the linker sees no reason to have the executable do so.
For the GNU linker, the solution for me was to add the linker flag --no-as-needed (if using GCC, add "-Wl, --no-as-needed"). It looks like GNU COBOL may use the GNU linker, so, it may just work for you!

BrainySmurf
Автор

One thing I remember from working in COBOL (about 10 years ago) was that we *always* used a copybook to define the linkage section for a program, and then included (with the copy command) it into both the program itself and into any programs that would call it. We also had naming conventions for the source files, so that it was immediately obvious (without looking inside a file) which files belong together. (Kinda like an equivalent to .c and .h files in C.)

Another thing we did, was have template programs with all the relevant divisions and sections largely prefilled, so whenever we needed to make a new program, we ran a utility that asked for the name of the new program, and which template we wanted to base it on, and possibly some extra template-specific questions (such as tables and fields for database lookups). It would then autogenerate the source file, and any relevant copybooks. For some simple sub-programs, such as a batch routine to dump a database table, or a sub-program to fetch a single record, we didn't need to do any more. The template system did all the work - including writing SQL.

tuxino
Автор

Every time there is an emergency, COBOL devs are needed. Let's get this emergency apocalypse COBOL crisis bread, gentlemen.

owenwexler
Автор

9:41 YO FINALLY SOMEONE ELSE WHO PRONOUNCES PNG CORRECTLY

OpenKeith
Автор

I liked how you kept track of all the little tiny issues you ran into, really felt like I got a sense of what it was like making this

TankorSmash
Автор

This is really cool! Didn't know COBOL could do stuff like this.

christopherfore
Автор

COBOL is so verbose but when it comes to data types instead of being clear like any other language with integer, character, etc. it's the super unintuitive 9, x, z...

kim
Автор

Looks like we're one step closer to a video on REXX. I would be interested in your thoughts on the string parsing & manipulation in that.
I used to build edit macros in REXX to help quickly build out COBOL and JCL in my mainframe days, and it was wonderful.

lukez
Автор

I used to genuinely love CoBOL back in the olden days. Way nicer to look at than BASIC or ForTran. :)
PDP-11/73, a VT-100, RSTS/E, and COBOL-81 .... (sigh) ... those were the days.
`goback` sounds like a weird GNU-ism .... `STOP RUN.` is the normal way of going about it.

edgeeffect
Автор

The special two digit codes for lines sounds kinda vile, but it does seem mostly useable with enough familiarization

nathanfranck
Автор

Absolutely devious behaviour being displayed here

itsbk