Rust Wont Save Us
Вставка
- Опубліковано 17 лют 2024
- Recorded live on twitch, GET IN
/ theprimeagen
Become a backend engineer. Its my favorite site
boot.dev/?promo=PRIMEYT
This is also the best way to support me is to support yourself becoming a better backend engineer.
Article link: glitchbyte.io/posts/rust-wont...
By: x.com/0xglitchbyte?s=21&t=-sv...
MY MAIN YT CHANNEL: Has well edited engineering videos
/ theprimeagen
Discord
/ discord
Have something for me to read or react to?: / theprimeagenreact
Kinesis Advantage 360: bit.ly/Prime-Kinesis
Hey I am sponsored by Turso, an edge database. I think they are pretty neet. Give them a try for free and if you want you can get a decent amount off (the free tier is the best (better than planetscale or any other))
turso.tech/deeznuts - Наука та технологія
TL;DR: If you are stupid, no tool in the world can save you.
The only fix for stupid is gatekeeping by smart.
exactly. Rust is not intended to fence stupid people away from their mistakes, it's intended to give C programmers a tool that helps them avoid one of the mistakes they can do accidentally.
@@disguysn not really
@@segueoyurimistake is accidental ret**ard maybe you mean it helps us to avoid the same boring mistake, rust is exist to replace cpp not C, C would not die because it never hype since the very beginning, ppl write C because they have no choice.
On the topic of immutability by default, one reason why I think it's great is that it inherently gives you a heads up when something is immutable when it should be mutable because it will throw an error when you try to mutate that variable. On the contrary, when something is mutable when it should be immutable, it's much more difficult to detect. I haven't actually written any Rust myself yet, but immutability by default is one of the several language features that greatly interest me about the language.
Dude. The package manager. Think of the package manager.
Until you make everything mutable by default to make the compiler shut up. Alarm fatigue is real. If everything is a warning, nothing is a warning.
the automatic underlining for mutable variables and methods is a natural readability improvement for sure
rust warns you for making stuff mutable when you dont mutate them later.
@@thewhitefalcon8539 i've not seen a SINGLE rust code base where this is the case. that is literally a YOU issue.
26:29 - "C is best async lang. You just open new thread" GIGACHAD chat moment
setjmp/longjmp
@@khhnator Some problems are just asynchronous. If a network request takes 100 milliseconds it would be a colossal waste to have a thread do nothing while waiting. And using multi-threading here is analogous to hiring one restaurant waiter per customer.
@@khhnator Asynchronous-style code implements _concurrency._ Multi-threading is best suited for _parallelism._ Concurrency is not parallelism so you're comparing the number of bugs in two different domains of computing.
@@khhnator it must be fun to design software with you. In a single comment you managed to use both sentences "the difference between parallel and concurrent are not relevant to this discussion" and a few lines afterwards "it can get nasty when lots of threads might need to share memory" and "fearless concurrency baby".
You have no idea what the concept of logical consistency means lmao
@@khhnator I'm not personally attacked at all. Don't know how you'd get to that conclusion. I'm just saying what you said has no internal coherence. Illogicality bugs me.
Maybe you feel personally attacked because of what I say? Idk. Idc either. Try some coherence next time :)
> you can on average bring more developers from "javascript is the only thing that should ever exist" into "oh ok, I understand why we have static typed languages" using something like Go, than using something like Rust... if that makes sense.
Yes. It does make sense. Lots of sense.
sorry pal. To me if programmers think javascript is the only thing that should ever exist, they are automatically dismissed by default. They are telling me already everything I need to know about them.
The OCaml feature you mention at 19:20 is "local mode" - it's not in the official compiler yet tho :)
It's only in the Jane Street branch of the compiler, they're still working on it. But it's a cool idea regardless, yeah
I gotta say, when I started programming Rust I didn't like having to opt in to mutability. Now that I'm used to it though, I love it. And the REASON I love it is because every time my code doesn't work and it says I need to make some variable mut, I stop and ask myself WHY I'm mutating this variable. Do I NEED to do that? What ramifications will this have up the chain?
99% of the time it's fine and I just mark it mut, but just having the compiler force me to ask myself these questions is great imo.
Before hearing about rust, I was using a Borland C++ compiler, when I updated my tool chain, I got an LLVM/CLANG compiler instead, and this was with embarcadero.
It was like chalk and cheese, the LLVM implementation was amazingly better at picking up tiny/subtle errors in your code that will compile.
I always thought that if those people behind the LLVM, or clang tool chain, continue doing their thing, then C++ would eventually turn out to be a safe language.
Even so, I have some very good lint tools, and run time tools, that makes it very difficult for bugs to pass by me.
I am not sure if moving to rust makes you no longer necessary to test code but I can't see myself not testing my code both static and runtime
Honestly with C++20 and C++23, even going back to C++17, its already immensely safe, if you don't use stick to the C way of doing things, it pretty much solves the same problems as Rust without forcing you into a paradigm that has you wrestling with the borrow checker or the language in general.
Borland died as a company decades ago I thought. I learnt C/C++ in Borland Turbo C back in 1993.
As for Rust lol good luck with that passing fad folks. My new startup is C/C++ first and that's after doing Java in industry for 20 years straight.
These developers pushing Cloud and Microservices first have hopped onto the Rust train.
Again - good luck.
My type safe and memory safe C/C++ with no exceptions or ego-driven metaprogramming templates in sight is doing over 100k requests and response per CPU core 😂
We don't need critical codebases polluted with Rust - we just need better programmers that understand the fundamentals.
Looking forward to providing a home at my startup for C/C++ devs needing to avoid managers and companies pushing Rust 😊
It'll be Google's Carbon next and then the next thing. By the time developers get around to actually delivering commercial products and notable commercial value - AI will be replacing them 😂
@@b1ueoceanare u ok, lil bro?
@@FlanPoirot no one in this industry is “ok” until we reverse the litany of missteps destroying it from within.
Maybe the accelerated pace of layoffs due this year and the prominent companies that begin abandoning the cloud will help folks begin to get the message 🤷♂️
Other than being forced to witness the madness - I’m good 👍
@@b1ueocean wtf? it is a programming language bro. not... whatever you think it is
Primeagen: "[Not having null] is something I wish we had more of."
Me: "So what you're saying is we need more less nothing?"
Ron Burgunudy: "That doesn't make sense."
The private/public language-level accessor argument is pointless on two levels:
1) Anyone can call a function as long as it's in the symbol table: you can bypass the language restrictions.
2) The presence of a function in a library isn't a security threat per se, it's the fault of an application if it adds ways to make it callable via another process or network connection, which doesn't happen magically.
aren't symbol tables for the compiler only? does it exist during run time
@@ea_naseer even if the symbol table doesn't exist, you can still just jmp to the address of the function or modify the "private" struct fields yourself by just writing to a known offset. Function visibility is only a security concern if someone on your team is stupid enough to automatically expose all public functions as external endpoints. The moment when the attacker can execute arbitrary public functions in your codebase, you've already lost.
If you think declaring a method public makes it available for hackers to call, or that declaring a method private prevents hackers from calling it, you are badly mistaken. Those keywords are for the design of your code, they do not have any special powers. I call private methods from libraries all the time.
What's your background in development and security?
Because yeah, it changes the design of your code, which is what's running.
The point of setting it to private is to reduce the attack surface. If you gain access to an object, you can't access the children's private functions or whatever.
Also I don't know what you mean by calling private languages from libraries. Are you using python? Typical true private functions can't be invoked anywhere except from within the object or struct method definitions itself
@@XxZeldaxXXxLinkxX this always sounded very theoretical to me as well, to be honest. it seems quite strange to think of public and private as security measures, and it has nothing to do with python to think so, it has everything to do with the fact, that if i access your code at compile time, i could do anything anyway, and if i access your code at runtime from memory, your public/private declarations wont help you.
It might make sense in plugins in dynamic dlls that get access to objects, or some dynamic api solutions, where you can define calls with strings, java network objects or similar, but then it becomes an architectural question again.
Not saying that making things public in any layer could not lead to problems, so probably that is what you mean with reducing attack surface, but I think securing functions means more than just the keywords overall. Except maybe in a full SOAP world.
@@XxZeldaxXXxLinkxXPrivate and Public has nothing to do with Security. Its just a nice way to Not expose every functionality to the user. In C f.ex you can also hide functions, like openssl does, but the users can modify the lib to expose the function again. So no security
@@XxZeldaxXXxLinkxX I have called private methods in java .class files many times. Sometimes you have to use reflection to make the method accessible, and there are ways to make this more difficult, but there are ways to defeat that also. And with C/C++/and Rust in unsafe mode, you can jump into any section of any code you want. And, right, @RogerValor, with python and javascript, the idea of "private" is just a suggestion. Seems to me that making methods private is not really about security.
@@XxZeldaxXXxLinkxX no private function visibility doesn't reduce the attack surface (or at least I don't know of any language in which it does). In high level languages you can call private functions via reflection, in low level languages you can call private functions via even lower level trickery such as hand written assembly, invoking undefined behaviour etc.
Function visibility CAN'T be about the attack surface, because if the attacker is capable of invoking arbitrary functions in your code (public or private) then you are royally f***ed anyway.
But.... but.... function visibility has very little to do with actual security... it's about logic encapsulation and minimizing the API surface more for readability... There's no actual safety in declaring something as private (and in fact, an attacker with JAR/DLL access can just call it anyway using reflection). That function visibility example is utterly useless...
Exactly, I stopped watching at that point. The author's FIRST argument: FAILED.
I was so so so confusing while reading the article. From a package level, the function visibility for me is to let users not call the wrong functions from my libs by not exposing them, but they can still modify that package code to make it public.
And that's it. it has nothing to do with the real security by any means. The real security is done via API level access, a service level where they can't modify my code. If you expose your function code as the service and people can eval the function from the same code level as you directly. I think the author has some huge misunderstanding on security....
The whole article is pure crap. Honestly
7:30 Java has reflection right? What does public/private have to do with it?
I guess you can restrict access to the reflection system, but that requires more work and almost nobody actually does it.
Rust cant save you from skill issue syndrome
Thanks for speaking on the real issue - SKILLS 👍
Only society can save itself not just with better tools, but with better wisdom. Yet it chooses not to do so because it doesn't see an immediate ROI with better wisdom, but there's an immediate stonk feedback for laying off wisdom that made the product.
We should have had ALGOL 60 instead of Fortran.
@@ea_naseer Original source for this industry-wide mistake or some famous engineer that wanted us to use ALGOL60 instead of Fortran-like languages?
Society can't save itself because we have all been born into sin. We're all morally bad. You can test yourself using God's moral law, the Ten Commandments. We've all broken the law, but Jesus paid the fine. That's why on the cross his last words were "It is finished."
He's so proud of almost shutting down netflix 💀💀💀
I can only wish to have such power
I think it's great to see people acknowledging things and also focusing on learning of it rather than ego
Rust won’t save us, but HolyC will
as God intended
I like your take on skill-issues across the board -- regardless of which framework, language, methodology -- if the team is mid, the product is mid.
private by default won't save anyone ever. If someone thinks it needs to be public, they'll just make it public. That's why people type `public void foo` instead of `private void foo` from muscle memory.
immutable by default won't save anyone ever. If someone comes across a case where a thing needs to be mutated, they'll make a new object with the thing set to the new state.
OOPs encapsulation techniques are not security features. They're encapsulation techniques. Don't let security "experts" tell you otherwise.
Having setters is not a security vulnerability. Don't let security "experts" tell you otherwise.
Having a DB object that has a dropDatabase function that you can call isn't a security vulnerability. Even if it was private, there was someway to get that function to be called.
That Confluence bug was because any-bloody-one could set an admin flag through the URL. Not because you can instantiate a class that inherits from somewhere that has a field that can be set.
That ASPX bug was because someone custom wrote their own header parsing, not because they had a header.
I'm so sick of "security experts" coming in from literally nowhere acting big brain and holier than thou with these shit programming takes. No offense to this ghostbyte person. All of the "vulnerabilities" showcased didn't need to not exist, they needed to be behind another layer of defense. I bet that's how Atlassian fixed the confluence bug, instead of changing their inheritance hierarchy.
I like how the author noted that (s)he worked in cybersecurity for almost 10 years. Makes you think.
Well said. The moment I heard that discussion around the public/private thing I was like: "Wait what, which sane developer allows API calls to execute arbitrary code on his system(so you can exploit private vs public). This is so much API design/security and not language issue:"
And i had same argument with people hating on Python not having private methods and not being compiled (like compoling something had ever stop any hacker :D ) as not being secure enough...
Secure what need to be secured: Access points.
class visibility is not a security feature...
Yah WTF
I'm not on the Rust hype train bc of what problems Rust solves the best but bc it's the nicest language and environment to program in.
Most of the other languages suck one way or another. Rust has the beautiful type system of Haskell, the power of C, the modern features of Python or C# or whatnot, and the best build system on planet Earth. It just does everything well.
So what if it won't magically fix all problems? It's still the most enjoyable problem solving experience.
best build system, not. it's unoptimised.
@@retropaganda8442 I'm not familiar with any better ones
@@retropaganda8442best as used here is ambiguous and relative. best for me would mean easy to set up relative to something like ghcup for Haskell.
I still don't see Rust's borrow checker solving any problems that RAII in C++ didn't solve better. Could've overhauled the concept of RAII instead, the borrow check is simply the worst choice, especially in claiming to be simple, its only "simple" when you don't come against something that makes you have to think about it, systematically RAII is a lot simpler and easier to wrap your head around, and if you want to violate it, you can do so without breaking the language.
@@Spartan322If you are not able to understand the borrow Checker dont blame the language lol, its YOU not the language. The borrow checker is only hard in the first days with Rust, after that you do everything automatically correct. Its really easy. The Rust Compiler gives the best help anyone can wish for. And If you are not able to learn a new paradigm quite easily, you should not be a programmer in the first place.
Im learning rust and c at the same time. Trying to get old school new school yin yang interaction going
How has it been so far?
@@knolljo well I started programming through python so there is some little things I have to get used to adding in and wrapping my head around some new concepts, but so far I enjoy it. Definitely a lot more curly brackets in my life
@@knolljo also, it's been so nice being able to write python, rust and c code with termux on Android and see how it compares to using the Linux command line. So far all three work really good right on a smart phone
@@bobanmilisavljevic7857I'd personally recommend leaning into C first, if you're *just* starting out. Gives you a more solid understanding of program "internals", since you have very little to no abstractions and get to work with raw memory.
If I may I'd suggest you to see C first, properly. Just C. Learn it properly. It can do functional, it can do pointers, it can do pretty much everything. Build a C compiler in C, knowing the concepts involved thoroughly. Then you learn Rust.
Programming gets easier if you look at everything through the eyes of a C programmer. Pretty much every language "inventor" knew C and made it's language features in relation to something C programmers have seen before or deal with. Python is to programming what Javascript is to web-programming - something that was never intended to do what it's currently doing so it's monstrously distorted. Just leave those alone.
You may think "oh but I'm fine learning both at the same time, I'm so smart! I'm saving time actually!" no you're not. You're hindering yourself. You learn both better if you learn them one at the time (C first then Rust). It's better if you focus in C and learn it properly and then you'll see how the concepts you've seen are implemented in Rust and which C shortcomings Rust has fixed. If you are smart, great! You'll need less time to absorb all the concepts thoroughly :)
Are you gonna write drop database in your Turso project
We're in the horrizone!
2:45 lol a few years ago (2020 I believe) a representative of one of Sweden's largest political parties was talking about cybersecurity on TV ahead of the election, and on the wall behind him was a sheet of paper with the SSID and password for the wi-fi at their HQ. Swedish public service TV ended up taking down the clip and reposting it with the info blurred after people made fun of it a ton online, lol.
Article: 9 min read. Prime: Hold my bear
In java you can use reflection to at runtime change a private function public and call it
I like c++. (But yeah, const default would be nice)
You don't use unwrap or expect in production, unless during initialization. And unlike nulls, unwrap/expect do not surprise you. It's an explicit crash. Meaning it has to be put on purpose and could be looked for during text search in your code
the beautiful thing about computing is that most computing problems (and solutions) relate to life in general. The problem about language safety has nothing to do with the language itself - it has to do with the programmer. Isn't the industry dominated by Javascript, that tool forged in Hell by S4tan himself? You just cannot put enough fences around stupid people. They'll always find a way to be stupid and abuse/misuse tools. And there always be predators looking to prey upon the weaker amongst the flock.
Rust is not intended to be "stupid-proof". You can abuse it still. It's intended to make it harder for you to *accidentally* make a mistake and make something stupid *in C*. And it does that well.
25:31 where can I find the "New Rust Async" book?
“For security to work it has to be baked in from the start”
Is what exactly rust does
Repulsive Grizzly !
Amazing !
19:22 yeah OCaml !!!
All true until you write unsafe somewhere. Then everything goes out of the window.
Even if you dont use unsafe, there are decent chances some of your dependencies do
Unsafe doesnt mean unsafe lol. This is the most common misunderstanding lol. Its nothing wrong with using unsafe
@@ITSecNEO nothing wrong per se, yes, but that piece of code have basically the same memory unsafe-ties that writing C o C++.
Which is the whole point
@@foji-video Again, nope, Please look that section Up in the Rust Book. Not everything is allowed in a unsafe Block :)
23:08 what kind of device you need to touch sawblade to turn it off!?
i think elixir is the best for async
24:45 it's hard for me to parse rust and c++ code to ast inside head so I don't know what kind to thing I don't know
8:49 is the risk still relevant even if you do `pub(crate)`?
I like static typed languages for just about all but web development. Once we pass JSON and user form data around, I really prefer to manupulate it with PHP. I just assume that all data is strings and tainted and cast it when it needs to interact with internal things.
Meanwhile in Rust I just parse it into a real object that doesn't have strings and can just use it wherever without any of those extras.
@@Luxalpa can you? But any record you use can be of any type, isn't that a problem?
@@AllanSavolainenyou just add #[derive(Deserialize) and boom you can turn json to that struct with serde json
@@Luxalpa Also, with PHP I can just parse JSON into an object or array (hashmap) without any external libs. Rust probably needs some dependancy.
But my major reason liking PHP here is the fact that I don't have to care if the JSON has 3 or "3" in the field, it just works. And yes yes, there are API definitions that say the field should be number or string, but oh so very often clients or servers send/return random types.
IEF can be fixed with rust, with public and private functions?
public and private functions have nothing to do with security, that's purely about API encapsulation, even if they're private you can still call them
Am i missing something, or do public/private modifiers have nothing to do with an insecure exposed function vulnerability?
For IEF you have to expose the function to the outside world, like through an HTTP API. Just marking something as public only exposes it within the current code base, which is not the "outside world"
I think you are right, it's a compile time protection code that calls private functions doesn't compile is all. There are still ways to call it at runtime.
@@alirigol6707 Java moment
@@alirigol6707can you explain to me how you can call a method with a string in a statically typed language?
The real problem in the example was an HTTP API that uses reflection to expose all public getters and setters. Maybe it's impossible to do that in Rust so that could be a benefit of Rust. But reflection does come in handy in many other cases.
Exposes it in the codebase, but it also means should an attacker gain access to to some sort of scope, they will be blocked from expanding that scope to private functions. Security is all about baby steps in escalating.
16:54 someone had to say it. I guess the problem is that in the years many gave null a meaning, so in order to get rid of null you have to manage what null has been used for (aka nullable boolean fields? evil).
> aka nullable boolean fields
Well tri-state checkbox is a thing :D
Why would I want a crab to shave me?
Who else thinks there will be another language that will eventually replace rust? It will have many of the benefits, like immutability, Options, Error handling, Enums, but will be simpler to read, compile and run like Go.
Imma feed you to the sigma
27:01 why does prime give people like that so much attention?
I dare the author to write a role based system in Rust, using type-state or witness design patterns and then make that claim. The Rust type system can be used to save us, so the bold statement "can't" is false.
Of course that not utilizing the language intelligently when using it's features, would not save you. But compare to other language, you have a lot more to utilize for the safety parts
G L E A M L A N G
Weak encryption? Don't tell me they cracked ROT13 already!
22:25 true
I was taught to pronounce IOCTLs as Eye-octals
In 2040, people are still coding in Java and still it's a mainstream language.
Though many fast languages evolved in last 20 years, like go/rust/mojo/mojo++/Microsoft's copy lang C##/etc.
But they are too fast to handle for human. That's why people left them and again started using Java.
Also, the trending of superfast language has been banned, because many developers have become TikToker, due to short and superfast productivity mindset.
As an AI Prompt Engenier i call skill issues. Wit the right key words my mojo++ code is flawless.
I personally would never write a function/method to drop a database. That is something you would want to manually login and do. Just as I have decided to never write a pipeline that would call terraform destroy. You just don't do it.
I don't understand article when they do a full paragraph for every single sentence.
I don't really like the DropDatabase example - if someone is actually writing code using that package and running it, then it means they already have access to the database credentials in some form or another.. if they want to drop the database, then making the function private will not stop them at all. It might be a good idea to make it private to try to reduce user error, but that's not really a security issue - if it being public is a security issue, then you always have bigger security issues.
0:10
I think Rust has got to have the most aggressive programming language community. I can't think of any language with such a frequent hostile appearance. And quantity of drama is also a measure I'm sure. Individuals have been awful in other languages. But the amount of shit anyone who suggests flaws with Rust get is incredible.
I'm not sure I understand why, maybe it's that Rust is a very significant time investment to learn well and critics are seen to threaten that investment. I don't agree with that perspective. Good critics are very important for the improvement of anything. C++ programmers should be in that same position. But at the same time who could be a passionate defender of a language like C++? 😂
If I'm right with the investment argument this blogpost is really a massive sore point.
I browsed HN. So much hate. But in fairness to them a lot of it picked on one particular example that was apparently fixed. I think the accusation that the article is deceptive/dishonest is just silly.
The people that use Rust tend to be anti social. They don't really know how to communicate or speak to other people. I would know I write Rust.
Rust developers have higher IQ prob on the spectrum
Yeah that too 100%. @@perc-ai
@deistormmods or is that those people dont know how to communicate with us crab people 🦀clickity clack 🦀clicky clack clack 🦀🦀🦀
I mostly agree. Julia devs give the rust zealots a run for their money though.
Yeah, I agree on that last bit about bringing TS (or whatever) devs over. I spent about 4 years having Go be my main language. I've been on a 2 year journey at Rust and although it has gone quicker, I think: "are other people really going to do this too?". I'm not an island. :\
Why did you move from Go to Rust?
It's been 6 months since I started studying Java, it's been 6 months since I started watching this channel, and every time I watch a video from this channel, it makes me think I made a bad decision
Don't think that way. Prime himself has used Java. Java is a very popular language, and it's simple enough to learn that you can go into depth with it and safely take those skills into a new language. A lot of fundamentals teach themselves to you and you can feel comfortable writing it. Lotta frameworks for different platforms. Java is a good time. It does suffer from certain characteristics, like verbosity and extremist OOP. But you won't go wrong with using Java, and since you've been using it for 6 months, you're already likely advanced enough to move on to another language without losing those idioms. Was Java your first language?
@@NibbleMeTwice Sorry for the delay, for some reason I didn't receive the notification. Regarding Java being my first language, kind of. It wasn't the language in which I learned the basics of programming (booleans, double, if/else, etc.), but it was the first one I committed to understanding more deeply at a professional level.
Additionally, thank you for the encouragement
re: "why opt into mutating?" (as opposed to opting into const-ing.) If you write modern C++, and follow "best practices," you're typing const for practically every variable, every parameter, lots of functions, it's silly. And you're probably doing it twice because of the freaking headers, unless you're writing header-only stuff or using C++20 modules. So Rust just makes everything immutable by default. Good plan. Saves typing.
Rust has its space, but I don’t think it’s the best language for MOST software.
You won
escape mutexes
Sounds like Nim lang to me, with borrow checker added :D
Eventually everybody switch to OCaml. :v
How much do we get per 1000 occurences of the word "Rust"? Asking for a friend who's looking for a side hustle.
Great now I'll never pronounce SQL the same
I'm trying to imagine the context in which a public function would be available to a hacker while a private one wouldn't. Your program would have to somehow be running in some kind of permissions context that the hacker wouldn't otherwise have. What did you do, sticky-bit your program and auto-generate a web service from your public interface or something? And you never, like, glanced over the manifest and noticed the "DropDatabase" function? Yeah, I dunno. I think the right answer there isn't to force all devs to never make public functions that shouldn't be accessible to hackers. That's just not really tenable. I think maybe a better plan might be to have super clear delineations around things like *what programs are going behind auto-gen'd web services.*
10:04 why can you call arbitrary public method by http(s) request!?
I'm curious why Zig has null instead of none, as null can only be used on an option anyway. My guess is for C library compatibility.
Why change things that aren't broken? You might as well ask why rust has curly braces instead of begin/end.
There's no issue with null itself, it's how the language handles it that matters. Zig forces you to handle nulls and catch errors at compile time, I don't think rust's approach is inherently better
@@arnontzoriIMO "Rust's" solution is better, as it allows for the use of "monadic operations", as C++ 23 proposals put them. Essentially, although I see that zig has some sort of version of `Option::map`, it doesn't have anything like `Option::and_then`, etc, which are really useful in highly functional code.
@@thewhitefalcon8539Using that logic, the majority of languages wouldn't exist.
@@The1RandomFool using my logic, the majority of languages would have curly braces. Oh wait, they do.
I will say, on the topic of Immutability by Default: I think Herb Sutter has it right with his CppFront project, where the programmer gets the choice of whether to have immutability by default or not on a scope level rather than it being declared from on high by the language designers. He did make Immutability the absolute default, but the programmer has the ability to say "for this part of code, I want mutability by default instead", which I think is really neat.
I think if, as a language designer, you're *forced* to choose one, it makes sense to choose Immutability by Default rather than the opposite, but I also have a lot of experience working contexts where being forced to explicitly declare every single variable as non-const would degrade productivity really badly.
Its just generally better to give choice to developers then to restrict their choice so long as it does not come at the cost of something else, and the developer should be able to build choices into their systems without restriction instead. Taking choices away is not a good enough and its the paradigm obsession of modern languages that actually frustrates the hell out of me.
Wait... I thought the definition of "variable" was something that can "vary" or "mutate".... If you want a placeholder constant, call it that instead.
pretty sure "drop database" doesn't exist in sqlite, a database in sqlite is a file.
rm -rf
19:54 It's perfect to pronounce horizon like you and the majority of european languages do. English is the black duck, segregated away from the rest of us, alone on its island.
Either way, I get the vibe the author knows only some Rust. 'Cause how can you be Rust proficient and not know about 'pub(crate)'?
why are private methods safer by default? this doesn't sound right...
"Extracting nulls" is not much of a tradeoff imo, because in a language with non-nullable types, 99% of the time a value simply can't be null and there's no need to check. You're only checking in the cases where explicitly a value can be null. In a language that doesn't support non-nullable types, you never know if the value you received from a method call can be null and either have to always check or keep it in your head, adding to mental load.
SQL is sequel no squill ....
bro forgot that windows just announced many things will be redone in rust :3
Typescript is both statically typed and dynamically typed.
Wat?
No, it's statically typed. What you're looking for is that it's weakly typed
Insecure Exposed Function? Nowadays that just means API.
Wtf is this article talking about. Default function visibility doesn't have anything to do with security. It doesn't matter if your function is marked public or private. If a malicious actor can arbitrarily choose to execute any public function they want, then you are f***ed either way. The only case where function visibility matters is if you are automatically generating external endpoints based on the function visibility, which is extremely rare in static languages and should be only done on classes/objects/modules that are specifically designated as external API surfaces.
Rust won’t, but Jesus does
What are the semantics of Jesus?
Is Jesus a garbage collector language?
@@manacht2727 obviously not or I wouldn't have to read your comment (joking you gave me the stick I had to)
Jesus still panics…
Collects after three days
...Are you serious?
I've heard Jesus didn't make mistakes.
IOCTL is pronounced eye-AWK-tul where I come from
We don't need to be saved.
I don't like rust because it's a low level type thing with high level looking syntax.
It rocks my brain to no end.
Don't you drop a SQEALite databases with `rm -f user.sqlite`?
Ahh...The Scorch Earth method.
Java functions eh?
Dude, you have to tell us, how is it possible a loop could destroy netflix permanently? wth how is that a thing?
Rust 2,0 will fix Rust and finally defeat Dreamberd as the perfect language,
dude, is that a comma?!
21:02- "writing their frontend and backend in the same language"
And that language being JavaScript doesn't help
DO. NOT. WRITE. THAT. removeDatabase. FUNCTION! Not with embedded SQL. In fact, I wrote my own database system that has 2 languages with isolated processors: 1 client-side, 1 server-side. So, there are certain things that you just can't (directly) do client-side. Deleting a database is one of them.
I mean.. the drop database function is kind of scary, but if it's treated as any kind of security issue instead of a design issue then the far scarier thing is that they have the database credentials already. That function can't possibly work unless they have the database credentials in some form or another, so it would only be a matter of finding it, and if they have the database credentials then they can obviously do whatever they want with it regardless of what functions you have.
I understood nothing from 2 vulnerabilities this guy presented as examples. And Rust magically should have fixed them. Ok, that was interesting (it wasn't)
Developers' whims go too far! If we satisfy them on security issues today, tomorrow they'll be demanding that language syntaxes make sense.
the swing in the Lang design world seems to be security in the syntax.
Why prime is opposing rust, the point he's made, 6 months back he was praising the same points.. lol.
Love from India❤
Honestly I despise a lot of the Rust community, it doesn't serve an original purpose, it co-opts the purposes of other languages, sometimes without good justification compared to the alternatives, and then it gets injected everywhere like "replace everything with Rust" no matter how unsuitable it would be for that. Aside from despising the language for numerous reasons (its ideas are nice, but its implementation is the worst way you could've done it) the community is absolutely horrible for Rust, I've been in regular non-rust programming places, but as soon as you criticize Rust for anything, they absolutely lose their crap and call you names. I can't stand Rust, and even more I can't stand its community, its no wonder its representatives are so crap.
As the post shows, once again someone assumes Rust only exists help with memmory safety and completely misses the point.
what point?
@@retropaganda8442 That memory safety is only a consequence of the overall philosofy of how Rust is developed. One can dislike Rust for any number of reasons, but I lost count of how many times someone will downplay the language saying something along the lines of "memory safety isn't such a big deal, the language isn't worth learning just for that", which is just an ignorant take in my opinion because memory safety isn't the end be all nor the only or main benefit of using Rust, as the post in the video shows.
people don't care. don't care a sh8t.
they just want to show something on screen.
but i don't feel that.
i get joy by seeing the code and not the output.
why? cause i already wrote what output i want.
my test already have that.
my code has to produce that.
i get joy writting that. designing.
that's why sometimes i feel low. people don't care.
Lots of big talk the article but the two "example" of vulnerability provided is pure skill issue. Who's in their sane mind is allowing user to edit application config in runtime via this long dot namespaced parameters? wut. Then header parsing, seems like reinvented the wheel there and put shitty string manipulation code. No need to use rust or similar fancy tech to prevent this. Just use common sense. For example even in symfony (php) these wouldn't happen as framework has standard sane ways of both dealing with app config and http headers.
Absolutely not true for the JS thing after typescript go just feels miserable.