<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Monomorphic &#187; academic</title>
	<atom:link href="http://www.monomorphic.org/wordpress/tag/academic/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.monomorphic.org/wordpress</link>
	<description>Conceptual meandering</description>
	<lastBuildDate>Wed, 11 Jan 2012 02:07:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>What makes a good programming language?</title>
		<link>http://www.monomorphic.org/wordpress/what-makes-a-good-programming-language/</link>
		<comments>http://www.monomorphic.org/wordpress/what-makes-a-good-programming-language/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 09:00:09 +0000</pubDate>
		<dc:creator>johan</dc:creator>
				<category><![CDATA[Computer science]]></category>
		<category><![CDATA[Software development]]></category>
		<category><![CDATA[academic]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programming languages]]></category>
		<category><![CDATA[scala]]></category>

		<guid isPermaLink="false">http://www.monomorphic.org/wordpress/?p=1012</guid>
		<description><![CDATA[New programming languages are released all the time. History is littered with dead ones. There are also many long time survivors in good shape, as well as geriatric languages on life support. What makes a programming language attractive and competitive? How can we evaluate its quality? There are many different aspects of this problem. Ease [...]]]></description>
			<content:encoded><![CDATA[<p>New programming languages are released all the time. History is littered with dead ones. There are also many long time survivors in good shape, as well as geriatric languages on life support.</p>
<p>What makes a programming language attractive and competitive? How can we evaluate its quality? There are many different aspects of this problem.</p>
<p><strong>Ease of reading and writing</strong>, or: directness of the mapping between the problem in your head and the model you are creating on the computer. This can be highly domain dependent, for instance languages such as LaTeX, Matlab and R are designed with specific problems in mind and cater to users from that domain. Their limits show quickly when you try to stretch them beyond their envisioned purpose. Speaking of general programming languages, I think Python deserves to be mentioned as a language that is extremely readable and writable. It has other shortcomings though &#8211; see below. Prolog is also highly read- and writable if it suits your problem.</p>
<p><strong>Runtime performance. </strong>Arguably this is one of the few reasons to bother with using C++. For the majority of programming projects though, performance is much less of a problem than one might think, especially if one considers how close the performance of many JVM languages get to C++. When programmers think about their overall productivity and effectiveness in developing and maintaining a system, C++ is often not the best choice, obviously.</p>
<p><strong>Scalability to large teams. </strong>The key property here is: does the language do anything to help me, as a developer, work with code that other people wrote? Ease of maintenance may be strongly correlated with usability in large teams. An anti-pattern here is languages that allow for solving the same problem in a huge amount of ways with very variable syntax. For instance, Perl and C++ can lead to notoriously unmaintainable code if used carelessly. Some say that Scala also suffers from this problem. Basically, the language helps here if it prevents me from doing things that other developers might not expect, and that I might forget to document or communicate. This is why Gosling famously called Java a blue collar language; it restricts you enough to make teamwork quite practical. It even restricts the layout of your source file hierarchy. (Now we begin to see that some goals are in conflict with each other).</p>
<p><strong>Scalability to large systems. </strong>This is related to the preceding property, but whereas team scalability seems to be mainly about avoiding the creation of code fragments that surprise people other than their creators, system size scalability seems to be about avoiding the creation of code fragments that surprise other code fragments. Here one needs invariants, good type checking, static constraints of all kinds. Scripting languages like Perl and Python, lacking static typing completely, are some of the worst in this regard, since we cannot even be sure at startup time that methods we try to invoke on objects exist at all (Python).</p>
<p><strong>Scalability over time (maintainability).</strong> If there is both system size scalability and team scalability, then the system is also likely to be able to live for a long time without great troubles.</p>
<p><strong>Developer efficiency and rapid prototyping. </strong>Depending on the nature of the system being developed, this may depend on several different properties listed above.</p>
<p><strong>Availability of quality tools.</strong> Mature runtime environments, such as the JVM, have many more high quality tools and IDEs available than a language than Ruby. Mature languages also have more compilers for more different architectures available.</p>
<p>These points begin to give us an idea of how we can evaluate programming languages. However, I also believe that making a good language and making people use it is largely about luck and factors outside the design itself. Just like there&#8217;s a big step between imagining and specifying an utopian society and making that social order an actuality, there&#8217;s a big step between designing an ideal programming language and achieving widespread adoption for it. We have seen a way forward though: with generalised runtime environments such as the JVM and the CLR, we may develop and deploy languages that take advantage of a lot of existing infrastructure much more easily than before. And what I hope for is in fact that it becomes even easier to deploy new languages, and that new languages are as interoperable as possible (insofar as it doesn&#8217;t constrain their design), so that we could see more competition, more evolution and more risk taking in the PL space.</p>
 <p><a href="http://www.monomorphic.org/wordpress/?flattrss_redirect&amp;id=1012&amp;md5=fff6eeac12b2b852112ea787fe9ec90f" title="Flattr" target="_blank"><img src="http://www.monomorphic.org/wordpress/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.monomorphic.org/wordpress/what-makes-a-good-programming-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pointers in programming languages</title>
		<link>http://www.monomorphic.org/wordpress/pointers-in-programming-languages/</link>
		<comments>http://www.monomorphic.org/wordpress/pointers-in-programming-languages/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 15:21:03 +0000</pubDate>
		<dc:creator>johan</dc:creator>
				<category><![CDATA[Computer science]]></category>
		<category><![CDATA[Software development]]></category>
		<category><![CDATA[academic]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programming languages]]></category>
		<category><![CDATA[research]]></category>
		<category><![CDATA[reuse]]></category>
		<category><![CDATA[scala]]></category>
		<category><![CDATA[state]]></category>

		<guid isPermaLink="false">http://www.monomorphic.org/wordpress/?p=1006</guid>
		<description><![CDATA[It is likely that few features cause as much problems as pointers and references in statement-oriented languages, such as C, C++ and Java. They are powerful, yes, and they allow us to control quite precisely how a program is to represent something. We can use them to conveniently compose objects and data without the redundancy [...]]]></description>
			<content:encoded><![CDATA[<p>It is likely that few features cause as much problems as pointers and references in statement-oriented languages, such as C, C++ and Java. They are powerful, yes, and they allow us to control quite precisely how a program is to represent something. We can use them to conveniently compose objects and data without the redundancy of replicating information massively. In languages like C they are even more powerful than in Java, since just about any part of memory can be viewed as if it were just about anything through the use of pointer arithmetic, which is indeed frightening.</p>
<p>But they also complicate reasoning about programs enormously. Both human reasoning and automated reasoning. Pointers allow any part of the program to have side effects in any other part of the program (if we have a reference to an object that originated there), and they make it very hard to reason about the properties that an object might have at a given point in time (since we generally have no idea who might hold a reference to it &#8211; it is amazing that programmers are forced to track this in their heads, more or less). In my effort to design my own language, multiple pointers to the same objects &#8211; aliases &#8211; have come back from time to time to bite me and block elegant, attractive designs. I believe that this is a<em> very </em>hard problem to design around. Aliased pointers set up communication channels between arbitrary parts of a program.</p>
<p>Nevertheless attempts have been made, in academia and in research labs, to solve this problem. Fraction-based permissions track how many aliases exist and endow each alias with specific permissions to access the object that is referred to. Ownership analysis forces access to certain objects to go through special, &#8220;owning&#8221; objects. Unique or &#8220;unshared&#8221; pointers in some language extensions restrict whether aliases may be created or not. But so far no solution has been extremely attractive and convenient, and none has made it into mainstream languages. (<del>I know that someone</del> Philipp Haller made a <a href="http://lamp.epfl.ch/~phaller/readme_uniqueness.html">uniqueness plugin for the Scala compiler</a>, but it is not in wide use, I believe.)</p>
<p>If we are to attempt further incremental evolution of the C-family languages, aliased pointers are one of the most important issues we can attack in my opinion.</p>
 <p><a href="http://www.monomorphic.org/wordpress/?flattrss_redirect&amp;id=1006&amp;md5=45794a6be4c8cfc42a0be706de7eb18b" title="Flattr" target="_blank"><img src="http://www.monomorphic.org/wordpress/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.monomorphic.org/wordpress/pointers-in-programming-languages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Assessing research quality</title>
		<link>http://www.monomorphic.org/wordpress/assessing-research-quality/</link>
		<comments>http://www.monomorphic.org/wordpress/assessing-research-quality/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 07:48:33 +0000</pubDate>
		<dc:creator>johan</dc:creator>
				<category><![CDATA[Computer science]]></category>
		<category><![CDATA[academic]]></category>
		<category><![CDATA[complexity]]></category>
		<category><![CDATA[epistemology]]></category>
		<category><![CDATA[fallacies]]></category>
		<category><![CDATA[human condition]]></category>

		<guid isPermaLink="false">http://www.monomorphic.org/wordpress/?p=925</guid>
		<description><![CDATA[Academic research is difficult to evaluate. In order to know the significance of an article, a result or an experiment, one must know a lot about the relevant field. It is probably fair to say that few people read research articles in great depth unless they work in exactly the area the article is in. [...]]]></description>
			<content:encoded><![CDATA[<p>Academic research is difficult to evaluate. In order to know the significance of an article, a result or an experiment, one must know a lot about the relevant field. It is probably fair to say that few people read research articles in great depth unless they work in exactly the area the article is in. PhD theses might cite hundreds of articles, but it seems natural that not all of these articles will be read with the same degree of scrutiny by the author of the thesis.</p>
<p>Hence the trouble with obtaining funding for research. In order to obtain funding, you have to communicate something that seems incommunicable without the full commitment of the reader. Grant dispensers want to know a number on a scale: &#8220;what&#8217;s the quality of this paper between 0 and 1?&#8221;, but this quality number cannot be communicated separately from the full substance of the paper and its environs. And thus we end up with keywords, catchphrases that become associated with quality for short periods of time, as a way of bypassing this complexity, an approximate way of indicating that you are doing research on something worthwhile.</p>
<p>This reflects a broader problem in society of evaluating authorities. I cannot evaluate my doctor&#8217;s, or my dentist&#8217;s, or my lawyer&#8217;s work, since I don&#8217;t have the necessary competence. Accordingly, I base my trust on the person and some of their superficial attributes, instead of judging the work by itself. It seems that the same kind of thing becomes necessary sometimes in choosing what researchers to fund.</p>
<p>It also points to a faculty that must have evolved in human being since millennia: the capacity for evaluating important properties of things we do not understand well very quickly, for danger, nutrition, etc. Only that this faculty does not translate well to research&#8230;</p>
 <p><a href="http://www.monomorphic.org/wordpress/?flattrss_redirect&amp;id=925&amp;md5=3ca265fc36c7c45e59631ba781b0c24c" title="Flattr" target="_blank"><img src="http://www.monomorphic.org/wordpress/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.monomorphic.org/wordpress/assessing-research-quality/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Values 1: Philosophy, science, and their relationship</title>
		<link>http://www.monomorphic.org/wordpress/values-1-philosophy-science-and-their-relationship/</link>
		<comments>http://www.monomorphic.org/wordpress/values-1-philosophy-science-and-their-relationship/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 13:40:44 +0000</pubDate>
		<dc:creator>johan</dc:creator>
				<category><![CDATA[Computer science]]></category>
		<category><![CDATA[Philosophy]]></category>
		<category><![CDATA[academic]]></category>
		<category><![CDATA[culture]]></category>
		<category><![CDATA[fallacies]]></category>
		<category><![CDATA[nietzsche]]></category>
		<category><![CDATA[ontologies]]></category>
		<category><![CDATA[science]]></category>
		<category><![CDATA[values]]></category>

		<guid isPermaLink="false">http://www.monomorphic.org/wordpress/?p=831</guid>
		<description><![CDATA[This is hopefully the start of a short series of posts in which I attempt to relate the concepts of value and value creation, in particular as they were understood by Friedrich Nietzsche, to the modern world, in some kind of way. Comments of all kinds are encouraged! In the beginning (understood as ancient Greece), [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.monomorphic.org/wordpress/wp-content/uploads/2011/01/digitalNietzsche1.png"><img class="alignleft size-medium wp-image-842" style="margin: 1em;" title="FWNietzsche" src="http://www.monomorphic.org/wordpress/wp-content/uploads/2011/01/digitalNietzsche1-224x300.png" alt="" width="224" height="300" /></a></p>
<p><em>This is hopefully the start of a short series of posts in which I attempt to relate the concepts of value and value creation, in particular as they were understood by Friedrich Nietzsche, to the modern world, in some kind of way. Comments of all kinds are encouraged!</em></p>
<p>In the beginning (understood as ancient Greece), there was philosophy. That is to say, most systematic inquiry into matters worth thinking about was collected under this umbrella term. Ethics, politics, epistemology and metaphysics went side by side with physics, biology and astronomy. As millennia passed, the collective human knowledge and scholarly labour grew, and some philosophical disciplines got their own name, cut the umbilical cord, and got to stand on their own feet.</p>
<p>There are many definitions as to what a <em>philosopher</em> is; one definition would be those who study the academic subject of philosophy in academic institutions. The German philosopher and philologist Friedrich Nietzsche wrote at length about what a philosopher really is; in his definition a philosopher is someone who creates values. Nietzsche rejected morals and universal truth as laid down by a God or higher authority; instead they are created by subjective human beings, and by philosophers in particular.</p>
<blockquote><p>Perhaps [the genuine philosopher] himself must have  been critic and sceptic and dogmatist and historian and also poet and collector and traveller and solver of riddles and moralist and seer and &#8220;free spirit&#8221; and almost everything in order to pass through the whole range of human values and value feelings [...] But all these are merely preconditions of his task: this task itself demands something different &#8211; it demands that he <em>create values</em>.</p>
<p>(Friedrich Nietzsche, <em>Beyond Good and Evil</em>, s. 211, Walter Kaufmann transl.)</p></blockquote>
<p>We may understand a <em>scholar</em> to be a person who processes knowledge. Good scholarship entails marshalling what has been written and studied previously, perhaps with a view to settling a question or supporting a perspective. Scientists and philosophers can make use of scholars in their work. To the extent that the scholar does more than merely process knowledge, he or she is something more than a scholar.</p>
<p>In contrast, a <em>scientist</em>, as we understand him or her today, is someone who combines scholarship and primary investigation (in the form of calculation, experimentation, measurement and so on) in order to create models of nature and the world, in order to gain the power to explain. The classical scientific process involves repeated refinement of hypotheses until one that cannot be proven wrong has been found.</p>
<p>Today, science, which formerly was known as <a href="http://en.wikipedia.org/wiki/Natural_philosophy">natural philosophy</a>, has grown enormously large, and to most people probably appears to have much greater value than philosophy. The scientific mindset is widely appreciated and respected throughout the world &#8212; perhaps too respected. Scientists learn as one of their highest virtues to be skeptical and to reject assertions that are made without a basis in measurement or theory. Paralysis by skepticism is very much a possibility. To see the danger in this, we have to recognise that a great deal of valuable things in human history have been created without such a basis &#8211; by people who have been something like the ones Nietzsche describes.</p>
<blockquote><p>The dangers for a philosopher&#8217;s development are indeed so manifold today that one may doubt whether this fruit can still ripen at all. The scope and the tower-building of the sciences has grown to be enormous, and with this also the probability that the philosopher grows weary while still learning or allows himself to be detained somewhere to become a &#8220;specialist&#8221; &#8211; so he never attains his proper level, the height for a comprehensive look, for looking around, for looking <em>down</em>. [...]</p>
<p>Indeed, the crowd has for a long time misjudged and mistaken the philosopher, whether for a scientific man and ideal scholar or for a religiously elevated, desensualized, &#8220;desecularized&#8221; enthusiast and sot of god. And if a man is praised today for living &#8220;wisely&#8221; or &#8220;as a philosopher&#8221;, it hardly means more than &#8220;prudently and apart&#8221;.</p>
<p>(Friedrich Nietzsche, <em>Beyond Good and Evil</em>, s. 205, Walter Kaufmann transl.)</p></blockquote>
<p>In fact, scientists today do not, in my experience, work like the ideal scientist described above. Scientists often use their own judgment and their own values in order to influence how their science is to be used. Einstein and Oppenheimer had opinions about the use and misuse of the nuclear bomb. Creators of vaccine may have opinions on how it is to be distributed and may be able to influence this. Sometimes these value statements made by scientists are pure judgments, applications of an ethic that the scientists already believe in. However, sometimes the situation is so new that the scientists effectively have to create values. To the extent that they do this, these scientists dabble in ethics, morality and philosophy, but this is often overlooked, as is the fact that scientific method itself was created by philosophy.</p>
<p>Nietzsche calls for philosophers to make use of scientists and artists, and create values in the service of mankind. He calls for a new recognition of the true role and dignity of philosophy, which does not at all need to mean a reduction of the value of science, but rather an expansion of the whole system. Philosophy stands naturally above science and scholarship and uses them as its tools. The activity of creating values based on philosophical insight by necessity goes on constantly and should not be confined to little nooks in the margins of society. The full extent of and need for this activity needs to be acknowledged.</p>
<p>Has the situation changed since Nietzsche wrote <em>Beyond Good and Evil </em>in 1886?</p>
 <p><a href="http://www.monomorphic.org/wordpress/?flattrss_redirect&amp;id=831&amp;md5=0d073b281ac6d562856b710a6ca4d8f2" title="Flattr" target="_blank"><img src="http://www.monomorphic.org/wordpress/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.monomorphic.org/wordpress/values-1-philosophy-science-and-their-relationship/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Type theory</title>
		<link>http://www.monomorphic.org/wordpress/type-theory/</link>
		<comments>http://www.monomorphic.org/wordpress/type-theory/#comments</comments>
		<pubDate>Sun, 26 Dec 2010 21:23:32 +0000</pubDate>
		<dc:creator>johan</dc:creator>
				<category><![CDATA[Computer science]]></category>
		<category><![CDATA[Philosophy]]></category>
		<category><![CDATA[academic]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programming languages]]></category>

		<guid isPermaLink="false">http://www.monomorphic.org/wordpress/?p=774</guid>
		<description><![CDATA[One of the most interesting things I&#8217;ve been studying in the past year has been type theory. I feel that type theory is an area where a lot of separate fields can come together in a good design. In strongly typed languages, language implementation efficiency, syntax and language semantics all leave essential marks in the [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most interesting things I&#8217;ve been studying in the past year has been type theory. I feel that type theory is an area where a lot of separate fields can come together in a good design. In strongly typed languages, language implementation efficiency, syntax and language semantics all leave essential marks in the type system, and conversely, flaws in the type system can impair all of them.</p>
<p>Type theory was invented by <a href="http://en.wikipedia.org/wiki/Bertrand_Russell">Bertrand Russell</a> as a solution to his own <a href="http://en.wikipedia.org/wiki/Russell%27s_paradox">well-known paradox</a>, which cast doubt on the foundations of mathematics upon its discovery.  The problem posed by the paradox is essentially: given a set of all sets that do not contain themselves, does that set contain itself? Another interesting problem arising from self-referentialism. Type theory resolves this issue by classifying the members of sets according to some type, and in such a system a set definition like this one is not permissible.</p>
<p>(The drama surrounding Russell&#8217;s paradox and <a href="http://en.wikipedia.org/wiki/Principia_Mathematica">Principia Mathematica</a> can now also be read in the form of a &#8220;logicomix&#8221; <a href="http://www.amazon.com/Logicomix-Search-Truth-Apostolos-Doxiadis/dp/1596914521">graphic novel</a> by Doxiadis et al!)</p>
<p>Type theory did not end its life as a metamathematical hack that solved a set theoretical problem. <a href="http://cacm.acm.org/magazines/2010/2/69367-type-theory-comes-of-age/fulltext">It has now come of age.</a> Type systems are, of course, at the heart of the development of many modern programming languages. Java, C#, Lisp, ML and Haskell are but a few of the ones that depend completely on a nontrivial type system. (Even though C and C++ have type systems, they are kept in a crippled state by the fact that the programmer is allowed to ignore their commandments at will.)</p>
<p>What is the benefit of a type system in a programming language? In the words of <a href="http://www.cis.upenn.edu/~bcpierce/">Benjamin Pierce</a>,</p>
<blockquote><p>A type system is a syntactic method for automatically checking the  absence of certain erroneous behaviors by classifying program phrases  according to the kinds of values they compute.</p></blockquote>
<p>So, generally speaking, a type system helps distinguish correct programs from incorrect programs. The parser also does part of this job, of course, since many programs that cannot compile will not parse. But there are programs that are syntactically correct but at the same time semantically unsound according to the evaluation rules of the language. Consider the following Java statement:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">T x <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> U<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This is clearly syntactically acceptable, but is it semantically valid? In order for it to be, either U needs to be the same type as T, or a subtype of T. But Java programmers are free to define new subtypes of existing types in source code. In order for the parser to check the correctness of the assignment, it seems that either the grammar would become enormously large, or it would place awkward restrictions on Java syntax. So we leave more refined aspects of correctness to the type checker, which is applied later, post-parsing.</p>
<p>What does a type system look like? As used in programming languages today, a type system consists of a set of <em>typing judgments</em>. The judgments can be stacked together to form the <em>typing derivation</em> of an expression in the language. Every expression normally has a unique typing derivation, and when a type can be derived, we call the expression well typed. As Benjamin Pierce&#8217;s formulation suggests, each typing rule makes some assumptions about the kinds of values that constitute the various parts of an expression, and then says something about the kind of value that will be computed by the expression as a whole.</p>
<p>Type systems can look prohibitive at first sight, since they use quite a few algebraic symbols. But in general, the structure and interrelationships between the symbols is the most important thing to discern from them, and focussing on this aspect makes reading them much easier.</p>
<p>In the following mini-type system, typing judgments will have the form <img src='http://www.monomorphic.org/wordpress/wp-content/latex/4e7/4e703057592a70077f2894e4f4643f16-ffffff-000000-0.png' alt='\Gamma \vdash t: T' title='\Gamma \vdash t: T' class='latex' />, where <img src='http://www.monomorphic.org/wordpress/wp-content/latex/077/07710b5c43702a8bb7b9104eacc6ba71-ffffff-000000-0.png' alt='\Gamma' title='\Gamma' class='latex' /> is a <em>typing context</em>, <img src='http://www.monomorphic.org/wordpress/wp-content/latex/e35/e358efa489f58062f10dd7316b65649e-ffffff-000000-0.png' alt='t' title='t' class='latex' /> is a <em>term</em>, and <img src='http://www.monomorphic.org/wordpress/wp-content/latex/b9e/b9ece18c950afbfa6b0fdbfa4ff731d3-ffffff-000000-0.png' alt='T' title='T' class='latex' /> is a type. Terms are essentially fragments of the source code, and from smaller terms we can construct larger terms using syntactic forms. So for example, if <strong>a</strong>, <strong>b</strong> and <strong>c</strong> are terms, then we might use the if-syntax to construct the larger term</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>a<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>b<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>c<span style="color: #009900;">&#125;</span></pre></div></div>

<p>in a java-like language. The typing context <img src='http://www.monomorphic.org/wordpress/wp-content/latex/077/07710b5c43702a8bb7b9104eacc6ba71-ffffff-000000-0.png' alt='\Gamma' title='\Gamma' class='latex' /> is essentially just a map, mapping already typed terms to the types assigned to them. As we type increasingly large terms, we gradually add more information to the typing context. The symbol <img src='http://www.monomorphic.org/wordpress/wp-content/latex/7f5/7f5788d56bd683ffba59eed8ad6ecbe6-ffffff-000000-0.png' alt='\vdash' title='\vdash' class='latex' /> is just notational convention and has no particular meaning. The judgment <img src='http://www.monomorphic.org/wordpress/wp-content/latex/4e7/4e703057592a70077f2894e4f4643f16-ffffff-000000-0.png' alt='\Gamma \vdash t: T' title='\Gamma \vdash t: T' class='latex' /> is read as &#8220;term t has type T in typing context <img src='http://www.monomorphic.org/wordpress/wp-content/latex/077/07710b5c43702a8bb7b9104eacc6ba71-ffffff-000000-0.png' alt='\Gamma' title='\Gamma' class='latex' />&#8220;.</p>
<p>A fragment of a minimal system might look like the following.</p>
<img src='http://www.monomorphic.org/wordpress/wp-content/latex/d7a/d7a8b6c7986eb44d76281142c2a69410-ffffff-000000-0.png' alt='  \inferrule  {  \Gamma \vdash t_1 : T  \and  \text{vartype}(v) = U  \and  T &lt;: U  }  {  \Gamma \vdash v = t_1 : U  }  {  \text{T-ASGN}  }  \\  \vspace{5mm}  \\   \inferrule  {  \Gamma \vdash t_1 : \text{Int}  \and  \Gamma \vdash t_2 : \text{Int}  }  {  \Gamma \vdash t_1~\textsf{intBinop}~t_2 : \text{Int}  }  {  \text{T-BINOP}  }   \\  \vspace{5mm}  \\   \inferrule  {  \Gamma \vdash t_1 : \text{Bool}  \and  \Gamma \vdash t_2 : T_0  \and  \Gamma \vdash t_3 : T_0  }  {  \Gamma \vdash \text{if}~t_1~\text{then}~t_2~\text{else}~t_3 : T_0  }  {  \text{T-IF}  }  ' title='  \inferrule  {  \Gamma \vdash t_1 : T  \and  \text{vartype}(v) = U  \and  T &lt;: U  }  {  \Gamma \vdash v = t_1 : U  }  {  \text{T-ASGN}  }  \\  \vspace{5mm}  \\   \inferrule  {  \Gamma \vdash t_1 : \text{Int}  \and  \Gamma \vdash t_2 : \text{Int}  }  {  \Gamma \vdash t_1~\textsf{intBinop}~t_2 : \text{Int}  }  {  \text{T-BINOP}  }   \\  \vspace{5mm}  \\   \inferrule  {  \Gamma \vdash t_1 : \text{Bool}  \and  \Gamma \vdash t_2 : T_0  \and  \Gamma \vdash t_3 : T_0  }  {  \Gamma \vdash \text{if}~t_1~\text{then}~t_2~\text{else}~t_3 : T_0  }  {  \text{T-IF}  }  ' class='latex' />
<p>Three typing rules have been introduced here, T-ASGN for assignments, T-IF for if-statements, and T-BINOP for binary operations on integers, like + and -.<br />
Every rule has the same structure: above the line, assumptions that must hold true for the rule to be applied; below the line, the conclusion we may draw if the assumptions are true.</p>
<p>Above, the following example was given.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">T x <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> U<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Using T-ASGN, we can type an assignment statement like this one. The assumption T &lt;: U says that T is a subtype of U. We have also assumed a lookup function <strong>vartype</strong> which gives the declared type of the variable we assign to. In English, we can read the rule T-ASGN as saying: &#8220;Assuming that the type of the right hand side is a subtype of, or the same type as, the declared type of the variable, the assignment will evaluate to a value that has the declared type of the variable&#8221;. Of course not all programming languages implement assignment in this way.</p>
<p>In the T-BINOP rule, we must of course substitute an actual operation on integers for the special word <strong>intBinop</strong> for it to be valid. For addition, the rule can be read as &#8220;Assuming that the left hand side and the right hand side are both integers, then the result is also an integer&#8221;.</p>
<p>Finally, the T-IF rule says &#8220;assuming that the truth condition is a boolean, and that the two alternative paths have the same type, then the if-statement evaluates to the same type as that of the two conditional paths&#8221;.</p>
<p>The shape of the type system follows the evaluation rules for the language quite closely, so that a well-typed term is also always possible to evaluate. We can thus avoid accepting programs that might get stuck without any valid evaluation rule at some point. (Consider what happens in Python if you try to invoke a method on an object, and the object doesn&#8217;t have a method with that name.) We are not limited to tracking just the kinds of values being computed in a type system. We can track various kinds of safety properties, such as memory regions being violated, as well, or we may track multiple properties at once. <a href="http://en.wikipedia.org/wiki/Effect_system">Type and effect systems </a>is one way of tracking both values being computed and resource violations.</p>
<p>A good source of more information on type systems applied to programming languages would be Benjamin Pierce&#8217;s <a href="http://www.amazon.com/Types-Programming-Languages-Benjamin-Pierce/dp/0262162091/ref=cm_cr_pr_product_top">Types and Programming Languages</a>.</p>
 <p><a href="http://www.monomorphic.org/wordpress/?flattrss_redirect&amp;id=774&amp;md5=d3d903e1d4d5f0b5f1bc76ddf9d7f12c" title="Flattr" target="_blank"><img src="http://www.monomorphic.org/wordpress/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.monomorphic.org/wordpress/type-theory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>One year into the Ph.D. process</title>
		<link>http://www.monomorphic.org/wordpress/one-year-into-the-ph-d-process/</link>
		<comments>http://www.monomorphic.org/wordpress/one-year-into-the-ph-d-process/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 05:25:29 +0000</pubDate>
		<dc:creator>johan</dc:creator>
				<category><![CDATA[Computer science]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Philosophy]]></category>
		<category><![CDATA[academic]]></category>
		<category><![CDATA[research]]></category>
		<category><![CDATA[trivia]]></category>

		<guid isPermaLink="false">http://www.monomorphic.org/wordpress/?p=574</guid>
		<description><![CDATA[I thought I&#8217;d write a more personal note for a change. It&#8217;s been just over a year since I started studying for my Ph.D. &#8212; formally, I entered the program in April 2009. With at least two years to go, how do things look with some hindsight? What do I think it means to obtain [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I&#8217;d write a more personal note for a change.</p>
<p>It&#8217;s been just over a year since I started studying for my Ph.D. &#8212; formally, I entered the program in April 2009. With at least two years to go, how do things look with some hindsight? What do I think it means to obtain the Ph.D. degree, or, more specifically and usefully, to be a researcher in computer science?</p>
<p>Much of what I&#8217;m noticing are things that sound obvious and natural, like everyday truisms, when expressed with words, but the idea I have of it goes a little bit deeper than that. For instance, we all get told over and over throughout our lives, starting in high school, that we have to become good communicators. So it&#8217;s not going to be a surprise to anyone when I say that I think the process entails becoming a much better communicator than I&#8217;ve ever been before. Maybe what&#8217;s different is that I am trying to communicate things that haven&#8217;t been communicated before, things that I invented &#8212; or things that have hitherto been communicated only by a very small number of people. (Most of the communication I did prior to becoming a Ph.D. student may not have been terribly original.) Basically, reading and understanding a large amount of scientific papers, and understanding them with a particular use in mind, either having or getting a sense of how they fit into your own work. Then, writing your own papers, and communicating, somehow, what you thought, and what you were the first person to think, so that somebody else might read it like you read the works of others, and use it similarly. Then, presenting research, discussing it, and understanding what is being presented and discussed by others &#8212; similar challenges in speech instead of in writing.</p>
<p>I can&#8217;t speak for other fields, but in computer science ( I work with programming languages and software engineering), I find that a lot of this, for me, has been about building up a certain mental dexterity with formalisms. Understanding the implications of formalisms as you read about them and seek to apply them. Communicating formalisms to others. Some of this is still difficult, in particular the &#8220;communicating to others&#8221; part, but I think I am achieving things in this regard.</p>
<p>Communication, then, where does it take us? One of my mental images of academic knowledge is a big directed acyclic graph (a tree) where papers reference other papers. A surprisingly big part of writing a paper is ensuring that your work can get assimilated into this graph easily &#8212; placing it well, referencing the right things, making sure that you can be referenced easily. Also: defining the boundaries of your work extremely well &#8212; here&#8217;s where it begins, here&#8217;s where it ends. We assume precisely this and arrive at precisely that. It really seems that these things can never be made clear enough.</p>
<p>Which leads to another mental image of research: the paper/unit of work as a building block. The more solid it is, and the harder and sharper its surfaces and edges are, the better structures can be built from it (though I think there are other kinds of valuable works too). That&#8217;s one direction I think I need to be aiming for as an aspiring researcher.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.monomorphic.org/wordpress/one-year-into-the-ph-d-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Call for research interns</title>
		<link>http://www.monomorphic.org/wordpress/call-for-research-interns/</link>
		<comments>http://www.monomorphic.org/wordpress/call-for-research-interns/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 07:30:09 +0000</pubDate>
		<dc:creator>johan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[academic]]></category>
		<category><![CDATA[NII]]></category>
		<category><![CDATA[poplar]]></category>
		<category><![CDATA[research]]></category>

		<guid isPermaLink="false">http://www.monomorphic.org/wordpress/?p=552</guid>
		<description><![CDATA[The project I&#8217;ve been working on for some time (the last year or so) is starting to acquire a more definite form, and hopefully more information about it will be released in the coming months. Its official name is now Poplar, and the current official overview is available here. Basically it revolves around protocol based [...]]]></description>
			<content:encoded><![CDATA[<p>The project I&#8217;ve been working on for some time (the last year or so) is starting to acquire a more definite form, and hopefully more information about it will be released in the coming months. Its official name is now Poplar, and the current official overview is available <a href="http://www.monomorphic.org/poplar/">here</a>. Basically it revolves around protocol based component composition for Java.</p>
<p>There is now an opportunity to do a paid internship for 2-6 months at Japan&#8217;s <a href="http://www.nii.ac.jp">National Institute of Informatics</a> in this project. If you are a masters or Ph.D. student who is interested in programming languages and software engineering, and you think the project sounds interesting, please do consider applying. Unfortunately the internship is only open to students of institutions who have signed MOU agreements with NII. The list of such universities, which includes many institutions from around the world, as well as more formal information, is available <a href="http://www.nii.ac.jp/Internship/Guidelines/1st_call_of_2010_internship_webpage.html">here</a>. If you know or want to learn Scala, all the better!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.monomorphic.org/wordpress/call-for-research-interns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tips for academics who develop software</title>
		<link>http://www.monomorphic.org/wordpress/advice-for-academics-who-develop-software/</link>
		<comments>http://www.monomorphic.org/wordpress/advice-for-academics-who-develop-software/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 17:44:14 +0000</pubDate>
		<dc:creator>johan</dc:creator>
				<category><![CDATA[Software development]]></category>
		<category><![CDATA[academic]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.monomorphic.org/wordpress/?p=533</guid>
		<description><![CDATA[Academics and practitioners, having rather different goals in life, tend to approach software development in quite different ways. No doubt there are many things each side of the fence can learn from the other, but I think academics in particular could often benefit quite a lot by adopting some of the practices used in industrial [...]]]></description>
			<content:encoded><![CDATA[<p>Academics and practitioners, having rather different goals in life, tend to approach software development in quite different ways. No doubt there are many things each side of the fence can learn from the other, but I think academics in particular could often benefit quite a lot by adopting some of the practices used in industrial development. And not just computer science academics!</p>
<p>A common misconception is that these techniques only are useful with large projects and large teams. I find, though, that they can help reduce much of the growth pains even in small projects, helping them reach maturity much faster.</p>
<p><strong>Use version control.</strong> Classical, but invalid, counter arguments include &#8220;it&#8217;s a hassle and too much work to set up&#8221;, or &#8220;there&#8217;s only one person working on this project anyway&#8221;. Even if it&#8217;s only you, you will benefit massively from being able to undo your changes far back in time. It will let you experiment safely. Plus, setup is no longer an issue with free and easy-to-use services like <a href="http://www.gitbub.com">github</a> and <a href="http://www.bitbucket.org">bitbucket</a>. My tool of choice is now Mercurial, and I used to use SVN. And there are many other good choices.</p>
<p><strong>Use a debugger.</strong> If there is a debugger available for your language, and there most certainly is, then you should use it to find nontrivial errors, rather than extensive printf style testing.</p>
<p><strong>Don&#8217;t optimise prematurely, but when you need to, use a profiler.</strong> Profilers tell you where a program&#8217;s performance bottlenecks are. You can profile things like heap usage (what classes use most space in Java, for instance) and CPU usage (which functions use the most CPU time). For Java, I&#8217;ve discovered that the NetBeans IDE has a very good built in profiler. Eclipse also has one, but it didn&#8217;t work on Mac last time I checked. For C/C++, GProf used to be good and probably still is.</p>
<p><strong>Use unit testing wisely.</strong> All of the above apply even to very small projects, but I think some projects are too small to need unit tests, at least initially. You be the judge. I find that unit tests can have a lot of benefit when applied to the fragile, complicated parts of a system, where many different things interlock. If you are ambitious you can also write tests first and code later &#8212; test driven development.</p>
<p><strong>Use a good IDE if you can.</strong> For a language like Java, where you have to type a lot of code to get something done and spread out your code across lots of files, a good IDE that can generate boilerplate code and navigate quickly can really speed up your work. It&#8217;s beneficial for other languages too. But I have no problem with people who use pure vim or emacs, after all these are practically IDEs.</p>
<p>I believe that honing your software development skills as an academic can pay off. Also see: Daniel Lemire on <a href="http://feedproxy.google.com/~r/daniel-lemire/atom/~3/yCTh62CVGi0/">why you should open source your projects</a>. (I will get around to doing this eventually, I promise <img src='http://www.monomorphic.org/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> )</p>
 <p><a href="http://www.monomorphic.org/wordpress/?flattrss_redirect&amp;id=533&amp;md5=14bb341f8788878c419453008dcc01a6" title="Flattr" target="_blank"><img src="http://www.monomorphic.org/wordpress/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.monomorphic.org/wordpress/advice-for-academics-who-develop-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Presentations: one lump of sugar, or two?</title>
		<link>http://www.monomorphic.org/wordpress/presentations-one-lump-of-sugar-or-two/</link>
		<comments>http://www.monomorphic.org/wordpress/presentations-one-lump-of-sugar-or-two/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 13:42:31 +0000</pubDate>
		<dc:creator>johan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[academic]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://www.monomorphic.org/wordpress/?p=369</guid>
		<description><![CDATA[Recently I watched a friend give a presentation on a research topic he&#8217;s been working on for years. I found the presentation to be fascinating, and the clearest explanation of his work that I have seen to date. But I felt compelled to criticise him on one point. In order to lighten up the speech [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.monomorphic.org/wordpress/wp-content/uploads/2009/11/kyoto.jpg"><img class="aligncenter size-medium wp-image-376" title="A glimpse of the monomorphic life" src="http://www.monomorphic.org/wordpress/wp-content/uploads/2009/11/kyoto-225x300.jpg" alt="A glimpse of the monomorphic life" width="225" height="300" /></a></p>
<p>Recently I watched a friend give a presentation on a research topic he&#8217;s been working on for years. I found the presentation to be fascinating, and the clearest explanation of his work that I have seen to date. But I felt compelled to criticise him on one point.</p>
<p>In order to lighten up the speech a bit, he had chosen to include characters from a popular science fiction movie on every other slide, using them to explain the results he had attained in theoretical computer science. The link between the characters and the results was nearly non-existent; the pictures were clearly only there to lighten the presentation up a bit. I had been irritated by people&#8217;s tendency to do these things for some time, so I decided to point it out. One extreme example of this tendency gone too far occurred recently in a presentation about the database CouchDB &#8211; readers can Google for the slides to see the full controversy, though they are somewhat NSFW. (I don&#8217;t want to make moral judgments in this context, but I think the academic/professional domain can be kept free of these controversies. Save those battles for where they belong!)</p>
<p>So there&#8217;s a tendency for people to sugarcoat their presentation topic sometimes. The arguments in favor of doing this are that it can lighten an intrinsically heavy subject a lot, and save people from nearly falling asleep from compounded boredom (such as a conference where 30+ presentations about results in theoretical computer science are given). Essentially it mixes in some sugar with the sour stuff, yielding what might be called a sweet and sour talk. The medicine becomes easier to swallow.</p>
<p>But isn&#8217;t there something essentially contradictory about mixing contemporary pop culture so freely with results that, in this case, were about essentially pure mathematical theory? For one thing it takes the essentially perennial and debases it, linking it up with images that are hopelessly stuck in a short timeframe. For another, it can be seen a vote of non-confidence in your own ideas. It can be seen as saying &#8220;I know this is boring and useless to you, so please bear with me, and look at these amusing pictures until it&#8217;s over.&#8221; I&#8217;m not a good presenter, but in order to become one, I think I need to have sufficient confidence in my ideas to present them unsweetened unless the circumstances are extreme. I need to make my audience see the value in my ideas. Also, it&#8217;s quite different if the sugar coating is of the kind that helps people get into your idea, or if it&#8217;s the kind that just distracts (this case).</p>
<p>My view is therefore that one should use one&#8217;s lumps of sugar with restraint. Maybe a situation where this is called for is when the audience necessarily contains some people who are on the level that you need to be talking to, and many other people who are not on that level, and cannot possibly be brought up to it. In this situation, the sugar might be used to keep the second group somewhat alive and alert. And this is in fact the kind of situation my friend wrote the presentation for originally. So, no scorn on him, just a word of warning to the general public!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.monomorphic.org/wordpress/presentations-one-lump-of-sugar-or-two/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Basic research in the UK</title>
		<link>http://www.monomorphic.org/wordpress/basic-research-in-the-uk/</link>
		<comments>http://www.monomorphic.org/wordpress/basic-research-in-the-uk/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 04:52:53 +0000</pubDate>
		<dc:creator>johan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[academic]]></category>
		<category><![CDATA[society]]></category>

		<guid isPermaLink="false">http://www.monomorphic.org/wordpress/?p=331</guid>
		<description><![CDATA[The Guardian reports that a new government panel will henceforth judge what research is worthy of funding in the UK. Universities will have to make the case for their research projects in order to receive money. Reuters UK, perhaps keen to draw attention, blurt out that &#8220;&#8216;Mickey Mouse&#8217; degrees face [a] funding battle&#8221;. Examples cited by [...]]]></description>
			<content:encoded><![CDATA[<p>The Guardian <a href="http://www.guardian.co.uk/education/2009/sep/23/panel-funding-university-research">reports</a> that a new government panel will henceforth judge what research is worthy of funding in the UK. Universities will have to make the case for their research projects in order to receive money. Reuters UK, perhaps keen to draw attention, <a href="http://uk.reuters.com/article/idUKTRE58M46V20090923">blurt out</a> that &#8220;&#8216;Mickey Mouse&#8217; degrees face [a] funding battle&#8221;.</p>
<p>Examples cited by Reuters UK include surf science, golf management and winemaking. I agree that these are probably vocational qualifications rather than fields meriting university study. But for blue skies projects in the natural sciences or the humanities, the payoff and effects on society are very hard to judge in advance. After all, we very often conduct the research precisely to evaluate these benefits.</p>
<p>The incentive situation with basic research is different today from what it was during the cold war era. When basic research was a national affair, not to be shared freely in the scientific community, it was probably possible to gain a national advantage by investing more in basic research. Today it&#8217;s all too easy to make the argument that other countries will reap the benefits, so why pay for the investment? Essentially a reverse prisoner&#8217;s dilemma: out of selfishness, you are tempted not to invest, but everybody benefits more if everybody invests. But surely this is too simple a view of the situation.</p>
<p>Where will countries that cut down on basic research be in the league tables of the future?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.monomorphic.org/wordpress/basic-research-in-the-uk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

