Digital mechanics