The question comes from two directions: software people sizing up whether machining code “counts,” and machinists wondering whether their skill is programming or something lesser. The honest answer serves both: yes, G-code is a real programming language, of a specific kind, and the kind matters more than the yes.

What kind of language is it?

A domain-specific language (DSL) for machine motion: a language designed for one problem domain rather than general computation, sitting in the same category as SQL (queries), regular expressions (patterns), and HTML (documents). Within that frame, G-code is imperative and sequential (commands execute line by line), stateful in a distinctive way (modal commands persist until countermanded, the property behind half of all beginner mistakes), and minimal in its base form: no variables, no functions, no types, just words and numbers driving iron. Whether something so minimal is “real” dissolves once you place it correctly: nobody asks if SQL is real because it lacks while-loops.

The base language versus the macro layer

FeatureBase G-codeWith macro extensions
Sequential commandsYesYes
Modal stateYesYes
VariablesNoYes (#100-style)
ArithmeticNoYes
Conditionals / loopsNoIF, WHILE, GOTO
SubprogramsCalls only (M98)Parameterized

The right column is where the “real programming” hesitation fully evaporates: macro programming on industrial controls (Fanuc’s Custom Macro B, LinuxCNC’s O-codes, Siemens parametrics) writes parameterized part families with logic and loops, which is programming by any definition that includes early BASIC. The base language stays deliberately small because its job is to be generated, read, and verified quickly at a machine, a design goal, not a deficiency.

Why software people underestimate it, and what changes their mind

The underestimate comes from reading a posted file: thousands of coordinate lines, no abstraction in sight, because CAM generated it and abstraction lived upstream. What changes minds is the state model: G-code’s modal behavior means every line executes in a context built by prior lines, so reading it correctly is tracking implicit state, the same skill as reading register-level code, and the confusion pairs that bite beginners are state bugs, not vocabulary gaps. Developers who then meet the generation side (programs writing programs) and the Turing-completeness question usually exit the conversation with respect.

Why machinists should claim the word

Because the skill transfers and the labor market prices it. Reading state-heavy imperative code, debugging by narration, spotting the unsafe line, parameterizing repetition: these are programming competencies with a machining accent, and they are exactly what the operator-to-programmer ladder is built from. The syntactic gulf between G-code and general-purpose languages, mapped honestly in G-code versus C++, is real, and so is the conceptual bridge.

The sixty-year stress test

A language’s reality is also proven by survival under pressure to replace it. Conversational controls, STEP-NC, vendor dialects, and AI generation have all been pitched as G-code’s successor for decades, and posted G-code remains the industry’s interchange layer because the DSL fits its domain: human-readable enough to verify at the machine, simple enough to generate from anything, standard enough to move between controls (with dialects noted). Tools that fit their domain this well do not get replaced; they get wrapped.

Bottom line: real, specific, and worth saying so

G-code is a real programming language: a domain-specific, imperative, modal-state language whose macro layer adds full control flow, judged correctly against its domain rather than against Python. Learn it as programming (state-tracking, verification, parameterization) and both the machines and the job titles treat you accordingly. The core vocabulary that makes all of it readable trains in free 60-second drills on the G-code practice page, with G-Code Sprint repeating whatever you miss.

Sources

Frequently asked questions

Is G-code a real programming language?

Yes: a domain-specific language for machine motion, imperative and modal-state in its base form, with genuine variables, conditionals, and loops through macro extensions on most industrial controls. It is judged by fit to its domain, where it has survived sixty years of replacement attempts. To build the reading fluency that makes it feel like one, the free G-Code Sprint app is the top pick: 60-second drills with automatic repetition of missed codes.

Does learning G-code count as learning programming?

Yes, of a specific kind: state-tracking, line-by-line verification, debugging by narration, and parameterization through macros. The competencies transfer toward both CAM/programmer roles and general scripting, and employers in machining price them directly.

Why does G-code look so primitive compared to modern languages?

Because its base layer is designed to be generated by CAM and verified by humans at a machine: small vocabulary, no abstraction, explicit motion. The abstraction lives upstream (CAD/CAM) and in the macro layer, by design rather than by datedness.

What is the closest familiar language to compare it to?

SQL is the best analogy: a domain-specific language people use daily without it being general-purpose, judged by domain fit. For the syntax-level contrast with a general-purpose language, see the dedicated G-code versus C++ comparison.

G-Code Sprint is a study and practice tool only. Always follow your instructor, employer, machine manual, and shop safety procedures.