my ideal scripting lang

This commit is contained in:
Wouter Groeneveld 2023-12-08 22:01:07 +01:00
parent 74a3a9a296
commit 4510ed99eb
1 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,39 @@
---
title: "My Ideal Scripting Language"
date: 2023-12-08T20:51:00+01:00
categories:
- programming
---
December marks the beginning of the countdown to Christmas, traditionally via Advent calendars. For us programmer nerds, a special one exists called [Advent of Code](https://adventofcode.com/) where each December day before Christmas we're treated with a challenging programming puzzle. This year a good friend convinced me to join in on the fun and so far I have been really enjoying these silly me-moments.
But which programming language do you pick for such a task? Aha, hurdle number one!
This isn't just a stupid question, but boils down to: which scripting/hacking/prototyping language do you fall back on? Over the years, I've been back and forth various languages for this, and right now, I'm solving Advent of Code in vanilla JavaScript, but I don't think it's the best pick. I've had this debate with myself before when I was a jury member for the [Vlaamse Programmeerwedstrijd](https://www.vlaamseprogrammeerwedstrijd.be/) (_Flemish Programming Contest_) where similar short and cryptic assignments appeared, and where I used JS, Kotlin, Go, Python, and a bit of Ruby.
What makes a great scripting language? I suppose that's a bit of a personal question and will boil down to preference---hence the title of this post is _my_ ideal scripting language. Nonetheless, I'll try to unravel what I am looking for when coding smaller scripts.
**Dynamics**. If I'm scripting, I don't have the patience to think about types, nor about possible incorrect type inferences. The programming language should be dynamically typed by nature.
**Quick Evaluation**. If I'm scripting, I don't have the patience to wait for a compilation and don't want to execute binaries[^waitc]. Additionally, it should be easy to execute the script, parse the results, etc.
[^waitc]: Modern languages such as [Nim](https://nim-lang.org/) offer ease-of-use features that lessen the pain of compiling, so I'm not completely set on this one.
**Introspective**. It should be easy to quickly try out different snippets, to gradually cobble together something working. That means a command-line based REPL at minimum, or more ideally an integrated evaluative environment that's easy to work with such as any browser's developer console or [Elixir's Livebook](https://livebook.dev/).
**Functional**. I like `map()`/`filter()`/`reduce()` chaining and I hate it that I can't do that in Go---at least not without shimming my own. That doesn't mean that the scripting language should be fully functional. On the contrary, I still want to be able to mutate things if I can't get things done in another way given the time constraints.
**Batteries Included**. As the famous Python saying goes...
**Unit Testing Included**. To extend the previous point, I want to quickly and easily be able to write a few unit tests to for example verify the Advent of Code's example input/expected output, and I don't want to bring in external dependencies just for that.
And then there are requirements I don't care about such as speed (of execution) and ease of low-level (pointer) access.
---
Given the above requirements, most languages I am familiar with are disqualified, such as C, C++, C#, Java, Go, and Kotlin. The following languages---to a certain degree---meet the requirements: JS, Ruby, Python, PHP? I'd love to learn Elixir or Lua and dive deeper into a Lisp dialect or even the [Pharo](https://pharo.org/) "immersive programming experience" to see whether or not I should start switching to something else besides vanilla JS. I don't like
It's interesting to read others' opinions on their ideal scripting language. In GOTO 2021, Richard Feldman and Erik Doernenburg [discussed their ideal general-purpose programming language](https://gotopia.tech/articles/152/the-ideal-programming-language), where Elm and Rust are the main stars.
It looks like a lot of exciting languages I haven't played with enough also fit the bill. What is your favorite scripting language? Hopefully I'll be wielding another tool for Advent of Code 2024!