{"id":4431,"date":"2024-03-22T02:00:00","date_gmt":"2024-03-22T06:00:00","guid":{"rendered":"https:\/\/www.both.org\/?p=4431"},"modified":"2024-03-16T09:16:39","modified_gmt":"2024-03-16T13:16:39","slug":"exploring-the-history-of-technology","status":"publish","type":"post","link":"https:\/\/www.both.org\/?p=4431","title":{"rendered":"Exploring the history of technology"},"content":{"rendered":"<div class=\"pld-like-dislike-wrap pld-template-1\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"\" data-post-id=\"4431\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                        <i class=\"fas fa-thumbs-up\"><\/i>\r\n                <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">2    <\/span>\r\n<\/div><\/div>\n<p>The standard recommendation for how to get started in open source is to \u201cscratch an itch,\u201d but with so many great open source programs and applications already available for every platform, including the web, it might be difficult to find your starting point. I\u2019d like to make a new suggestion to anyone who wants to get started in open source programming: explore technology history by writing a few cool \u201cretro\u201d programs.<\/p>\n\n\n\n<p>Here are a few \u201cjumping off\u201d points that any new programmer can use to learn both about programming and about the history of computing. Try out these ideas to explore a programming language that\u2019s new to you, whether that\u2019s Python, Rust, Go, or any other programming language.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">fmt: The trivial document formatter<\/h2>\n\n\n\n<p>When early Unix started to become popular as a research platform, universities wanted to learn more about it. The University of California at Berkeley requested and received a copy of Unix to run on a computer system there. Over time, faculty and students at Berkeley updated this copy of Unix and added new features to it. This \u201cBerkeley Unix\u201d became \u201cBSD,\u201d the Berkeley Software Distribution; BSD remains a popular version of Unix.<\/p>\n\n\n\n<p>One useful utility added to BSD was <code>fmt<\/code>, a program that reformatted plain text files. In its most basic usage, <code>fmt<\/code> <em>collected<\/em> words from the input and <em>filled<\/em> paragraphs on the output. The modern <code>fmt<\/code> program accepts several command line arguments that control formatting, such as <code>-c<\/code> to center the output lines and <code>-m<\/code> to recognize mail headers. However, a simple implementation of <code>fmt<\/code> might only accept files as command line arguments, and make assumptions for how the program should operate, such as hard-coding an output width.<\/p>\n\n\n\n<p>This program is a good exercise to learn a new programming language, and should only require functions to read lines of data and recognize words or <em>tokens<\/em> in the input. One implementation might print words one at a time to the output. Keep track of the length of the \u201ccurrent output line, and the length of the next word to print, and add a new line when the line gets too long.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">RUNOFF: An early document markup system<\/h2>\n\n\n\n<p>RUNOFF was certainly not the first document preparation system, it borrowed ideas from several predecessors that came before it. But RUNOFF made it easy to format documents for later printing on a chain printer. In the 1960s, these typewriter-like printers were very common.<\/p>\n\n\n\n<p>Like <code>fmt<\/code>, RUNOFF <em>collected<\/em> words from a file then <em>filled<\/em> paragraphs for the output. Blank lines started a new paragraph. This was the most basic way to format documents.<\/p>\n\n\n\n<p>But the real power of RUNOFF was using its control words to format text. These commands started with a leading period in the first column of a line, such as <code>.center<\/code> to center the next line of text, which could be abbreviated as <code>.ce<\/code> as a two-letter command.<\/p>\n\n\n\n<p>To write your own version of RUNOFF, start with an implementation of <code>fmt<\/code> that reads input from a file, and fills one line of text at a time. Then add control words to provide basic formatting. A simple implementation of RUNOFF might only use the abbreviated control words, like <code>.br<\/code> to \u201cbreak\u201d a new line, and <code>.bp<\/code> to begin a new page.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Control word<\/strong><\/td><td><strong>Abbreviation<\/strong><\/td><td><strong>Causes break?<\/strong><\/td><\/tr><tr><td>.adjust<\/td><td>.ad<\/td><td>yes<\/td><\/tr><tr><td>.append FILE<\/td><td>.ap FILE<\/td><td>no<\/td><\/tr><tr><td>.begin page<\/td><td>.bp<\/td><td>yes<\/td><\/tr><tr><td>.break<\/td><td>.br<\/td><td>yes<\/td><\/tr><tr><td>.center<\/td><td>.ce<\/td><td>yes<\/td><\/tr><tr><td>.double space<\/td><td>.ds<\/td><td>yes<\/td><\/tr><tr><td>.fill<\/td><td>.fi<\/td><td>yes<\/td><\/tr><tr><td>.header TEXT<\/td><td>.he TEXT<\/td><td>no<\/td><\/tr><tr><td>.indent N<\/td><td>.in N<\/td><td>no<\/td><\/tr><tr><td>.line length N<\/td><td>.ll N<\/td><td>no<\/td><\/tr><tr><td>.literal<\/td><td>.li<\/td><td>no<\/td><\/tr><tr><td>.nofill<\/td><td>.nf<\/td><td>yes<\/td><\/tr><tr><td>.nojust<\/td><td>.nj<\/td><td>yes<\/td><\/tr><tr><td>.page (N)<\/td><td>.pa (N)<\/td><td>yes (if N)<\/td><\/tr><tr><td>.single space<\/td><td>.ss<\/td><td>yes<\/td><\/tr><tr><td>.space (N)<\/td><td>.sp (N)<\/td><td>yes (default: N=1 line)<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">RUNOFF supported these control words<\/figcaption><\/figure>\n\n\n\n<p>RUNOFF is an excellent program to learn a new programming language. And it demonstrates the usefulness of other document processing systems. In fact, programmers at Bell Labs found RUNOFF so useful that they created their own implementation for the first Unix system. This early version only implemented the abbreviated commands, and so it was given an abbreviated name: <code>roff<\/code>. Later, the Unix team added new features to <code>roff<\/code> to support more advanced document formatting; this \u201cnew roff\u201d was called <code>nroff<\/code>. And several years later, when Bell Labs acquired a C\/A\/T phototypesetter, they updated <code>nroff<\/code> to support fonts and other special formatting provided by the C\/A\/T; this \u201ctypesetter roff\u201d was named <code>troff<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">LANPAR: The first computer spreadsheet program<\/h2>\n\n\n\n<p>In the 1960s, computers were still new to organizations. But computers of that era were not yet like the computers we know today: instead of interacting with the system with a keyboard and mouse, and seeing your results on a screen, computer operators fed stacks of cards into the system and waited until the computer processed them and printed the output on paper. It was a slow process compared to day\u2019s immediate user feedback, but these computers were a boon to productivity in the 1960s.<\/p>\n\n\n\n<p>For example, managers of business departments would need to create annual budget plans. These were models of what the organization expected to do over the next year, including spend and revenue. Modeling budgets was very tedious to do on paper, so the central computing departments in most organizations developed finance planning programs. Enter your starting assumptions and the finance software would plan your spend, estimate your revenue, and calculate your budget. But if you wanted to model a different set of expectations, it might take the programming team several months to implement even a minor change.<\/p>\n\n\n\n<p>In 1969, two engineers at Bell Canada had a pretty neat idea: \u201cWhat if managers could describe their own budget assumptions and calculations in a way that made sense to them? The system can model a new budget with that data and programmers can focus on more interesting problems.\u201d The result was a new program called LANPAR that was the first computer spreadsheet program, although not in the form we might recognize today.<\/p>\n\n\n\n<p>Here\u2019s how LANPAR worked: Imagine a grid of cells or \u201cboxes\u201d that each contain either a number or a calculation. In LANPAR, everything was a calculation or a number, no text. To define a number, use the letter K followed by the value, like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>K 3.141<\/code><\/pre>\n\n\n\n<p>Calculations used references to other boxes in the grid. The first row of boxes was 101, 102, 103, and so on. The second row was 201, 202, 203, \u2026 so any box address was two digits for the \u201ccolumn\u201d and one or more digits for the \u201crow.\u201d LANPAR supported 99 columns and 999 rows.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\">101<\/td><td class=\"has-text-align-center\" data-align=\"center\">102<\/td><td class=\"has-text-align-center\" data-align=\"center\">103<\/td><td class=\"has-text-align-center\" data-align=\"center\">104<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">201<\/td><td class=\"has-text-align-center\" data-align=\"center\">202<\/td><td class=\"has-text-align-center\" data-align=\"center\">203<\/td><td class=\"has-text-align-center\" data-align=\"center\">204<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">301<\/td><td class=\"has-text-align-center\" data-align=\"center\">302<\/td><td class=\"has-text-align-center\" data-align=\"center\">303<\/td><td class=\"has-text-align-center\" data-align=\"center\">304<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">LANPAR arranged boxes in a grid<\/figcaption><\/figure>\n\n\n\n<p>A calculation used these box references with basic arithmetic operations, in the order presented. LANPAR did not use operator precedence, so adding a few numbers then dividing the sum by another number looked like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>101 + 102 + 103 \/ 201<\/code><\/pre>\n\n\n\n<p>For example, if the first row of numbers was 1, 2, and 3, and box 201 had the number 3, the calculation would be the same as 1+2+3=6, then 6 divided by 3, giving the value 2.<\/p>\n\n\n\n<p>Originating in 1969, LANPAR could only read data from punched cards, rather than keyboard input. Each card represented a row of boxes; punched cards were limited to 72 columns of data, so LANPAR also supported continuation cards. But to explore this retro-computing program, your modern version of LANPAR might read lines of data from a file. Separate box data with a semicolon, like the original LANPAR. For example, to enter a simple calculation to find the average of three numbers, you might enter these lines: One line to hold the data, one box on a new line with the count, and another box on a third line to perform the calculation.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>K 1 ; K 2 ; K 3\nK 3\n101 + 102 + 103 \/ 201<\/code><\/pre>\n\n\n\n<p>Because LANPAR operated in \u201cbatch\u201d mode, it read the data, then processed all the boxes in a loop. When all calculations were complete, it printed the results. So the above LANPAR \u201cspreadsheet\u201d file might generate output like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1 ; 2 ; 3\n3\n2<\/code><\/pre>\n\n\n\n<p>This is a great first program to explore a new programming language. Writing your own version of LANPAR requires arrays to hold the data, and loops to iterate through the boxes to perform the calculations. Any LANPAR implementation will need to convert string data into number values, such as <code>K 3<\/code> to become the number 3. This will also require a parser for the data to read each part of the data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Learn programming and explore tech history<\/h2>\n\n\n\n<p>Whether you\u2019re new to programming or learning a new programming language, these project ideas can be great \u201cjumping off\u201d points to writing a new program. And I love that these programs demonstrate some key milestones in computing history: For example, LANPAR was the first computer \u201cspreadsheet\u201d and inspired other desktop spreadsheet programs like VisiCalc and Lotus 1-2-3. RUNOFF wasn\u2019t the first computer document preparation system, but it influenced other systems that came after it.<\/p>\n\n\n\n<p>So by exploring these programs and writing your own versions, you can <em>learn a new programming language<\/em> and also gain first-hand knowledge about <em>how these programs worked<\/em>. This is an excellent exercise for any programmer, at any skill level.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn about these important milestones in computing history as you experiment with writing your first program.<\/p>\n","protected":false},"author":33,"featured_media":2814,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[5,14,150],"tags":[316,91,108,152],"class_list":["post-4431","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-open-source-software","category-programming","tag-history","tag-linux","tag-open-source","tag-programming"],"modified_by":"David Both","_links":{"self":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/4431","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/users\/33"}],"replies":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4431"}],"version-history":[{"count":3,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/4431\/revisions"}],"predecessor-version":[{"id":4435,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/4431\/revisions\/4435"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/media\/2814"}],"wp:attachment":[{"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4431"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4431"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}