News for hackers. Stuff that matters.
Re:Why Rust? by cageface on Tuesday October 18, 2022 @07:30AM (#33245721)
I've started working in Rust too and I too find it a tremendous breath of fresh air. It's the first time I've been excited about a new programming language in many years.

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.

Re:Why Rust? by pjmlp on Tuesday October 18, 2022 @07:36AM (#33245765)
> 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.

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.

Re:Why Rust? by dannymi on Tuesday October 18, 2022 @08:44AM (#33246314)
>I wonder why, doing Windows programming with OWL in 1993 was quite delightful,

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.

Re:Why Rust? by pjmlp on Tuesday October 18, 2022 @09:00AM (#33246459)
Compared with Win16 Petzold style, that looks great, and it also reveals lack of knowledge from OWL features that don't require direct Win16 calls like raw strings instead of TString.

By the way, you should have a dive into how the "modern" development experience with Rust/WinRT compares with C++ Builder in 2022.

Re:Why Rust? by bluejekyll on Tuesday October 18, 2022 @09:24AM (#33246722)
> I see similar aproaches with Rust code making use of unsafe when there are safe alternatives.

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_...

Re:Why Rust? by torstenvl on Tuesday October 18, 2022 @09:27AM (#33246770)
That isn't a trend line, the crates are sorted by percentage of unsafe code.

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.

Re:Why Rust? by bluejekyll on Tuesday October 18, 2022 @12:44PM (#33250235)
Yes, you’re correct trend is the wrong term. Was that an aggressive statement? It wasn’t intended to be.

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.

Re:Why Rust? by pjmlp on Tuesday October 18, 2022 @01:25PM (#33250904)
Have a look at Rust/WinRT where the Microsoft team is the opinion others should provide the safer wrappers on top.
Re:Why Rust? by bluejekyll on Tuesday October 18, 2022 @08:04PM (#33255755)
Isn’t that an FFI boundary though? There are a lot of examples of FFI crates where the inner FFI is wrapped by an outer safe crate with a Rust API.

Not having looked at that API specifically, it might be that they think there are perhaps different approaches to implementing the safe interfaces, and those may be best left to specific implementations for UI abstraction frameworks, like Druid.

Just speculating.

Re:Why Rust? by cageface on Tuesday October 18, 2022 @09:27AM (#33246775)
Yeah everything was perfect back in my day and there's nothing new under the sun. You kids get off my lawn.

I've been coding C/C++ since 1995. I'll take Rust any day, thanks.

Re:Why Rust? by pjmlp on Tuesday October 18, 2022 @11:09AM (#33248433)
Are we GUI, CUDA and SYSCL yet?

Don't forget that to contribute to Rust backends on their present forms, some C++ is required.

Re:Why Rust? by badsectoracula on Tuesday October 18, 2022 @09:39AM (#33246937)
> doing Windows programming with OWL in 1993 was quite delightful

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.

[0] http://runtimeterror.com/tech/fowl/

Re:Why Rust? by pjmlp on Tuesday October 18, 2022 @11:13AM (#33248494)
When the alternative was raw Win16, it was certainly delightful and felt pretty much an evolution from Turbo Vision.

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.

Re:Why Rust? by rvz on Tuesday October 18, 2022 @07:33AM (#33245736)
> Too bad most of the Rust jobs right now seem to be in crypto.

What is the problem with that?

Re:Why Rust? by rwaksmunski on Tuesday October 18, 2022 @07:41AM (#33245806)
Potential criminal liability and resume stench. Would you hire ex scammer/ponzi to maintain your backend? I wouldn't.
Re:Why Rust? by rvz on Tuesday October 18, 2022 @07:47AM (#33245851)
Yeah, I wouldn't hire someone from a company who caused mass genocide and ran a fake news propaganda machine and then and profited billions from it [0] and is also using Rust as well then. /s

[0] https://www.globalwitness.org/en/campaigns/digital-threats/r...

Re:Why Rust? by black_puppydog on Tuesday October 18, 2022 @07:57AM (#33245926)
Having FB on your resume can leave a stench indeed. Depends a bit on context though, it's a big place. Going into crypto today, that's a pretty clear lack of judgement.
Re:Why Rust? by RestlessMind on Tuesday October 18, 2022 @02:19PM (#33251695)
> resume stench

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.

Re:Why Rust? by rwaksmunski on Tuesday October 18, 2022 @02:43PM (#33252002)
I hire candidates based on skill, core values and judgment. I completely accept that others might use different criteria.
Re:Why Rust? by RestlessMind on Tuesday October 18, 2022 @02:54PM (#33252181)
So you think someone who worked at a crypto startup showed a lack of judgement? Do you have a blacklist of companies or sectors (adtech, surveillance tech, data collection, weapons manufacturers, pharma, lottery, porn, ...)? I would love to see that list.
Re:Why Rust? by rwaksmunski on Tuesday October 18, 2022 @03:23PM (#33252547)
> So you think someone who worked at a crypto startup showed a lack of judgement?

Yes, yes I do. I've had a candidate with 2 crypto rug pull startups under his belt, otherwise brilliant and passionate about tech. He went back in for a hat trick. I do not think he displayed proper judgement, do you?

Re:Why Rust? by RestlessMind on Tuesday October 18, 2022 @03:47PM (#33252871)
Depends on the details of the prior two startups and the third one. It may or may not be poor judgement. But to get back to your original post, will you blacklist every single candidate who has had a stint in the Crypto space?

Do you also think that someone who worked on two Google chat apps (which are obviously discontinued) and now working on their third one is showing a lack of judgement?

Re:Why Rust? by rwaksmunski on Tuesday October 18, 2022 @04:27PM (#33253401)
> But to get back to your original post, will you blacklist every single candidate who has had a stint in the Crypto space?

Not if they recognize the mistake and learn from it.

> Do you also think that someone who worked on two Google chat apps (which are obviously discontinued) and now working on their third one is showing a lack of judgement?

No, it's not fraud and the paycheck checks out. On the other hand, can you imagine? Do you know someone like that?

Re:Why Rust? by RestlessMind on Tuesday October 18, 2022 @07:09PM (#33255307)
> if they recognize the mistake

what if they don't think it was any mistake and was just an honest job?

> can you imagine? Do you know someone like that?

Yes, personally know someone at Google in that space who worked on multiple chat apps and nicely climbed the career ladder.

Re:Why Rust? by sirwhinesalot on Tuesday October 18, 2022 @07:40AM (#33245793)
It's a bubble, 99/100 crypto companies are going to crash and burn, or already have. If you manage to land on the 1/100 that actually does something useful and survives, well, better odds than the lottery I suppose.
Re:Why Rust? by indy on Tuesday October 18, 2022 @07:49AM (#33245864)
Sounds a lot like Silicon Valley circa. 1999
Re:Why Rust? by sirwhinesalot on Tuesday October 18, 2022 @08:27AM (#33246176)
That's my feeling, you might pick the company that becomes the google of crypto, or you might end up in one of the ones you haven't even heard about because they disappeared without a trace.
Re:Why Rust? by marcosdumay on Tuesday October 18, 2022 @08:56AM (#33246413)
Except that cryptomoney isn't adding insane amounts of value in any niche, outside of extortion and evading government controls.
Re:Why Rust? by indy on Tuesday October 18, 2022 @09:03AM (#33246496)
Evading government controls sounds like a valuable attribute.
Re:Why Rust? by marcosdumay on Tuesday October 18, 2022 @10:23AM (#33247658)
Yes and no, both. That really depends on what government and what control.

But anyway, the amount of value you can provide there is severely limited, as you can only at most undo the value your government is destroying. You can't ever get in a better situation than what you would get with a competent liberal-ish government and no cryptomoney.

That means some business can exist there, and a small amount of it can even be morally acceptable. But it is completely different from the internet boom.

Re:Why Rust? by RestlessMind on Tuesday October 18, 2022 @03:53PM (#33252930)
> You can't ever get in a better situation than what you would get with a competent liberal-ish government and no cryptomoney.

And what if you have only an incompetent authoritarian government? How would you help fight citizens of those governments? Crypto is a great tool there. Just because there are insufferable crypto-bros peddling shitcoins to make a quick buck doesn't mean entire Crypto field is useless. That'd be like blacklisting the entire data mining field because surveillance tech and adtech exist.

Re:Why Rust? by marcosdumay on Tuesday October 18, 2022 @05:27PM (#33254247)
> And what if you have only an incompetent authoritarian government?

Then cryptomoney can give you a limited, non-zero amount of value. Still less than fixing the government, but it is easier to deploy.

Even then, comparing it with the internet boom is bullshit.

Re:Why Rust? by RestlessMind on Tuesday October 18, 2022 @07:28PM (#33255485)
> Then cryptomoney can give you a limited, non-zero amount of value.

Glad we agree on this. Everything else (eg. comparison with internet boom) is a matter of degree and only time will tell.

Re:Why Rust? by achenet on Tuesday October 18, 2022 @10:35AM (#33247841)
oh hi there, would you like to hire a few super expensive accountants to optimize taxes like the other big corporations?

(in case it isn't obvious, yes, I fully agree that evading government control/taxation is a hugely lucrative market).

Re:Why Rust? by RestlessMind on Tuesday October 18, 2022 @03:50PM (#33252903)
Ability to evade government controls sounds like a great thing in a lot of circumstances. I have compiled a list of specific examples around that topic: https://news.ycombinator.com/item?id=32406095

Why do you think governments are always right? Haven't you learned any history?

Re:Why Rust? by rvz on Tuesday October 18, 2022 @07:51AM (#33245884)
> It's a bubble, 99/100 crypto companies are going to crash and burn, or already have.

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]

[0] https://foundation.rust-lang.org/members

Re:Why Rust? by paulgb on Tuesday October 18, 2022 @08:01AM (#33245965)
VC typically has an investment horizon of 10 years, and the latest crypto surge is only ~2 years old. A lot of the companies from the last (circa 2018) ICO bubble did crash and burn. I don’t think it can be taken as fact that the ones from this round are “here to stay”.
Re:Why Rust? by api on Tuesday October 18, 2022 @09:52AM (#33247130)
What are crypto companies doing that I should care about? Give me something I could go check out and use that is:

(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?)

Re:Why Rust? by RestlessMind on Tuesday October 18, 2022 @02:24PM (#33251753)
https://news.ycombinator.com/item?id=32406095

I prepared that post since the question you posed comes up every week here, if not more frequently.

Re:Why Rust? by api on Tuesday October 18, 2022 @06:08PM (#33254705)
That’s cryptocurrency in its original use case: virtual money.

This was all technically possible in 2009. What I was getting at was… what’s new? Billions and billions have been poured into all kinds of app development and R&D in this space and all we have is still what we had when Bitcoin launched.

What are all these people in crypto building? Where is it? Where can I use it?

Imagine if 25 years after the dot com era after hundreds of billions had been spent we still just had e-mail, static html4, and text chat protocols over dialup modem.

Re:Why Rust? by RestlessMind on Tuesday October 18, 2022 @07:24PM (#33255456)
> what’s new?

Increased social and political acceptance of Bitcoin as virtual money? That is a big deal.

> ...all we have is still what we had when Bitcoin launched.

False. In 2009, a very very small minority took it seriously. Now you have Blackrocks of the world getting in that business and SEC approving a Bitcoin ETF. So after Billions and billions of investment, now Crypto is a "serious business". Which is exactly why people in Afghanistan and Venezuela can rely on Bitcoin. They wouldn't have done so in 2009.

Another use case is digital art. Until NFTs, I am not sure how artists made money with their digital collections. Now, the creators of Bored Apes can fetch ~75 ETH (~100K USD)[1] per Ape, even today after the Crypto market has crashed. That is durable value and Crypto has enabled that avenue for artists. If you think NFTs are scam for laundering black money, burden of proof would be on you to make a case about why that is different from traditional paintings. And if you think traditional art too is nothing more than an avenue for money laundering, then... I'd propose we agree to disagree.

Yet another use case is branding. Just look at the adoption of NFTs[2] among top brands like Nike, D&G, Tiffany, Gucci, NFL, NBA, La Liga or Australian Open. If legit businesses and sports leagues are adopting Crypto for branding purposes, that is a resounding proof about the viability of this particular use case.

[1] https://opensea.io/collection/boredapeyachtclub

[2] https://www.coindesk.com/web3/top-brands-in-web3-nfts-and-th...

Re:Why Rust? by soundnote on Tuesday October 18, 2022 @11:49PM (#33257391)
Arguably Brave.
Re:Why Rust? by api on Wednesday October 19, 2022 @11:06AM (#33263310)
Does anyone actually use BAT or just the Brave browser? I would consider paying for a privacy-first browser in regular money, but have no interest in the BAT thing which seems entirely shoehorned in.
Re:Why Rust? by soundnote on Wednesday October 19, 2022 @02:52PM (#33266351)
According to Eich, something like 20% of their userbase or so. I personally have no interest in it, but don't mind their ad model. The company does sell real money services - perhaps most notably in the "pay for the browser" type category, they offer a paid, ad-free version of Brave Search.
Re:Why Rust? by gdprrrr on Tuesday October 18, 2022 @10:35AM (#33247846)
Well, considering that 90% of all startups fail, that number isn't unrealistic
Re:Why Rust? by littlestymaar on Tuesday October 18, 2022 @10:41AM (#33247942)
True, but that's the investor's problem, not the employees. They'll end up losing their jobs in the end and move on, but it's not like people in other tech company never lose their job either. The good thing when it eventually happens is that there will be a lot of senior Rust developers that are needed by most company to even start doing things in Rust.

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.

Re:Why Rust? by jakobnissen on Tuesday October 18, 2022 @07:37AM (#33245769)
I imagine if you're not a cryptographer, you don't have a chance getting those jobs.
Re:Why Rust? by vanviegen on Tuesday October 18, 2022 @07:53AM (#33245897)
I don't think there are that many people with deep knowledge of crypto working in the 'crypto' scene.
Re:Why Rust? by coffeeblack on Tuesday October 18, 2022 @08:20AM (#33246120)
Probably better if you are not a cryptographer. Because you have fewer inclination to write “your own cryptographic algo”.
Re:Why Rust? by rvz on Tuesday October 18, 2022 @08:06AM (#33245996)
Here are a few prominent cryptographers in the 'cryptocurrency' scene with 'deep knowledge':

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.

[0] https://blog.cryptographyengineering.com/

[1] https://falcon-sign.info/

[2] https://nadim.computer/

[3] http://people.csail.mit.edu/silvio/

Re:Why Rust? by spoiler on Tuesday October 18, 2022 @08:17AM (#33246088)
A lot of crypto nerds swarmed to this field because the tech is undeniably fun, and the whole space is rather interesting and is fun to play in. Kinda like it's more fun writing a multiplayer game than a singleplayer game?

I don't think most of these people are into cryptocurrencies specifically.

Re:Why Rust? by rvz on Wednesday October 19, 2022 @08:54AM (#33261415)
> I don't think most of these people are into cryptocurrencies specifically.

They are? Especially the creator of Algorand (a cryptocurrency) Silvio Micali. In his CV [0]

> "Scientific Interests, Cryptocurrencies, Blockchains"

At the bottom of his CV:

> "Technology Transfer: Algorand, Founder and Inventor of the Core Technology"

If that is not 'into' cryptocurrencies, then I don't know what is.

[0] http://people.csail.mit.edu/silvio/CV.pdf

Re:Why Rust? by nicoburns on Tuesday October 18, 2022 @08:02AM (#33245972)
Sadly crypto in this context refers to cryptocurrencies, not cryptography.
Re:Why Rust? by stouset on Tuesday October 18, 2022 @08:07AM (#33245999)
You'd be surprised. Most legitimate cryptographers I know won't touch this space with a ten-foot pole. That should you to guess who the people actually implementing it are.
Re:Why Rust? by bornfreddy on Tuesday October 18, 2022 @10:18AM (#33247556)
Sorry to be explaining the joke, but I think GP (deliberately) misunderstood what was meant by the term "crypto".
Re:Why Rust? by Alyka on Tuesday October 18, 2022 @08:11AM (#33246034)
There are still other options available :) For example, Qdrant vector search engine. It's written in Rust, and it's not about crypto. And currently they are hiring Rust developer. Check job openings in LinkedIn
Re:Why Rust? by Gigachad on Tuesday October 18, 2022 @06:46PM (#33255091)
Very scummy companies. They often try to pull tricks like paying your wage in mostly their own coin which they plan to rug pull before you are able to cash it out.
Re:Why Rust? by pif on Tuesday October 18, 2022 @07:48AM (#33245855)
> I always found it very difficult to work at a high level of abstraction in C++.

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.

Re:Why Rust? by black_puppydog on Tuesday October 18, 2022 @07:55AM (#33245917)
> Too bad most of the Rust jobs right now seem to be in 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

Re:Why Rust? by allisdust on Tuesday October 18, 2022 @08:25AM (#33246152)
It was due to its ability to be compiled to wasm which most chains use to execute contracts.
Re:Why Rust? by manholio on Tuesday October 18, 2022 @09:18AM (#33246665)
> Except some, who always ask for "Senior Rust Developer" which I'd guess is still a limited supply market.

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.

Re:Why Rust? by alexb_ on Tuesday October 18, 2022 @11:02AM (#33248311)
I think you misread - they are talking about the non-crypto companies here.
Re:Why Rust? by tasn on Tuesday October 18, 2022 @09:30AM (#33246821)
> Too bad most of the Rust jobs right now seem to be in crypto.

We are hiring for Rust engineers. Not crypto. :)

https://www.svix.com/careers/

Re:Why Rust? by HarHarVeryFunny on Tuesday October 18, 2022 @09:31AM (#33246839)
> Rust code, on the other hand, often doesn't look much more elaborate than code I write in much higher level languages

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++ ?

Re:Why Rust? by emilern on Tuesday October 18, 2022 @09:42AM (#33246982)
The enum example in the article
Re:Why Rust? by HarHarVeryFunny on Tuesday October 18, 2022 @04:51PM (#33253736)
OK, that's an interesting language feature, but I can't say it's something that I've often wanted to do in C++. Of course C++ does have std::variant and std::any, although I'm not really a fan. I'd tend to (and have) just use a class that contains the variants and an enum to track which one, then setters and getters.

event.SetKeyPress(ch);

event.SetMouseButtonPress(pos, but); etc

...

switch (event.type) {

case EvKeyPress: ch = event.GetKeyPress();

Re:Why Rust? by HarHarVeryFunny on Wednesday October 19, 2022 @07:30AM (#33260577)
Of course the Rust features being used by that Event type are runtime polymorphism and type introspection, so another obvious C++ approach would be just to use a pointer to a virtual based class including the type, then:

switch (event->type) {

case EvKeyPressEvent:

  {

    auto kpe - dynamic_cast<KeyPressEvent*>(event)

    ...

  }

  break;

}
Re:Why Rust? by api on Tuesday October 18, 2022 @09:49AM (#33247076)
ZeroTier is doing all its new stuff in Rust and rewriting our core network virtualization engine in Rust, and not crypto. We are hiring.
Re:Why Rust? by stonemetal12 on Tuesday October 18, 2022 @11:03AM (#33248326)
You might try looking at r/rust they have a who's hiring post like HN does. I have only looked at it once or twice but haven't seen a single crypto post.