• Complain

it-ebooks - Programming Languages Lecture Notes (NEU CS4400)

Here you can read online it-ebooks - Programming Languages Lecture Notes (NEU CS4400) full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2017, publisher: iBooker it-ebooks, genre: Home and family. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

No cover
  • Book:
    Programming Languages Lecture Notes (NEU CS4400)
  • Author:
  • Publisher:
    iBooker it-ebooks
  • Genre:
  • Year:
    2017
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

Programming Languages Lecture Notes (NEU CS4400): summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Programming Languages Lecture Notes (NEU CS4400)" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

it-ebooks: author's other books


Who wrote Programming Languages Lecture Notes (NEU CS4400)? Find out the surname, the name of the author of the book and a list of all author's works by series.

Programming Languages Lecture Notes (NEU CS4400) — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Programming Languages Lecture Notes (NEU CS4400)" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Programming Languages Lecture Notes (NEU CS4400)

From: Programming Languages

Intro to CS4400/CS5400
Tuesday, January 10th
  • General plan for how the course will go.

  • Administrative stuff. (Most of the stuff from the web page.)

    http://pl.barzilay.org/

Intro to Programming Languages
Tuesday, January 10th
  • Why should we care about programming languages? (Any examples of bigprojects without a little language?)

  • What defines a language?

    • syntax
    • semantics
    • libraries
    • idioms
  • How important is each of these?

    • libraries give you the run-time support, not an important part ofthe language itself. (BTW, the line between a library and partof the language is less obvious than it seems.)

    • idioms originate from both language design and culture. They areoften misleading. For example, JavaScript programmers will oftenwrite:

      function explorer_move() { doThis(); }function mozilla_move() { doThat(); }if (isExplorer) document.onmousemove = explorer_move;else document.onmousemove = mozilla_move;

      or

      if (isExplorer) document.onmousemove = function() { doThis(); };else document.onmousemove = function() { doThat(); };

      or

      document.onmousemove = isExplorer ? function() { ... } : function() { ... };

      or

      document.onmousemove = isExplorer ? () => { doThis(); } : () => { doThat(); };

      or

      document.onmousemove = isExplorer ? doThis : doThat;

      How many JavaScript programmers will know what this does:

      function foo(n) { return function(m) { return m+n; };}

      or these:

      n => m => m+n;(x,y) => s => s(x,y);

      (Real example)

    • Compare:

      • a[25]+5 (Java: exception)
      • (+ (vector-ref a 25) 5) (Racket: exception)
      • a[25]+5 (JavaScript: exception (or NaN))
      • a[25]+5 (Python: exception)
      • $a[25]+5 (Perl: 5)
      • a[25]+5 (C: BOOM)

      -> syntax is mostly in the cosmetics department; semantics is thereal thing.

  • How should we talk about semantics?

    • A few well-known formalisms for semantics.

    • We will use programs to explain semantics: the best explanation isa program.

    • Ignore possible philosophical issues with circularity (but be awareof them). (Actually, they are solved: Scheme has a formalexplanation that can be taken as a translation from Scheme to logic,which means that things that we write can be translated to logic.)

    • We will use Racket for many reasons (syntax, functional, practical,simple, formal, statically typed, environment).

Intro to Racket
Tuesday, January 10th
  • General layout of the parts of Racket:

    • The Racket language is (mostly) in the Scheme family, or moregenerally in the Lisp family;

    • Racket: the core language implementation (language and runtime),written in C;

    • The actual language(s) that are available in Racket have lots ofadditional parts that are implemented in Racket itself;

    • GRacket: a portable Racket GUI extension, written in Racket too;

    • DrRacket: a GRacket application (also written in Racket);

    • Our language(s)

  • Documentation: the Racket documentation is your friend (But bewarethat some things are provided in different forms from differentplaces).

Side-note: Goto Statement Considered Harmful
Tuesday, January 10th

A review of Goto Statement Considered Harmful, by E.W. DIJKSTRA

This paper tries to convince us that the well-known goto statementshould be eliminated from our programming languages or, at least(since I dont think that it will ever be eliminated), thatprogrammers should not use it. It is not clear what should replaceit. The paper doesnt explain to us what would be the use of the ifstatement without a goto to redirect the flow of execution: Shouldall our postconditions consist of a single statement, or should weonly use the arithmetic if, which doesnt contain the offensivegoto?

And how will one deal with the case in which, having reached the endof an alternative, the program needs to continue the executionsomewhere else?

The author is a proponent of the so-called structured programmingstyle, in which, if I get it right, gotos are replaced by indentation.Structured programming is a nice academic exercise, which works wellfor small examples, but I doubt that any real-world program will everbe written in such a style. More than 10 years of industrialexperience with Fortran have proved conclusively to everybodyconcerned that, in the real world, the goto is useful and necessary:its presence might cause some inconveniences in debugging, but it is ade facto standard and we must live with it. It will take more thanthe academic elucubrations of a purist to remove it from ourlanguages.

Publishing this would waste valuable paper: Should it be published, Iam as sure it will go uncited and unnoticed as I am confident that, 30years from now, the goto will still be alive and well and used aswidely as it is today.

Confidential comments to the editor: The author should withdraw thepaper and submit it someplace where it will not be peer reviewed. Aletter to the editor would be a perfect choice: Nobody will notice itthere!

Quick Intro to Racket
Tuesday, January 10th

Racket syntax: similar to other Sexpr-based languages.

Reminder: the parens can be compared to C/etc function cal parens they always mean that some function is applied. This is the reason why(+ (1) (2)) wont work: if you use C syntax that is +(1(), 2()) but1 isnt a function so 1() is an error.

An important difference between syntax and semantics. A good way tothink about this is the difference between the string42 stored in afile somewhere (two ASCII values), and the number42 stored inmemory (in some representation). You could also continue with the aboveexample: there is nothing wrong with murder its just a word,but murder is something youll go to jail for. The evaluationfunction that Racket uses is actually a function that takes a piece ofsyntax and returns (or executes) its semantics.


define expressions are used for creating new bindings, do not try touse them to change values. For example, you should not try to writesomething like (define x (+ x 1)) in an attempt to mimic x = x+1.It will not work.


There are two boolean values built in to Racket: #t (true) and #f(false). They can be used in if statements, for example:

(if (< 2 3) 10 20) --> 10

because (< 2 3) evaluates to #t. As a matter of fact, any valueexcept for #f is considered to be true, so:

(if 0 1 2) --> 1 ; all of these are "truthy"(if "false" 1 2) --> 1(if "" 1 2) --> 1(if null 1 2) --> 1(if #t 1 2) --> 1 ; including the true value(if #f 1 2) --> 2 ; the only false value(if #false 1 2) --> 2 ; another way to write it(if false 1 2) --> 2 ; also false since it's bound to #f

Note: Racket is a functional language so everything has a value.

This means that the expression

(if test consequent)

has no meaning when test evaluates to #f

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Programming Languages Lecture Notes (NEU CS4400)»

Look at similar books to Programming Languages Lecture Notes (NEU CS4400). We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Programming Languages Lecture Notes (NEU CS4400)»

Discussion, reviews of the book Programming Languages Lecture Notes (NEU CS4400) and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.