by cageface · 4y ago · 0 comments
C++ promised to be a language that was both high performance and very expressive but I always found it very difficult to work at a high level of abstraction in C++. The sharp details always stab through.
Rust code, on the other hand, often doesn't look much more elaborate than code I write in much higher level languages but it's far, far faster and I feel more confident in its correctness.
Too bad most of the Rust jobs right now seem to be in crypto.
We are hiring for Rust engineers. Not crypto. :)
It is not really surprising that the crypto bros jumped onto the bandwagon, the tech got hyped just around the same time. Just, one of them correctly. :)
It's just a shame that other companies don't seem to follow suit. Except some, who always ask for "Senior Rust Developer" which I'd guess is still a limited supply market. :D
I've seen a role advertised for 750k/month. It makes sens: those who move fastest get to milk the crypto bubble and make out like bandits. Oh wait, exactly like bandits.
I wonder why, doing Windows programming with OWL in 1993 was quite delightful, or Mac with AppToolbox/PowerPlant,...
Yes there is always C stuff coming throught the cracks, but I see similar aproaches with Rust code making use of unsafe when there are safe alternatives.
For me, it's because memories are not trustworthy (rose-colored glasses). Also, I had less experience back then. And we as an industry didn't know any better.
I got started in programming in Borland Pascal and Borland C++. Because of nostalgy, I've tried using them for fun again ten years ago and boy is there a reason I stopped using them in the first place. Sheesh.
Example OWL snippets:
for (int index = 0; index < count-1; index++) {
int len = GetStringLen(index);
TAPointer<tchar> buf(new tchar[len+1]);
GetString((tchar*)buf, index);
*outStream << (tchar*)buf << _T('\n');
//delete buf;
}
...
TClipboard cb(*this, false);
if (cb.EmptyClipboard()) {
int len = GetStringLen(index);
HANDLE cbhdl = ::GlobalAlloc(GHND,len+1);
LPTSTR buf = (LPTSTR)::GlobalLock(cbhdl);
GetString(buf, index);
::GlobalUnlock(cbhdl);
...
class tGastValid : public TEdit {
public:
tGastValid(TWindow *Win, short ID) : TEdit(Win, ID) {}
void EvKillFocus(HWND);
DECLARE_RESPONSE_TABLE(tGastValid);
};
DEFINE_RESPONSE_TABLE1(tGastValid, TEdit)
EV_WM_KILLFOCUS,
END_RESPONSE_TABLE;
void tGastValid::EvKillFocus(HWND hWnd) {
GetParentO()->SendMessage(WM_COMMAND, DB_BTGAST, 0);
TEdit::EvKillFocus(hWnd);
}
^-- I liked THAT? What was wrong with me ;)That said, Borland had really good class libraries. If I had those libraries in a modern language, hey that wouldn't be so bad. But these languages? No, thank you.
By the way, you should have a dive into how the "modern" development experience with Rust/WinRT compares with C++ Builder in 2022.
Really? I review and read a bunch of Rust code on a weekly basis from projects I might use in various contexts. I hardly ever see unsafe used, except in contexts where it is necessary like FFI.
I am pretty sure that your comment is provably false, if someone wanted to run a report on crates.io. Oh, looks like someone did, and it trends to 0: https://www.reddit.com/r/rust/comments/g0wu9b/percentage_of_...
From your link: To get this plot I ordered all crates by unsafe code % and then plotted it, so each point on the graph is unsafe code % for a single crate.
The link is still some evidence in support of your position, given that it drops off close to the left edge, i.e., a small number of crates have a large amount of unsafe code. But it isn't nearly the smackdown of GP's position you must think it to be for you to be so aggressive toward them.
I find the statements around unsafe in Rust to generally be incorrect though, from what I can tell, it’s only ever used in quite narrow cases and not generally across the vast majority of Rust software.
I never used the C++ version OWL (though i do have Borland C++ 5 around here, perhaps i'll try it for fun at some point), but the Turbo Pascal version of OWL (which i also really used but had a brush with - and some docs) wasn't really that great - more of a helper library for the underlying Windows API, needing to know the underlying API, in practice not very different than MFC (also more of a helper library to make using Win16/Win32 easier than something to let you ignore it).
VCL was by long long far the best API/Framework (and in some ways it still is, though FCL/LCL is better since it is richer and also crossplatform).
FWIW i did a partial recreation of Turbo Pascal OWL in Free Pascal some years ago[0]. It doesn't have much of a practical use though (unless you want to make some small GUI EXE files in Free Pascal) since i think even Borland abandoned the Pascal version of OWL and i doubt many people used it.
Naturally VCL was even better, Microsoft is still trying to catch up with C++ Builder and failing spectacularly at it. C++/CX could have been it, but then the ATL/WRL folks at WinDev had to kill it.
I've been coding C/C++ since 1995. I'll take Rust any day, thanks.
Don't forget that to contribute to Rust backends on their present forms, some C++ is required.
I'm curious to see an example. Could you show something written in Rust, or another "much higher level language" that you think would be messier or more difficult to write in C++ ?
event.SetKeyPress(ch);
event.SetMouseButtonPress(pos, but); etc
...
switch (event.type) {
case EvKeyPress: ch = event.GetKeyPress();
switch (event->type) {
case EvKeyPressEvent:
{
auto kpe - dynamic_cast<KeyPressEvent*>(event)
...
}
break;
}What is the problem with that?
This is such a bogus argument. I am working in Crypto and have no trouble getting offers from non crypto companies. My resume also carries other evils such as the surveillance overlord and the evil empire, among others. I always found it easy to waltz into a new job with those names.
I have also hired dozens of people coming from companies which were pinatas of du jour. Neither I nor any of the other people involved (sourcers, recruiters, execs, HR) gave even a minimal amount of shit regarding "resume stench". If a candidate passed our hiring bar, we hired them.
So stop spreading this FUD.
[0] https://www.globalwitness.org/en/campaigns/digital-threats/r...
I'm sure this is the 990th time that I have heard this. The fact is, it isn't going away and it seems even more crypto companies have taken interest in using Rust and that is good.
Even some (crypto) companies are sponsoring the Rust Foundation as silver members. Nothing wrong with that. [0]
(1) Not speculation, gambling, or some variation thereof.
(2) Useful for something other than crypto itself.
(3) Actually works and can be used today.
(4) Continues to make sense even in a crypto bear market. (In other words: I will still buy milk even if the US dollar is falling because the point is the milk not the dollar. What in crypto is like that?)
Is their work pointless? Sure. But aren't Googlers' jobs not pointless too? That's the sad state of the 21th century: most people have a bullshit job but they need it to pay their mortgage.
Matthew Green from John Hopkins University [0]
Zhenfei Zhang of Ethereum, Mina, Algorand blockchains who co-created the NIST post-quantum cryptography standard for digital signatures called Falcon [1]
Nadim Kobeissi creator of cryptocat now created Capsule Social [2]
Silvio Micali, Turing Award Winner for his work on Zero-Knowledge Proofs [3]
So, I'm afraid that there are some credible people like those above who have a significant and documented background in cryptography who are also working in the cryptocurrency industry.
That's the opposite of my experience. The ability to abstract is exactly what I miss since working with C#, with much useful stuff removed to please incompetent developers and their managers.