Talk:Modulinos

From Rosetta Code

Needs more description

The task description here is missing something. Is this a task to show a main function that will be run from the command line? I've never heard the phrase "scripted main" before, so I'd like some more definition there too. The examples also seem to do lots of stuff that isn't described in the directions. --Mwn3d 00:16, 4 March 2011 (UTC)

Very much agree.
The Github link in the intro text says this:
Programs that only run main() if they're not loaded as libraries by other programs.
Make of that what you will. Clarification definitely needed. -- Erik Siers 07:16, 4 March 2011 (UTC)

Name change?

Reason being that ScriptedMain , even if changed to the more RC norm of "Scripted main", doesn't mean much, or as much as, say, "Executable library". The task seems to be about having a means of allowing library code - usually imported/included into a larger program; to also function as a useful program in its own right when executed directly.

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. --Paddy3118 00:39, 4 March 2011 (UTC)

Some chat in IRC

There was some discussion in IRC on the subject: http://irclog.perlgeek.de/rosettacode/2011-03-04#i_3355683. --Michael Mol 16:14, 4 March 2011 (UTC)

When a compiled program is run, the compiled program is run. The compiled program cannot be loaded as a library too can it? (I mean that it isn't done normally). If not then only normally interpreted languages could have this property; things like the C example don't fit the task description. --Paddy3118 16:33, 4 March 2011 (UTC)
I could change the task to reflect what Python does with, for example its CGIHTTPServer module, where calling it as command python -m CGIHTTPServer starts a web server, and loading it as a module would allow the calling program access to code for setting up a web server. --Paddy3118 16:33, 4 March 2011 (UTC)