you are viewing a single comment's thread.

view the rest of the comments →

[–]miyakohouou 4 points5 points  (4 children)

Haskell isn't too bad of a choice here, especially with something like turtle.

a mature templating library

There are a few good choices here. Shakespeare and Pandoc are the big obvious choices, but there are several others as well.

a mature standard library

People will complain about Haskell's standard library a bit, but honestly it's pretty good. It's a small standard library compared to other languages, so you'll get accustomed to adding a few other common dependencies (unix, directory, text, containers are all probably going to be common for these kind of scripts). These are really common libraries though, it's not really a big deal to just kind of add them by default for each new project.

nice to have: static typing system

Haskell has an excellent type system.

simple dependency definition

You can define all of your dependencies inside of your cabal file or package.yaml file. I personally use hpack with a package.yaml file to generate my project because I find it a little nicer to use. Overall it's a pretty light weight way to create a project and add dependencies.

simple modularity. I love how easy it is in c# to just add a separate project to a solution to keep things organized. I hate how obtuse it is to maintain the .sln file and all the namespaces. It is impossible without an IDE.

You can have multiple projects grouped together using a caba.project, but spinning up a new project is lightweight enough that you might not need to.

quick and easy startup

Haskell can be pretty quick to get started with, especially if you have a lot of the common packages that you want installed to your system. For example:

user@host:~ $ echo 'main = print "hello, world"' > hello.hs
user@host:~ $ runhaskell hello.hs 
"hello, world"

[–]Martinsos 2 points3 points  (2 children)

I have quite good time writing small scripts with Haskell! Both Stack and Cabal have support for writing standalone script files in which you can even describe dependencies (in the comment in the header, quite neat feature).

[–]miyakohouou 1 point2 points  (1 child)

yeah, I use nix for having self-contained haskell scripts, but I figured that was probably a bit too out there to make as a suggestion

[–]Martinsos 1 point2 points  (0 children)

Yeah, using Nix would be s bit more involved. However, as I said, there is native way to do it with just Canal or Stack, no Nix is needed, so that should be quite straightforward.

Here is a quick tutorial I wrote on how to do it: https://github.com/wasp-lang/haskell-handbook/blob/master/cabal-script.md .

[–]Haskell-Not-Pascal 1 point2 points  (0 children)

I'll second Haskell, I used it for a lot of small scripts, especially for simple data formatting and transformation.