![]() |
![]() |
|
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 is 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 DamesWe 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/.
++++++++++++<-]>. >++++++++++[>++++++++++<-]>+. +++++++..+++.>++++[>+++++++++++<-]>. <+++[>----<-]>.<<<<<+++[>+++++<-]>. >>.+++.------.--------.>>+. ]]>(Note: this runs in DrRacket ≤v6.12, but not in v7.0.)
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)
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)
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)
language popularity index
poster: programming languages history
The hello world collection
- examples: enscript -o foo.ps (wimpout.ps)
Example: enscript -o foo.ps ; cat foo.ps ; open foo.ps
Example: cat wimpoutBoard.ps ; open wimpoutBoard.ps
also, sh: Example: cd ~/Unix
find . -name \*.ps -print
find . -name \*.ps -print | grep -i wimpout
- other notables:
* postscript
- C, Ada, Fortran, Pascal, Rexx, ...
- Smalltalk, Java, C++, C#, ...
- APL; Mathematica; Matlab
- javascript, perl, etc; html ? -- no; data. But, .css.
- sh/csh, .bat, applescript; scriptable photoshop?
Example: cd ~/Unix
find \*.ps
find \*.ps | grep -i wimpout
Note that we are calling functions. (How are arguments passed?)
- a *programmable* calculator.
* MS Word "macros" and mailing-list scripts
- abacus-instructions ?
- brainfudge: https://www.hashcollision.org/brainfudge/
There are more things in heaven and earth, Horatio,
Than are dreamt of in your philosophy.
— Hamlet 1.5.184–185, Hamlet to Horatio
Now there's more things in Tennessee
than is dreamed of in your philosophy
-- The Cramps, Cornfed Dames
https://www.hashcollision.org/brainfudge/ :
++++++++++++<-]>.
>++++++++++[>++++++++++<-]>+.
+++++++..+++.>++++[>+++++++++++<-]>.
<+++[>----<-]>.<<<<<+++[>+++++<-]>.
>>.+++.------.--------.>>+.
]]>
This page licensed CC-BY 4.0 Ian Barland Page last generated | Please mail any suggestions (incl. typos, broken links) to ibarland |