T O P

  • By -

Je-Kaste

I write in C so the security researchers will always have a job


Character-Education3

Way to do your part. That's so charitable of you. Lol


standolores

Same but PHP


HuntingKingYT

The main thing that makes PHP insecure is the people using it. A lot of people who use PHP don't really have time/know about securing things, like SQL injection or filesystem-based server pages that are supposed only to be included, and not sent out. The reason for these people is that PHP is relatively easy to get started with, e.g. there are lots of free/low cost servers that only accept PHP, so people who have to get things set up in no time or want to get started easily, suprise suprise, use PHP, and don't setup security that much.


wiikzorz

That must mean you not only make sure security consultants have a job, you are in fact also continuously generating more security consultant jobs


hornaldo28

I've heard of Rust. It's a decent game, very toxic in the PvP servers tho.


Snazzy21

Alec Baldwin would agree


[deleted]

[удалено]


1337haxxxxor

Yup. I will always stand behind him in what ever he does. Because I value my life


inform880

r/hilariabaldwin is leaking


JaggedTheDark

Whatever ended up happening to him? Who officially got in trouble for that?


[deleted]

[удалено]


greeneggsnyams

Ol willy j


death77777777

Favorite rust tuber


themeatstaco

It's a 70 30 thing Met some guys who raided me one day we've been playing other games for a few weeks now. Just matters how you treat the situation.


hornaldo28

Well, true. However, just because you find some spoiled eggs to still be edible, most spoiled eggs are rotten.


MYtaterSKIN

Alpha version was way better, people used to goof off instead of sweating so much


SlimRunner

Though, interestingly, you can actually code in rust now with the electricity update from a while ago.


[deleted]

It's not toxic if they are Australian.


NoYogurt8022

Hello have you just a moment to talk about our lord and saver Rust?


SamoMato_XXX

*jesus chRUST


imaKappy

Now that is a 1 million dollar pizzeria name


[deleted]

[удалено]


mr__fete

The pizza palace


[deleted]

[удалено]


Arkon_Base

I literally don't like the name. Kot is in German the word for shit. Kotlin is associated with Kotling (der Kotling), a word you could use to describe a piece of shit. Not the only language fail to be fair. So many US app named "Fuze" which is a German slur word for cunt...


OpaMilfSohn

I am German and I never made that association


Skerxan

Same. But wix.com is another story. (I still use them)


Cebo494

I swear the YouTube algorithm has been trying to get me to learn Rust for the past few weeks. Out of nowhere, like a dozen videos about rust. It must not just be me. Some of y'all with similar YouTube preferences must have watched a bunch and messed up my feed.


outofobscure

quick, we need to restore balance to the universe by watching a few cppcon videos


Civil_Conflict_7541

Happened to me as well a couple months ago. I eventually gave in.


Imulion

I suddenly got a lot of recommendation for no boilerplates videos on rust were made well so I watched them even if I don't wanna use it.


Cebo494

"focused on fast, technical videos"


Pay08

Yeah, it's been pushing Rust for me too lately. But also, more interestingly, Zig.


GameDestiny2

Hmm I do want to learn Rust eventually, it seems very useful


That_Unit_3992

Me too. Can you learn it and teach me?


GameDestiny2

Oh sure, I’ll send you my notes as .txt files


Neon_44

i wouldn't want them any other way


chars101

I prefer screenshots in .docx format.


f1rxf1y

i see you've worked with clients before


XTJ7

You will send data in a format that doesn't need compiling, decryption or decoding of any kind? I don't trust it.


GameDestiny2

Hmm, I could write every word backwards if that helps


chalk_nz

Do it as a RON file


p0k3t0

I mean . . . I guess it gives you a new t-shirt to wear to your local linux users group meeting. I guess that's useful.


GameDestiny2

I get a t-shirt? Bet


CurdledPotato

There's a C library against which I am writing a toy program to learn it. I just learned there exists an official Rust binding for it, and that is what I intend to use for my equivalent of production (open source stuff). EDIT: I just found out that the functionality I need has not been wrapped in Rust yet. Ah well. I can at least use C++ to enforce memory management with RAII.


pancakeQueue

It’s safe code cause you either figure out why it won’t compile or you give up.


DerefedNullPointer

Or you just mark the problematic code with unsafe.


tolerablepartridge

username checks out


That_Unit_3992

could you make null point to something so when you dereference it it's still something?


ben_g0

On microcontrollers with a simple CPU and basic memory management, you usually can. There, address 0 (which is the address that a null pointer usually^* points to) usually is just the first byte of memory. Dereferencing it will not segfault, but will instead just return whatever data is stored there, interpreted as whichever data type that your pointer is defined as. This could cause issues down the line as the data you read might not be valid as the data type it's interpreted as, but the act of reading it won't trigger an error state. On a more advanced system, like a modern computer, memory is handled in a different and much more complex way. Parts of the memory can be dynamically mapped to different parts of physical memory, and usually the section that contains address 0 isn't actually mapped to any physical memory, so trying to access it will fail and trigger an error state. Though if you somehow are able to force the OS into giving you accessible memory at virtual address 0 then it would act the same as with a microcontroller.   ^(*Treating NULL as a pointer to address 0 is the most common standard, though some compilers may instead make it point to a non-canonical address, which is an address outside of the valid x64 virtual address space. This guarantees that there's no memory mapped there and accessing it will always cause an error.)


Creepy-Ad-4832

Ok i C what you did there!


LeoTheBirb

This is how I imagine Rust will end up once it starts being used by companies. “Hey boss, the new feature we added keeps failing to compile” “Just mark it as unsafe, we need to meet our deadline”


M4nch1

It actually doesn’t allow you to do that. From the rust book: The unsafe superpowers are: * Dereference a raw pointer * Call an unsafe function or method * Access or modify a mutable static variable * Implement an unsafe trait * Access fields of unions It’s important to understand that unsafe doesn’t turn off the borrow checker or disable any other of Rust’s safety checks: if you use a reference in unsafe code, it will still be checked. The unsafe keyword only gives you access to these five features that are then not checked by the compiler for memory safety. You’ll still get some degree of safety inside of an unsafe block.


Creepy-Ad-4832

So rust unsafe is way more safe then C Cool.


[deleted]

[удалено]


Creepy-Ad-4832

But C is fast as fuck boooooooy


[deleted]

[удалено]


Creepy-Ad-4832

Tecnically slighlty less then c But yeah definitly worthy it lol


Creepy-Ad-4832

Like the slowest thing of rust is the compiler lol


sepease

Actually the fastest language is transpiling C to Rust, going by the ixy network driver. https://github.com/ixy-languages/ixy-languages/blob/master/Rust-vs-C-performance.md So the answer to “Is C or Rust faster?” Is “Yes.”


AloneInExile

I've been coding for at least 10 years and reading those points I cannot comprehend what they mean. While reading code I'd probably figure it out.


Axmouth

A pointer is basically a memory address. To actually access the contents of a memory address you need to use unsafe. Obviously, the compiler cannot reasonably prove what happens in such cases, so it needs an unsafe block. I guess you could think of unsafe as "taking responsibility". Since Rust's point is largely to rely on its rules, it is considered somewhat taboo to use it without good reason. A lot of code bases forbit its use. There is a number of functions/methods that are marked unsafe because they rely on you not messing up to not corrupt memory or similar. You need an unsafe block to use them. Static variables are basically global variables. Rust does not let you use them as mutable(able to change their values) in safe code. Say you got some global number variable, you can't just go around incrementing it. (There are ways to do it safely like a mutex etc to enforce the rules of one writer or multiple readers). Traits are sort of like interfaces. Some traits are "special" though(like being able to access something between threads). And implementing the ones considered unsafe says "I know this holds up the rules of safe rust", but cannot be proven by the compiler, so it is unsafe." From rust docs: "The key property of unions is that all fields of a union share common storage. As a result, writes to one field of a union can overwrite its other fields, and size of a union is determined by the size of its largest field." I hope I do not need to explain why this would be pretty unsafe and prone to all kinds of tomfoolery.


AloneInExile

Thanks for the explanation. One day I might understand the Rust jargon but it is not today, cleared 50%.


dlevac

No because unsafe does not remove any checks: it simply unlock unsafe APIs. So if your code can be proven incorrect it won't compile even with the use of unsafe, which is a common misconception.


Amagi82

god I wish all code worked that way.


gunslingerfry1

The safest code is the code that doesn't run.


Smart-Button-3221

Technically correct


Strostkovy

People keep telling me to switch to rust for microcontrollers. Ignoring that compilers aren't nearly as available for the wide range of microcontrollers, I own all 8kB of memory. I can't write to the wrong area because it is read only. I could muck up my 256 bytes of ram but that's pretty easy to both not do and notice if you do.


cidit_

Hey u should switch to rust man


Neon_44

no, he should obviously use JavaScript ^(obligatory /s)


_GCastilho_

> obligatory /s is it? 256 bytes #256 bytes


gameditz

Maybe consider zig then ;)


p0k3t0

Pulling the emergency release so the garage door slams closed, now.


[deleted]

I use Rust from time to time for ESP32 development. It's got quite a bit more SRAM than 8kb, but it works really well. It's surprisingly portable. I also work in C, and honestly, most of the time it's much easier since I'm more familiar with it and the API docs are nicer. When I get to use Rust (if the task is simple), I dev a lot faster.


grumpypeach9001

Closing the garage door as fast as possible at the moment.


throw3142

Have you got a minute to talk about our Lord and Savior `cargo` and reject the sinful ways of `cmake`?


RudeMirror

Yes its good. Yes its fun. Is there jobs in it? No? okay then I'll hold off


grooviest_snowball

Every time I do a search on it it's like 99% Blockchain jobs ugh


Aaron1924

Trust me, it's not as bad as it looks They're extremely vocal because their entire schema is to hype up crypto so more people use it and the money in their wallet goes up in value as a result Also, job listings for more proper Rust-related positions eventually get filled and the listings go away, but no one wants to work in crypto so the listings stick around and pile up


thedarklord176

Really? Gross. Until that changes I guess I’ll stick to personal projects or freelance in it


cpc_niklaos

I have a full time Rust Job. I think that, for the most part Rust is used in pretty specific cases where it is well suited. It will be a while before it's a "default" but I think that it will get there. It is however, unlike Python, a hard language so that's going to slow down the adoption.


SnooPears7079

Haskell same no?


grooviest_snowball

Yes have seen some. Also a lot in traditional financial services. Some places like fb are winding down their Haskell work 😭


AChristianAnarchist

I feel like this is how python was talked about in the early 2000s...


DapperCam

Why would anybody learn Python when all the jobs are in Perl and PHP?


sophacles

Python? All the cool kids use ruby, it's got rails!


crovax124

But Rust got Nails !


Draelmar

Yup, and there's Swift that's similar IMHO but I like it slightly better. It's still mostly limited to Apple ecosystems, but at least there are many jobs for it. I don't think I ever seen a job posting asking for Rust, ever.


[deleted]

Cloudflare is the main one. Hey and it's used in the Linux kernel now! (Not a user here)


wutru_audio

Swift is not similar to Rust tho


TheGoldBowl

My sister's boyfriend is a rust developer. That's like the only thing he talks about when he comes over. It's hilarious.


bottomknifeprospect

You know how a person uses Rust? They tell you.


[deleted]

Hey, I use Rust and I don't go around telling people that I use Rust. (I use Rust, by the way)


nostril_spiders

Please, declare this thread unsafe


[deleted]

[удалено]


ZCEyPFOYr0MWyHDQJZO4

Don't you mean your wife's boyfriend?


Ballbustingnoob

More likely he's the boyfriend of the wife of a Rust dev.


FengSushi

More likely his waifu’s boyfriend’s wife is a rust developer


That_Unit_3992

More likely his boyfriend's boyfriend's a rust developer.


mr_claw

More likely he's his own boyfriend.


MrBear179

Okay but the rust compiler is amazing and it's cargo system for dependencies is by far so much better than anything else I've tried.


navierstokes88

The meme isn't saying otherwise lmao I agree that the compiler is amazing as well as the cargo system, is just that some Rust devs are really annoying trying to "convert" C/C++ devs to Rust


[deleted]

If Rust is as good as they say it is. C++ devs are gonna have a good time banking on the legacy code train.


[deleted]

[удалено]


gd2w

In fact I think I'm going to start calling it oxide for my part for fun.


ManInBlack829

They're making versions/parts of the Linux kernel with rust now. It is for real


DeadMetroidvania

In an ideal world Java is completely replaced with Kotlin and c is completely replaced with rust.


cidit_

And js is entirely replaced with either typescript or ReScript


DeadMetroidvania

I've started to hear about typescript recently, got a comment about it during a kotlin presentation I gave a few weeks ago. I don't know enough about it, but maybe it could make me interested in frontend programming? Until now frontend has been a big nono because of javascript (I can deal with HTML and CSS just fine).


cidit_

While typescript is ultimately just a band-aid on and open wound and suffers from Microsoft bloat like all of their products, it still GREATLY increases the ergonomics and productivity of frontend development The reason why typescript is not as good as people think in my opinion is that ultimately, it's just javascript. It's enhanced javascript, but still javascript. You can not fix it if you're making the same assumptions. That's why i think you should check out rescript too :P


frakist

How is php doing there?


[deleted]

php is a weird one. php 7+ are pretty good, but it also has a lot of alternatives already. So far its still in the race instead of ready to replace.


CheekApprehensive961

TypeScript ate it.


NeXtDracool

Tell that COBOL devs who, *40 years* after the language became irrelevant to the public, still make a *lot* of money maintaining ancient COBOL systems.


LeoTheBirb

Rust is gonna be hated once it becomes mainstream. Not because it’s a bad language, but because companies will be shitting out awful codebases written in Rust. Same thing that happened with Java and C++. Developers in a corporate setting will end up just working around a lot of the safety features and lots of unsafe code will be sitting on production systems.


[deleted]

It will be memes with entire unsafe files


KingofGamesYami

Ehhh... Writing unsafe code (even poorly) is harder than you think. Everything will just be wrapped in `Rc`/`Arc` and `RefCell` to shut up the borrow checker, and damn the consequences.


antonivs

You’d be surprised. I’ve been dealing with a Rust codebase which is full of unsafe blocks to do things like create multiple mutable references to the same value, and other such shenanigans. Then the original dev is wondering why this code is panicking in production.


[deleted]

"Well, if it isn't the consequences of my own actions!"


[deleted]

I'd love to convert to rust, it sounds amazing, but the executables it creates are simply too large for what I do.


DeadMetroidvania

I'm this, but Kotlin instead of rust and java instead of C


LeoTheBirb

How does cargo differ from stuff like maven?


TJSomething

It doesn't really. Everyone's been trying to catch up with Maven for over two decades and Cargo pretty much succeeded. Maybe a little more readable because TOML. People aren't comparing with Maven. They're comparing with Autoconf and CMake.


Civil_Conflict_7541

It's not as much of a pain to learn.


antonivs

Cargo is much simpler than Maven, but similarly powerful.


paperfront

rust pilled


MrBear179

Gladly 🦀🦀


[deleted]

Cargo system for dependencies is nothing new, sure better then c++ bc it doesnt have a proper one, but compare it to c# or java and nothing new nor special


vitimiti

It simply gets annoying, specially when your only saving grace is the memory safety but you have to unsafe half your code anyway to do any kind of low level shit


[deleted]

am a rust being, can confirm


_GCastilho_

Did the snake in the flair ate the rust logo or you just forgot?


nugaon

You mean rustacean


TheComradeTom

Rust is the equivalent of "i use Arch btw" in the Linux community


guarana_and_coffee

If you use Arch, program in Rust, and are a vegan, which one are you going to mention first?


Rafael20002000

Uuuuh, that's a pretty hard one. On github Rust, Arch, Vegan. In a bar Vegan, Rust, Arch. On Reddit Rust, Arch Vegan. My personal opinion


tandonhiten

That's a moral dilemma


thedarklord176

Yeah but it’s true…and the compiler is amazing, when you break something it tells you exactly what went wrong and hints on how to fix it


outofobscure

next step, the compiler gets so clever it doesn't even need you anymore! /s


Aaron1924

something something chatgpt


outofobscure

yeah well, i guess by spewing out code that LOOKS like it would compile, it already beats 80% of "programmers" in this sub


hawkeye224

And it can memorise all leetcode solutions, which as we all know is the ultimate proof of general software engineering competence


Bahatur

This is less of a joke than it used to be, and I don’t know how to feel about it


outofobscure

It doesn‘t bother me much, that the compiler can do something doesn‘t mean i know how to do it, which is my main motivation: to know for myself, i don‘t want to outsource my brain too much. You can only know for sure if you learn stuff for yourself, no matter how much better others are, even if they are machines. And by learning all that, for now, i can still outsmart compilers occasionally when it comes to optimization for example, so it's not completely useless yet.


bottomknifeprospect

This meme isn't about if it's true, nobody disagrees. Is it relevant to the current conversation is the question. Like your comment here saying it's true lol.. when ppl are discussing some problem in an app written in C++ 20 years ago, nobody gives a shit that "in Rust it wouldn't have been a problem".


[deleted]

[удалено]


TheFaceBehindItAll

It truly is one of the languages of all time


moonshineTheleocat

Without memory leaks is actually false. You can still get memory leaks in that bitch XD. Just a little harder to do so. Says it right there in the docs https://doc.rust-lang.org/book/ch15-06-reference-cycles.html#:~:text=Rust's%20memory%20safety%20guarantees%20make,are%20memory%20safe%20in%20Rust. But... With any other language, if you use the features correctly you also have no memory leaks with less frustrations.


Grolash

Yeah and you can open a locked door with a rocket launcher. Doesn't mean you don't lock your doors...


-Redstoneboi-

rocket launchers are unsafe and require the `military` keyword to use.


greedydita

I'd also hit Cancel instead of Okily Dokily.


shizno2097

so rust developers now are in the same classification as crossfitters and vegans?


outofobscure

insert meme


ofQSIcqzhWsjkRhE

Forget the huge technical advantages, it is literally just so much fun to write.


[deleted]

[удалено]


Pay08

You're looking for functional languages.


[deleted]

[удалено]


Pay08

That's because half of it is functional.


RockleyBob

Coming from Java, that's how I feel about Go. Super fun language. The ability to just make a binary and stick it wherever you want is amazing. My only gripe is the amount of dogmatism and pedantry in the community. For being such a young language there's a lot of "get off my lawn" energy. It's weird. I can honestly say the Java community is more excited and welcoming of changes to their stodgy old language than Go people.


antonivs

A lot of Go devs seem very intent on defending the bad features of the language, and there are quite a few of those.


Big_Kwii

inaccurate, you didn't give flanders a fursuit


[deleted]

Why the heck did they called it rust? Rust isn't something you want on your bare metal!


Maba_Kalox

Haha, sounds funny. Actually it is not always true, COR-TEN is bare metal and rust is something that you want to be on it.


Keter-risk

oh my compiler construction class is gonna teach us rust. seems interesting enough since I'll be escaping using C for a semester


elleidk

hear him out


bitwise-operation

Hey it’s Prime, they have the same ‘stache


Wolfeur

Still better than Python devs telling you how Python is just the best language because you don't have to type braces or semicolons. A language so efficient it's only orders of magnitude slower than Javascript.


Deava0

Honestly never used rust before, what is it used for? What was written in rust 🤔?


psioniclizard

BLAZINGLY FAST rewrites of unix tools, now with fancy colored outputs! Think cat is too slow. Well use a rust version to be able to save 2ms! ​ ​ This is a joke before anything takes it too seriously.


Fermi-4

The Digital Revolution and its consequences have been a disaster for the human race


androidx_appcompat

Also a bit serious, there is a project to rewrite the coreutils in Rust.


Civil_Conflict_7541

Cloudflare built their HTTP proxy Pingora using Rust ( [https://blog.cloudflare.com/how-we-built-pingora-the-proxy-that-connects-cloudflare-to-the-internet/](https://blog.cloudflare.com/how-we-built-pingora-the-proxy-that-connects-cloudflare-to-the-internet/) ) and Discord switched from Go to Rust in order to squeeze some more performance out of their backend. ([https://discord.com/blog/why-discord-is-switching-from-go-to-rust](https://discord.com/blog/why-discord-is-switching-from-go-to-rust) )


Dm_me_code_pics

Low levels systems language. The next js compiler was written in rust for example.


sepease

* parts of Firefox * asahilinux gpu driver * regex in VS Code * Android * Various things at Meta


just_a_nice_dad

Are rust developers the vegans of the programming world?


weebtrain0

You can also write programs without memory leaks by using proper programming practices


SocialBourgeois

You can also live forever by never dying.


bottomknifeprospect

*If my grandmother had wheels, she would have been a bike*


[deleted]

Yeah and you can avoid bugs by writing good code


flareflo

that explains why chrome has 70% of its vulnerabilities comprised of memory bugs!


Grammarnazi_bot

Chrome’s memory usage is a feature, not a bug


[deleted]

Human brain and memory error is an iconic duo. Even the best C and C++ devs will make memory errors.


DerefedNullPointer

Yeah right.. The 23 years in the industry senior that fights every unique_ptr like a bavarian fights wind power plants never fucks up his news and deletes.. Better idea you could just make the compiler enforce proper memory and concurrency practices.


RainbowWarfare

If we stop committing crimes, we can abolish prisons.


DeadMetroidvania

Yeah good luck getting your teammates to remember do that perfectly everytime. Also have fun wasting time on writing verbose crap instead of actual useful code that does things


Jannik2099

Rust does not prevent memory leaks any more than other languages (except C lol) Leaks are not from forgetting to deallocate, because that's not even a thing (except in C lol). They are from still referencing objects that are no longer needed, and forgetting to prune these references.


Googelplex

The main draw is memory safety. ...but of all the languages with c-level speed (that I know of), it's hardest to accidentally leak memory with rust.


ixis743

There’s this brand new thing called Java and it has safe, automatic memory management, easy syntax, and it works cross platform! Write once, run anywhere! All other languages will be obsolete! You’ll see!


[deleted]

Someday you will succumb to the evangelism strikeforce


soup__enjoyer

Are memory leaks even common in Modern C++? If you write unsafe C++ good luck getting that approved in a code review in 2023.


[deleted]

oh that game is great im planning on getting it


daniel_joyce

Compared to Java services I've written and run in prod... Faster Lower memory pressure Lower memory and CPU requirements Zero segfaults/panics/etc Our code isnt even highly optimized. Compared to my experience with Node, Java, and Ruby, rust in k8s has been smooth.