Talk:Rosetta Code/Run examples: Difference between revisions

Content added Content deleted
(→‎Task status: doable but difficult)
(→‎Task status: Further thoughts.)
Line 51: Line 51:
::: Although this task has a number of issues, I don't think it's untenable as there are six existing solutions including a very extensive Perl 6 one from Thundergnat. Whilst I consider the EC to be impractical and the MC unrealistic, you can just ignore these as I did for the Go entry. --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 15:22, 14 February 2020 (UTC)
::: Although this task has a number of issues, I don't think it's untenable as there are six existing solutions including a very extensive Perl 6 one from Thundergnat. Whilst I consider the EC to be impractical and the MC unrealistic, you can just ignore these as I did for the Go entry. --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 15:22, 14 February 2020 (UTC)
:::: The biggest difficulty with coming up with a general purpose, all (most) language task runner is the inconsistent markup and layout used by different entry authors. When I first wrote the Perl 6 task runner, I spent over a week going through and regularizing / standardizing markup on the various Perl 6 task entry authors and ensuring that the vast majority are complete runnable programs. It's pretty good now, but that was a real barrier to entry when I first wrote the code. The next several, not easily prioritizable difficulties for other languages: many task entries are not complete, stand-alone runnable code, they leave out standard libraries, or more commonly, call for including other task entry code... but don't actually include it; many task authors chose to spilt up entries into separate "task function" and "task demo" code blocks with no easy algorithmic way to tell which is which; some languages are just complicated to install / compile. None of it is insurmountable, but it requires more time and energy than I am willing to put into it. The extra credit (report on task entries that fail) is actually pretty easy, though determining '''why''' they fail may be hard. The Perl 6 entry already does report failures, though it just reports on the command line, not a compiled list. Just a matter of teeing it into a file though if I wanted to add that. The more credit (compare output to a standard) is somewhat infeasible for a Rosettacode task unless it was severely constrained to a select group of languages and tasks; and even then would be a large undertaking. Just smoking the Perl 6 entries takes several hundred / thousand lines of code, a few hours of runtime and extensive (one time) manual modification to the tasks to properly capture and compare the outputs. --[[User:Thundergnat|Thundergnat]] ([[User talk:Thundergnat|talk]]) 19:36, 15 February 2020 (UTC)
:::: The biggest difficulty with coming up with a general purpose, all (most) language task runner is the inconsistent markup and layout used by different entry authors. When I first wrote the Perl 6 task runner, I spent over a week going through and regularizing / standardizing markup on the various Perl 6 task entry authors and ensuring that the vast majority are complete runnable programs. It's pretty good now, but that was a real barrier to entry when I first wrote the code. The next several, not easily prioritizable difficulties for other languages: many task entries are not complete, stand-alone runnable code, they leave out standard libraries, or more commonly, call for including other task entry code... but don't actually include it; many task authors chose to spilt up entries into separate "task function" and "task demo" code blocks with no easy algorithmic way to tell which is which; some languages are just complicated to install / compile. None of it is insurmountable, but it requires more time and energy than I am willing to put into it. The extra credit (report on task entries that fail) is actually pretty easy, though determining '''why''' they fail may be hard. The Perl 6 entry already does report failures, though it just reports on the command line, not a compiled list. Just a matter of teeing it into a file though if I wanted to add that. The more credit (compare output to a standard) is somewhat infeasible for a Rosettacode task unless it was severely constrained to a select group of languages and tasks; and even then would be a large undertaking. Just smoking the Perl 6 entries takes several hundred / thousand lines of code, a few hours of runtime and extensive (one time) manual modification to the tasks to properly capture and compare the outputs. --[[User:Thundergnat|Thundergnat]] ([[User talk:Thundergnat|talk]]) 19:36, 15 February 2020 (UTC)

:::::Yeah, distinguishing snippets and programs split up into bits from actual runnable programs is a significant difficulty with this task. In the case of Go I could have looked for a main() function to determine whether it might be runnable but it might still not be if it were using imports which were not currently installed on the machine. Trying to check this and, if necessary, download the necessary resources would have been a hopeless task as a lot of Go libraries use C stuff which needs to be installed first.

:::::I therefore decided to just extract the first potentially runnable code and leave it to the user to determine whether it was actually runnable or not. If they said run it anyway, it would just fail to build or error out, hopefully without bringing down the host executable.

:::::Another potential difficulty is running programs for languages which have had version changes which are not backwards compatible, a notable example here being Python. I wondered here about looking for 'print' statements to see whether they had brackets or not for the arguments but, of course, not all programs will use 'print' and there may be other changes as well which are less easy to detect.

:::::I thought Pete made a good point about having some way of determining whether code was runnable or not and ideally you should include the version number and platform(s) as well. But, whilst that might be good practice for the future, it's difficult to see how one could enforce it and, even if you could, trying to deal with what's happened in the past for all languages would be impractical in any case.--[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 20:56, 15 February 2020 (UTC)