Sign in

Mark Di Marco

@markmarkoh.bsky.social
36 followers 64 following 12 posts

Early stage startup engineer and engineering leader, currently VP of Eng at Buildforce. Recording episodes of a new show called Commit History, which explores interesting commit on interesting open source projects markmarkoh.com

PostsRepliesMedia
Mark Di Marco @markmarkoh.bsky.social · 12/04/2025
Is this vibe coding? Asking for a friend.
010
Mark Di Marco @markmarkoh.bsky.social · 01/12/2024
The Day 1 #AdventOfCode solution we've all been waiting for: COBOL 65 years ago a committee met in the Pentagon to standardize a new programming language, and soon COBOL-60 was born. Can you guess the name of the sorting algorithm used in the SORT-ARRAYS procedure? adventofcode.com/2024/day/1
Screenshot of code Preamble in COBOL:
IDENTIFICATION DIVISION.
       PROGRAM-ID. NUMBER-PAIRING.
       
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT INPUT-FILE ASSIGN TO "INPUT.TXT"
           ORGANIZATION IS LINE SEQUENTIAL.
       
       DATA DIVISION.
       FILE SECTION.
       FD INPUT-FILE.
       01 INPUT-LINE.
          05 LEFT-NUM   PIC X(5).
          05 FILLER    PIC X(3).
          05 RIGHT-NUM  PIC X(5).
       
       WORKING-STORAGE SECTION.
       01 WS-ARRAYS.
          05 LEFT-ARRAY  OCCURS 1000 TIMES PIC S9(5).
          05 RIGHT-ARRAY OCCURS 1000 TIMES PIC S9(5).
       
       01 WS-VARIABLES.
          05 EOF-FLAG    PIC X VALUE 'N'.
          05 ARRAY-SIZE  PIC 9(4) VALUE 0.
          05 TOTAL-DIST  PIC 9(8) VALUE 0.
          05 TEMP-NUM    PIC S9(5).
          05 I           PIC 9(4).
          05 J           PIC 9(4).
          05 DIFF        PIC S9(5).
       
       PROCEDURE DIVISION.
       MAIN-PROCEDURE.
           DISPLAY "=== STARTING PROGRAM ==="
           OPEN INPUT INPUT-FILE
           PERFORM READ-NUMBERS UNTIL EOF-FLAG = 'Y'
           CLOSE INPUT-FILE
           
           DISPLAY "=== SORTING ARRAYS ==="
           PERFORM SORT-ARRAYS
           
           DISPLAY "=== CALCULATING DISTANCES ==="
           PERFORM CALCULATE-DISTANCE
           
           DISPLAY "=== FINAL RESULT ==="
           DISPLAY "TOTAL DISTANCE: " TOTAL-DIST
           STOP RUN.Screenshot of main procedures in COBOL for day 1 of advent of code solution:
       READ-NUMBERS.
           READ INPUT-FILE
               AT END MOVE 'Y' TO EOF-FLAG
               NOT AT END
                   ADD 1 TO ARRAY-SIZE
                   MOVE FUNCTION NUMVAL(LEFT-NUM) TO LEFT-ARRAY(ARRAY-SIZE)
                   MOVE FUNCTION NUMVAL(RIGHT-NUM) TO RIGHT-ARRAY(ARRAY-SIZE)
           END-READ.
           
       SORT-ARRAYS.
           PERFORM VARYING I FROM 1 BY 1 
               UNTIL I > ARRAY-SIZE - 1
               PERFORM VARYING J FROM 1 BY 1 
                   UNTIL J > ARRAY-SIZE - I
                   IF LEFT-ARRAY(J) > LEFT-ARRAY(J + 1)
                       MOVE LEFT-ARRAY(J) TO TEMP-NUM
                       MOVE LEFT-ARRAY(J + 1) TO LEFT-ARRAY(J)
                       MOVE TEMP-NUM TO LEFT-ARRAY(J + 1)
                   END-IF
                   IF RIGHT-ARRAY(J) > RIGHT-ARRAY(J + 1)
                       MOVE RIGHT-ARRAY(J) TO TEMP-NUM
                       MOVE RIGHT-ARRAY(J + 1) TO RIGHT-ARRAY(J)
                       MOVE TEMP-NUM TO RIGHT-ARRAY(J + 1)
                   END-IF
               END-PERFORM
           END-PERFORM.
           
       CALCULATE-DISTANCE.
           PERFORM VARYING I FROM 1 BY 1 
               UNTIL I > ARRAY-SIZE
               COMPUTE DIFF = LEFT-ARRAY(I) - RIGHT-ARRAY(I)
               IF DIFF < 0
                   COMPUTE DIFF = DIFF * -1
               END-IF
               ADD DIFF TO TOTAL-DIST
           END-PERFORM.
121
Mark Di Marco @markmarkoh.bsky.social · 01/12/2024
I look for commits in all sorts of programming languages, and so far throughout my research, Zig has been my favorite “new” language that not enough people are talking about. Here were a few patterns from my Bun.sh episode that stuck out: @ziglang.bsky.social
010