Chris's Wiki :: blog/python/WhyNoMainFunction Commentshttps://utcc.utoronto.ca/~cks/space/blog/python/WhyNoMainFunction?atomcommentsDWiki2020-07-22T03:58:43ZRecent comments in Chris's Wiki :: blog/python/WhyNoMainFunction.By Chris Siebenmann on /blog/python/WhyNoMainFunctiontag:CSpace:blog/python/WhyNoMainFunction:85b640a4721853f4db29812e37b0383e0b2afffeChris Siebenmann<div class="wikitext"><p>It's true that languages that normally only run code in the context of a
function have to do some extra work in order to support an interactive
shell, but it can definitely be done and generally should feel natural.</p>
<p>As far as Python and Perl go, I think they both have a lot of
predecessors that behaved this way. For Perl, Unix shell scripts are an
obvious inspiration; for Python, its lineage stretches back to BASIC
(among other things), and most versions of BASIC act much the same.</p>
</div>2020-07-22T03:58:43ZBy hahn@mcmaster.ca on /blog/python/WhyNoMainFunctiontag:CSpace:blog/python/WhyNoMainFunction:6e579fd45ea2563619059169c16f76329d57e239hahn@mcmaster.ca<div class="wikitext"><p>This is perhaps not entirely fair, but I've always assumed Python is acting like Perl...</p>
</div>2020-07-21T17:34:20ZBy Sandip Bhattacharya on /blog/python/WhyNoMainFunctiontag:CSpace:blog/python/WhyNoMainFunction:4f76934ba87fd2e30d94d77c96e6ef8ea7acf3f5Sandip Bhattacharyahttps://blog.sandipb.net<div class="wikitext"><p>Don't you think this eschewing of a main() function also makes Python provide the interactive shell more ... uh ... naturally?</p>
<p>Languages which have entry point functions don't lend themselves very well to supporting interactive shells very easily from what I have seen.</p>
<p>I think this is what makes stuff like Pandas so much possible in languages like Python (and other LISPy languages).</p>
</div>2020-07-21T09:56:14Z