Rust thread?

Is Rust a good language for a total programming newbie to learn? I've been self studying this and Python for a while, and I'm wondering if I should drop Rust for now. I like what I've read about Rust, (Safety & Control) and would like to continue with it.

My job requires the occasional repetitive task for testing purposes, and Rust seems like it would fit the job better for this over Python, because I don't need Rust to be installed.

Other urls found in this thread:

github.com/PurpleI2P/i2pd/commit/c231eff4b1d74c2f09b1bd3584923f7e1ffc718c
rust-lang.org/en-US/friends.html
ts.data61.csiro.au/publications/papers/Leslie_CFGGMPSEH_05.pdf
ts.data61.csiro.au/publications/papers/Leslie_CFGGMPSEH_05-tr.pdf
groups.google.com/a/isocpp.org/forum/#!msg/std-proposals/qd3L1-bGg1A/vGcb4ahJ5UYJ
twitter.com/SFWRedditGifs

Safety & Control for what? These words alone doesnt mean anything. On Rust context, they are most buzzwords than anything.

The real key there is just marketing: Rust have a built-in code analyzer which just say "Your code isn't good... Fix it". Nothing more, nothing less. Any good static analyzer would perform equally or even better.

What we really need is a methodology related to Project Guidelines: Better design outside the language scope.

Ok. So does a lack of guidelines make the language bad for newbs?

Rust is a fairly young and quite rapidly evolving language. It lacks the powerful, stable libraries available for C and C++, and the ones built in to Go and the higher level languages like Python, Java, and .NET.

Depending on what you're testing, having a binary program probably doesn't make much sense. It's unwieldy, while scripting is just the tool for the job. If installing python isn't feasible, look for the OS's built in scripting capabilities: powershell or bash.

My advice concerns about theory related to software development in general: It's literally "know what you are doing". Languages are just tools...

But you're right also, but not only for newbs: C++ is a huge example. We don't need someone redesigning everything from scratch once again.

>Know what you are doing
I've heard "the right hammer for the right nail" before along these lines too.

What are some good ways to learn software dev? I'm fairly computer literate and programming is really the final frontier for me. I can grasp most technical concepts quickly, but learning development is a bit abstract.

Rust is good at solving problems that, by the sound of it, you don't actually have. Learn Python first, or bash/powershell like the other user suggested. If you really, truly need something self-contained, you can use py2exe.

Rust also has a proper type system and support for functional programming.

Which most of these "language expressivity" concepts are partially (or none at all) used on today code. Pajeets and code monkeys are the majority, remember that. Majority of developers can't even grasp basic tooling about quality (Debuggers, analyzers, sanitizers, gnu stuff and so on).

t. pajeet. It's ok pajeet, one day you'll learn to poo in the loo, and then you'll reach enlightenment and stop saying the most retarded shit Sup Forums has ever seen!

>Pajeets and code monkeys are the majority, remember that. Majority of developers can't even grasp basic tooling about quality (Debuggers, analyzers, sanitizers, gnu stuff and so on).
This is literally the reason why Go exists. If you want a language designed for stupid people, use Go.

or, better yet, learn Go

>look at me, I'm smart
you can learn and use both, you know

I started with C, wouldn't recommend any C languages or Rust, just start with javascript / node.js first.

Do this if you just want to learn syntax and making programs. C is useful if you want in depth knowledge of how programs are ran and what happens under the hood. Rust tries to follow this, but what ends up happening is you're forced to look deep under the hood just to figure out why your programs are not working as intended. All in all which language you pick depends on what depth of understanding you require.

don't use rust it's SJW TRASH
C++ is fully redpilled
case and point: github.com/PurpleI2P/i2pd/commit/c231eff4b1d74c2f09b1bd3584923f7e1ffc718c

>Safety & Control for what? These words alone doesnt mean anything. On Rust context, they are most buzzwords than anything.
>t. Javascriptfag

It doesn't mean anything to people who have never written C/C++.

>using Go for systems programming
Even the Go people have given up on that meme and are selling Go as a better web-server alternative to Node.

Learn C++ before you learn Rust. Rust will likely not see any substantial use outside of Mozilla. Also a lot of concepts in Rust are basically to patch the shortcomings of C++ and won't make any sense to you until you've written substantial C++ and have seen how it can trip you up.

The Rust ecosystem is a very small fraction of the C++ ecosystem and its compilers aren't as mature as C++. You will almost always get C++ to run faster than equivalent Rust code just because the C++ compilers have had decades of headstart over Rust.

>case and point: github.com/PurpleI2P/i2pd/commit/c231eff4b1d74c2f09b1bd3584923f7e1ffc718c
Can you explain? Are SJWs known for being opposed to unnecessarily low MTU settings, and I just didn't get the memo?

subtle redpill is subtle

Sure, you should learn Go, but why the fuck would you willingly use Go?

it's best to have the kid get motivated by making small cool programs and have his curiosity grown by a high level language

go is more relevant now that rust will be in its entire lifetime.
I think it's the reaction from the oracle vs google java patent shitfest

Oh for fuck's sake. The fact that the correct MTU number is literally one thousand four hundred eighty-eight does not make C++ "redpilled". Especially since this is some random-ass project that happens to be written in C++, not the language/compiler/standard library itself.

Rust is already quite relevant outside mozilla. Unlike go, which is so shit that not even google uses it (google has more rust users than go users).

KILL YOURSELF

As much as I'd want this to be true I think that's bullshit.
Please prove me wrong with some source.

rust-lang.org/en-US/friends.html

>google not even on the list

The Rust hype is declining and before you know it only Mozilla uses it for Servo.

That's just complete bullshit tho.

Rust is fucking shitt conan exiles is way better...

So tell me this, "Rustaceans"... If Rust is so good, how come Linux isn't written in it???

Like saying McDonalds has healthy food because they sell salads. Rust FP is crippled to the max. You'll notice it once you try to make anything reusable based on Iterators, almost impossible.

Fuck off. The "C/C++ is unsafe" circlejerk is driven by people who have never written nor mastered the languages. These fucking idiots are the programming epitome of Sup Forumsacks telling you how awful Sweden is even though they never visited that country.

I need books.
Books for absolute beginner in programming, assumes that I know what a variable means.

Where are those books?

Also, why are people telling golang is more "productive" than Rust?

>assumes that I don't* know

yet.

There is an UNIX like OS calledo Redox OS written entirely in Rust

>Microkernel architecture
>Drivers run in the userspace
>Memory safe
>Includes common Unix commands

>literally called Redo

>drivers run in userspace
How horrifying.

>memory safe
What does this even mean?

>includes common Unix commands
How would it be a UNIX like if it didn't?

I meant Redox OS, that was a typo

>How horrifying.
It actually means driver crashes won't make you reboot your computer

>What does this even mean?
No memory leaks and buffer overflows in the kernel

>How would it be a UNIX like if it didn't?
Common UNIX libraries are modified in most Linux distros. For example, $cat is different in common Linux distros than BSD Reno derivatives. Look up the source code.


Educate yourself

>It actually means driver crashes won't make you reboot your computer
It also means horrible performance.

>No memory leaks and buffer overflows in the kernel
See above.

>Common UNIX libraries are modified in most Linux distros. For example, $cat is different in common Linux distros than BSD Reno derivatives. Look up the source code.
It is also different in FreeBSD than in BSD Reno because BSD Reno is a proprietary BSD.

"Modified" means nothing, user. All that matters is if they're there or not. See POSIX.

>It also means horrible performance.
Not necessarily, the traditional drivers are written for being used in the kernel space. Performance overhead is definitely be overcome with proper standards (See NetBSD)

>How would it be a UNIX like if it didn't?
>implying memory leaks ensure better performance
what?

Are you sure you know what you are talking about? Or is it just the common butthurt over Rust?

>Not necessarily, the traditional drivers are written for being used in the kernel space. Performance overhead is definitely be overcome with proper standards (See NetBSD)
No, necessarily.

When instructing a device to do DMA, you need to allocate continuous buffers in RAM that the device can reach. In user space, you have no control over physical addresses because you are running in a virtual address space and pages can be shuffled around at whatever actual address based solely on the discretion of the OS. This means that you either have to drop in and out of kernelspace whenever your driver needs to set up a DMA buffer (which would also require an incredibly bloated DMA API)

or it would require control over physical address space from userspace, something that is a huge security risk and would mean that userspace can overwrite whatever physical address it wants to.

NetBSD runs drivers in kernel space because the developers aren't completely fucking insane, so I don't see how that supports your argument.

Every company is slowly going towards go anyway, the syntax of rust is terrible and they know it.

I tried using Rust for a small project once but I gave up because of insanely long compile times.

Rekt.

Go and Rust are not competitors,
Go was originally created to be a systems language. Now it tries to (migh be able to) replace Java or C#.

Rust is trying to be the better C++

I use golang for my pet project. The compile time is very low. But the compiler errors are a bit cryptic. They are working on it though.

Please refer to
ts.data61.csiro.au/publications/papers/Leslie_CFGGMPSEH_05.pdf
and
ts.data61.csiro.au/publications/papers/Leslie_CFGGMPSEH_05-tr.pdf

Hopefully this will clear things up about the current tradition of kernel and drivers' instruction and allocation algorithms

stop samefagging and start reading

>Hopefully this will clear things up about the current tradition of kernel and drivers' instruction and allocation algorithms
Please refer to my specific example. They admit that they do not consider the ramifications of exposing physical addresses to userspace. They also just expose pinning user pages to userspace.

>Note that we do not tackle the problem of protecting the system from errant driver DMA, we leave this aspect for future work.

They did what I already noted was a bad idea in
>or it would require control over physical address space from userspace, something that is a huge security risk and would mean that userspace can overwrite whatever physical address it wants to.


In other words, the benefit of running in userspace is entirely lost. A bad driver will be able to pass along a bad pointer to the device and your system will crash. A malicious driver will have access to kernel space memory and be able to read and write to it.

>A bad driver will be able to pass along a bad pointer to the device and your system will crash. A malicious driver will have access to kernel space memory and be able to read and write to it.
Only if C had memory safety...
Oh wait

Go is not a viable systems programming language because it doesn't get nearly the performance of C/C++/Rust.

Go is as fast/slow as Java which is usually 1.5x to 5x slower than equivalent C++. That already removes it from the systems prog space. That's why they pivoted to competing with Java and Node for the web server space.

Golang really doesn't belong anywhere. It's a half-assed server language and a half-assed systems language.

It has nothing to do with "memory safety", it has everything to do with exposing physical memory to userspace is a bad idea. "Memory safety" in rust is nothing more than glorified bounds checking and some reference counting. This is about (deliberately) addressing parts of memory you're not supposed to address or be able to address.

Not to mention that they also conclude that running in user-space has severe performance penalty for interrupt-heavy devices, such as network cards, or high-bandwidth devices, such as high-speed SSD disks.

So all in all, it's clearly a bad idea.

Rust BTFO'd

He's not going to respond user.

>Note that we do not tackle the problem of protecting the system from errant driver DMA, we leave this aspect for future work.
seL4 (which is also by NICTA/Data61) solves this by configuring the IOMMU so that devices can only write to memory controlled by the process that manages the device.

>seL4 (which is also by NICTA/Data61) solves this by configuring the IOMMU so that devices can only write to memory controlled by the process that manages the device.
The IOMMU only protects against rogue device writes. It doesn't protect against a bad/malicious driver.

The problem is that you're still exposing physical addresses to user space, which opens up for a userspace processes reading and writing into kernelspace.

I don't understand your objection.

Suppose we have an API that works like this:
> driver (userspace): requests 1024 contiguous pages
> kernel: reports that the pages are available at physical address 0x12345000 and virtual address 0x23456000
Then the driver sets up DMA using the physical address and reads the results using the corresponding virtual address.

Do you see some way for the driver to use this API to access kernel memory? Or, is there some reason why this API is completely unsuitable for the intended purpose?

>Do you see some way for the driver to use this API to access kernel memory?
The driver doesn't need to use the addresses returned from this API, it can very well just ignore setting up the correct IOMMU domains and make the device write to arbitrary addresses.

>Or, is there some reason why this API is completely unsuitable for the intended purpose?
Yes, some devices are unable to address above a certain amount of bits. Old Nvidia graphic cards are only unable to address 30 bits, but the IO address space may be 64-bits. There may also be some funky alignment issues.

Therefore, you need low-level control in order to specify the range.

>the google shills are so shitty they can't even use reality to discuss rust, they have to make shit up
Classic.
Are you trying to chain random statements hoping that they can be construed to somehow align with reality? Pathetic. Come back when you have stopped failing OS 101.

>Is Rust a good language

No. It's shit made for retards.

samefagging game strong

There's nothing incorrect about neither of my posts user. You're grasping for straws.

Just because you don't understand how device drivers work, doesn't mean you can dismiss it all together.

What?

and none of this is relevant to the thread because OP is doing business automation

Rust is everything C++ should have been.

>it can very well just ignore setting up the correct IOMMU domains
IOMMU settings in seL4 are handled by the kernel, just like page tables are.

>Yes, some devices are unable to address above a certain amount of bits.
>There may also be some funky alignment issues.
So add an option for the driver to request N pages somewhere in a specific address range, with specific alignment. I'm surprised you even raised this as an objection, given the solution is so obvious.

Anything else?

>I think it's the reaction from the oracle vs google java patent shitfest
It's more the reaction to the technical failures of Python internally at Google.

>Anything else?
How do you propose calling user-space callbacks for device initiated interrupts.

Protip: you need to guarantee that user-space driver doesn't block (same as for a kernel space driver), and that the cost of context switching is low.

So now a user-space process can exhaust memory by requesting all the available address ranges and then simply avoid releasing it back.

Great fucking idea.

Are you actually this stupid, or just pretending?

I just want to add that IOMMU kills P2P performance for devices that doesn't implement ATS (which most doesn't do) unless you identity map.

>driven by people who have never written nor mastered the language

gr8 b8 m8

These ranges have to be pinned in memory in order to do DMA. Please explain to me how you would prevent a malicious driver from doing this.

>inb4 a malicious kernel space driver would be able to do the same
Yes, that is correct. But the claim here is that user-space drivers are able to protect from malicious and bad drivers.

>Rust is everything C++ should have been.

slow? or c#

Have you ever heard of mlock(2)?

OK pajeet whatever you say, you are an expert fizzbuzz java programmer. One day you'll know what a kernel is.

No, producing programs that doesn't have shitty exploits.

Given that it's neither, I would wager he meant neither. Really makes you think huh.

>Rebranded Java?
definately no

what's wrong with c++11 especially with c++14?

You haven't addressed anything in my posts... You're just going into full defensive mode and spouting memes.

mlock() might block (suspend process until resources are available), requesting a DMA range might not. mlock() also gives no guarantee on where in physical memory pages are locked, only that they remain in RAM. The kernel can still shuffle it around.

start with template >C++14
>14
ooh look, they fixed that broken shitty language in fourteen, right :D

groups.google.com/a/isocpp.org/forum/#!msg/std-proposals/qd3L1-bGg1A/vGcb4ahJ5UYJ

Hi,


template void f() {}
template void f() {}
COMPILES


struct S {
template void f() {}
template void f() {}
};
--> error: explicit specialization of 'f' in class scope
FUCKING RETARDED
WOW IT REALLY MAKES SENSE THAT THIS WORKS AT GLOBAL SCOPE BUT NOT IN-CLASS


struct S {
template struct Inner {};
template struct Inner {};
};
--> error: explicit specialization of 'Inner' in class scope
FUCKING RETARDED


struct S {
template struct Inner {};
template struct Inner {};
};
WOW, RETARDS, WORKS WITH A STUPID-RETARDED WORKAROUND


struct S {
template void f() {}
template void f() {}
};
--> function template partial specialization is not allowed
FUCKING RETARDED
WOW THE RETARDED WORKAROUND DOESN'T WORK FOR FUNCTIONS


template void f(X x) {}
template void f(X* x) {}
OH, OK THIS GOOD


template void f() {}
template void f() {}
--> function template partial specialization is not allowed
FUCKING RETARDED.


I don't even want to hear 1 piece of bullshit out of a single one of you people's mouths about this one.
If you give me one piece of bullshit, you're a fucking n00b.

Every one of these things is used for metaprogramming.

After 15 years of awareness about these problems, nothing was fixed.
And now with C++14, yet another oversight release, we're heading for 20 years of fucking retardation.

Thank you standards body people for your retarded level of awareness, you fucking retards.
Can you fix the holes you fucking retards?

...

kek

>its compilers aren't as mature as C++

rustc outputs LLVM IR, which is then compiled to your architecture of choice. The level of optimization it can achieve is only dependent of what this IR can be optimized to.

Look at a simple "Hello, World" example in Rust and you will quickly change your mind. Don't fall for this meme.

Many things:
-retains C syntax which causes a plethora of issues, including the necessity to let people shoot themselves (and others) in the foot repeatedly
-constantly growing amount of features making it impossible to learn the whole language, or understand it when reading someone else's code
-syntax is strewn with inconsistencies which make correct parsers an engineering feat in and of itself. Those inconsistencies are necessary to keep tacking on features while retaining C syntax.
-No proper way to do memory safety. In particular, no cost-free constructs (this is what the borrow checker in rust is, it's completely free, there is no reference counting or gc).
It's going in the right direction for features, but in the wrong direction for actual usability because it bloats and balloons instead of being fixed.

hurr hurr durr
fn main() {
println!("you are a faggot");
}

> 2 messages have been deleted.
Maximum butthurt.
Get over it, Rust is the superior C++.

Holy shit
"YOU WANT ME TO WRITE THE PROPOSAL?
I'M NOT EVEN FUCKING SANE
YOU THINK I KNOW HOW TO WRITE A PROPOSAL
YOU PEOPLE ARE SUPPOSEDLY SANE
AND YOU CAN'T EVEN DO IT

WHY DO YOU HAVE TO WASTE SO MUCH TIME ON THE RETARDED PROPOSALS WITH ALL THE PRETTY PRINT?
DO YOU THINK I HAVE FUCKING TIME FOR A BUNCH OF FUCKING PRETTY PRINT
WHY DONT YOU READ MY FUCKING POST WHERE I SAID IT'S FUCKING RETARDED AND BE HAPPY WITH THAT AS THE PROPOSAL
AND THEN WRITE THE GODDAMN STANDARD WORDING TO IT AND USE WHAT I SAID ABOUT RETARDATION AS THE LITERAL PRESENTATION
YOU DON'T NEED A BUNCH OF FUCKING HIGH-WORDING LITERARY C++ DOCUMENTARIAN TPS-REPORT MAGIC FOR WEIRD FUCKING FREAK BEARDED MEN WHO ARE GONNA VOTE NO BECAUSE IT WASNT WORDED RIGHT TO FIGURE THIS SHIT OUT, OK?
WHY YOU THINK C++ IS SO FUCKING SLOW? BECAUSE ALL YOU FUCKING RETARDS NEED A BUNCH OF FUCKING POWERPOINT DIAGRAMS TO UNDERSTAND ANYTHING
FIX THE GODDAMN WORDING AND THEN JUST DO IT, WHO HAS TIME TO FUCK AROUND WITH DOCUMENT INDENTATION BULL-CRAP AND A BIG FUCKING PRETEXT WHERE I TRY TO SOUND ALL NICE AND SANE FOR CRAZY PEOPLE JUST TO MAKE YOU UNDERSTAND THE CONCEPT
THAT YOU NEED TO FIX THE BASIC FUCKING TEMPLATE FEATURES"

Is this Sup Forums?

>C++ permanently BTFO

Different poster but that syntax is really horrible. There's so much punctuation for no reason I can understand, more than Perl. How can anyone tell what this program does?

it's like one more symbol than the C version...

The sad part is that it took me 2 minutes to figure out you were not serious.

Why do faggots always have to learn the latest hipster shit languages?

Learn what is fucking useful. Do you go into math class and ask if you should learn some obscure theoretical bullshit mathematics? NO. No one gives a fuck about it, and it will NEVER be useful. Learn practical shit that will give you a useful skill.

Go learn Brainfuck and kill yourself

kek

Dumb frogposter

Dumb non-frogposter

So where did those C/C++ (((expert))) codemasters run off to?

C primer is quite good.