In a choice between C or Go I recommend Rust
I'm not sure how to continue my programming journey, so I'm asking here:
I've only ever used Python, and I love it, except when it's slow (which is *always* when you're interested in writing very efficient graph algorithms like I am).
I like simple, clean code, I've mostly never used objects or classes, they're not particularly useful for what I'm doing.
So, after some research, I am thinking about learning C or Go. The thing is, C is much more widely used and supported, but I don't want to become a hardcore developer who has to manage memory and shit. I want to be a mathematician who can write good code, that's all.
Also, I like that Go makes concurrency easier, at least that's what I've read, which is something I'll need to use a LOT because of the particular algos I have in mind.
What do you guys recommend? cc nostr:npub1fjqqy4a93z5zsjwsfxqhc2764kvykfdyttvldkkkdera8dr78vhsmmleku
Discussion
lol. why?
Because that is where it sits. It is as perfomant and capable as c but safer than go. For distributed and secure systems it is probably the "right" language.
"safer"
what is safer about a language that has macros and the ability to tamper with memory directly versus another that has a lot of obstacles to doing this kind of tampering?
the only difference in memory safety between the two languages is you can get a performance problem in Go if you just fling out a bazillion new buffers for no reason, use them once and then forget about them... and then you need to consider a freelist
there is no buffer overflow vulnerability in valid code in either language
i tell you what the safety problem with rust is
the protocol has to be designed to be secure, most vulns these days are protocol level not buffer overflow
so, Rust is fixing a problem from 20 years ago with an overly complex syntax that really is just hints for a really dumb GC, and go has a sophisticated, 15 year old GC that builds upon its own experience and that of Java's GCs and other GC using languages
this "safety" thing is illusory
what's unsafe is hard to read code, and complex syntax and the red flag is that it takes 100 times longer to compile it
Ok fine, good points all. But it is safer in that I don't have to tell my friends that I program in go. I use rust, I don't have any friends.
what has programming got to do with your social life exactly?
how does this in any way have anything to do with the best choice for writing simulators for a mathematician who is not greatly experienced with programming?
most mathematicians and similar pick python because of its simplicity
Go is simple also, but if you are doing large graph calculations like WoT then it's also 10x faster
safety has nothing to do with his question, nor does your social standing with your hipster mates