Why ipso?
3 Aug, 2022
This post is for everyone who learns about ipso
and wonders, “Why should I use this?”
The short answer? You shouldn’t, unless you want to.
ipso
is very much a personal project. I created it because I wanted a scripting language that I’d
enjoy using. Something that would make writing glue code and throwaway scripts feel good to me.
It follows that any attempts by me to convince or persuade you to use this language would be in
poor taste. Just as I wouldn’t argue that you should start liking
Meshuggah or pineapple on
pizza, I won’t argue that you should value what
ipso
has to offer. To each their own.
My role as the language designer is to lay out my values and preferences and how they have influenced the language, so that you can easily decide whether or not it’s for you.
The two main forces driving my decisions in ipso
are my senses of correctness and convenience. To
satisfy my need for correctness, the language has static types and achieves equational
reasoning through explicit effects1 with computation expressions2. In service of convenience, it has string
interpolation3 and command literals4, and aims to have a
comprehensive standard library5. Some features exist for both ends, such as
anonymous records6 and variants7, and type classes8.
Finally, I’ll leave you with some ipso
code for a CI
script I
wrote. Hopefully the features I’ve described together with the code below give you a sense of
whether or not you’d like to use this language.
#! /usr/bin/env ipso
: IO ()
main =
main comp
let versionVar = "GITHUB_REF_NAME"
let versionFile = "ipso-cli/src/version.rs"
bind mVersionInGit <- env.getvar versionVar
case mVersionInGit of
->
None x comp
"error: $versionVar not set"
println
exit.failure->
Some versionInGit comp
bind versionLine <- file.read versionFile
# extract `version` from `pub const VERSION: &str = "version";`
let versionInRust =
versionLine|> string.split ' '
|> array.index 5
|> string.split '"'
|> array.index 1
"$versionVar version: $versionInGit"
println "$versionFile version: $versionInRust"
println if versionInGit == versionInRust
then
comp
"success: versions match"
println
exit.successelse
comp
"error: version mismatch"
println exit.failure