Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Augmenting Smalltalk Syntax

Talk at Smalltalks 2016 about how easy is in Smalltalk to create control flow structures and play with that.

  • Be the first to comment

Augmenting Smalltalk Syntax

  1. 1. agile software development & services Augmenting Smalltalk with your own Control Flow Syntax Hernán Wilkinson Twitter: @HernanWilkinson Blog:
  2. 2. In linguistics, syntax is the set of rules, principles, and processes that govern the structure of sentences in a given language, specifically word order. The term syntax is also used to refer to the study of such principles and processes. The goal of many syntacticians is to discover the syntactic rules common to all languages. In mathematics, syntax refers to the rules governing the behavior of mathematical systems, such as formal languages used in logic. (See logical syntax.) Syntax
  3. 3. In linguistics, grammar is the set of structural rules governing the composition of clauses, phrases, and words in any given natural language. The term refers also to the study of such rules, and this field includes morphology, syntax, and phonology, often complemented by phonetics, semantics, and pragmatics. Grammar
  4. 4. How easy is to change the syntax? How easy is to change the grammar? Change
  5. 5. Complexity = essential + accidental Complexity
  6. 6. Complexity = essential + accidental Complexity We can not reduce this one
  7. 7. Complexity = essential + accidental Complexity We can not reduce this one We can definitely reduce this one
  8. 8. Smalltalk Complexity
  9. 9. One day, in a typical PARC hallway bullsession, Ted Kaehler, Dan Ingalls, and I were standing around talking about programming languages. The subject of power came up and the two of them wondered how large a language one would have to make to get great power. With as much panache as I could muster, I asserted that you could define the "most powerful language in the world" in "a page of code." They said, "Put up or shut up."
  10. 10. “The biggest hit for me while at SAIL in late '69 was to really understand LISP. Of course, every student knew about car, cdr, and cons, but … no one had penetrated the mysteries of eval and apply. I could hardly believe how beautiful and wonderful the idea of LISP was [McCarthy 1960]”
  11. 11. “… there were deep flaws in its logical foundations. By this, I mean that the pure language was supposed to be based on functions, but its most important components--such as lambda expressions, quotes, and conds--were not functions at all, and instead were called special forms”
  12. 12. Closure
  13. 13. Closure Lisp Lambda Functions Algol-60 Block & Lexicographic binding Scheme Closure
  14. 14. “with full closures you can avoid control flow syntax”
  15. 15. Smalltalk Syntax object message (and other minor stuff)
  16. 16. if
  17. 17. Closure
  18. 18. Does not compile!
  19. 19. Example
  20. 20. (Ruby)
  21. 21. (Ruby)
  22. 22. while
  23. 23. Does not compile!
  24. 24. Closure
  25. 25. Closure Boolean or Closure?
  26. 26. Example
  27. 27. exceptions
  28. 28. Closure Closure
  29. 29. Implicit condition… why?Implicit condition… why?
  30. 30. In how many places is ZeroDevide handled? In how many places is SubscriptOutOfBounds handled?
  31. 31. Resources
  32. 32. file will not close if an exception signals before
  33. 33. Syntatically solved again
  34. 34. DSL
  35. 35. Conclusions ▶ Less syntax  more flexibility ▶ Less syntax  more grammar ▶ More grammar  easier to change, to augment! ▶ Less syntax makes the language yours! ▶ Don’t be afraid! Make your own language!
  36. 36. Questions? @hernanwilkinson
  37. 37. agile software development & services twitter: @10Pines Argentina Tel.: +54 (11) 6091-3125 Alem 896, 6 (1001) Buenos Aires