<?xml version='1.0' encoding='utf-8' ?>

<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>The Mandelbear&apos;s Musings</title>
  <link>https://mdlbear.dreamwidth.org/</link>
  <description>The Mandelbear&apos;s Musings - Dreamwidth Studios</description>
  <lastBuildDate>Sat, 26 May 2018 04:52:53 GMT</lastBuildDate>
  <generator>LiveJournal / Dreamwidth Studios</generator>
  <lj:journal>mdlbear</lj:journal>
  <lj:journaltype>personal</lj:journaltype>
  <image>
    <url>https://v2.dreamwidth.org/15740388/505737</url>
    <title>The Mandelbear&apos;s Musings</title>
    <link>https://mdlbear.dreamwidth.org/</link>
    <width>96</width>
    <height>96</height>
  </image>

<item>
  <guid isPermaLink='true'>https://mdlbear.dreamwidth.org/1621179.html</guid>
  <pubDate>Sat, 26 May 2018 04:52:53 GMT</pubDate>
  <title>Computer Languages:  compiled, interpreted, and assembled.</title>
  <link>https://mdlbear.dreamwidth.org/1621179.html</link>
  <description>

&lt;p&gt; A few months ago while waiting for a ferry with my sister I mentioned a
    programming language called Elm, which I&apos;ve been particularly interested
    in because it&apos;s a functional language that compiles into Javascript.  Her
    response, predictably, was something like &quot;I have no idea what you just
    said.  What does &apos;compiles&apos; mean?&quot;  So I explained the difference between
    compilers and interpreters, and a few other things about programming
    languages, and she said that it was the first time anyone had explained
    how programming languages work in a way that made sense to her.  In the
    back of my mind, I thought it might someday make an interesting blog post.
    So here it is.

&lt;p&gt; Inside of a computer, everything is a number.  These days, these numbers
    are all represented in binary (base two -- just ones and zeroes), stored
    in a couple of billion numbered locations each of which holds eight binary
    digits.  (A binary digit is called a &quot;bit&quot;, and eight of them together
    make a &quot;byte&quot;, which is the amount of data needed to represent a number
    between 0 and 255, or a single character in a block of text.  Apart from
    the numerical coincidence, computer bits have nothing to do with the bits
    that were made by breaking apart &quot;&lt;a href=&quot;https://en.wikipedia.org/wiki/Spanish_dollar&quot;&gt;pieces of
    eight&lt;/a&gt;&quot;.)

&lt;p&gt; The numbers in the computer&apos;s memory are used for three different things.
    First, some of them are used to represent the data that the computer is
    going to be working on.  Second, some of them represent the
    &lt;em&gt;location&lt;/em&gt; of those data.  And finally, some of them are
    instructions that tell the computer what to &lt;em&gt;do&lt;/em&gt; with the
    data.  Those instructions are called &quot;machine language&quot; because they&apos;re
    the only thing the machine actually understands.  Nobody writes programs
    in machine language if they can possibly avoid it.

&lt;p&gt; &lt;span class=&quot;cut-wrapper&quot;&gt;&lt;span style=&quot;display: none;&quot; id=&quot;span-cuttag___1&quot; class=&quot;cuttag&quot;&gt;&lt;/span&gt;&lt;b class=&quot;cut-open&quot;&gt;(&amp;nbsp;&lt;/b&gt;&lt;b class=&quot;cut-text&quot;&gt;&lt;a href=&quot;https://mdlbear.dreamwidth.org/1621179.html#cutid1&quot;&gt;the details&lt;/a&gt;&lt;/b&gt;&lt;b class=&quot;cut-close&quot;&gt;&amp;nbsp;)&lt;/b&gt;&lt;/span&gt;&lt;div style=&quot;display: none;&quot; id=&quot;div-cuttag___1&quot; aria-live=&quot;assertive&quot;&gt;&lt;/div&gt;

&lt;p&gt; TL;DR: an &lt;em&gt;assembler&lt;/em&gt; turns each line in a program directly into a
    machine-language instruction.  A &lt;em&gt;compiler&lt;/em&gt; takes a program written
    in a more complicated (for the computer) but easier to write in (for
    people) and turns it into a sequence of machine-language instructions,
    that can then be read back in and run.  An &lt;em&gt;interpreter&lt;/em&gt; skips that
    last step -- instead of writing out the machine language instructions, it
    just &lt;em&gt;does them&lt;/em&gt; on the spot.

&lt;p&gt; Teaser:  Next time I&apos;ll talk about different kinds of programming
    languages:  functional, imperative, object-oriented, and scripting.  I&apos;m
    also open to suggestions -- what would &lt;em&gt;you&lt;/em&gt; like me to write about?&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=mdlbear&amp;ditemid=1621179&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://mdlbear.dreamwidth.org/1621179.html</comments>
  <category>assemblers</category>
  <category>interpreters</category>
  <category>curmudgeon</category>
  <category>software</category>
  <category>compilers</category>
  <lj:mood>didactic</lj:mood>
  <lj:security>public</lj:security>
  <lj:reply-count>6</lj:reply-count>
</item>
</channel>
</rss>
