| CARVIEW |
Select Language
HTTP/2 200
server: GitHub.com
content-type: application/xml
last-modified: Sun, 07 Dec 2025 22:00:06 GMT
access-control-allow-origin: *
etag: W/"6935f8e6-d33c"
expires: Sun, 25 Jan 2026 11:17:38 GMT
cache-control: max-age=600
content-encoding: gzip
x-proxy-cache: MISS
x-github-request-id: BA04:2A6F35:2ECD04:361DA7:6975F979
accept-ranges: bytes
age: 0
date: Sun, 25 Jan 2026 11:07:38 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210050-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1769339258.160741,VS0,VE223
vary: Accept-Encoding
x-fastly-request-id: cd6b995e1fdd3a953750760908cc8f52ea661c5d
content-length: 18030
Tomas Petricek - Languages and tools, open-source, philosophy of science and F# coding
https://tomasp.net
Tomas is a computer scientist, open-source developer and an occasional philosopher of science. I'm working on tools for data-driven storytelling, contribute to a number of F# projects and I run trainings and offer consulting via fsharpWorks.
-
Choose Your Own Adventure Calculus
https://tomasp.net/blog/2025/adventure-calculus/
https://tomasp.net/blog/2025/adventure-calculus/
Sun, 02 Feb 2025 13:52:03 GMT
<p>The rule of three suggests that if you encounter the same pattern for the third time in your
code, you should refactor it into a reusable abstraction. The same thing applies in programming
language theory. When you find that you are doing the same thing for the third time, it is
probably a good idea to stop and think - is there a general pattern?</p>
<div class="rdecor" style="max-width:400px;text-align:center">
<img src="https://tomasp.net/blog/2025/adventure-calculus/olympics.png" style="width:100%" />
<p><strong>Figure 1.</strong> Auto-completion list showing possible operations in The Gamma</p>
</div>
<p>In my <a href="https://tomasp.net/academic/theses/coeffects/" title="Tomas Petricek (2017). Context-aware programming languages">PhD thesis on context-aware computations</a>, I did exactly this. When we realised
that liveness analysis, resource tracking and checking of data-flow computations all require
type system with similar structure, we came up with the idea of <em>coeffects</em>, which is an
abstraction that can capture all three (and so, you only need to add one mechanism for
tracking context into your language).</p>
<p>Recently, the same thing happened to me again. A lot of my work has been around interaction
with <a href="https://tomasp.net/techdims/" title="Joel Jakubovic, Jonathan Edwards, Tomas Petricek (2023). Technical dimensions of programming systems">programming systems</a>. I am interested in looking not just at the programming
languages, but also the stateful, interactive systems they are part of - and how programs are
created through interactive editor tools, gradually revised in notebook systems or how proofs
are created in interactive proof assistants. And interestingly, in three recent collaborations
around those ideas, we ended up finding a very similar pattern.</p>
<p>In multiple different systems, we encountered a pattern where the programming system
iteratively offers the user (programmer, data scientist, proof theoretician) a choice of
options that the user can choose from to construct or refine their program (see Figure 1).
In all systems, the user can also edit the code in other ways, but a lot (sometimes
everything!) can be done just by choosing options.</p>
<p>I now have three examples, so it is time to describe the general pattern. Earlier,
we called this (jokingly) dot-driven development, (seriously) AI assistants and (foolishly)
iterative prompting. For the lack of a better name, I will refer to the abstraction
as the <em>choose-your-own-adventure calculus</em>.</p>
-
What can routers at Centre Pompidou teach us about software evolution?
https://tomasp.net/blog/2023/pompidou/
https://tomasp.net/blog/2023/pompidou/
Thu, 07 Dec 2023 17:30:00 GMT
<p>Back in June, I was in Paris for the <a href="https://ncrafts.io/">NewCrafts conference</a> to talk about
<a href="https://vimeopro.com/newcrafts/newcrafts/video/842234359">the growing opacity of software systems</a>.
This was fun, partly because NewCrafts is a fantastic conference (you can already <a href="https://ncrafts.io/">get your
tickets</a> for 2024!) and also partly because my talk (arguing against many
established "good engineering" practices) was in many ways arguing for the exact opposite than
one of the keynotes, leading to many interesting conversations.</p>
<p>While in Paris, I also visited the <a href="https://www.centrepompidou.fr/en/">famous Centre Pompidou</a>.
Perhaps to the dismay of many modern art lovers, I spent a lot of time staring at the ceiling
looking for routers.</p>
<div class="wdecor" style="text-align:center;margin-bottom:50px">
<img src="https://tomasp.net/blog/2023/pompidou/router1.jpg" style="margin:10px; max-width:30%;border:solid 4px black" /></a>
<img src="https://tomasp.net/blog/2023/pompidou/router2.jpg" style="margin:10px; max-width:30%;border:solid 4px black" /></a>
<img src="https://tomasp.net/blog/2023/pompidou/router3.jpg" style="margin:10px; max-width:30%;border:solid 4px black" /></a>
<p>Spot the routers at Centre Pompidou!</p>
</div>
-
Where programs live? Vague spaces and software systems
https://tomasp.net/blog/2023/vague-spaces/
https://tomasp.net/blog/2023/vague-spaces/
Fri, 10 Feb 2023 22:44:19 GMT
<p>Architecture and urban planning have been a useful source of ideas for thinking about programming.
I have written <a href="https://tomasp.net/blog/tag/design/">various blog posts</a> and a paper
<a href="https://tomasp.net/academic/papers/metaphors/">Programming as Architecture, Design, and Urban Planning</a>
that argue why and explore some of those ideas. Like urban planning and architecture, the design of
any interesting software system deals with complex problems that can rarely be analysed in full and
with structures that will continue to evolve in unexpected ways after they are created.</p>
<p>My most recent reading on cities was a book <a href="https://www.academia.cz/mesto-naruby-2-dotisk--haluzik-radan--academia--2021">The City Inside Out</a>
(Czech only, unfortunately) that explore places referred to as <a href="https://www.atributosurbanos.es/en/terms/terrain-vague/">terrain vague</a>.
This term refers to unused and abandoned spaces that have lost their purpose or
do not have a clear use, but are used in various ways nevertheless. For various historical
reasons, there seem to be quite a few of such places in Prague (Figure 1) and, more generally,
Central European cities, which is the focus of the book.</p>
<p>The book is an interesting inspiration for thinking about programming in many ways.
It uses an inter-disciplinary approach ranging from history and philosophy to
<a href="https://en.wikipedia.org/wiki/Paleoethnobotany">archaeobotany</a>, which is much needed for thinking
about programming too. (Not archeobotany, but inter-disciplinary thinking certainly!)
More specifically, it makes you think about the concept of a <em>space</em> in
which cities and programs exist, how the spaces inhabited by the two differ, what would it look
like if they were different and what structures get created in those spaces as a result of
social and technical forces.</p>
<div class="wdecor" style="text-align:center">
<a href="https://iprpraha.cz/projekt/120/nakladove-nadrazi-zizkov"><img src="https://tomasp.net/blog/2023/vague-spaces/zizkov.jpg" style="max-width:100%;border:solid 4px black" /></a>
<p><strong>Figure 1.</strong> Nákladové nádraží (freight railway station) Žižkov - an example of a large<br />
space in Prague that no longer serves its original purpose (<a href="https://hotelove.cz/nakladove-nadrazi-zizkov/">photo source</a>)</p>
</div>
-
The Timeless Way of Programming
https://tomasp.net/blog/2022/timeless-way/
https://tomasp.net/blog/2022/timeless-way/
Thu, 01 Sep 2022 00:03:53 GMT
<div class="rdecor" style="text-align:center">
<img src="https://tomasp.net/blog/2022/timeless-way/timeless.jpg" style="max-width:260px" />
<p style="max-width:260px"><b>Figure 1.</b> The Timeless Way of Building - Christopher Alexander</p>
</div>
<p>Many programmers know the name of the architect Christopher Alexander for his work on
<em>design patterns</em> that has been adapted into the world of programming. A lot of people
know of the, sometimes ridiculed, patterns like strategy (functions!) or visitor (pattern
matching!) and some have read the <a href="https://amzn.to/3Cd7sBv" title="Design Patterns: Elements of Reusable Object-Oriented Software - Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides">Gang of Four design patterns book</a> that introduced them.
A few people know of the <a href="https://dreamsongs.com/Files/PatternsOfSoftware.pdf" title="Patterns of Software: Tales from the Software Community - Richard P. Gabriel">Patterns of Software</a> book by Richard P. Gabriel, which is a much more
profound reflection on software inspired by the work of Christopher Alexander. And almost
nobody has actually read Christopher Alexander's books. (Thanks in advance for reminding me
on <a href="https://twitter.com/tomaspetricek">Twitter</a> that I am mistaken...)</p>
<p>I read Alexander's <a href="https://amzn.to/3bZw1Y2" title="Notes on the Synthesis of Form - Christopher Alexander">Notes on the Synthesis of Form</a> a couple of years ago, and used
it as one of the sources for ideas in my recent Onward! essay on <a href="https://tomasp.net/academic/papers/metaphors/" title="Programming as Architecture, Design, and Urban Planning - Tomas Petricek">architecture, design and urban
planning</a>, but I did not know his other work. Only recently, after <a href="https://www.theguardian.com/artanddesign/2022/mar/29/christopher-alexander-obituary">Christopher Alexander
died</a>,
I finally ordered two books that are most directly about design patterns,
<a href="https://amzn.to/3CeIrGe" title="The Timeless Way of Building - Christopher Alexander">The Timeless Way of Building</a> and <a href="https://amzn.to/3wecpGG" title="A Pattern Language: Towns, Buildings, Construction - Christopher Alexander">A Pattern Language</a>.</p>
<p>This post is a somewhat unorganized collection of thoughts triggered by reading of The Timeless
Way of Building, including my understanding of Alexander's work, some critical thoughts
and on the applications of his ideas to software.</p>
-
No-code, no thought? Substrates for simple programming for all
https://tomasp.net/blog/2022/no-code-substrates/
https://tomasp.net/blog/2022/no-code-substrates/
Thu, 28 Apr 2022 09:37:00 GMT
<div class="rdecor" style="text-align:center">
<img src="https://tomasp.net/blog/2022/no-code-substrates/flow-matic.png" style="max-width:350px" />
<p style="max-width:350px"><strong>Figure 1.</strong> Virtually eliminates your coding load. FLOW-MATIC promotional
brochure (1957)</p>
</div>
<p>No-code is a hot new topic for programming startups. The idea is to develop a system
that allows end-users to do the programming they need without the difficult task of writing
code. There are no-code systems for building mobile apps, analysing data and many more.</p>
<p>It is perhaps not a surprise that "eliminating programming load" is not as new idea as some
people may think and there is an excellent blog series on <a href="https://instadeq.com/blog/categories/history/" title="No-code history - Instadeq Blog - No-code Data Analysis & Interactive Visualizations">no-code history by Instadeq</a>,
going back to 1959.</p>
<p>Funnily enough, the 1957 <a href="https://www.computerhistory.org/collections/catalog/102646140" title="Introducing a New Language for Automatic Programming Univac Flow-Matic">promotional brochure about FLOW-MATIC</a>,
a predecessor to COBOL created by Grace Hopper, uses almost the same language that you will
find in startup pitch decks today (Figure 1). Of course, in 1957, coding referred to the
tedious process of transcribing the desired program to low-level assembler or (more often)
directly to machine code and "virtually eliminating your coding load" meant having a symbolic
high-level programming language so easy that a reasonably skilled mathematician would be able
to use it.</p>
<p>So, is there really anything new about no-code systems? Is it really possible to "eliminate
your programming load"? And what would it really take to make some real progress in that direction?</p>
-
Pop-up from Hell: On the growing opacity of web programs
https://tomasp.net/blog/2021/popup-from-hell/
https://tomasp.net/blog/2021/popup-from-hell/
Fri, 08 Oct 2021 11:14:47 GMT
<p>I started to learn how to program in high school at the end of the 1990s using a mix of BASIC, Turbo
Pascal and HTML with JavaScript. The seed for this blog post comes from my experience with learning
how to program in JavaScript, without having much guidance or organized resources. This article continues
a theme that I started in my <a href="https://tomasp.net/commodore64">interactive Commodore 64 article</a>,
which is to look at past programming systems and see what interesting past ideas have been lost
in contemporary systems. Unlike with Commodore 64, which I first used in 2018 in the
Seattle Living Computers museum, my perspective on the Early Web may be biased by personal
experience. I will do my best to not make this post sound like a grumbling of an old nerd!
(I thought this only comes later, but I may have been wrong...)</p>
<div class="rdecor"><img src="https://tomasp.net/blog/2021/popup-from-hell/close-me.gif" style="max-width:400px" /></div>
<p>The 1990s, the web had a fair amount of quirky web pages, often created just for fun. The GeoCities
hosting service, which has <a href="https://www.oocities.org">partly been archived</a> is a witness of this
and there are even academic books, such as <a href="https://amzn.to/2YiEUVe">Dot-Com Design</a> documenting
this history.</p>
<p>Some of the quirky things that you could do with JavaScript included creating roll-over effects
(making an image change when mouse pointer is over it), creating an animation that follows the
cursor as it moves and, of course, annoying the users with all sorts of pop-up windows for both
entertaining and advertising purposes. Annoying pop-ups will be the starting point for my blog
post, but I'll be using those to make a more general and interesting point about how programs
evolve to become more opaque.</p>
<p><em>This blog post is based on a talk <a href="https://tpetricek.github.io/Talks/2021/popup-from-hell/">Popup from hell: Reflections on the most annoying 1990s
program</a> that I did recently at an
(in person!) meeting of the <a href="https://programme.hypotheses.org/">PROGRAMme project</a>. Thanks to
everyone who attended for lively discussion and useful feedback!</em></p>
-
Software designers, not engineers: An interview from alternative universe
https://tomasp.net/blog/2021/software-designers/
https://tomasp.net/blog/2021/software-designers/
Mon, 19 Apr 2021 12:30:57 GMT
<p>While the physicists investigate the nature of the mysterious portal that has recently appeared in
North London, several human beings recently came through the portal, which appears to be a
gate into an alternative universe. As we understood from the last two people coming through the
portal, it seems to be a linked with a universe that is in many ways like ours, reached about the
same level of social and technological development, but differs in numerous curious details.
The paths through which people in this alternative universe reached similar results as our world
are often subtly different.</p>
<div class="rdecor"><a href="https://amzn.to/3x0Ww5a"><img src="https://tomasp.net/blog/2021/software-designers/ways.png" style="max-width:260px" /></a></div>
<p>The most recent visitor from the alternative universe is Ms Zaha Atkinson, who would most likely
be titled <em>software engineer</em> in our world, although the title she uses in her home world is
<em>software designer</em>. She is a well-known software designer and has been also titled using the
strange-sounding title <em>softwarenova</em>, a label that we will soon say more about. As with other
technological and societal developments, the alternative universe seems to have arrived at very
similar results as our worlds. Software is eating the (alternative) world, but it is built in very
different ways. The interview with Ms Zaha Atkinson, presented below, reveals how very different
the world of software is when we think of programmers as software <em>designers</em> rather than as
software <em>engineers</em>.</p>
<p><em>This article is a work of fiction. Any resemblance to actual events or persons, living or dead,
may or may not be entirely coincidental. It has been largely inspired by the book
<a href="https://amzn.to/3x0Ww5a">Designerly Ways of Knowing</a> by Nigel Cross. Ms <a href="https://en.wikipedia.org/wiki/Zaha%5FHadid">Zaha</a>
<a href="https://en.wikipedia.org/wiki/Bill%5FAtkinson">Atkinson</a> also may or may not be entirely fictional.</em></p>
-
Is deep learning a new kind of programming? Operationalistic look at programming
https://tomasp.net/blog/2020/learning-and-programming/
https://tomasp.net/blog/2020/learning-and-programming/
Wed, 07 Oct 2020 00:43:16 GMT
<p>In most discussions about how to make programming better, someone eventually says
something along the lines of <em>"we'll just have to wait until deep learning solves
the problem!"</em> I think this is a <a href="https://en.wikipedia.org/wiki/AI_winter">naively optimistic idea</a>,
but it raises one interesting question: In what sense are programs created using deep
learning a <em>different kind</em> of programs than those written by hand?</p>
<div class="rdecor">
<img src="https://tomasp.net/blog/2020/learning-and-programming/bridgman.jpg" style="max-width:350px"/>
</div>
<p>This question recently arose in discussions that we have been having as part of the
<a href="https://programme.hypotheses.org/">PROGRAMme project</a>, which explores historical and
philosophical perspectives on the question "What is a (computer) program?" and so this
article owes much debt to <a href="https://programme.hypotheses.org/members">others involved in the project</a>,
especially Maël Pégny, Liesbeth De Mol and Nick Wiggershaus.</p>
<p>Many people will intuitively think that, if you train a deep neural network to solve some
a problem, you get a different kind of program than if you manually write some logic to solve
the problem. But what exactly is the difference? In both cases, the program is a sequence of
instructions that are deterministically executed by a machine, one after another, to produce
the result.</p>
<p>When reading the excellent book <a href="https://amzn.to/2SvTwKT" title="Hasok Chang (2004). Inventing Temperature: Measurement and Scientific Progress">Inventing Temperature</a> by Hasok
Chang recently, I came across the idea of <a href="https://plato.stanford.edu/entries/operationalism/" title="Hasok Chang (2019). Operationalism, The Stanford Encyclopedia of Philosophy">operationalism</a>,
which I believe provides a useful perspective for thinking about the issue of deep learning and
programming. The operationalist point of view was introduced by a physicist Percy Williams Bridgman. To
quote: <em>we mean by any concept nothing more than a set of operations; the concept is synonymous
with the corresponding set of operations</em>. What does this tell us about deep learning and programming?</p>
-
Creating interactive You Draw bar chart with Compost
https://tomasp.net/blog/2020/youdraw-compost-visualization/
https://tomasp.net/blog/2020/youdraw-compost-visualization/
Thu, 16 Jul 2020 21:20:16 GMT
<p>For a long time, I've been thinking about how to design a data visualization library that would
make it easier to compose charts from simple components. On the one hand, there are charting libraries
like <a href="https://developers.google.com/chart">Google Charts</a>, which offer a long list of pre-defined
charts. On the other hand, there are libraries like <a href="https://d3js.org/">D3.js</a>, which let you
construct any data visualization, but in a very low-level way. There is also <a href="https://vega.github.io/vega/">Vega</a>,
based the idea of <em>grammar of graphics</em>, which is somewhere in between, but requires you to
specify charts in a fairly complex language including <a href="https://vega.github.io/vega/docs/transforms/">a huge number of transformations</a>
that you need to write in JSON.</p>
<p>In the spirit of functional domain specific languages, I wanted to have a small number of
simple but powerful primitives that can be composed by writing code in a normal programming language
like F# or JavaScript, rather than using JSON.</p>
<p>My final motivation for working on this was the <a href="https://www.nytimes.com/interactive/2017/01/15/us/politics/you-draw-obama-legacy.html">You Draw It article series</a>
by New York Times, which uses interactive charts where the reader first has to make their own guess
before seeing the actual data. I wanted to recreate this, but for bar charts, when working on
<a href="https://turing.thegamma.net/expenditure/">visualizing government spending using The Gamma</a>.</p>
<p>The code for this was somewhat hidden inside The Gamma, but last month, I finally extracted all
the functionality into a new stand-alone library <a href="https://compostjs.github.io/compost/">Compost.js</a>
with simple and clean <a href="https://github.com/compostjs/compost">source code on GitHub</a> and
an accompanying <a href="https://compostjs.github.io/compost/paper.pdf">paper draft that describes it (PDF)</a>.</p>
<p>In this article, I will show how to use Compost.js to implement a "You Draw" bar chart inspired
by the NYT article. When loaded, all bars show the average value. You have to drag
the bars to positions that you believe represent the actual values. Once you do this, you can
click "Show me how I did" and the chart will animate to show the actual data, revealing how good
your guess was. Before looking at the code, you can have a look at the resulting interactive chart,
showing the top 5 areas from the 2015 UK budget (in % of GDP):</p>
-
Data exploration calculus: Capturing the essence of exploratory data scripting
https://tomasp.net/blog/2020/data-exploration-calculus/
https://tomasp.net/blog/2020/data-exploration-calculus/
Tue, 21 Apr 2020 13:42:16 GMT
<p>Most real-world programming languages are too complex to be studied using formal methods.
For this reason, academics often work with simple theoretical languages instead. The <a href="https://en.wikipedia.org/wiki/Lambda_calculus">λ-calculus</a>
is a simple formal language that is often used for talking about functional languages, the <a href="https://en.wikipedia.org/wiki/%CE%A0-calculus">π-calculus</a>
is a model of concurrent programming and there is an entire book, <a href="https://link.springer.com/book/10.1007/978-1-4419-8598-9">A Theory of Objects</a>
modelling various object-oriented systems.</p>
<div class="rdecor"><img src="https://tomasp.net/blog/2020/data-exploration-calculus/ft.gif" style="width:360px"/><br/><p style="width:360px;line-height:20px;margin-top:10px;text-align:center;"><small>Animation from Financial Times article "Why the world's recycling system stopped working".</small></p></div>
<p>Those calculi try to capture the most interesting aspect of the programming language. This is
function application in functional programming, sending of messages in concurrent programming
and object construction with inheritance in object-oriented programming.</p>
<p>Recently, I have been working on programming tools for data exploration.
In particular, I'm interested in the kind of programming that journalists need to do when
they work with data. A good example is the coding done for the
<a href="https://www.ft.com/content/360e2524-d71a-11e8-a854-33d6f82e62f8">Why the world's recycling system stopped working</a>
article by Financial Times, which is <a href="https://github.com/ft-interactive/recycling-is-broken-notebooks">available on GitHub</a>.</p>
<p>Although data journalists and other data scientists use regular programming languages like
Python, the kind of code they write is very different from the kind of code you need to write
when building a library or a web application in Python.</p>
<p>In a paper <a href="https://programming-journal.org/2020/4/8/">Foundations of a live data exploration environment</a>
that was published in February 2020 in the open access <a href="https://programming-journal.org/">Programming Journal</a>,
I wanted to talk about some interesting work that I've been doing on live previews in
<a href="https://thegamma.net">The Gamma</a>. For this, I needed a small model of my programming language.</p>
<p>In the end the most interesting aspect of the paper is the definition of the
<em>data exploration calculus</em>, a small programming language that captures the kind of code
that data scientists write to explore data. This looks quite different from,
say, a λ-calculus and π-calculus. It should be interesting not only if you're planning to do
theoretical programming language research about data scripting, but also because
it captures some of the atypical properties of the programs that data scientists write...</p>
-
On architecture, urban planning and software construction
https://tomasp.net/blog/2020/cities-and-programming/
https://tomasp.net/blog/2020/cities-and-programming/
Tue, 07 Apr 2020 22:13:16 GMT
<p>Despite having the term <em>science</em> in its name, it is not always clear what kind of
discipline <em>computer science</em> actually is. Research on programming is sometimes like
science, sometimes like mathematics, sometimes like engineering, sometimes like design
and sometimes like art. It also has a long tradition of importing ideas from a wide range
of other disciplines.</p>
<p>In this article, I will look at ideas from architecture and urban planning. Architecture
has already been an inspiration for <em>design patterns</em>, although some would say that we did
quite poor job and imported a trivialized (and not very useful) version of the idea. However,
there are many other interesting ideas in architecture and urban planning worth exploring.</p>
<div class="rdecor-sm"><img src="https://tomasp.net/blog/2020/cities-and-programming/patterns.jpg" /></div>
<p>To explain why learning from architecture and urban planning is a good idea, I will first
discuss similarities between problems solved by architects or urban planners and programmers.
I will then look at a number of concrete ideas that we can learn, mostly taking inspiration
from four books that I've read recently. There are two general areas:</p>
<ul>
<li>
<p>First, writing about architecture and urban planning often uses interesting methodologies
that research on programming could adopt to gain new insights into systems, programming
and its problems.</p>
</li>
<li>
<p>Second, there are a number of more concrete ideas in architecture and urban planning that
might directly apply to software. For example, can programmers learn how to deal with complexity
of software by looking at how urban planners deal with the complexity of cities? Or, can we learn
about software maintenance by looking at how buildings evolve in time?</p>
</li>
</ul>
<p>The nature of problems that programmers face are often more similar to the problems that
architects and urban planners have to deal with than, say, the problems that scientists, engineers
or mathematicians need to solve. We might not want to go all the way and completely rebuild
how we do programming to mirror architecture and urban planning, but treating the ideas from those
disciplines as equal to those from science or engineering will make programming richer and more
productive discipline.</p>
-
What to teach as the first programming language and why
https://tomasp.net/blog/2019/first-language/
https://tomasp.net/blog/2019/first-language/
Mon, 02 Dec 2019 16:48:25 GMT
<p>The number of Google search results for the phrase
<a href="https://www.google.com/search?q=" title="choosing+the+first+programming+language">"choosing the first programming language"</a>
at the time of writing is 15,800. This illustrates just how debated the issue of choosing the first
programming language is. In this blog post, I will not actually try to answer the question posed
in the title of the post. I will not discuss what language we should teach as the first one.
Instead, I will look at a more interesting question.</p>
<p>I will investigate the arguments that are used in favour of or against particular programming
languages in computer science curriculum. I am more interested in the kind of argumentation that
is employed to support a particular choice than in the specific languages involved. This approach is
valuable for two reasons. First, by looking at the argumentation used, we can learn what educators
consider important about computer science. Second, understanding the motivations behind different
arguments allows us to make our own debates about the choice of a programming language more informed.</p>
<p>The scope of this blog post is limited to the choice of the first programming language taught in an
undergraduate computer science programmes at universities. This means that I will not discuss other
important contexts such as choices at a primary or a secondary education level, choices for
independent learners and choices in other university degrees that might involve programming.</p>
<p>Note that this blog post is adapted from an essay that I wrote as part of a
<a href="https://www.kent.ac.uk/teaching/qualifications/pgche/">Postgrduate Certificate for Higher Education programme</a>
at University of Kent, so it assumes less knowledge about programming than a typical reader of
my blog has. This makes it accessible to a broader audience thinking about education
though!</p>
-
What should a Software Engineering course look like?
https://tomasp.net/blog/2019/software-engineering/
https://tomasp.net/blog/2019/software-engineering/
Fri, 08 Feb 2019 11:22:57 GMT
<p>When I joined the <a href="https://www.cs.kent.ac.uk/">School of Computing</a> at the <a href="https://www.kent.ac.uk/">University of
Kent</a>, I was asked what subjects I wanted to teach. One of the topics
I chose was <em>Software Engineering</em>. I spent quite a lot of time reading about the history of
software engineering when working on my paper <a href="/academic/papers/failures/index.html">on programming
errors</a> and I go to a fair number of <a href="https://github.com/tpetricek/Talks">professional
programming conferences</a>, so I thought I can come up
with a good way of teaching it! Yet, I was not quite sure how to go about it or even what
<em>software engineering</em> actually means.</p>
<p>In this blog post, I share my thought process on deciding what to cover in my Software
Engineering module and also a rough list of topics. The introduction explaining <em>why</em> I chose
these and <em>how</em> I structure them is perhaps more important than the list itself, but it
is fairly long, so if you just want to see a list you can
<a href="https://tomasp.net/blog/2019/software-engineering/#fund">skip ahead to Section 2</a> (but please read the
introduction if you want to comment on the list!) I also add a brief reflection on why I think
this is a good approach, referencing a couple of ideas from philosophy of science in <a href="#phil">Section 3</a>.</p>
-
Write your own Excel in 100 lines of F#
https://tomasp.net/blog/2018/write-your-own-excel/
https://tomasp.net/blog/2018/write-your-own-excel/
Mon, 12 Nov 2018 12:58:50 GMT
<p>I've been teaching F# for over seven years now, both in the public F# FastTrack course that we run
at SkillsMatter in London and in various custom trainings for private companies. Every time I teach
the F# FastTrack course, I modify the material in one way or another. I wrote about some of this
interesting history <a href="#">last year in an fsharpWorks article</a>. The course now has a stable half-day
introduction to the language and a stable focus on the ideas behind functional-first programming,
but there are always new examples and applications that illustrate this style of programming.</p>
<img src="https://tomasp.net/blog/2018/write-your-own-excel/logo.png" class="rdecor" />
<p>When we started, we mostly focused on teaching functional programming concepts that might be useful
even if you use C# and on building analytical components that your could integrate into a larger
.NET solution. Since then, the F# community has matured, established the <a href="https://fsharp.org">F# Software Foundation</a>,
but also built a number of mature end-to-end ecosystems that you can rely on such as <a href="https://fable.io">Fable</a>,
the F# to JavaScript compiler, and <a href="https://safe-stack.github.io">SAFE Stack</a> for full-stack web development.</p>
<p>For the upcoming December course in London, I added a number of demos and hands-on tasks built
using Fable, partly because running F# in a browser is an easy way to illustrate many concepts
and partly because Fable has some amazing functional-first libraries.</p>
<blockquote>
<p><em><i class="fa fa-hand-o-right" style="font-size:110%;margin:0px 5px 0px 0px"></i></em>
If you are interested in learning F# and attending our course, the next <a href="https://skillsmatter.com/courses/473-tomas-petricek-phil-trelford-fast-track-to-fsharp">F# FastTrack</a>
takes place on <strong>6-7 December</strong> in London at SkillsMatter. We also offer custom
on-site trainings. Get in touch at <a href="https://twitter.com/tomaspetricek">@tomaspetricek</a>
or email <a href="mailto:tomas@tomasp.net">tomas@tomasp.net</a> for a 10% discount for the course.</p>
</blockquote>
<p>One of the new samples I want to show, which I also <a href="https://vimeo.com/281241807">live coded at NDC 2018</a>,
is building a simple web-based Excel-like spreadsheet application. The spreadsheet demonstrates
all the great F# features such as domain modeling with types, the power of compositionality
and also how functional-first approach can be amazingly powerful for building user interfaces.</p>
-
Programming as interaction: A new perspective for programming language research
https://tomasp.net/blog/2018/programming-interaction/
https://tomasp.net/blog/2018/programming-interaction/
Mon, 08 Oct 2018 11:22:57 GMT
<p>In May, I joined the <a href="https://www.cs.kent.ac.uk/">School of Computing</a> at the <a href="https://www.kent.ac.uk/">University of
Kent</a> as a Lecturer (equivalent of Assistant Professor in some other countries).
When applying for the job, I spent a lot of time thinking about how to best explain the kind of
research that I would like to do. This blog post is a brief summary of my ideas. I'm interested
in way too many things, including <a href="https://tomasp.net/blog/tag/philosophy/">philosophy and design</a> and
<a href="https://tomasp.net/blog/tag/data-journalism/">data journalism</a>, but this post will be mainly about
programming language research. After all, I'm a member of the <a href="https://www.cs.kent.ac.uk/research/groups/plas/">Programming Languages
and Systems group</a>!</p>
<img src="https://tomasp.net/blog/2018/programming-interaction/kent.png" class="rdecor-sm" style="max-width:250px"/>
<p>Unlike some of my <a href="https://tomasp.net/blog/2016/thinking-unthinkable/">other posts about programming languages</a>,
I won't try to convince you that we should be studying programming languages completely differently this
time. Instead, I want to describe <em>one simple trick that will make current programming language
research much more interesting</em>!</p>
<p>A lot of programming language papers today talk about programs and program properties. In
statically typed programming languages, we can check that a program <span class="math">\(e\)</span> has certain type <span class="math">\(\tau\)</span>,
which means that, when the program is run, it will only produce values of the type.
This is very nice, but it misses a fundamental thing about programming. How was this program
<span class="math">\(e\)</span> actually constructed?</p>
<p>When programming, you spend most of your time working with programs that are <em>unfinished</em>. This
means that they do not do what they are supposed to be (eventually) doing and, very often, they
are not well-typed or even syntactically invalid. However, that does not mean that we can afford
to ignore them. In many cases, programmers can even run those programs (using REPL or using a
notebook environment). In other words, programming language research should not study <em>programs</em>,
but should instead study <em>programming</em>!</p>
<blockquote>
<p><em><i class="fa fa-hand-o-right" style="font-size:110%;margin:0px 5px 0px 0px"></i></em>
I'm also writing this because I'll soon be looking for collaborators and PhD students,
so if the ideas in this blog post sound interesting to you or if you've been working on
something related, please let me know! You can get in touch at <a href="https://twitter.com/tomaspetricek">@tomaspetricek</a>
or email <a href="mailto:tomas@tomasp.net">tomas@tomasp.net</a>.</p>
<p>We'll have funding for PhD students from September 2019 and I'm also working on getting money
for a post-doc position. All of these are open ended, so if the blog post made you curious
(and you wouldn't mind living in Canterbury or London), definitely reach out!</p>
</blockquote>
-
Would aliens understand lambda calculus?
https://tomasp.net/blog/2018/alien-lambda-calculus/
https://tomasp.net/blog/2018/alien-lambda-calculus/
Tue, 22 May 2018 09:27:00 GMT
<p>Unless you are a sci-fi author or some secret government agency, the question whether aliens
would understand lambda calculus is probably not your main practical concern. However, the question
is intriguing because it nicely vividly formulates a fundamental question about our formal mathematical
knowledge. Are mathematical theories and results about them <em>invented</em>, i.e. constructed by
humans, or <em>discovered</em>, i.e. are they eternal truths that exist regardless of whether there are
humans to know them?</p>
<img src="https://tomasp.net/blog/2018/alien-lambda-calculus/human.jpg" class="rdecor"
style="width:40%;max-width:400px;margin-left:30px;margin-top:0px;margin-bottom:0px" />
<p>The question makes for a fantastic late night pub debate, but how can we go about answering it using
a more serious methodology? Is there a paper one can read to better understand the problem?
Occasionally, a <a href="https://www.youtube.com/watch?list=PLcGKfGEEONaCIl5eU53uPBnRJ9rbIH32R&v=IOiZatlZtGU">talk</a>
or an <a href="https://www.quora.com/Do-aliens-have-LISP-or-Scheme">online comment</a>
by a computer scientist comments on this question, but way too often, people miss the fact that
the nature of mathematical entities is one of the fundamental questions of <em>philosophy of
mathematics</em>. Alas, all those discussions are carefully hidden in the humanities department!</p>
<p>I believe that knowing a bit about philosophy of mathematics is important if we want to have a
meaningful debate about philosophical questions of mathematics (sic!) and so I did a talk
<a href="https://www.youtube.com/watch?v=JoWH2jNlvQQ">on this very subject at CodeMesh 2017</a>.
This article is slightly refined and hopefully
more polished version of the talk for those who, like me, prefer reading over watching.
Keep in mind that the question about the nature of mathematical entities is one of the fundamental
questions of an <em>entire academic discipline</em>. As such, this article cannot possibly cover all the
relevant discussions. Compared to some other writings in this space, this article is, at least,
based on a couple of philosophical books that, I believe, have useful things to say on the subject!</p>
-
The design side of programming language design
https://tomasp.net/blog/2017/design-side-of-pl/
https://tomasp.net/blog/2017/design-side-of-pl/
Tue, 12 Sep 2017 16:42:38 GMT
<div style="text-align:center">
<a href="https://amzn.to/2gVxn8W">
<img src="https://tomasp.net/blog/2017/design-side-of-pl/parsons.jpg" class="rdecor"
style="max-width:220px;margin-left:30px;margin-top:20px;margin-bottom:20px;width:75%" /></a></div>
<p>The word "design" is often used when talking about programming languages. In fact, it even made
it into the name of one of the most prestigious academic programming conferences, <a href="https://www.sigplan.org/Conferences/PLDI/">Programming
Language Design and Implementation (PLDI)</a>. Yet, it is
almost impossible to come across a paper about programming languages that uses design methods to
study its subject. We intuitively feel that "design" is an important aspect of programming
languages, but we never found a way to talk about it and instead treat programming languages as
mathematical puzzles or as engineering problems.</p>
<p>This is a shame. Applying design thinking, in the sense used in applied arts, can let us talk
about, explore and answer important questions about programming languages that are ignored when
we limit ourselves to mathematical or engineering methods. I think the programming language
community is, perhaps unconsciously, aware of this - one of the reviews of <a href="https://tomasp.net/academic/papers/fsharp-data/">my recent PLDI
paper</a> said <em>"this is a nice, novel design paper,
and the community often wants more design papers in our conferences"</em>. The problem is that we
we do not know how to write and evaluate work that follows design methodology.</p>
<p>To better understand how design works, I recently read <a href="https://amzn.to/2gVxn8W">The Philosophy of Design</a>
by Glenn Parsons. The book perhaps did not answer many of my questions about design, but it did give
me a number of ideas about what design is, what questions it can explore and how those could be
relevant for the study of programming languages...</p>
-
Getting started with The Gamma just got easier
https://tomasp.net/blog/2017/thegamma-getting-started/
https://tomasp.net/blog/2017/thegamma-getting-started/
Wed, 14 Jun 2017 12:27:17 GMT
<p>Over the last year, I have been working on <a href="https://thegamma.net/">The Gamma project</a>, which aims
to make data-driven visualizations more trustworthy and to enable large number of people to
build visualizations backed by data. The Gamma makes it possible to create visualizations that
are built on trustworthy primary data sources such as the <a href="https://data.worldbank.org">World Bank</a>
and you can provide your own <a href="https://thegamma.net/publishing/">data source by writing a REST service</a>.</p>
<p>A great piece of feedback that I got when talking about The Gamma is that this is a nice ultimate
goal, but it makes it hard for people to start with The Gamma. If you do not want to use the World
Bank data and you're not a developer to write your own REST service, how do you get started?</p>
<a href="https://gallery.thegamma.net/create">
<img src="https://tomasp.net/blog/2017/thegamma-getting-started/gallery.png" style="margin:10px 10% 20px 10%; width:80%"/>
</a>
<p>To make starting with The Gamma easier, the gallery now has a <a href="https://gallery.thegamma.net/create">new four-step getting started page</a>
where you can upload your data as a CSV file or paste it from Excel spreadsheet and create nice
visualizations that let your reader explore other aspects of the data.</p>
<p><a href="https://gallery.thegamma.net/create">Head over to The Gamma Gallery to check it out</a> or continue
reading to learn more about creating your first The Gamma visualization...</p>
-
Papers we Scrutinize: How to critically read papers
https://tomasp.net/blog/2017/papers-we-scrutinize/
https://tomasp.net/blog/2017/papers-we-scrutinize/
Wed, 12 Apr 2017 13:05:48 GMT
<p>As someone who enjoys being at the intersection of the academic world and the world of
industry, I'm very happy to see any attempts at bridging this harmful gap. For this reason,
it is great to see that <a href="https://michaelrbernste.in/2014/10/21/should-i-read-papers.html">more people are interested in reading academic
papers</a> and that initiatives
like <a href="https://paperswelove.org/">Papers We Love</a> are there to help.</p>
<a href="https://paperswelove.org/"><img src="https://tomasp.net/blog/2017/papers-we-scrutinize/pwl.png" class="rdecor" style="width:300px;"/></a>
<p>There is one caveat with academic papers though. It is very easy to see academic papers
as containing eternal and unquestionable truths, rather than as something that the reader
should actively interact with. I <a href="https://twitter.com/tomaspetricek/status/814600193643577344">recently remarked</a>
about this saying that "reading papers" is too passive. I also mentioned one way of doing more
than just "reading", which is to write "critical reviews" – something that we recently tried
to do at the <a href="https://2017.programmingconference.org/track/refuses-2017">Salon des Refusés</a> workshop.
In this post, I would like to expand my remark.</p>
<p>First of all, it is very easy to miss the context in which papers are written. The life of an academic
paper is not complete after it is published. Instead, it continues living its own life – people refer to it
in various contexts, give different meanings to entities that appear in the paper and may "love"
different parts of the paper than the author. This also means that there are different ways of
reading papers. You can try to reconstruct the original historical context, read it according to
the current main-stream interpretation or see it as an inspiration for your own ideas.</p>
<p>I suspect that many people, both in academia and outside, read papers without worrying about
<em>how</em> they are reading them. You can certainly "do science" or "read papers" without reflecting
on the process. That said, I think the philosophical reflection is important if we do not want to
get stuck in local maxima.</p>
-
The mythology of programming language ideas
https://tomasp.net/blog/2017/programming-mythology/
https://tomasp.net/blog/2017/programming-mythology/
Tue, 07 Mar 2017 15:31:34 GMT
<p>If you read a about the history of science, you will no doubt be astonished by some of the
amazing theories that people used to believe. I recently finished reading <a href="https://amzn.to/2mPjXtW">The Invention of Science
by David Wootton</a>, which documents many of them (and is well worth reading,
not just because of this!) For example, did you know that if you put garlic on a magnet, the magnet
will stop working? Fortunately, you can recover the magnet by smearing goats blood on it. <a href="https://en.wikipedia.org/wiki/Giambattista_della_Porta">Giambattista
della Porta</a> tested this and concluded that it
was false, but <a href="https://en.wikipedia.org/wiki/Alexander_Ross_(writer)">Alexander Ross</a> argued that
our garlic is perhaps not so vigorous as those of ancient Greeks.</p>
<div style="text-align:center"><a href="https://tomasp.net/blog/2017/programming-mythology/heliocentric.jpg">
<img src="https://tomasp.net/blog/2017/programming-mythology/heliocentric.jpg" class="rdecor"
style="width:60%;max-width:400px;margin-left:30px;margin-top:0px;margin-bottom:20px" /></a></div>
<p>You can just laugh at these stories, but they can serve as interesting lessons for any scientist.
The lesson, however, is not the obvious one. Academics will <a href="https://danghica.blogspot.co.uk/2016/09/what-else-are-we-getting-wrong.html">sometimes read those
stories</a> and use them
to argue against something they do not consider scientific - arguing that it is like believing
that garlic break magnets.</p>
<p>This is not how the analogy works. What is amazing about the old stories is that the conclusions
that now seem funny often had very solid reasoning behind them. If you believed in the basic
assumption of the time, then you could reach the same conclusions by following fairly sound
reasoning principles. In other words, the amazing theories were scientific and entirely reasonable.
The lesson is that what seems a completely reasonable idea now, may turn out to be wrong and quite
hilarious in retrospect.</p>
<p>In this article, I will look at a couple of amazing theories that people believed in the past
and I will explain why they were reasonable given the way of thinking of the time.
Along the way, I will explore some of the ways of thinking that we use today about
programming and computer science and why they might appear silly in the future.</p>