Overview
ISO/IEC 30170:2012 - Information technology - Programming languages - Ruby - is the international standard that defines the syntax and semantics of the Ruby programming language. It provides the normative language specification used to describe how Ruby programs are written and how conforming Ruby processors (interpreters or compilers) must behave. The standard also defines the rules for conformance of Ruby processors and programs, while explicitly excluding implementation limits such as program size, minimal hardware requirements, activation methods, and methods for reporting errors.
Key topics and technical requirements
ISO/IEC 30170:2012 covers the formal structure and runtime semantics of Ruby. Major technical topics in the document include:
- Lexical structure: program text, tokens, identifiers, keywords, string and numeric literals, regular expressions and here-documents.
- Syntax and grammar: productions, syntactic terms and notational conventions for writing valid Ruby source.
- Semantics: execution context attributes, evaluation rules, and the meaning of expressions and statements.
- Fundamental concepts: objects, variables (local, instance, class, global), methods, blocks, classes, singleton classes and modules, inheritance and method lookup.
- Expressions & statements: method invocation, operator expressions, assignments, control structures, iteration and jump expressions (return, break, next, redo, retry).
- Scope rules: scoping of local, global and class variables.
- Exceptions & error handling: causes of exceptions and the specified handling model.
- Built-in classes and modules: descriptions of core classes, modules, constants and commonly provided instance/singleton methods.
- Conformance rules: definitions for conforming Ruby processors, strictly conforming Ruby programs, and conforming Ruby programs to enable consistent behavior across implementations.
Note: the standard does not prescribe runtime resource limits, system activation methods, or specific forms of error reporting.
Applications and who uses this standard
ISO/IEC 30170:2012 is primarily used by:
- Ruby language implementers - authors of interpreters, virtual machines and compilers who need a formal reference for correct behavior and interoperability.
- Tool and library developers - maintainers of static analyzers, linters, debuggers and language servers that must follow the language specification.
- Test and conformance bodies - organizations creating compliance suites or certification tests for Ruby processors.
- Educators and researchers - those teaching language design or studying Ruby’s formal semantics.
- Enterprise and vendor teams - ensuring portability and predictable behavior of Ruby-based systems.
Related standards
ISO/IEC 30170:2012 complements other ISO/IEC programming-language standards and international best practices for language specification and conformance testing. For implementation or compliance projects, consult this standard as the authoritative specification of Ruby’s syntax and semantics.
Keywords: ISO/IEC 30170, Ruby standard, Ruby syntax and semantics, Ruby processor conformance, programming language specification, Ruby interpreter, Ruby compiler.