An Introduction to Computer Science for Everyone

Total Page:16

File Type:pdf, Size:1020Kb

An Introduction to Computer Science for Everyone CS 101: An Introduction to Computer Science for Everyone Software Engineering and Programming Languages Fall 2015 Contents 1 Languages, Levels, Libraries, and Longevity 2 2 Lyft Goes Swift: How (And Why) It Rewrote Its App From Scratch in Apple's New Language 9 3 Programming Language Can Build Synthetic DNA 14 4 Coverty Gets Code Right 25% Faster 16 5 HTML5 vs Native: The Mobile App Debate 19 6 New mathematical framework formalizes oddball programming techniques 28 1 1 LANGUAGES, LEVELS, LIBRARIES, AND LONGEVITY 2 New programming languages are born every day. Why do some succeed and some fail? JOHN R. MASHEY, TECHVISER 32 December/January 2004-2005 rants: [email protected] more queue: www.acmqueue.com December/January 2004-2005 33 QUEUE QUEUE John Mashey, \Languages, Levels, Libraries, and Longevity." ACMqueue, December 2004. Copyright Association for Computing Machinery. Article provided by Library Reserves for private study, scholarship, or research. Do not redistribute. This article can also be found at http://queue.acm.org/detail.cfm?id=1039532. 1 LANGUAGES, LEVELS, LIBRARIES, AND LONGEVITY 3 Programming FOCUS Languages Languages, Levels, Libraries, and Longevity In 50 years, we’ve already seen numerous programming systems come and (mostly) go, although some have remained a long time and will probably do so for: decades? centuries? millennia? The questions about language designs, levels of abstraction, libraries, and resulting longevity are numerous. Why do new languages arise? Why is it sometimes easier to write new software than to adapt old software that works? How many different levels of languages make sense? Why do some languages last in the face of “better” ones? We can gather insights from the last 50 years of programming systems to the current time. For the far future, Vernor Vinge’s fine science-fiction novel, A Deepness in the Sky, rings all too true. The young protagonist, Pham, has joined a starship crew and is 32 December/January 2004-2005 rants: [email protected] more queue: www.acmqueue.com December/January 2004-2005 33 QUEUE QUEUE John Mashey, \Languages, Levels, Libraries, and Longevity." ACMqueue, December 2004. Copyright Association for Computing Machinery. Article provided by Library Reserves for private study, scholarship, or research. Do not redistribute. This article can also be found at http://queue.acm.org/detail.cfm?id=1039532. 1 LANGUAGES, LEVELS, LIBRARIES, AND LONGEVITY 4 Programming FOCUS Languages Languages, Levels, Libraries, and Longevity learning the high-value vocation of “programmer archae- powerful, barely visible descendants, containing layers of ologist,” as the crew’s safety depends on the ability to software (and more than a few trapdoors). In the United find needed code, use it, and modify it without breaking States, we already have approximately 100 CPUs per per- something. He is initially appalled at the code he finds: son, and this number has traditionally increased tenfold The programs were crap…Programming went back each decade. As wireless sensor networks proliferate, we to the beginning of time…There were programs face a future in which most objects have CPUs and are here that had been written five thousand years ago, linked together via radio. before Humankind ever left Earth. The wonder of Software already matters, will continue to matter even it—the horror of it…these programs still worked… more pervasively, and language choice will always be an down at the very bottom of it was a little program important element of software quality, understandability, that ran a counter. Second by second, the Qeng Ho and usability. counted from the instant that a human had first set foot on Old Earth’s moon. But if you looked at it still more closely… the starting instant was actually Language wars seem to go on forever. Classic refer- about fifteen million seconds later, the 0-second ences on early languages are Jean Sammet’s Programming of one of Humankind’s first computer operating Languages—HistoryLANGUAGE WARS and ARE Fundamentals FOREVER ,2 which discussed systems… approximately 120 important languages as of 1969, and “We should rewrite it all,” said Pham. Richard Wexelblat’s History of Progarmming Languages,3 “It’s been done,” said Sura. which recorded a conference that chose 10 important “It’s been tried,” corrected Bret…“You and a languages created before 1967 and still in use in 1977. thousand friends would have to work for a century Of the 10, substantial new code is still written by many or so to reproduce it… And guess what—even if you people in Basic, Cobol, and Fortran. Others remain popu- did, by the time you finished, you’d have your own lar in their specific domains (Lisp, APT, and occasionally set of inconsistencies. And you still wouldn’t be Snobol), and some long-established IBM languages (PL/I, consistent with all the applications that might be GPSS) remain. Most of the 120 are gone. needed now and then…” Successful languages continue to arise from small “The word for all this is ‘mature programming groups in industry or universities, from commercial environment.’”1 vendors, or via consortia. In fact, with current CPUs and Any old Unix person would be amused to think that software, it is easier for individuals to create interest- Unix’s January 1, 1970, date would be enshrined so long. ing languages. By 2020, when those CPUs are laughably We have begun a process in which many people’s lives ancient, it should become even easier. are already dependent on the correct working of software, Several Web sites extensively catalog computer lan- and likely to become even more so. Software once runna- guages, including http://hopl.murdoch.edu.au. ble only on large systems migrates downward onto larger numbers of smaller computers. Some current cellphones use 300-MHz CPUs, running at a rate higher than any Unlike computers, human beings are not easily reengi- CPU commercially produced by 1990. Some have 64 MB neered for higher performance. Programmers vary wildly of memory, competitive with many expensive systems inLEVELS ability, AND but LEVERAGEeach person has real I/O limits in reading of the late 1980s. Vinge’s book extrapolates from current and writing code. Much software progress has come from small “smart dust” computers to assume that 5,000 years using faster computers, more efficient for people, if less so from now, most computing will be done by their hyper- for the computer. Dramatic increases in computer perfor- 34 December/January 2004-2005 rants: [email protected] more queue: www.acmqueue.com December/January 2004-2005 35 QUEUE QUEUE John Mashey, \Languages, Levels, Libraries, and Longevity." ACMqueue, December 2004. Copyright Association for Computing Machinery. Article provided by Library Reserves for private study, scholarship, or research. Do not redistribute. This article can also be found at http://queue.acm.org/detail.cfm?id=1039532. 1 LANGUAGES, LEVELS, LIBRARIES, AND LONGEVITY 5 mance and storage are matched by the expansion of code. PHP, Javascript, and Python are widely used where code In each computer class (mainframe, minicomputer, need not be so efficient, but where human efficiency, ease microcomputer), people tended first to write assembly of expression, and maintenance are the highest priorities. code for performance, then use higher-level languages as Sometimes a change in computing environment requires the computer class became more powerful. Commonly, new types of languages to allow widespread use. Program- more powerful languages are later-binding, moving more ming distributed applications was for decades a difficult decisions closer to execution time. A typical progression task that could be handled only by experts, despite is as follows: repeated attempts to write better languages or toolkits for Assembly language is normally one-to-one with CPU creating them. The Web changed that substantially. instructions. As an example of the evolution of different levels of Macro-assembler is one-to-many with CPU instruc- languages, let’s go to the Bell Laboratories of the 1970s, tions, good for parameterized expansion of standard code one of several environments that helped create important sequences. Humans are still burdened with substantial foundations of current computing. Of course, its roots go work in arranging data storage, allocating registers, and even further back. choosing efficient instruction sequences. These first In 1970, “real computers” were still mainframes, two levels have mostly (and thankfully) disappeared for although minicomputers were seeing increasing use. The most programmers, but some small embedded micros DEC (Digital Equipment Corporation) 16-bit PDP-11 was and many DSPs (digital signal processors) are still pro- introduced in 1970, and of particular importance, the grammed this way. PDP-11/45 appeared in 1972, with up to 248 KB of MOS Higher-level algorithmic languages such as Fortran (metal-oxide semiconductor) memory. By 1975, the PDP- and C automate much low-level detail so the human can 11/70 allowed a huge increase to 4 MB, although each concentrate on algorithms. Object orientation, inspired program was still restricted to 64 KB instructions and 64 by Simula and Smalltalk, and found widely in C++, Java, KB data. Some sites supported 16 simultaneous users on and C#, improves code and eases maintenance with bet- an 11/45, and with heroic effort, 48 on an 11/70. The ter data structures. VAX-11/780 was introduced in 1977 Domain-specific languages such and spread lower-cost 32-bit comput- as APT (Automatically Programmed ing more widely. By the end of the Tools) aim at a target domain, and decade, minicomputers were “real so can supply specific operations computers,” and 32-bit microcom- needed there and ignore everything puters were beginning to appear. else. Text-processing languages, such In 1970, there was widespread as roff, troff, SGML, Scribe, TeX, Post- use of applications languages such as script, and HTML, are familiar mem- Fortran, Cobol, and PL/I, but many bers of this group, some of which are applications’ and most systems’ powerful programming languages in codes were still written in assem- their own right.
Recommended publications
  • Ed Wegman, Yasmin Said and Milton Johns Sue Me for $2 Million but at This Stage a Motion to Dismiss Cannot Argue Matters of Fact, Just Legal Reasons
    Wegman, Said and Johns Sue Me For $2 Million Executive Summary MAS2015i 05/19/15 John R. Mashey1 The suits were badly written in many ways, rife with falsehoods and errors, Ed Wegman, Yasmin Said and Milton Johns Sue Me for $2 Million but at this stage a Motion to Dismiss cannot argue matters of fact, just legal reasons. On 04/17/15 my lawyers filed a strong, detailed Motion to Dismiss Executive Summary with Prejudice, which if accepted at hearing, would mean “don’t try again.” In December 2009, Canadian blogger Deep Climate (DC) started finding plagiarism in the 2006 Wegman Report (WR), which attacked the “hockey On 04/30/15, few days before the hearing, Johns filed voluntary stick” and authors Michael Mann, Raymond Bradley and Malcom Hughes. dismissals of their complaints, his last day at his own firm Day Johns, Based on those finds, in March 2010 Bradley lodged complaints against the where he had been since 2008. On 05/01/14 he joined Fluet Huber + Hoag. WR and a related paper with George Mason University (GMU). Later, I and At that stage, voluntary dismissal avoided “with prejudice” ruling and made others found more problems and reported them to GMU and journals. it harder to file a “frivolous lawsuit” claim. In March 2011, DC exposed pervasive plagiarism in a paper in Wiley’s Since court documentation is now public, that leaves on the record many WIREs:Computational Statistics journal. Soon after, similar or worse claims that I think are false, misleading or that fall far outside normal problems were found in a 2nd paper.
    [Show full text]
  • Oral History of John Mashey
    Oral History of John Mashey Interviewed by: John Markoff Edited by: Dag Spicer Recorded July 10, 2018 Mountain View, CA CHM Reference number: X8712.2019 © 2018 Computer History Museum Oral History of John Mashey Markoff: Today is Wednesday, July 18th, 2018. And we're at the Computer History Museum in Mountain View, California. I'm conducting this interview with John Mashey, who was an early contributor to UNIX at Bell Laboratories, beginning in the 1970s. He moved to Silicon Valley in the 1980s. And has since been involved with a number of the Valley's most significant start-up ventures. So why don't we begin with your family life? Could you give us some family background? I'd be interested in your parents, where they came from, what they did, maybe your earliest memories, and whether you had siblings. Mashey: Okay, so I grew up on a small farm in Western Pennsylvania, about 20 miles north of Pittsburgh, just at the edge of Allegheny County. The farm ... and here's a sketch from the 1850s, right? The barn and the farmhouse are still there, although the farmhouse is now a community center for a retirement community. Since it's no longer being farmed, the trees have all grown to take over the pasture that was in front of it. Markoff: And what was farmed when you were living there? Mashey: Oh, what was farmed? Cows and chickens, originally, but you know, we'd grow hay and corn and wheat and oats to feed things. Markoff: Would you call it a dairy farm? Mashey: It was a dairy farm, but it stopped being a dairy farm when State law said, "You must pasteurize milk." And basically small farmers stopped doing dairy, because the economics didn't make sense anymore.
    [Show full text]
  • MIPS Isas & Other Features History, Why’S, Mistakes & Omissions but One of the Longer Survivors!
    MIPS ISAs & Other Features History, why’s, mistakes & omissions but one of the longer survivors! John R. Mashey [email protected], @JohnMashey February 24, 2017 (updated from 02/24/17, 11/20/97) UC Santa Barbara – CMPSC 154 – special edition Speaker – John R. Mashey - en.wikipedia.org/wiki/John_Mashey • Small farm in (hilly) Western Pennsylvania N of Pittsburgh, founded ~1850 PA – Climate matters; keep topsoil; fix things; recycle; Liebig’s Law. smog, oil, coal, Marcellus shale • Pennsylvania State University, 1964-1973, BS Math, MS/PhD CMPSC • Bell Labs 1973-1983, early UNIX, MTS → Supervisor New – Programmer’s Workbench, shell programming, text processing, Jersey workload measurement/tuning in first UNIX computer center, etc – Created & managed group with software + cognitive psychologists • Convergent Technologies 1983-1984 ($400M), MTS → Director Software • MIPS Computer Systems 1985-1992, ($150M) Mgr. OS → VP Systems Technology – System coprocessor, TLB, interrupt-handling; byte addressing(!);64-bit; Hot Chips 1989-2016 – MIPS Performance Brief editor; a SPEC benchmarking group founder 1988- (science, statistics) • Silicon Graphics 1992-2000 ($3B),Dir. Systems Technology→ VP & Chief Scientist Silicon – MIPS R10000 & later architecture, including performance counters & software Valley – ccNUMA system architecture (NUMAflex in Origin3000, Altix); supercomputers for NCAR, etc – Performance issues in HPC, DBMS; technology forecasting, software strategy, Big Data – Evangelist work with sales/marketing, business development, alliances, scientists❤ ☹1995 • 2001- Typical Silicon Valley “Semi-retired” some consulting for high-tech co’s, VCs Computer History Museum Trustee; Travel; ski in B.C.; hike; bike; occasionally write articles, do talks Technical advisory boards … interest in climate 2001-, and then a weird hobby 2007- Help climate scientists, expose machinery of doubt, blog, rocks in gears.
    [Show full text]
  • LIFE with UNIX a Guide for Everyone
    LIFE WITH UNIX LIFE WITH UNIX A Guide For Everyone Don Libes & Sandy Ressler PRENTICE HALL, Englewood Cliffs, New Jersey 07632 Library of Congress Cataloging in Publication Data Life with UNIX, A Guide For Everyone UNIX is a registered trademark of AT&T. Production: Sophie Papanikolaou Cover production: Eloise Starkweather Cover design: Lundgren Graphics, Ltd. Cover artwork: Sandy Ressler Marketing: Mary Franz Life With UNIX was edited and composed with Frame Maker on a Sun Microsystems work- station running UNIX. Camera-ready copy was prepared on a Linotronic 100P by Profession- al Fast-Print Corporation using PostScript files generated by Frame Maker. 1989 by Prentice-Hall, Inc. A division of Simon & Schuster Englewood Cliffs, New Jersey 07632 All rights reserved. No part of this book may be reproduced, in any form or by any means, without written permission from the publisher. Printed in the United States of America 10 9 8 7 6 5 4 3 2 1 Prentice-Hall International (UK) Limited, London Prentice-Hall of Australia Pty. Limited, Sydney Prentice-Hall Canada Inc., Toronto Prentice-Hall Hispanoamericana, S.A., Mexico Prentice-Hall of India Priviate Limited, New Delhi Prentice-Hall of Japan, Inc., Tokyo Simon & Schuster Asia Pte. Ltd., Singapore Editora Prentice-Hall do Brasil, Ltda., Rio de Janeiro To our loving families Contents Preface .................................................................................................................. xiii How To Read This Book ......................................................................................xvii
    [Show full text]
  • The Machineries of Doubt & Disinformation Cigarettes, Climate
    The Machineries of Doubt & Disinformation Cigarettes, Climate & Other Electronic Confusions John R. Mashey JohnMashey AT yahoo PERIOD com @JohnMashey May 10, 2017 Stanford EE380 Overview • Introduction – Speaker: computer scientist/executive stumbles into an alternate universe – Background: books and blogs, consider this vaccine just in case • Climate change science, at most briefly – Consensus: It is warming, we are doing it and it will have (mostly) negative effects. – Evidence at least as strong as that for medical science: smokingdisease – Must reduce GHG emissions to lessen damage, may need to go negative – Implies reengineering of the world’s energy system … tough problem • Anti-science machinery of doubt – organization, people, funding, ideology – Goal: avoid unwanted policy, bypass science/realities in favor of politics – Tobacco anti-science environmental anti-science – Example: Heartland Institute: Joe Camel Innocent, mercury OK, no warming – Example: the Minnesota Social Cost of Carbon case, 2016 – Strong entanglement with politics, including reality-dismissal • Doubt & disinformation in the Internet age and before (examples) • Rocks in the gears • Discussion 1 Speaker – John R. Mashey - en.wikipedia.org/wiki/John_Mashey • Small farm in (hilly) Western Pennsylvania N of Pittsburgh, founded ~1850 PA – Climate matters; keep topsoil; fix things; recycle; Liebig’s Law. smog, oil, coal, Marcellus shale • Pennsylvania State University, 1964-1973, BS Math, MS/PhD CMPSC • Bell Labs 1973-1983, early UNIX, MTS Supervisor New – Programmer’s Workbench, shell programming, text processing, Jersey workload measurement/tuning in first UNIX computer center, etc – Created & managed group with software + cognitive psychologists • Convergent Technologies 1983-1984 ($400M), MTS Director Software • MIPS Computer Systems 1985-1992, ($150M) Mgr.
    [Show full text]
  • Crescendo to Climategate Cacophony Behind the 2006 Wegman Report and Two Decades of Climate Anti-Science John R
    Crescendo to Climategate Cacophony Behind the 2006 Wegman Report and Two Decades of Climate Anti-Science John R. Mashey* Climate science has produced increasingly-stronger scientific results intentionally obscured by an increasingly-noisy anti-science PR campaign. This has surged in a long crescendo from 1990 to the cacophony of ―Climategate,‖ the email hack of the University of East Anglia‘s Climatic Research Unit. This 185-page report details the long history of these attacks, including funding flows, organizations, people and tactics. It highlights the reality behind a 2005-2006 campaign that purposefully misled Congress. Its results have formed a pillar of the anti-science PR campaign to this day, including Climategate. Although the author has benefited from frequent discussions with leading researchers, the report is based primarily on public information - government reports, organizations' websites, peer-reviewed articles, scholarly books and existing Freedom of Information Act (FOIA) data. This report shows in detail: A tight network of organizations and individuals funded and executed the long campaign. They used well-honed tactics pioneered by tobacco companies, but to obscure the dangers of second-hand smoke, acid rain, chlorofluorocarbons and greenhouse gas emissions. From 2001 to 2005, several of these, the Competitive Enterprise Institute, George C. Marshall Institute, Senator James Inhofe and allies found ―new voices‖ in Canadians Ross McKitrick & Steven McIntyre, encouraged them and introduced them to Washington, DC. Using the old tactics, they tried to discredit specific scientists and the Intergovernmental Panel on Climate Change (IPCC). In 2005, Representatives Joe Barton and Ed Whitfield unusually demanded information from climate scientists Michael Mann, Raymond Bradley and Malcom Hughes, originators of a 1999 ―hockey stick‖ graph later used in the IPCC 2001 reports.
    [Show full text]