Strange Code

Book description

Strengthen your overall coding skills by exploring the wonderful, wild, and often weird world of esoteric languages (esolangs). Strange Code starts with a dive into the underlying history of programming, covering the early computer-science concepts, like Turing machines and Turing completeness, that led to the languages we use today. It then explores the realm of “atypical” programming languages, introducing you to the out-of-the-box thinking that comes from these unusual approaches to coding.

Later chapters address the even more unusual esolangs, nearly all of which are like nothing you’ve ever seen. Finally, author Ron Kneusel helps you develop and use two entirely new programming languages. You may not apply these languages in your day job, but this one-of-a-kind book will motivate you to think differently about what it means to express thought through code, while discovering the far-flung boundaries of programming.

You'll learn:

•How to program with pictures using Piet
•How to write two-dimensional programs in Befunge
•How to implement machine-learning algorithms using the text pattern matching language SNOBOL
•How to decipher Brainfuck code like [->-[>+>>]>[[-]+>+>>]How to design and create two original programming languages

Learning to think in these languages will make you a better, more confident programmer.

Table of contents

  1. Cover Page
  2. Title Page
  3. Copyright Page
  4. Dedication
  5. About the Author
  6. About the Technical Reviewer
  7. BRIEF CONTENTS
  8. CONTENTS IN DETAIL
  9. FOREWORD
  10. ACKNOWLEDGMENTS
  11. INTRODUCTION
  12. PART I ON PROGRAMMING LANGUAGES
  13. 1 A CHERRY-PICKED REVIEW OF PROGRAMMING LANGUAGES
    1. Programming Language Paleontology
    2. The First Programming Languages
    3. ALGOL
    4. APL
    5. BASIC
    6. PL/I
    7. Logo
    8. Simula
    9. Pascal
    10. Prolog
    11. Smalltalk
    12. Standard ML
    13. Summary
  14. 2 THE ESSENTIALS OF PROGRAMMING LANGUAGES
    1. Defining Programming Language
    2. Syntax and Semantics
    3. Implementing Programming Languages
    4. Data Types
    5. Data Structures
    6. Variables and Scope
    7. Controlling Program Flow
    8. Programming Paradigms
    9. Summary
  15. 3 TURING MACHINES AND TURING COMPLETENESS
    1. The Halting Problem
    2. Turing Machines
    3. Universal Turing Machine
    4. Turing Completeness
    5. Let’s Build a Turing Machine
    6. Summary
  16. PART II ATYPICAL PROGRAMMING LANGUAGES
  17. 4 FORTH
    1. Installation
    2. Origins and Philosophy
    3. The Language
    4. Square Root Redux
    5. Discussion
    6. Summary
  18. 5 SNOBOL
    1. Installation
    2. Origins and Philosophy
    3. The Language
    4. Machine Learning with SNOBOL
    5. Discussion
    6. Summary
  19. 6 CLIPS
    1. Installation
    2. Origins and Philosophy
    3. The Language
    4. CLIPS in Action
    5. Discussion
    6. Summary
  20. PART III ESOTERIC PROGRAMMING LANGUAGES
  21. 7 THE ABCS OF ABCS
    1. ABC
    2. ABC2
    3. ABC2 in Action
    4. Discussion
    5. Summary
  22. 8 FRACTRAN
    1. The FRACTRAN Specification
    2. A Tale of Two Implementations
    3. Using FRACTRAN
    4. Understanding FRACTRAN
    5. More FRACTRAN Examples
    6. Discussion
    7. Summary
  23. 9 PIET
    1. Installation
    2. Understanding Piet
    3. Piet in Action
    4. A Tribute to Piet Mondrian
    5. The Piet Universe
    6. Discussion
    7. Summary
  24. 10 BRAINFUCK
    1. WTF Is BF?
    2. The Two Implementations
    3. BF in Action
    4. The BF Multiverse
    5. Discussion
    6. Summary
  25. 11 BEFUNGE
    1. Befunge-93 World Tour
    2. Befunge in Action
    3. Discussion
    4. Summary
  26. PART IV HOMEGROWN ESOLANGS
  27. 12 FILSKA
    1. Philosophy and Design
    2. Implementating Filska
    3. Summary
  28. 13 USING FILSKA
    1. Hello, World!
    2. Fibonacci, Anyone?
    3. Random Numbers
    4. A Simple Fractal
    5. Getting to the Roots of the Problem
    6. Linear Least-Squares Fit to a Line
    7. Discussion
    8. Summary
  29. 14 FIREFLY
    1. Philosophy and Design
    2. Implementation
    3. Configuring the Micro:bit
    4. Summary
  30. 15 USING FIREFLY
    1. The Process
    2. Fly Time
    3. Space Trek
    4. Beethoven in Lights
    5. Dance Dance
    6. Tea Time
    7. Discussion
    8. Summary
  31. 16 GOING FURTHER
    1. The Runners-Up
    2. Programming Language Resources
    3. Postlude
  32. APPENDIX: GENETIC PROGRAMMING WITH FIREFLY
    1. Introduction to Genetic Programming
    2. How Genetic Programming Works
    3. Defining Displays
    4. A Tiny Firefly Interpreter
    5. The Genetic Algorithm
    6. Putting It All Together
    7. Evolving Firefly Programs
    8. Discussion
    9. Final Thoughts
  33. INDEX

Product information

  • Title: Strange Code
  • Author(s): Ronald T. Kneusel
  • Release date: September 2022
  • Publisher(s): No Starch Press
  • ISBN: 9781718502406