Talk:Modulinos: Difference between revisions

Line 16:
The idea of an executable library (scripted main), has merit for interpreted languages, but seems contrived for compiled languages as in most cases you are further removed from both the library sources and the means to compile them, when actually executing a program using the library. Although many stand alone libraries are available in, for example, C, I have only seen stand-alone utilities that come with those libraries as separate programs with separate source files that link to the libraries at compile time. --[[User:Paddy3118|Paddy3118]] 00:39, 4 March 2011 (UTC)
 
There is some truth to that. But many languages offer scripting and compilation. In any case, it's helpful to know that main() is always executed (C, C++, D), optionally executed (Perl, Python, Ruby, Chicken Scheme), or requires obscure syntactical tricks to even attempt (Bash, Lua, Common Lisp). I could omit the print-current-directory, print-current-program, and print-command-line-arguments sections from the scripted main examples, since Rosetta already has snippets for those behaviors. But programmers are likely to want scripted main and these other behaviors together, and often one is needed in order for the other to be possible. E.g., Chicken Scheme has no built-in way to get the program name, and scripted main won't work in compiled mode unless it can compare its command line arguments and program name. TL;DR: All four behaviors are useful to know and they're very hard to Google. --[[User:Mcandre|Mcandre]]
 
TL;DR: All four behaviors are useful to know and they're very hard to Google. --[[User:Mcandre|Mcandre]]
 
== Some chat in IRC ==
Anonymous user