Wednesday, October 18, 2006

Group Discussion: About Dynamic Languages and Python

This month at the DFW Unix User Group our main presentation was given by Dave Thomas about Ruby and Rails. Seeing as I run the Linux SIG afterward and am often short on topic ideas, I figured we could make an evening of dynamic languages, discussing what is a dynamic language, why you would want one and how Python fits into the picture. It was a bit of a walk-through of loosely related programming concepts, attempting to explain various concepts that are commonly tossed about but loosely defined.

The group of about 15-20 people was quite interactive as we discussed (and debated) the meanings of data typing, covering the dimension of dynamic versus static (whether variables can change their type, once set), and the independent dimension of weak versus strong (whether type mismatches are implicitly fixed).






dynamicstatic
strongPython, RubyJava, FORTRAN
weakPerl, PHPCOBOL, C

Also introduced was the concept of duck typing, yet another aspect of dynamic languages, and brief overviews of continuations and closures, two very different ideas that people often confuse. We also went through the meanings of introspection and reflection, finding it hard to separate the two. We covered the distinction between first-class, second-class and other-class language concepts, showing how functions in C/C++ and classes in C++ are second-class constructs but first-class in Python.

This led to definitions of paradigms (algorithms for computers) versus methodologies (algorithms for people), also frequently confused in conversation. We covered the common methodologies of flowcharting, structured and top-down programming, object-oriented and extreme programming. And the well-known procedural, functional, object-oriented and declarative paradigms. The audience noticed that object-oriented was on both lists, being both a paradigm and a methodology. And we wondered why we call it 'functional' programming instead of function-oriented' programming, similar to OO. It was also pointed out that 'object-oriented' and 'dynamically typed' are independent traits of a language and that you can have one without the other.

At this point we went a bit into the history of object-oriented programming, beginning with Simula-67, which had only non-instanced data and lacked inheritance until those ideas where introduced by Smalltalk. And it was noted that there are (at least) three object-oriented flavors; the usual split between C++ and Smalltalk but also yet another approach with Oberon.

As a group we tackled the definition of a scripting language, concluding it was the use to which the language was put more than anything about the syntax itself.

Moving into Python, we began defining the criterial for choosing a dynamic language; ease of expression, ease of handing maintenance off to others, richness of libraries, quality of documentation, license, and the size, friendliness and skill level of the supporting community. Python excels in all these areas and the history and feature set of of Python was introduced.

It was also pointed out that Python is not an either-or language, in that you can combine it with various environments such as Java/JVM, C#/CLR and C++/CPython.

The talk was not our usual fare of Linux applications but seemed to be well received. Our membership consists of programmers and sysadmins. This talk was also my first use of reStructured text combined with the S5 slide format as I usually produce slides using OpenOffice.org, exported to PDF. The slideshow is available for online viewing as well as the raw reStructured text making it up.

-Jeff

No comments: