← Graph

One machine please, make it Turing

talk 29 connections

David Halasz's wroclove.rb 2024 talk (invited, in his words, by Andrzej 'Andre' Krzywda). A theoretical-computer-science crash course for Ruby programmers in four parts. (1) How computers work — models assembly as a Ruby Instruction class with an instruction pointer and Jump/Add/Subtract subclasses. (2) Formal languages — alphabets, grammars (terminals, non-terminals, production rules), and the Chomsky hierarchy: regular languages (regular grammars, parsable by finite-state machines / regexes; any Ruby regex compiles to such an automaton), context-free languages (single non-terminal on the left; parsable by pushdown automata; deterministic vs non-deterministic have different expressive power; all parenthesis-matching languages live here), context-sensitive languages (multi-symbol left-hand sides; parsable by linearly-bounded automata — close to real computers with finite memory), and recursively enumerable languages (unrestricted grammars; parsable by Turing machines; equivalent to lambda calculus and general recursive functions). (3) Turing machines — infinite tape, read/write head, states, transition function; used for proofs rather than computation; one machine can simulate another; determinism doesn't change expressive power; multitape machines reduce to single-tape (historical proof that a single-memory computer can exist, though physical code/data segments in x86 are separate); Church-Turing thesis; universal Turing machines; algorithmic complexity as space (cells used) vs time (head moves). (4) How compilers and interpreters work — lexical analysis (tokens via regular expressions / FSMs), syntactical analysis (parse tree / abstract syntax tree; sometimes bytecode instead; produces syntax errors), semantical analysis (type coherence, scopes, declarations; Rust's borrow checker lives here), optimizations (constant folding, constant propagation, caching, loop unrolling — including leveraging MMX/SSE for 4-wide multiplication), execution or code generation to assembly. Virtual machines are introduced as the component running intermediate representation — YARV (Yet Another Ruby Virtual Machine by Koji/Koichi Sasada) is Ruby's stack-based VM and also the home of the GVL and GC. Closes by noting that, in practice, nobody writes these by hand: lexer/parser generators and existing VMs (Java VM / JRuby, GraalVM / TruffleRuby, llvm for Ruby, Parrot, .NET) are already available; syntactical analysis uses pushdown automata, semantical analysis uses graph traversal — patterns Rubyists already use.

type
talk
talk One machine please, make it Turing
about
Chapter two of the talk introduces alphabets, grammars, words and languages.
talk One machine please, make it Turing
about
Walks through regular, context-free, context-sensitive, and recursively enumerable languages.
talk One machine please, make it Turing
about
Introduces FSMs as the parser for regular languages and lexical analysis.
talk One machine please, make it Turing
about
Explains pushdown automata as FSM + stack for context-free languages, with the parenthesis-matching example.
talk One machine please, make it Turing
about
Turing Machine concept
Core chapter describes tape, head, states, determinism, and multitape reductions.
talk One machine please, make it Turing
about
Presented as the bridge between Turing machines, lambda calculus and partially recursive functions.
talk One machine please, make it Turing
about
Lambda Calculus concept
Cited as equivalent in power to Turing machines and general recursive functions.
talk One machine please, make it Turing
about
Defines spatial and time complexity in Turing-machine terms (cells used, head moves).
talk One machine please, make it Turing
about
Chapter four walks through lex, parse, semantic, optimize, execute/codegen.
talk One machine please, make it Turing
about
AST is described as Ruby's internal tree representation after parsing.
talk One machine please, make it Turing
about
Bytecode concept
Described as an alternative/additional intermediate representation (e.g. Java, and YARV's execution format).
talk One machine please, make it Turing
about
Given as an optimization example — precomputed multiplications of literal constants.
talk One machine please, make it Turing
about
Given as an optimization example — substituting known constant values.
talk One machine please, make it Turing
about
Loop Unrolling concept
Halasz's favorite optimization, exploiting MMX/SSE SIMD for four multiplications at once.
talk One machine please, make it Turing
about
Virtual Machine concept
Explains what a (non-VirtualBox) VM is and how it hosts intermediate representations.
talk One machine please, make it Turing
about
YARV tool
Cited as Ruby's stack-based virtual machine written by Koichi Sasada.
talk One machine please, make it Turing
about
JRuby tool
Cited as the Ruby implementation running on the Java VM.
talk One machine please, make it Turing
about
Cited as an alternative Ruby implementation on GraalVM.
talk One machine please, make it Turing
about
LLVM tool
Mentioned as an alternative VM/compilation target for Ruby.
talk One machine please, make it Turing
about
Parrot VM tool
Mentioned as an alternative VM compatible with Ruby-family languages.
talk One machine please, make it Turing
about
Practical closing advice to use existing generators rather than writing parsers by hand.
talk One machine please, make it Turing
about
Halasz notes the GVL that 'kills parallelism in Ruby' lives inside the virtual machine layer.
person David Halasz
authored
One machine please, make it Turing talk
Halasz delivered the talk at wroclove.rb 2024.
from_talk
One machine please, make it Turing talk
Closing takeaway urging pattern recognition in real codebases.
from_talk
One machine please, make it Turing talk
Halasz's 'really bad news': you will never do this manually — tools exist.
from_talk
One machine please, make it Turing talk
Pattern-recognition point: every Ruby regex generates an FSM under the hood.
talk One machine please, make it Turing
presented_at
Talk was given at the March 22, 2024 edition of wroclove.rb.
related_to
One machine please, make it Turing talk
Blimke references David Halasz's talk the day before about formal languages as inspiration for adding a university slide to his own presentation.
related_to
One machine please, make it Turing talk
Halasz jokes repeatedly that 'Andre made me do it' — Krzywda invited him as an organizer.
relationship: invited the speaker

Provenance

Created
2026-04-17 16:17 seed
Read by
28 extractions