Patrick Dubroy
@dubroy
Should languages require an explicit entry point (e.g. "main"), or not?

(I surprised myself by not having an opinion on this.)
Apr 7, 2021 · 3

Most “scripting” languages don’t, and most compiled languages do, but is there a good reason for that?

It occurred to me that maybe the distinction is between langs that allow top-level expressions vs those that don't. E.g., Haskell → no top-level expr, has main().

The Swift doc even calls this out explicitly: developer.apple.com/swift/blog/

https://twitter.com/dubroy/status/1379842576044457985 ∙ Archived on 2025-03-28.

← Twitter Archive: 2021