Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Programming Languages

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →

Programming Languages

Avatar for Dave Jagoda

Dave Jagoda

July 20, 2016

More Decks by Dave Jagoda

Other Decks in Programming

Transcript

  1. Goals of this presentation • Natural Languages (aka Human Languages)

    • Programming Languages vs. Natural Languages • All Programming Languages are the same • All Programming Languages are different • Language Family Trees • A Tour of Languages • Why choose one language over another?
  2. Comparing Natural Languages Consider counting in English, French, and Japanese

    Click this hyperlink to see some number tables Are some human languages are better than others for some tasks? Malcolm Gladwell suggests that they are in Outliers
  3. Programming Languages vs. Natural Languages Both types of languages are

    for communication Both are used to record ideas "The fundamental problem of communication is that of reproducing at one point either exactly or approximately a message selected at another point. Frequently the messages have meaning." Claude Shannon (1948)
  4. Programming Languages vs. Natural Languages Must not be ambiguous Ambiguity

    in a programming language is considered a bug, or at least capable of causing undefined behavior. May be ambiguous The Oxford Comma might make this clearer: "Top stories: World leaders at Mandela tribute, Obama-Castro handshake and same-sex marriage date set…" Some humor depends on ambiguity: "I see," said the blind man, as he picked up his hammer and saw.
  5. Programming Languages vs. Natural Languages Deliberate adoption from other languages

    Python, Java, and Ruby all provide Perl-style regular expression patterns Greenspun's Tenth Rule: Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp. Designed (mostly) Unintended adoption from other languages Japanese from English: sararīman, bā kōdo (image: Wikipedia) English from Spanish: patio, rodeo Evolved (mostly - Académie française tries to control adoption of words in French)
  6. Programming Languages vs. Natural Languages More convergent than divergent Good

    ideas from other languages often get incorporated over time. Most languages have more than immediate ancestor language. More divergent than convergent Tower of Babel Recall the language trees we saw earlier Consider the mutually unintelligible languages that evolved from Latin (e.g. Spanish, Portuguese, Italian) Consider the mutually unintelligible languages that use Chinese characters (e.g. Mandarin, Cantonese, Japanese)
  7. Programming Languages vs. Natural Languages Communicate to humans and computers

    "Programs must be written for people to read, and only incidentally for machines to execute." (image: MITpress) Communicate to humans Besides communicating to other humans, we use language to communicate to ourselves (e.g. to-do list). Our thoughts are in language (or so I think).
  8. Programming Languages vs. Natural Languages 1st language often changes over

    time My first language in chronological order BASIC Pascal C Perl Python JavaScript? 1st language doesn't change Exception: kids that move to a place where a different language is spoken
  9. Programming Languages vs. Natural Languages Estimated median languages is >

    2 I just made that up, but given n = median number of languages known, then: 1 <= n < ∞ Estimated median number of languages is 2 https://jakubmarian.com/average-number-of-languages-spoken-by-the-eu-population
  10. All Programming Languages are the same They all do the

    same thing - computation. They can all solve the exact same problems. Terms you may hear to describe them are: • Computability • Turing completeness • Lambda calculus Informally: • conditions - e.g. an 'if' statement • loops - e.g. a 'for' loop • states - e.g. variables
  11. All Programming Languages are different Insert cogent and irrefutable philosophical

    argument here: • #include <DavidHume.h> • #include <ReneDescartes.h> • #include <HandWaving.h> Different languages look different (see tour later for examples) The way things are expressed are different New languages are invented to improve upon prior languages New languages are invented to express things differently
  12. The Blub Paradox • Paul Graham's Beating the Averages suggests

    some languages are better ◦ How would one know? ◦ Plato's allegory of the cave is possible prior art ◦ Looking 'down' you can see less powerful languages ◦ What do you see when you look 'up'? • The cooking knife analogy - right tool for the job: • How do you say 'ninety-six' in French or Japanese? • Some languages are better than others for certain tasks • Are some languages just better overall?
  13. Are some programming languages better than others? Sometimes, you don't

    have a choice or very much choice: • iOS development implies Objective-C or Swift • Android development implies Java Sometimes libraries may encourage using a language • e.g. scikit is a Python machine learning library Sometimes, you have a lot of choice: • Backend development: JavaScript, Python, Ruby, Go, PHP, C, C++, etc.
  14. Fortran - 1956 Fortran is a contraction of Formula Translation

    Developed at IBM by John Backus and team Still in use today - the Lindy effect Considered a high level programming language Intended as an alternative to assembly language for the IBM 704 mainframe Target: scientific calculations
  15. LISP - 1958 The name is a contraction of LISt

    Processor Designed at MIT by "Uncle John" McCarthy, implemented by Steve "Slug" Russell Still in use today - the Lindy effect Influenced languages like JavaScript and Ruby Paul Graham loves it, Larry Wall does not: "fingernail clippings in oatmeal" Targets: AI, concurrency, less bugs in code (program copied from SICP)
  16. C - 1972 Named as the successor to the B

    language Developed by Dennis Ritchie at Bell Labs According the TIOBE language index, currently the 2nd most popular programming language! Things associated with C: portable, fast, control, memory management, pointers, core dumps, with great power comes great responsibility Languages built in C: Perl, Python, Java, Ruby Targets: Operating Systems, compilers, devices
  17. Worse is Better - Richard Gabriel - 1991 LISP Academia

    Theory MIT, Cambridge, Massachusetts "The Right Thing" Incorrectness is simply not allowed. The design must not be inconsistent. Symbolics filed for bankruptcy in 1996. C Industry Practice Bell Labs, Murray Hill, New Jersey "The New Jersey Approach" It is slightly better to be simple than correct. The design must not be overly inconsistent. "Unix and C are the ultimate computer viruses."
  18. Python vs. Ruby Guido van Rossum - 1991 Targets: scientific

    computing, scripting Yukihiro "Matz" Matsumoto - 1995 Targets: web development, scripting
  19. Java vs. JavaScript James Gosling - 1995 Target: enterprise applications

    Brendan Eich - 1995 Target: code in the browser
  20. Why choose one language over another? Sometimes you don't have

    much choice: • iOS development => Objective-C, Swift • Android => Java • Operating Systems => C, Assembly Language • Web front end development => JavaScript
  21. Why choose one language over another? Sometimes the libraries you

    want are for a particular language. A library is like a set of ready-to-use recipes. Instead of making from scratch, the recipe will help you avoid re-creating things, saving time, and often giving better results. Grandma's stuffing recipe might be better than your recipe. If your Grandma is a programmer, her code is likely to be better than yours, too. • scikit-learn for Machine Learning => Python • rails for Web Development => Ruby • WordPress for Web Publishing => PHP
  22. References Vladimir Vacić - History of Programming Languages Rajesh Kumar

    - Natural vs Programming Languages Donnie Berkholz - Programming languages ranked by expressiveness
  23. Programming Languages vs. Natural Languages Programming Language Families: • Lisp

    • C Programming Language Paradigms: • Procedural • Functional • Object Oriented Natural Language Families: • Germanic • Romance • Slavonic • Chinese Grammatical Categories: • Conjugation of verbs • Case (genitive, dative, etc.)
  24. Things to ponder about Natural Languages • What language do

    you think in? • What language do you dream in? • What language do you speak, read, write? • How many languages do you need to know? • If you are familiar with multiple languages, does one seem better? ◦ better for all purposes? ◦ better for some purposes? • Is the answer to the foregoing questions all the same language? • Do any of the foregoing questions have more than one answer for you? • Have any of these answers changed over time? "I speak Spanish to God, Italian to women, French to men and German to my horse." - Charles V?