/dpt/ daily programming thread

Do you think that you look cool in user imageboard, Jow Forums?

Old thread:

Attached: 2e776d48733cd4b1.png (1024x1024, 108K)

Other urls found in this thread:

smallcultfollowing.com/babysteps/blog/2016/04/27/non-lexical-lifetimes-introduction/
rustjobs.rs/
bgr.com/2011/01/13/rim-looks-to-attract-new-talent-with-rim-jobs/
rim.jobs/
learnyouahaskell.com/
twitter.com/mitsuhiko/
rustbyexample.com/
twitter.com/AnonBabble

I'm a professional Rust developer. AMA

Attached: steve klabnik.jpg (1400x933, 384K)

Eonly reminder to use #![feature(nll)].

>trying to look cool
shiggy

First of fearless concurrency. You will never be taken seriously by IRL devs like pic related.

Attached: rust-dev.jpg (400x400, 19K)

why

smallcultfollowing.com/babysteps/blog/2016/04/27/non-lexical-lifetimes-introduction/

What are your pronouns?

haskell!

It solves a lot of tricky lifetime issues.

>rustlets still don't understand that "lifetimes" and borrow-checking are fundamentally braindead concepts
>mindless shilling continues

explain

fellow haskeleler :3

x & 01
This is a bitwise operator performing what is known as a bitmask operation.
Each corresponding pair of bits in the two integers is ANDed together, and the result of the operation determines that bit in the output. Using a constant of 1 has the following effect.
abcd efgh
& 0000 0001
= 0000 000h
Anything ANDed with 0 equals 0, and anything ANDed with 1 is itself. It's as though we've applied a mask to the number so we can examine only the least significant bit in isolation.
x >>= 1
This shifts x to the right by 1. Every bit is moved into the position to its right. This causes the least significant bit to be destroyed and the most significant bit to be set to 0 as a placeholder (this is only guaranteed for unsigned integers)
abcd efgh
>> 0000 0001
= 0abc defg
The loop removes the least significant bit after it has been checked and the next least significant bit is moved into that position to be checked instead.
The loop terminates when the whole integer has become 0 i.e. there are no bits left to check.

> >>=

Attached: 1493049208271.png (668x667, 777K)

>2018
>he's still in the denial stage
Even C++, D and Haskell-fags have moved to the bargaining stage.

>>=)

Those three languages have nothing in common (Not even letters)

I'm going to abuse the comma operator and nobody can stop me!

gentoo installer

drawbacks?

True, but they all have been reacting to Rust in one way or another. C++ introduced std::option and been thinking about BC-like semantic, GHC is playing with linear types and D has added @nogc and betterC.
It's not stable so you have to use nightly.

you can overload it in C++

OwO

>they all have been reacting to Rust
No they haven't, std::option is not based on Rust, and adding linear types is nothing to do with Rust. It's because someone wrote a PhD paper on adding linear types to Haskell.

Rust has affine types, not linear types.

I just want to thank the user who introduced me to VS Code last thread. Comfiest text editor I have ever used for a newbie like myself. It just werks.

>electron

>electron
That looks interesting. Can it handle C/C++?

I'm convinced that ConstraintLayout is an elaborate practical joke to make Android developers even more miserable than what they usually are

I got two points off on the simple protected mode operating system I wrote for operating systems class. All it does is capture keystrokes and print them to the screen, but typing the "1" character produces random garbage characters. Only problem is, when I tried to step through it line by line in GDB, it works properly, for some reason. Here's the keyboard interrupt handler, written in assembly:

.global kbd_enter
kbd_enter:

pushf //pushf actually stores the value of the FLAGS register - including the interrupt flag
cli //we clear interrupts so that we're not interrupted during the interrupt handler
push eax //push some registers so we have something to use
push edx
in al, 0x64 //see if the keyboard has anything available...
and al, 0x01
jz _kbd_skip //if it doesn't, skip right to the end.
in al, 0x60 //get the scancode in from the keyboard
and eax, 0x00ff //this sets all but the first word of EAX to zero. where the scancode is
push eax //now send the scancode to the kbd_handler
call kbd_handler
pop eax //clear the stack

_kbd_skip:
mov al, 0x20 //send EOI to the PIC.
out 0x20, al
pop edx //clean the stack
pop eax
popf //restore the flags register - including the interrupt flag which is 1, enabling interrupts
iret //return to the C loop.


and the C function it calls:
//kbd_handler is called by the keyboard interrupt handler in the assembly code.
//this function takes the scancode, converts it into a char, and puts it into the keyboard buffer.
void kbd_handler(unsigned int scancode)
{
//if scancode is zero, or the buffer is full, ignore it.
if (scancode==0||buffer_start>buffer_end) return;
keyboard_buffer[buffer_end]=keyarray[scancode];
buffer_end++;
if (buffer_end>99) buffer_end = 0;
}


any ideas?

Attached: Screenshot from 2018-04-03 09:23:48.png (814x492, 19K)

what

Oops, I thought you were suggesting that electron was a better text editor than VS Code. My bad, I didn't know exactly what electron was until I googled it.

>refused yet another job offer
keeping my sweet employment virginity for a haskell job.

Attached: 1492554590171.png (718x718, 600K)

>they all have been reacting to Rust in one way or another
The only appropriate reaction to Rust is violent vomiting.

>he doesn't notice that his text editor is using > 2GiB of RAM without any files opened
JEJ

rustjobs.rs/

>random garbage characters
>doesn't manifest itself in gdb
sounds like an uninitialized variable

Are you that starved for attention that you repost this LARP every second thread?

Attached: 8c6.gif (480x238, 443K)

good work

Attached: 1521737508606.png (603x642, 407K)

>Being a ramlet
Look at him, and laugh!

>rustjobs.rs/
Still can't hold a candle to
bgr.com/2011/01/13/rim-looks-to-attract-new-talent-with-rim-jobs/
rim.jobs/

only happens when you type the character "1", though
other characters are fine

Attached: Screenshot from 2018-04-03 09:58:09.png (787x516, 28K)

>employment virginity

Attached: 1514920750407s.jpg (124x124, 3K)

famesag

no

Attached: Screenshot-2018-4-3 g - dpt daily programming thread - Technology - 4chan.png (334x120, 3K)

nope

Attached: 1521723839722.jpg (379x364, 20K)

all me btw

no

Attached: Screenshot-2018-4-3 g - dpt daily programming thread - Technology - 4chan(1).png (525x527, 59K)

might be the two lines
popf
iret

Restoring interrupts before you've returned from the interrupt handler allows the iret instruction to be interrupted by another keyboard interrupt, messing up the stack

Don't know why it would only happen when typing '1' though

I actually got 5 (You)s this thread tho.

Attached: hYMIItH.png (511x564, 142K)

>I got only one
tfw when (you)let

>rustjobs.rs/
>There are no open rust jobs anywhere in the world.
Utterly BTFO. Rust is completely irrelevant in the real world.

so are you

>n-n-no u

Attached: 1514883135537.jpg (244x206, 10K)

Attached: image7.jpg (800x341, 43K)

How will he ever recover

>in denial that rust is shit
>angry why somebody would make shit like that
>maybe there's reason this language is so shit
>fuck I wasted actual time with this shit lang
>accepting rustfags are mentally ill

>in denial rust is better than $your_favourite_language
>angry why somebody would use rust and not $your_favourite_language
>maybe there's reason $your_favourite_language is better than rust
>fuck I wasted actual time trying to keep using $your_favourite_language
>accepting people who keep using $your_favourite_language are mentally ill

lol you rustfags suck even at shitposting, just fuck off.

Reminder that the five stages of grief pic implies coming to terms with an abysmal language for lack of a better choice (presumably when you're too dumb to master C or C++).

I see you've moved onto anger now.

>equating writing software in rust with grief
>thinking this says something good about rust
Just how mentally challenged can you get?

Attached: 729.gif (340x340, 137K)

>Just how mentally challenged can you get?
mentally challenged enough to favour Rust

Attached: 1462232392038.jpg (415x440, 57K)

>favour

do you not speak English?

>favourre

>flavouire

Ask an employed Rust programmer anything Rust related. On answer 100% contentedness guaranteed.

Attached: steve klabnik 2.jpg (1280x720, 62K)

reminder more businesses use rust in production than haskell

Can you show me examples of non-revolting Rust programmers? Why do they always look so genetically malformed?

What book should i read to learn to program ?

more businesses use php in production than rust

more businesses use rust in production than c++. educate yourselves

learnyouahaskell.com/

twitter.com/mitsuhiko/

Attached: profile_400x400.png (400x400, 241K)

>saveur

Attached: dexter.jpg (800x420, 66K)

This is an English board limey, we don't speak none of that Frenchy-flavoured British of yours.

What a fucking creep. He looks like the love child of Jeffrey Dahmer and Ted Bundy.

>uppity rustic nigger trying to talk back

Attached: 1508521681282.jpg (491x488, 19K)

Sure thing m8

Attached: Armin_Ronacher-820x461.jpg (820x461, 40K)

Just imagine being his wife and bearing his child

Attached: 76b5a5d4af466377d62f46a84b1f858e.jpg (800x533, 203K)

(((You)))

Attached: 8477896865_fda52fd495_b.jpg (1024x681, 113K)

>Ted Bundy
>born to Eleanor Louise Cowell at the Elizabeth Lund Home for Unwed Mothers
you can't make this up

>hurr durr dongle iykwim

What's the best book for C++ if you know Java and Python?

A detailed guide on how to use a modern-design toilet

Don't even try it. Not until you know C reasonably well any way.

>dont even try it unless you know C
no fuck off with your 1980's style of teaching it's not C with classes(tm)

Why?

rustbyexample.com/

Attached: 1488250819351.jpg (500x700, 76K)

Otherwise strange things will happen and you will have no idea why or what they mean.

>otherwise blue smoke will pour out of your screen and spooky action at a distances will occur

Or you could just use a debugger and step through to see where your assumptions fuck up horribly and then reason about how to fix it... like a normal person.

Effective C++

>kills your typechecker
Nothin' personnel kid..

Attached: 2018-04-03-190254_350x221_scrot.png (350x221, 17K)

>not using dependent types and church encoded natural numbers to make this a simple matter of incrementing a natural number

quick and clean kill sir

What functions should be defined for a priority queue ADT?

You sure that the problem is in handler and not in your output code? And those are not random garbage characters either. Those are 1 3 5 7 etc in ASCII. Notice the pattern?

extract, singleton, union