![]() |
![]() |
|
Three things to consider, in a language:
Families of languages:
In class, we discussed the notable features of these families.
And although we did associate various languages as notably-having some
of these features,
we also noted that saying a language being a member of a family/category is bunk --
rather, think of these as styles of programming, and say that (e.g.)
"Racket notably supports functional-style (but certainly it
also features an object system,
and is also conducive to scripting tasks)".
At the end of class, the board looked like this (right-click to see in separate tab, full-size) (Photo credit eafzalzada@; thanks!)
There are a huge number of particular languages. We'll glance at poster: programming languages history (note the two earliest languages). You might want to browse, on your own, a language popularity index or a hello world collection.
Finally, it is true:
There are more things in heaven and earth, Horatio, Than are dreamt of in your philosophy. — Hamlet 1.5.184–185, Hamlet to HoratioLess high-falutin’,
Now there's more things in Tennessee than is dreamed of in your philosophy -- The Cramps, Cornfed DamesSee also: A Brief, Incomplete, and Mostly Wrong History of Programming Languages.
We mentioned that the racket developers consider racket not just a modern scheme, but rather a tool-system for easily designing your own languages. Those languages may not look like racket at all, but can be internally translated w/o too much work, such as demo'd by www.hashcollision.org/brainfudge/.
#lang planet dyoo/bf ++++++[>++++++++++++<-]>. >++++++++++[>++++++++++<-]>+. +++++++..+++.>++++[>+++++++++++<-]>. <+++[>----<-]>.<<<<<+++[>+++++<-]>. >>.+++.------.--------.>>+.
A good list of
10 influential, if (mostly) dead, programming langauges
What are various languages you've used?
These categories are (a) very blurry; (b) not informative -- not the fundamental building blocks of language-features.
low-level -- understading the language's semantics requires knowledge of the hardware it runs on.
C ("high-level assembly"),
assembly
Procedural: organize code in procedures (like functions/methods, but may have side-effects and not return values)
Organization based on *functions* that get passed data (cf. O.O.)
Ada - lots of safety features (and, requirements)
scripting: easy to work with files, OS calls, manipulate strings and I/O; glue together parts of other large projects
perl, python, javascript, php
ruby -- everything is an object, e.g. 3.plus(4)
javascript -- uses instance-based inheritance, not class-based inheritance
object-oriented: objects; inheritance (allows code re-use and code specialization)
you don't "call a function", you do "message passing" --
give an object a method (that is, request it to do something)
Organization based on *objects* that are asked to perform their actions(methods) (cf. Procedural)
Digression/detailed-preview: I have a videogame two functions
"damage-dealt-when-attacking" and "damage-dealt-when-defending".
I could combine these into a single "damage-dealt", where I also pass
the one of the two specific strings {"attacking","defending"}.
This'd work even if there were "damage-dealt-when-retreating";
there'd just be a big conditional based on which string was provided.
[Or I could use a hash-table to map the string to the right code to jump to, internally.]
…In fact, I could combine any 20 functions into one, and just pass along
string naming the "real" function (and perhaps all the other arguments as
one big List<Object>).
Well, in that case, the string is the "message" that we're passing.
O.O. just does that by having the dispatch being done in code associated
with the object/class, and thus there are only (say) 20 valid method-names.
Smalltalk -- first O.O. lang;
Java, C++, C#, Alice -- has some primitive types that are not objects (e.g. int, double, boolean, char)
functional: organize code into pure functions (no side-effects, always *return* value)
(If you give the same function the same inputs later, you MUST get the same answer.)
No mutation -- don't change variables or fields.
higher-order functions: can pass a function as an input, to be (used by) other functions! ...Can create new functions that didn't exist at compile-time.
Tends to have lots of small functions (only a few lines long).
Lisp (1965 -- 2nd oldest language in use, after Fortran);
evolved to Scheme (a streamlined lisp),
scheme evolved into racket (an industrial-strength scheme)
racket, F#
Haskell -- *pure* functional; lazy (and, very very abstract).
Declarative language -- your program gives the defining properties of the solution, but NOT how to find it.
(don't talk about loops, or variables, or updates; talk about *specifying* the result.)
Prolog
SQL, Excel
high-level domain-specific language:
Mathematica, MatLab
html, markup:
They are data -- not languages.
Side-effect: making a change that can be seen elsehwere.
Examples: setting global variables; e.g. current-time-of-day; and I/O.
name yr family feature(s)/notables (descendents/related) example TM, lambda calculus machine / hardware switches (incl. Babbage's Analytic Engine) assembly Lisp; Scheme, ML, Haskel, F# Fortran; PL/I; Algol; SmallTalk; C++, java, C# Ada; sh, csh, Tcl/Tk, perl, python, ruby rpn; postscript (printer is the interpreter; req'd M68000, not 8088,6502); pdf prolog (Japanese "4th wave") Basic (Apple II ROM; line#s; goto;'gosub' but no params (only globals) (recursion?!)), http://www.jenutech.com/images/HomeSweetGoto10.gif http://theinfosphere.org/File:Gotohell.jpg Pascal (teaching; nested procedures)
Link: A Brief, Totally Accurate History of Programming Languages
This page licensed CC-BY 4.0 Ian Barland Page last generated | Please mail any suggestions (incl. typos, broken links) to ibarland ![]() |