Re: Compiles without Executing




<niklasb@xxxxxxxxxxxxx> wrote in message news:1141255483.798243.96580@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Dave wrote:
CNerd2025 wrote:
> My boss, sort of an eccentric guy, came in today and asked if I could
> write a program that:
> a) compiles correctly
> b) is logically correct, and
> c) never executes.
>

Personally I'm inclined to answer "no" to the question; if it compiles
and is correct, then it will run.
[snip]

...subject to resource limitations. A program may be "logically
correct" and yet fail to run on a computer with limited memory,
for example.

This suggests a possible approach. What if you could write
a program that would work given infinite resources, but can't
actually load and run on ANY real computer? Depending on
how you define "logically correct" this might fit the bill.

To meet the "never executes" criterion, just make sure the
OS can't load the program -- again for resource reasons, like
a data segment too large for available address space. The
program might be "correct" by some definitions and yet none
of its code would ever execute (only OS code).


Nice idea; didn't think of this one. But it seems to assume that the OS, upon encountering a 20GB executable file, for example, won't just load the first 512 kilobytes into memory and leave the rest on disk as it tries to run the program file.

- Oliver

.



Relevant Pages

  • Re: Compiles without Executing
    ... how you define "logically correct" this might fit the bill. ... To meet the "never executes" criterion, ... OS can't load the program -- again for resource reasons, ...
    (comp.programming)
  • Re: Compiles without Executing
    ... Personally I'm inclined to answer "no" to the question; if it compiles ... how you define "logically correct" this might fit the bill. ... To meet the "never executes" criterion, ... OS can't load the program -- again for resource reasons, ...
    (comp.programming)
  • Re: Getting URLs
    ... "Executes wget to put the search result into ... portable across Lisp systems (ok this is a Windows eecutable, ... feature behind the GET-URL function. ... It indicates the resource should be stored in this file. ...
    (comp.lang.lisp)
  • Re: page_load executes twice ?
    ... when page executes page load second time,, ... > pageload (although page is loading second time ispostback property is ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How to conditionally use a specified module
    ... >> executes at compile time. ... d> Hi Uri, ... require can load any module just like use. ...
    (perl.beginners)