What is a Programming Language?

What is a Programming Language? - CS1102: What is a...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Kathi Fisler, WPI September 13, 2007 1 The Design and Programming Perspectives To start to understand what comprises a programming language, let’s consider sample programs in four different languages (see Figure 1). What differences do you observe? 1. Syntax: each uses rather different notations for writing down programs. Quite true, but syntax is only so interesting; let’s look for deeper differences. 2. What kinds of data they inherently support. Fortran supported various kinds of numbers, C includes arrays, while Scheme included lists (de±ne-struct came in later), Java has classes. 3. Program organization techniques: The original Fortran didn’t even have functions or basic blocks of code. Modern languages all provide functions, many now provide classes and objects, as well as larger organizational constructs like packages and modules. 4. What kinds of control constructs the programmer can use to express computations. Fortran provided only branches (conditionals) and goto-statements. Later languages provided loops, function calls, exceptions, and other ways for programmers to control how a program executes. 5. What the language will do for the programmer. Languages like C require programmers to declare variables and free memory. Languages like Scheme and Java use garbage collection (programs that reclaim memory when a program is no longer using it). The different degrees of typechecking in modern languages (and there are lots of interesting differences) also fall into this category. Even though these samples are from large, mainstream languages, the same differences de±ne the boundaries of small, domain speci±c languages (such as those you implement to create a particular software system). Thus, our quick contrast of these languages suggests the questions you need to ask when you’re about to de±ne a new language: 1 1. What kind of data is this language designed to process? 2. What operations can someone perform on the data? 3. What control operators do I need to sequence operations? 4. What work is the language trying to save the programmer from doing? 5. What decisions should be postponed until run-time? 1 Side note: Languages are fascinating artifacts, because they are carefully engineered to tradeoff a range of concerns like the ones in this list (while retaining efFciency and a host of other important features). If you’re interested in this material, you should take a more substantial and upper-level course than 1102. Starting 2005-6, CS 4536 (Programming Language Design) will be offered every-other year; a similar course is the annual graduate course CS536 [Programming Language Design], which undergraduates can count as a 4000-level class. 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/06/2008 for the course CS 1102 taught by Professor Fisler during the Fall '07 term at WPI.

Page1 / 7

What is a Programming Language? - CS1102: What is a...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online