by oriolid · 4y ago · 0 comments
On extreme end, porting something from let's say Commodore 64 to Spectrum ZX would be more a complete rewrite.
I also don't really understand the point of this project. Since it's compiled from C, it doesn't get any of possible benefits of using a language that is not C.
That may be part of the process, sure. The formal definition isn't clear on exactly what process is necessary to target a new environment, just that some action is necessary. Introducing a new compiler is one possible action to achieve the result.
However, when you do have to modify the code like you suggest, typically you are adding the environment specific aspects in #ifdef-type directives, so you're still not introducing a new codebase to maintain. It's still the same codebase that will be maintained just as it always way.
And even if you want to split hairs, no matter how you slice it there is no implication that the product of the port is what you will maintain. I still have no idea where that is coming from.
> I also don't really understand the point of this project.
To avoid cgo when using the library, I'm sure. Isn't that the point of a lot of cznic/modernc.org's projects?
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.
"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.