The gerund as subject
A gerund clause can be the subject of a sentence:
Hiking can be a relaxing and rewarding activity.
Swimming in the winter can boost your immune system.
Learning a foreign language is easier at a young age.
The use of the gerund as subject is more common than that of the to-infinitive.