Got recently dragged into the whole effort of SerenityOS and, in the effect, this of Jakt language. Most certainly by the personal traits of Andreas and Jonathan. Putting all the accolades and awes aside I thought Iāll share some āoutsiderā perspective on the language itself (as I think is pretty interesting as having a clear purpose that will drive its developmentāsomething that some other languages tend lack).
What Iāve noticed is this ānamedā parameters approach for method calls which I really like. Having seen also ES/TS interpolation strings I found them very useful and straightforward so I was pretty shocked they did not land in the language (yet?). Adding two plus two, I thought that would be nice to marry those ideas. After a moment of thought I came to realisation that having something similar to ES/TS approach (probably well-to-known to the creators) might be not the best thing in the end. I thought that I might want to bite too much at once.
Iāve limited my thinking process to the places I use this interpolation pattern most. And this was just printing/logging. Trying to see things from this perspective Iāve noticed that print
functions use anonymous parameters and {}
placeholders. ES/TS interpolation has inline formatting but has pretty much the same drawback as the current approach in Jaktāyou have to extract you expression into a variable if you want to re-use it.
By simply using named parameters in print
function (and maybe other formatting functions Iām not aware at the moment) that would be parsed in the formatting string, one could avoid artificiality and go for explicitness that Jakt is aiming for. I do not have exact syntax for that and not really thinking about any at the moment as there are many examples in the wild and most probably community has already itās own preferences. Iāll try to produce an example though:
println(
"Copying file {blue}{firstFile}{reset} to file {blue}{secondFile}{reset}",
firstFile, secondFile,
blue: "\u001b[34m", reset: "\u001b[0m"
)
This is all about the thing I wanted to share with you passing on the whole string interpolation topic for now. š
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too