DEV Community

Hello World in Go From Rust

paschal on January 07, 2024

Introduction Suppose every software in the world was written in just one programming language Eg. C. In that case, there'll be no need f...
Collapse
 
ooosys profile image
oOosys • Edited

What about writing a Rust application writing to stdout and a golang application reading from stdin and then run from command line: $ rustHelloWorld | golangGreetingsFromRustReceiver? Wouldn't it make much more sense? Notice, that no matter the programming language the final binary executable will be written is same "language" assuming same CPU and hardware periphery ... This is the common point where all programming languages meet ... the binary executable ... with stdin and stdout provided by the system.

Collapse
 
obbap profile image
paschal

For a trivial hello world application like what I have here that could work but that won’t scale for much more complex applications. There are many things using variables across the languages will give you like caching computation you had done prior, you won’t know all of this if you’re always writing to and reading from a file. There’ll also be file I/O overhead and security concerns (other applications can write to stdin)

Collapse
 
ooosys profile image
oOosys • Edited

Yes ... it seems that this kind of justification is so mainstream that ChatGPT responds with a same one if asked about which sense does it make, but ... the fact is that modern applications tend to over-complicate things keeping software developer busy with problems which where not there if not created by confused minds without clear vision of what is really needed, in first place. What can be done to improve this situation? I encourage you to check in first place where a problem originates from. This will help to solve it at its roots instead of patching the patches with each next patch generating some unexpected side-effects which remain unnoticed or need another patch later on. Emacs as text editor is an excellent example of a complex application screwed to a degree that it is as good as impossible to get things right there because of all the past which contributed to the chaos now only a hand full of experts are able to handle.