Snippets from file using Crystal

Snippets from file using Crystal

File: ~/.config/snippets.yml
evaluate-commands %sh{
  cat <<'EOF' | crystal eval
    require "yaml"
    class String
      def shell_escape
        "'" + self.gsub("'", %('"'"')) + "'"
      end
    end
    yaml = File.open(File.join(ENV["XDG_CONFIG_HOME"], "snippets.yml")) do |file|
      Hash(String, String).from_yaml(file)
    end
    yaml.each do |snippet, expansion|
      puts "
        set-option -add global snippets #{snippet.shell_escape} #{expansion.shell_escape}
        set-option -add global static_words #{snippet.shell_escape}
      "
    end
EOF
}

Example

~/.config/snippets.yml

cat: 🐈
crab: 🦀

map-sequence global cat %{exec :cat2:}
map-sequence global crab %{exec :crab:}

As someone not familiar with Crystal, is there something about the language that makes it a good pairing with Kakoune? Faster eval times then most other languages?

Not specifically, I just like the language.