Skip to content

Commit

Permalink
Prepare article for publication
Browse files Browse the repository at this point in the history
  • Loading branch information
ploeh committed Feb 5, 2024
1 parent 6c80281 commit c8fb356
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: post
title: "Statically and dynamically typed scripts"
description: "Extracting and analysing data in Haskell and Python."
date: 2024-02-02 6:47 UTC
date: 2024-02-05 7:53 UTC
tags: [Article Series, Languages]
---
{% include JB/setup %}
Expand All @@ -24,7 +24,7 @@ <h3 id="ae9c59e5fd0744f98841c6f864b20e33">
Static or dynamic types for scripting <a href="#ae9c59e5fd0744f98841c6f864b20e33">#</a>
</h3>
<p>
I'd like to make one point with these articles, and that is that dynamically typed languages aren't inherently better suited for scripting that statically typed languages. From this, it does not, however, follow that statically typed languages are better, either. Rather, I increasingly believe that whether you find one or the other more productive is a question of personality, past experiences, programming background, etc. I've been over this ground before. <a href="/2021/08/09/am-i-stuck-in-a-local-maximum">Many of my heroes seem to favour dynamically typed languages</a>, while I keep returning to statically typed languages.
I'd like to make one point with these articles, and that is that dynamically typed languages aren't inherently better suited for scripting than statically typed languages. From this, it does not, however, follow that statically typed languages are better, either. Rather, I increasingly believe that whether you find one or the other more productive is a question of personality, past experiences, programming background, etc. I've been over this ground before. <a href="/2021/08/09/am-i-stuck-in-a-local-maximum">Many of my heroes seem to favour dynamically typed languages</a>, while I keep returning to statically typed languages.
</p>
<p>
For more than a decade I've preferred <a href="https://fsharp.org/">F#</a> or Haskell for ad-hoc scripting. Note that while these languages are statically typed, they are <a href="/2019/12/16/zone-of-ceremony">low on ceremony</a>. Types are <em>inferred</em> rather than declared. This means that for scripts, you can experiment with small code blocks, iteratively move closer to what you need, just as you would with a language like Python. Change a line of code, and the inferred type changes with it; there are no type declarations that you also need to fix.
Expand Down Expand Up @@ -92,7 +92,7 @@ <h3 id="331b2ed3198f4a59872eb0e9d2f4ebd9">
For this small task, I don't think that there's a clear winner. I still like my Haskell code the best, but I'm sure someone better at Python could write a much cleaner script. I also have to admit that <a href="https://matplotlib.org/">Matplotlib</a> makes it a breeze to produce nice-looking plots with Python, whereas I don't even know where to start with that with Haskell.
</p>
<p>
Recently I've done some more advanced data analysis with Python, such as principal component analysis, random forest classification, KNN-classification, etc. While I understand that I'm only scratching the surface of data science and machine learning, it's obvious that there's a rich Python ecosystem for that kind of work.
Recently I've done some more advanced data analysis with Python, such as random forest classification, principal component analysis, KNN-classification, etc. While I understand that I'm only scratching the surface of data science and machine learning, it's obvious that there's a rich Python ecosystem for that kind of work.
</p>
<h3 id="dcf63d011f02487eb051e3a75cbe59f7">
Conclusion <a href="#dcf63d011f02487eb051e3a75cbe59f7">#</a>
Expand Down

0 comments on commit c8fb356

Please sign in to comment.