last day (15 days later) » 

10:06 PM
would you guys suggest using an ELF library to create an executable or should I be lazy and chmod an empty file
 
@user82302 Context?
 
I'm confused. You tagged this question as compiler, yet it doesn't generate an executable. Is it really an interpreter? — 200_success ♦ 59 mins ago
 
I'm not going to take a question about "Nothing" seriously.
3
 
@user82302 He's asking something different than you expect I think.
 
But I will say... a compiler takes source code as input and provides a compiled executable program as output.
An interpreter takes source code as input and prints its output directly to console (it doesn't generate a file)
 
10:09 PM
sounds easy enough
i just need to write an empty ELF file then
 
@user82302 So what is your program supposed to be, a compiler or an interpreter?
 
i'll probably add a REPL option
 
Interpreter it is.
 
but by default it'll be a "compiler"
 
Since it's the "nothing" language, do you mean RPL?
 
10:11 PM
@user82302 It isn't compiling anything.
 
isn't taking an empty file and converting it to ELF fit your definition of "compiling"?
 
No.
That's a exe generator.
It doesn't compile anything.
 
it compiles Nothing
 
compiling is just one step from code to executble
 
Exactly.
I said a compiler takes source code as its input and provides a compiled executable program as its output.
An empty file isn't source code.
 
10:14 PM
@nhgrif I'd argue an empty file can't be executed and therefore isn't an executable.
 
so if I were to compile an empty file using GCC in freestanding mode, then GCC isn't compiling anything?
 
If you're compiling C and you don't have a main function, I don't know what GCC will do, but you won't be able to run the output...
 
I doubt you'd get a .o file out of an empty .c file...
 
Most likely, GCC will generate an error yelling about not being able to find main.
For what it's worth... I actually could compile a .swift file that had nothing in it... But it'd have to be called main.swift. and has an implicit main function that exists in a file called main.swift.
 
i'd argue that the compiler and linker are two distinct programs
 
10:18 PM
@user82302 How is that relevant to this discussion?
 
the compiler wouldn't complain about lack of main, the linker would
 
The linker won't have much work if you feed it an empty file.
 
for all intents and purposes generating an exe will replace the "linking" step in the compilation process
 
Bottom line is: what you wrote looks more like an interpreter than like a compiler. Think about whether that's intentional or not.
 
in C, in order to link an executable, there are special "start-up" object files. not the case in Nothing, so I think I can get away with it
 
10:20 PM
An empty ELF is not an executable in my opinion, since it can't be executed.
 
it would not be completely empty. it would contain ELF headers, etc. just it wouldn't do anything
arguably I could have it output "Hello, world!" and still be a valid Nothing executable
 
@user82302 The specification says that the output doesn't have to be what the user expected and it would still be valid
 
41 messages moved from The 2nd Monitor
 

last day (15 days later) »