7 ms·
> The formal definition isn't clear on exactly what process is necessary to target a new environment I'm interested in the source of this "formal definition",
by oriolid 4y ago
> The formal definition isn't clear on exactly what process is necessary to target a new environment
I'm interested in the source of this "formal definition", because it doesn't really match anything I have come across over the years.
> typically you are adding the environment specific aspects in #ifdef-type directives
Not really, more like writing platform-specific parts as separate modules. Of course you can write Java for Android and Objective C for iOS in the same file if you really want, but it doesn't make much sense. Or even write a compiler that takes a source file with target-specific paths and transpiles to Java and Objective C if you want to go all in. I've never seen anyone do that.
- randomdata 4y ago> I'm interested in the source of this "formal definition", because it doesn't really match anything I have come across over the years. "In software engineering, porting is the process of adapting software for the purpose of achieving some form of execution in a computing environment that is different from the one that a given program (meant for such execution) was originally designed for (e.g., different CPU, operating system, or third party library)." Here we have software (Tcl) that was adapted to work in a computing environment (Go) that is different than the given program was originally designed for. This doesn't seem very controversial. > Of course you can write Java for Android and Objective C for iOS in the same file if you really want, but it doesn't make much sense. If you are changing the language software is written in, it is a stretch to call that porting. That isn't even a fork. That is a new project.
- oriolid 4y agoIt make it sound a lot like you think that "porting" means what the rest of the world calls compiling and have no idea what porting is.
- randomdata 4y agoWe certainly aren't talking about compiling. Compilation is repeatable. A port is done once.
- oriolid 4y agoCompiling can also be done once and the object files can be published on Github if you for some reason want to do that. As far as I understand, this "port" is transpiled from C source and the Go source files are compiler artifacts just like object files.
- randomdata 4y agoCompiling is repeatable, however. Porting is done once.
- oriolid 4y agoErgo, traspiling to a different language is not porting.
- randomdata 4y agoNor is transpiling - or compiling as it is more commonly known - to another CPU architecture or operating system, but that’s not what we are talking about here. The topic of the day is porting. Porting and compiling are quite different.
- oriolid 4y agoPlease see https://en.wikipedia.org/wiki/Source-to-source_compiler https://en.wikipedia.org/wiki/Source-to-source_compiler to see the usual definition of transpiling, and how it is different from compiling and cross compiling (mentioned under "not to be confused with").
- randomdata 4y agoWhat I am to see? This Tcl port is clearly not source-to-source compiled. Everyone in this thread, including yourself as far as I can tell, agree that the product of this port is not usable as the source. The original Tcl codebase written in C remains the source and must be compiled each time it is modified to keep this Go package in sync. Hell, this entire thread started because someone pointed out that the Go target output isn't usable as the source... The Go project's gc compiler was source-to-source compiled from its original C codebase into a Go codebase, which became the new source as the original C code was abandoned. Is this the origin of your confusion? That is a strange place to arrive just because Go is in the title, though. Or is it that you also don't understand what the word source means?