echo IS a function.
What might be confusing to you is that in Nim all three following variations are the same
echo("foo")
echo "foo"
"foo".echo
If you're curious about nim, I can highly recommend "Nim in Action".