D, Java? To D or not to D?

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Sat Jan 6 04:21:36 PST 2007


Daniel Keep wrote:
> Frits van Bommel wrote:
>> I don't think there's currently any way to have it run directly on 
>> Windows and Linux simply because there's AFAIK no executable format 
>> that's supported by both OSs (ELF is supported on multiple OSs, but 
>> Windows doesn't support it). Furthermore, all executable formats I 
>> know of (except for plain binary, which AFAIK Linux doesn't 
>> support[1]) have some (unique) signature in the first few bytes, so a 
>> file can't be multiple of these formats at the same time.
>>
>> So you'd need to either using some sort of custom loader binary for 
>> each OS or modify OSs to support a common binary format (i.e. a custom 
>> loader, but integrated into the OS).
>>
>>
>> [1]: Windows "supports" these for programs that fit in 64k: .com files 
>> are plain binaries. They're not really useful for anything but 
>> backwards compatibility though.
> 
> Linux can support PEs (ie: .exe files); that's what Wine is for.

Read the first sentence that you quoted again. run _directly_. As in: 
you can type the name of the app at the prompt and it runs (without a 
batch file, script or loader application in between) as long as it's in 
the PATH variable.

> If Windows won't support it, you have to change everything else :3

Yeah, that's technically an option. But I don't think asking people to 
upgrade their kernel to run my apps is a very nice thing to do, unless 
absolutely necessary (i.e. "it actually uses a new syscall in the 
kernel" or "kernels before x.y.z have a bug that breaks this app", not 
"I used this cool new executable format").
Not to mention the difficulty you'd have in getting the Linux, BSD and 
Mac kernel hackers to ship all ship a patch to be able to load a Windows 
executable format...



More information about the Digitalmars-d mailing list