I Built a Modern Web App in COBOL (Even the Web Server)
nickfthedev
0:00 / 0:00
I Built a Modern Web App in COBOL (Even the Web Server)
123 просмотра · 7 дн. назад
nickfthedev
28 подписчиков
123 просмотра · 7 дн. назад
COBOL turns 67 this year. So I used it to build a modern habit tracker web app. I don't mean COBOL hiding behind a Node server: the web server itself is COBOL. Raw sockets, HTTP parsing, routing, HTML rendering and a plain-text database, all in about 650 lines of GnuCOBOL. And zero JavaScript.
In this video: • What COBOL is and why banks still run it • Calling C socket functions (socket, bind, listen, accept) straight from COBOL • Why the server forks a process per request, 1995-style • Parsing HTTP with INSPECT and UNSTRING, routing with EVALUATE • Building HTML with STRING ... WITH POINTER, and escaping user input • Date math with INTEGER-OF-DATE (COBOL beats JavaScript here) • A "database" made of fixed-width text records
Chapters 0:00 COBOL is older than the moon landing 0:24 Quick history lesson 0:58 What we're building: Streaks 1:23 Setup: GnuCOBOL + Zed, the four divisions 1:57 Fixed-size everything: PIC clauses 2:29 Raw sockets from COBOL 2:55 One process per request (fork) 3:21 Parsing HTTP and routing with EVALUATE 3:48 Building HTML and escaping user input 4:19 Date math and streaks 4:50 The very serious emoji AI 5:10 The database: two text files 5:33 Demo 6:04 Verdict 6:28 What should I build next?
Tools: GnuCOBOL 3.2, Zed (community COBOL extension), Safari.
If you enjoyed this, like and subscribe, and tell me in the comments which ancient language I should build a web app in next. Fortran? Pascal? Pure assembly?
#COBOL #WebDevelopment #Programming