As far as I know yes, a compiler is needed.If you're new to script writing and want to do stuff in Maya, I'd definitely start with MEL. There's a lot more resources, Maya tells you exactly what commands it needs (echo commands), and more people here are familiar with it.
Edit: I'm not sure you can even script C++ direct in Maya. Doesn't it need to compile?