← Home ← Back to /g/

Thread 106222209

72 posts 10 images /g/
Anonymous No.106222209 >>106222377 >>106223825 >>106224106 >>106224589 >>106225543 >>106229557 >>106231854
Is it true that crab language doesn't let you design your program they way you want and instead cucks you into a different one until its compiler is satisfied?
Anonymous No.106222325 >>106222381 >>106223246 >>106224080 >>106224095 >>106229787
All programming languages require you to write your program in a specific way. It's called following the grammar of the fucking language.
Anonymous No.106222377
>>106222209 (OP)

how many crab wrote program before you if you manage type something at right place it might just work
Anonymous No.106222381 >>106222521
>>106222325
Sure, but isn't Rust doing it on some fundamentally different level? Because surely it's not grammar, more like "you must not think this or that way about a problem because it's bad".
Anonymous No.106222521
>>106222381
What you mean to say is that the language is "opinionated". Which is not a quality unique to Rust, though admittedly it is also not universal to all programming languages either. But yes. Rust steers you towards specific design patterns and architectural patterns when using the language. And it does so from a blanket assumption that any function might be threaded. So what it's trying to prevent you from doing is writing code that shits the bed in a multi-threaded context.
Anonymous No.106223246 >>106229774
>>106222325
>Memory structure, control-flow, and what-not is a grammar restriction
The absolute state of rust tranoids and their "low-level systems language"
Anonymous No.106223445 >>106223535
been watching based tsoding? hes right
Anonymous No.106223535 >>106223558
>>106223445
Retard writes his Rust like it’s C and is surprised it’s anal. Like no shit, what did you expect? I don’t see the point in crust if you can just write C or sepples instead.
Anonymous No.106223558 >>106223587 >>106225684 >>106229413
>>106223535
>Retard writes his Rust like it’s C
wasnt it one of its design goals?
that you put in "unsafe" and you have free reign?
Anonymous No.106223587 >>106223760
>>106223558
Unsafe rust is literally C++. If Tsoding actually learned it instead of meming around, he might like it.
Anonymous No.106223600
Any society that would give up a little liberty to gain a little security will deserve neither and lose both.
Anonymous No.106223685 >>106225684
I think you can do many things in Rust just lik you woud in other languages. You just have to be explicit about it. Create unnecessary copies. Play it extra (un)safe so stuff can't be executed in parallel. You just mainly lose perf.
Anonymous No.106223760
>>106223587
Nah, I think it's a bit harder if you want it to be actually valid (as in not breaking safe code) as compiler takes certain assumptions about it you have to meet that are stricter than what C and C++ needs.
Anonymous No.106223825 >>106223967 >>106225715
>>106222209 (OP)
You have to appease a static analysis tool that isn't very smart. For example pic rel. But the language itself is fine. It's community is fucking insufferable. If you don't enjoy writing any language you should never write that language (unless you're being paid or some shit and even then find a better job you enjoy).
Anonymous No.106223967 >>106224058
>>106223825
The Rust community is shit but when does a programming community actually matter when you are writing code? Nocoder complaints like these assume that you NEED to be in some kind of degenerate discord server in order to effectively use the tools you are using. It is possible to write Rust and not interact with trannies. Shocking, I know.
Anonymous No.106224058 >>106224094 >>106224137
>>106223967
Ok so you know how to do everything with in X and do not need help every now and again. Good to know you're the God of programming. Mortals sometimes need to ask for help and that involves interacting with others.
>inb4 AI
Don't out yourself as a vibecoding zoomer.
Anonymous No.106224080
>>106222325
On top of that, languages all have a concept of undefined behavior and if you violate that contract, shit can go wrong. OP is a retarded faggot and FPBP.
Anonymous No.106224094 >>106224105
>>106224058
Documentation exists, retard. Maybe you are the real zoomer here as I don't require constant handholding while I program.
Anonymous No.106224095
>>106222325
Lisp doesn't have this problem.
Anonymous No.106224105 >>106224134
>>106224094
Funny boy, even making up your own head canon now :L. You got any more?
Anonymous No.106224106 >>106225776
>>106222209 (OP)
Crab suffers from the same shit c++ has suffered. Feature bloat. The sheer amount of features you have in this thing is insane
Anonymous No.106224134 >>106224159
>>106224105
What are you talking about besides dodging the actual reply?
Anonymous No.106224137 >>106224159
>>106224058
Yep. Based on your code snippet, you're also incredibly low IQ so I can see why your zoomer ass needs dicks cord just to write Rust. I literally never interact with the "community" (ignoring calling retards like (You) on /g/) outside of writing code and contributing to open source projects.

Git gud, literal skill issue.
Anonymous No.106224159 >>106224174 >>106224175
>>106224134
I'm dogging nothing. I find it funny you just made a load of shit up in your head.
>>106224137
Kek same fagging phone poster but I'll bite. It's called an example. Grow up.
Anonymous No.106224174 >>106224219
>>106224159
It's an example that makes no sense and demonstrates a complete lack of understanding.
Anonymous No.106224175 >>106224186
>>106224159
ironic
Anonymous No.106224186 >>106224214 >>106224250
>>106224175
>Foot fag
Oh no it's retarded. You expect me to take you seriously when you have ebussy's dick down your throat? Scurry off now.
Anonymous No.106224214 >>106224233
>>106224186
Take your medication, schizo.
Anonymous No.106224219 >>106224236
>>106224174
So you have never done a -> b -> a etc etc, you know, like filling a frame buffer? Way to out yourself as a jeet webdev.
Anonymous No.106224233 >>106224238
>>106224214
>Win11
Oh it's worse than expected. I apologize for only calling you a footfag. The screen shot tool is deceiving.
Anonymous No.106224236 >>106224266
>>106224219
>so you never wrote an aliasing foot gun where you accidentally alias with diverging branches?
No, because I'm not a fucking retard and would write the bottom code in C++, just like in Rust, but at least rust has good syntax for tuple restructuring and everything being an expression for the most part.
Anonymous No.106224238
>>106224233
At least my fonts render properly.
Anonymous No.106224250 >>106224266
>>106224186
Other anon, I'm using a fucking foot and I'm superior to you. Seethe. Learn to code.
Anonymous No.106224266 >>106224279
>>106224236
Maybe you should learn to count and the top example is never a problem? I can see why you love Rust given you need big daddy compiler to save you from yourself. Pathetic.
>>106224250
You're also a fag.
Anonymous No.106224279 >>106224312
>>106224266
The top example is an aliasing bug waiting to go off. The fact you can't see it demonstrates you're low IQ. Rust is helping you be a better developer as a whole but your incapable of rubbing two braincells to realize why it's problematic.

I'm starting to think Rust hate is just low IQ seething.
Anonymous No.106224312 >>106224327
>>106224279
There's nothing wrong with it because I know to set the fucking pointer with initializing it to 0 then setting it with active = 1 - active so it can only ever be one or zero. Maybe you should learn some elementary math operations before making sweeping statements about others coding abilities?
>inb4 someone else might change my code etc etc
If I'm building a game I'm never allowing faggots like you to touch the code so it's never a problem. Just because you lack the ability to not fuck up your own shit doesn't mean others will.
>low iq
A bit rich given you need the compiler to prove the correctness of your own code. Maybe you need to improve a little so you don't need someone else's tool to do that for you?
Anonymous No.106224327 >>106224383
>>106224312
Holy shit. You're literally retarded. This is absolutely insane levels of cope. Again, you're assuming a static analyzer can solve P = NP or something because I legitimately don't think you understand why rust, which is by nature mostly deterministic, sees those two INDEPENDENT BRANCHES and notices you can potentially have a read only and a mutable reference to either a or b.

Kill yourself you stupid nigger. I'm sick of you absolutely low IQ shitters fucking up this board with your toy garbage code. Jesus fucking Christ.
Anonymous No.106224383 >>106224455
>>106224327
Cope and way to out yourself as a Rust troon. If your static analyzer can't even recognize that it's impossible for 2 branches to ever overlap then it's dogshit. The pointer isn't mutable, this code will always produce &a, &mut b. It is impossible to ever get aliasing errors here and it fucks up because it was made by skill-less lgbt faggots more concerned with bullshit and impossible hypothetical situations instead of reality (and that's par for the course with your kind given you think you can wake up and chance your gender based on how you feel today). That gaping axe wound doesn't make you a woman.
Anonymous No.106224455 >>106224473
>>106224383
You're like those retards who wonder why detecting faces is so hard.
>um I can plainly see it's a human face

A compiler can't be 95% confident, faggot, and if the analyzer sees something that's retarded, it should tell you it's retarded, even if correct. Again, kill yourself. You're low IQ and need to check your ego and actually listen and learn, but you won't, thus why you should do this world a favor.
Anonymous No.106224473
>>106224455
I accept your concession, troon.
Anonymous No.106224589
>>106222209 (OP)
yes, because some need and some want you to use another layer of abstraction
Anonymous No.106225543
>>106222209 (OP)
post code in any language
Anonymous No.106225684
>>106223558
No.
Rust is a modern C++ alternative.
Zig is a C alternative.

>>106223685
Unnecessary copies is not a problem in Rust if you know what you are doing. Unnecessary RefCells, Mutexes, reference counting, etc is something that you might find yourself over relying on if you never touch unsafe.
Unnecessary copies is more of C++ issue because of how easy it is to cause UB when dealing with string_views and such in a language without explicit lifetimes. When I read C++ I often get terrified by the amount of random string allocations everywhere.
Anonymous No.106225715 >>106226362
>>106223825
>For example pic rel.
And then some other team member refractors this function, changes the if a little and shit hits the fan because this awkward invariant you just put there is not statically checked or documented anywhere.
Rust is the way it is in order to mitigate issues like this.
Anonymous No.106225776 >>106226191
>>106224106
I have seen a lot of complains on /g/ that Rust is too barebones and you need external crates to do anything.
You claim Rust is bloated and has too many features.
Which one is this?
Anonymous No.106226191 >>106226442
>>106225776
>You claim Rust is bloated and has too many features.
It has too many features as in too many shit to learn. It's barebones as in the std library has nothing except cross platform network/file stuff
Anonymous No.106226362 >>106226442 >>106228106
>>106225715
Do you Rust guys ever read code before making changes or do you just start making sweeping, uneducated changes based on whatever you are feel like doing in the moment as soon as you get a hold of a codebase? The way you all Rust guys talk makes me think you will just purposefully do the most stupid stuff just to cause problems and then say "well rust would have prevented this as it would not have let me do stupid stuff". Maybe consider making an attempt at not doing stupid stuff in the first place and then the worst case scenario you guys seem to think will happen every time probably won't happen. In this example if you cannot read an If statement below another if statement and you change a hard-coded immutable variable your language choice is not going to save you from yourself and you probably need to have a better plan of action before you start writing code.
Anonymous No.106226442 >>106226454 >>106229816
>>106226191
Haskell is even harder to learn. Would you say that it is even more bloated than Rust?

>>106226362
No amount of carefulness is going to save you from getting confused by awkward code like the one you posted.
Anonymous No.106226454 >>106226510
>>106226442
Thanks for confirming that you cannot reason about simple things. No wonder you lot get confused by C/C++.
Anonymous No.106226510 >>106227318
>>106226454
how can you be a programmer, whose entire purpose is to automate things, then get surprised by a compiler that automates the checks you have to do manually? it's retarded as fuck.
Anonymous No.106227318 >>106227454
>>106226510
No you thinking a simple frame-buffer swap is problematic code outs you a either a nocoder, zealot, shit-stirrer or someone who is fucking stupid (all of the above). Even the fucking game of life which is baby's first game dev project uses something like that to achieve a performant rendering of state that needs to be updated frame to frame without having to reallocate fresh buffers every tick (and using integers as pointers seems to be the defacto way of getting around the borrow checker in Rust as well, even bevy devs were bragging about it like it was some amazing discovery in some conference a few years back). Step outside the corporate webdev hellscape for once in your life and you might learn a thing or 2. Peace out.
Anonymous No.106227454
>>106227318
I have way more projects than you. I regularly with niche cryptographic protocols, custom encodings, SQL queries that take up >100 LOC, and pic related is a hash map that I have outperforming Rust's Swiss Table implementation in all benchmarks (so far).
Anonymous No.106228106
>>106226362
The more expressive a language is the more confidence you can have when writing.
In ASM you have to worry about which registers are volatile, whether data is passed via stack or register, did you update the subtraction to the stack pointer to reflect the a change in stack usage of a function correctly or will a call erase some of your data?
In C you don't. It defines an abstraction of a function signature and just handles it automatically. You don't have to worry if someone forgot to pass an argument to it, or passed a wrong type. When you get an X it is always a sizeof(X), there is no half of X. The m1 in X is always at offsetof(X, m1), you can just use ./-> without worrying about fucking up the offset when an m0 is added/changes size.
But just like asm had things it couldn't express to be handled automatically, C has things it can't express too.
Rust can express more things than C, so it can be used with more confidence
Anonymous No.106229413
>>106223558
Yes and no. Unsafe lets you fuck around with raw pointers. So you can do something stupid if you really want to. It's just you have to be explicit about being stupid. Rust is like OSHA. Yes, you can still jump off a high bridge, but we're putting guard rails in place so that you have to really be trying to do so.
Anonymous No.106229557 >>106229629
>>106222209 (OP)
Yes, half the battle is making the compiler shut up.
Anonymous No.106229629 >>106229677
>>106229557
It's horrifying realizing a lot of junior devs can't even write code that can pass the borrow check and they're probably writing C++ shit code right now for legacy boomerware. I have actually seen it in real life what this results in, but it's still insane reading people being confident in their complete lack of skill.
Anonymous No.106229677
>>106229629
100K starting doesn't exactly go along with competence ya kno?
Anonymous No.106229774
>>106223246
>The absolute state of rust tranoids and their "low-level systems language"

Rust tranoids are the lowest form of life on earth
Anonymous No.106229787 >>106230039
>>106222325
>All programming languages require you to write your program in a specific way.

Bullshit.

This is only true on a single-paradigm language. On a very restrictive one, like Golang.

On a multi-paradigm language, is exactly the opposite -- the language doesn't force you to go for a particular way to solve the problem.
Anonymous No.106229816 >>106229829 >>106230492
>>106226442
>Haskell is even harder to learn. Would you say that it is even more bloated than Rust?

Haskell has a proper garbage collector and a more advanced type system.

This means you will spend less effort and less time to produce a solution.

This also means more concise, higher level code.

Rust is a downgrade from Haskell.

This is year 2025 where we have precise, concurrent, fast garbage collectors yet the Rustacean neanderthals are "no, garbage collector BAD, human replacing the computer GOOD"
Anonymous No.106229829
>>106229816
>Rust
>Downgrade from a shitty GC language that copes with the mutability question with an inefficient answer
Anonymous No.106230039 >>106230090 >>106230125
>>106229787
Give an example of a multi-paradigm language
Anonymous No.106230090 >>106230107 >>106230122 >>106231468 >>106232116
>>106230039
Common Lisp
has CLOS, the most advanced object system
is imperative by default
has lambda support and fset lib for persistent data structures
has a conditions system, which can (and has been) used to implement aspect-oriented programming
has reader macros and normal macros, allowing for indefinite extension of the language without modification of the standard (see the Coalton project which adds static types a la '98 Haskell)
has the Screamer lib for indeterministic programming
and so on
Anonymous No.106230107 >>106230122
>>106230090
oh yeah there is even the April lib, which adds APL to Common Lisp
Anonymous No.106230122
>>106230090
>>106230107
just to emphasize the point: there is nothing stopping you from writing a reader macro that adds a borrow checker to Common Lisp
Anonymous No.106230125 >>106232116
>>106230039
C++
Javascript
Java if you ignore every file starting with public class
Anonymous No.106230492 >>106231460
>>106229816
>This means you will spend less effort and less time to produce a solution.
Your original claim was about bloat which manifests as "in too many shit to learn" and now you are talking about productivity? Your argument is all over the place.
Anonymous No.106231460
>>106230492
>Your original claim was about bloat which manifests as "in too many shit to learn" and now you are talking about productivity? Your argument is all over the place.

Dude this is an anonymous forum, stop mixing up people.
Anonymous No.106231468 >>106231713
>>106230090
>Common Lisp

an immensely superior language to Rust and most other programming languages out there with the exception of Haskell, Erlang, and maybe Scala3 and OCaml.

>has CLOS, the most advanced object system

indeed
Anonymous No.106231713
>>106231468
nah, you're underselling Rust. Common Lisp has a GC, which, while not a problem in almost all ciircumstances, DOES lead to waste of computational cycles that spend time solving a problem that can be resolved at compile time. people that shit on Rust are very clearly, to me, not experienced enough.
Anonymous No.106231854
>>106222209 (OP)
Rust is like a math professor. You have to prove to the compiler that your program works. As the result you write less shitty code.
Anonymous No.106232116
>>106230090
Can I write lisp code that doesn't result in a tree?
>>106230125
Can I call a non-template function with a template parameter?