>>1161 Its compiler and probably also the spec has a CoC. Just learn C and lua: C for really fast low-level shit and Lua for everything else (LuaJIT is pretty much the fastest scripting language out there).
Tried it for a while, but managing lifetimes is a pain.
>>1163 Never tried Lua more than really basic scripting. The module versions issue is kind of a pain, I'm assuming you use C the majority of the time ? Which version do you use ?
Rust is probably a pretty good language, otherwise they wouldn't waste so much effort making the compiler, then writing tons of code in it. Everytime I've tried learning it though I hit a wall, where I feel like the language is going out of it's way to make my life difficult.
>>1176 That's what everybody who ever tried Rust says.
Odds are, if nobody can use a programming language, the language's not "pretty good", it's garbage.
>>1175 I usually just use the latest version, which has bit operations and shit. If I need speed I use 5.1/luajit. But yeah, it is really annoying when some shitty module doesn't support the lua version I'm using... pretty easy to patch the modules to work on later versions though.
>>1177 Obviously some people can use rust. If you were a brainlet who couldn't program in c, you couldn't say that it's garbage. If rust has as many benefits as people say, then it might be worth learning
>>1161 SJWs and CoCk aside, the Rust language is far more complex than C. It is therefore harder to learn properly. C is simple enough that you can learn all of its rules in less than a week.
C being inherently unsafe is a myth; it is not hard to write C code which has no bugs. There are good memory checkers and debuggers available, and a good compiler will output lots of warnings which will help your code safety in some areas.
It also helps a lot to run OpenBSD and use their safe string functions like strl*, et.
Rust is not intuitive and frustrating to write, but it does mostly eliminate a large class of errors, has good tooling and benchmarks at a parity with C. I wouldn't make it a priority to learn.
>>1405 >Rust is not intuitive and frustrating to write
Yeah, and that's why I won't program in it. I do it for fun, not for shekels.
>it does mostly eliminate a large class of errors
For me, it is much more enjoyable to use a debugger to fix a bug than to use an opaque and shitty programming language which is "safe" (i.e. crippled).
With tools like valgrind, memory leaks are all removed.
With the high quality safe functions in OpenBSD, string-related problems in my code have all but disappeared.
Initializing all your pointers to NULL (and setting them back to NULL after free()) fixes unitialized pointer issues.
Using assertions properly can help spot a lot of bugs and potential bugs.
Using pledge() and unveil() properly can stop your program from doing any damage whatsoever even if for some reason the above contingencies do not stop a bug.
I simply do not understand why people think C is "unsafe" or "dangerous", or why anyone could think fucking Rust of all things is the solution.
>>1411 Steve Klabnik couldn't be more Jewish if you wrapped him in a rainbow torah.
DoD is sinking money into tools for assist refactoring C to Rust, so I suspect that demand for the language will grow as it matures and essential libraries become more stable and useful. If I were a NEET or otherwise had a lot of time on my hands, then I'd probably invest more time in getting a good handle on the language.
For me, crossing the bridge from nominally learning the language to actually writing something useful is too far to justify much more time in it.
>>1414 >getting a programming job
>ever
Enjoy working with pajeets and diversity hires.
Enjoy having to live up to tech-illiterate boomers' unrealistic expectations.
Enjoy having to deal with other people's cancerous, unmaintainable code.
>>1411 >C criticism
>C++ standard quotes
Nah. Pointers are simple if you just consider that it's a structured type with an address and the pointed type size.
Anyway, most of C (often valid) criticisms are about the historical baggage, not about the core of the langage. Rust > C++ but C > C++ -inb4 just take the good parts of C++).
>>1414 >DoD is sinking money into tools for assist refactoring C to Rust
Why would they be doing that? Everything I'm reading points to Rust just being another poo language, because C is too hard for them or something.
Or, maybe it's because C is too good and it's too easy to make programs that they need to have exploited later down the road unexploitable, and they also need an excuse and something to blame when they sell backdoors to LEAs and IntelAviv security researchers and hackers find massive flaws in their systems. On top of this they finally get to shitcan the old guard of competent white, male C programmers, and enlist an army of stinking niggers who will work for a quarter of the pay and probably introduce most of these bugs through sheer incompetence, thus giving the perfect cover of plausible deniability.
It's no wonder kikefox is being re-written in this shit.
>>1424 I think it's the same reason they forced a lot of mission critical software to be written in Ada. Memory leaks and buffer overflows are a big fucking deal when you're talking about drones and ICBMs. C is popular because it hit academia early, so there are a lot of C coders, which creates a feedback loop for more training in schools
I got a pdf of Programming Rust (O'Reilly, 2018) recently, and I'm going to try to post it in 4 pieces. Then I'll tell you how to put it back together.
>>2938 >>2939 >>2940 >>2941 Ok, I just downloaded all four parts and successfully reassembled them, so here's how you do it.
<download all four parts, and name them something convenient like file1, file2, etc.
<nothing special needs to be done with file1
<file2, file3, and file4 each need to have the first four bytes of the file removed; this is easy to do with the ired hex editor, but you can do it however you like
<with ired, you just launch the program with e.g. ired file2 then type
<r-4
<followed by Enter, then type quit followed by Enter; that removes the first 4 bytes from the file; do the same for file3 and file4
<then you just concatenate them
<cat file1 file2 file3 file4 > ProgrammingRust.pdf
>>2942 Technically you could post any type of file if you write %PDF as the first 4 bytes. It's similar on pigchan, except there you don't even need to modify the file, just rename file to .pdf
>>2984 Then rust must be unsafe becayse of all the publicized exploits in rust. People brag about safety in a given language not because it's impossible to write bad code, but because of it's tendency to encourage safe code.
>>1406 It's good that you can write memory-safe C. Rust has more than that to offer though. You also get no data races, better macros, a nice build system, and the best error messages I've seen out of a compiler.
If you like c and you have a free afternoon, you should give rust a try.
>>3053 It solves data races the same way it solves memory safety. By making the compiler try and prove that data races don't happen. The programmer is the one who is expected to remove data races, and they do this using the same constructs they use in other languages. The difference is two fold: first, if the compiler says there aren't race conditions, then there aren't race conditions. All code that compiles is correct. Second, the programmer can write code that they know has no race conditions, but that is rejected anyways. Not all code that is correct compiles.
If I want effortless concurency, then I can already do this by piping a bunch of programs together in bash. Rust is yet another instantiation of the "provable correctness" meme that academics have been failing to push for 50 years.
FWIW I have given rust a try. The beautiful error message recomended I wrap everything in unsafe. I did so, and got my code working properly. Didn't feel like I was using the language properly though.
Is there a list somewhere of good beginner level exercises in rust, with solutions? All the rust code I've seen is enterprise tier, like the one you posted, and not very good for figuring out how the language works.
I've spent about two months on Rust and, frankly, my two months would have been MUCH more productively spent having read about good, modern coding practices for C or learning a language with a clear use-case like Julia.
Rust is also close to useless without introducing massive numbers of dependencies. Really basic shit like, defining a type of error or parsing command line arguments or dealing with a JSON end up being very verbose and cumbersome unless you use somebody else's crate to do it. No other nu-lang seems to have this problem.
The big problem I have with Rust is that the safety guarantees is basically all bullshit. The majority of important libraries you need are written in the language this cartoon crab was supposed to protect you from. Evil C++. Anytime you do anything with a GUI, you're basically stuck with bindings to C++ libraries. Graphics? more C++ bindings. Math? C++ or Fortran. Its standard library has libc as a dependency, and performance critical operations are, quite often, done with "unsafe" code blocks.
The promise is all bullshit. The entire project should have been superset of C or C++ with lifetime annotations and a special compiler.
The proof is in the pudding, though. How many shops are using Rocket (which benches no better than Node) for their web applications? Where is Rust actually shipping?
>>3053 You need a lot more than an afternoon to learn Rust. Once you feel like you 'get' the typechecking and lifetime annotations, you then start to peer into the real complexity of the language.
>>3097 It *does* make a difference. Rust's design-by-committee strategy has resulted in an incoherent mess. It's a mashup of imperative and functional languages in an attempt to be everything to everybody. This is EXACTLY the same mistake C++ made, and exactly why it's frustrating.
Case in point: http://antoyo.ml/evolution-rust-programmer ALL of these coding styles are valid. Now imagine that you live on a place called Earth where these hominids called "humans" live and there exists in the realm of possibility a need to use or modify a program one of these creatures has written. What if he's a "rustacean" and he used some bizarre procedural macro mini-language you now have to learn to understand how any of his shit works? You have to functionally become a polyglot of one or more DSLs any time you want to add a feature or fix a logic error?
Don't get me started on how Cargo is just NPM all over again.
Contrast this state in Rust with languages developed with clear, coherent objectives and only one or a few people acting as executives for the language. The difference is night and day.
>>3098 >Don't get me started on how Cargo is just NPM all over again.
Please continue. I don't fuck with javascript at all, but I like what I've seen of cargo so far. What am I in for?
>>3131 I ċould be wrong buť wiťh NṔM iťs basiċally a nesťed ṕaċĸage manager on your sysťem ťhať you'll need in order ťo use ťhe heaṕs of Node JS module deṕendenċies. Ṕerl seems ĸind of similar in ťhať regard.
>drying do brobe dhad G is nod unsafe by bragging aboud how you habe do gnow shid do wride safe g gode, dhus brobing dhad g is unsafe
>>1406 >(i.e. gribbled).
Demonsdrades how you habe no idea of whad rusd is whadsoeber. I mean, id would suffige do jusd briefly seargh dhe dogumendadion do gnow dhad id dodally allows you do wride gode in an unsafe manner if you degide you need do, for whadeber reason.
>>3098 >dealing widh a JSON end ub being bery berbose and gumbersome unless you use somebody else's grade do do id.
Now dell me aboud how you deal widh JSON from G/G++ widhoud dhird bardy libraries in a safe manner, widhoud berbosidy.
> Dhe majoridy of imbordand libraries you need are wridden in dhe language dhis gardoon grab was subbosed do brodegd you from. Ebil G++. Anydime you do anydhing widh a GUI, you're basigally sdugg widh bindings do G++ libraries. Grabhigs? more G++ bindings. Madh? G++ or Fordran. Ids sdandard library has libg as a debendengy, and berformange gridigal oberadions are, guide ofden, done widh "unsafe" gode bloggs.
Whad gould rusd debs bossibly do? Rewride dhe endire fugging world indo a sane language? Dhe majoridy of sofdware will mosd ligely be gradually borded do memory safe languages dhough, nod negessarily/mosd ligely nod rusd.
>G and G++
>dhird bardy libraries
>berbosidy
>gribbled
>wride gode
Wordfilders should be gebd on bermanendly for /g/. BERY FUNNY HABASE
>>3266 so basigally you need do deagdibade dhe safedy do do anydhing imbordand. good do gnow. safe Rusd is gribbled.
>>3268 >Now dell me aboud how you deal widh JSON from G/G++ widhoud dhird bardy libraries in a safe manner, widhoud berbosidy
You aren'd subbosed do deal widh JSON widhoud a library. No brogramming language deals widh JSON widhoud a library, unless you use JabaSgribd or some odher shiddy brogramming language dhad isn'd for real burboses.
>ruby doo
SGOOBY BOO!!
>>3268 >>3270 Dhe whole boind of JSON is dhad id's simble do barse. When id was inbended dhey bragged aboud fidding dhe grammar on a business gard. You gould imblemend id in 30 lines of g easy.
>bhydhon doo :DD
Bydhon insdalls baggages globally by defauld. Id's gommon do sed ub a logal enbironmend do insdall bardigular bersions of libraries in for a giben brojegd, bud eben here dhe baggages only nesd one deeb.
Is it actually good or just another SJW language? Should I bother learning it, or focus on getting better at C?