/dpt/ - Daily Programming Thread

Old thread: What are you working on, Jow Forums?

Attached: 1547506211203.png (1920x1080, 1.84M)

Other urls found in this thread:

winestockwebdesign.com/Essays/Lisp_Curse.html
gdcvault.com/play/1022248/SIMD-at-Insomniac-Games-How
twitter.com/AnonBabble

first for C

Lisp is so powerful that problems which are technical issues in other programming languages are social issues in Lisp.

Attached: hatdog.jpg (900x948, 260K)

second for nim

nth for Nim!

First for Butts

Attached: 3DE4E80B-FE56-43FB-95F7-55128ED68387.jpg (640x392, 52K)

Lisp is the most powerful programming language.

JavaScript rocks!

Attached: js-rocks.png (1000x494, 368K)

Reminder to ignore the Idris poster.

no!

What language should I use to build a music database?

I prefer Buns

Attached: 1529184671130.png (850x1295, 576K)

why not just B

Idris

For example?

hey guys, so ive recently fell for the programming meme and just wrote my first hello world in c, i have a question, what language will give me a better chance at becoming self employed the fastest? Although I do want to get a full understanding of CS and Programming, I also need money and not being able to self employ will force me to restrict programming as a part time hobby and I'd like to get good at seriously.

>Idris
Thank you. This seems over my head for now but I'll keep reading.

Attached: idris-elba[1].jpg (978x1109, 230K)

Python?

Python...?

>C-t
>M-d
>"google"
>what is software written in

Also would you employ a pajeet if your business depended on it? No, then why would you employ yourself?

B is literally the language C replaced.

B needs the D

lisp being a programmable programming language, you can extend it as you want but the problem is that other programmers probably don't want what you want, resulting in numerous implementations of the same concept. a concrete example: scheme. scheme has numerous implementations that aren't compatible with each other.

This?
procedure Main is
type Door is (Closed, Open);
subtype DoorClosed is Door range Closed..Closed;
subtype DoorOpen is Door range Open..Open;

function OpenDoor (D : DoorClosed) return DoorOpen is
begin
return Open;
end OpenDoor;

function CloseDoor (D : DoorOpen) return DoorClosed is
begin
return Closed;
end CloseDoor;

procedure Knock (D : DoorClosed) is
begin
null;
end Knock;

function DoorProg (D: DoorClosed) return DoorClosed is
begin
Knock(D);
return CloseDoor(OpenDoor(D));
end DoorProg;

begin
null;
end Main;

Ada's pretty cute.

>c-t?
>m-d?

i don't understnad tehse terms but i am not a pajeet nor am i trying to be a pajeet, quite frankly i feel like ur bean a big meanie

Attached: a38.jpg (1024x962, 48K)

But concretely, which concrete aspects of this language family would you say are of "social" character, rather than technical?

dumb frogposter

>just wrote my first hello world in c
>I'm not a pajeet

winestockwebdesign.com/Essays/Lisp_Curse.html

Fuck off, retarded frogposter.
You're not welcome here.

Ignore them. C-t and M-d come from the cult of Emacsfags.

>frogposter
>can't infer that it has something to do with search

maybe i should just kms how do i stop being a pajeet please user

Attached: 95f.png (655x509, 28K)

>stop being a dumb frogposter
>git gud
>???
>PROFIT

Start posting anime pictures here and the 300 lb obese trannies/traps will begin helping you while jerking it to your image.

JavaScript rocks!

Attached: javascript rocks.png (1000x494, 134K)

this, but unironically

Attached: 1523387830883.png (688x720, 349K)

based
cringe

I've read that essay quite a long time ago, and all it says are very general statements (except for one example). I want to ask YOU: how would YOU elaborate your statement, concretely. Do you mean that it is easy to create DSLs, so no Lisp program looks like the other? That macros allow for read-time and eval-time trickery that no other language can dream of? That it allows the level of clearness of expression that rivals best FORTH programs? If so, what did you do with it, what was your own experience with Lisp?

i never have used lisp.

Attached: hqdefault.jpg (480x360, 19K)

how
Like this?

shit forgot pic

Attached: tumblr_nvsekpDXDO1udwanoo1_1280.jpg (655x666, 49K)

while(1);

Attached: 91F23D63-E45C-4498-89F3-5D7B4CF4C982.jpg (960x929, 277K)

ctrl+c

*captures signal*

kill -9

*captures signal*

Need big brain C++ here.
Suppose I have this function (simplified for the purpose of the post):
void foo(const size_t index)
{
Data d;
d.value = fetch(index);

map[index] = std::move(d);
}

Originally it didn't have the std::move call however the copy assignment operator was showing up a lot of times in the profiler, after adding std::move the function is so far down the execution time it's no longer an issue however is that even correct code? The d variable is on the stack so I don't really know if that's valid or I'm relying on some accidental luck that it works.

You can't capture SIGKILL, silly.

If Data has a move constructor, look at what it does. If it doesn't, read on what default move constructor does.

Yeah, there's nothing wrong with that. Though you might want to think about using emplace over the [] operator.
It looks like you don't really understand move semantics.

Basically what said, if Data has a move constructor then it will probably be beneficial. Otherwise it will just call the copy constructor

At what point as a hobbyist programmer will I need the knowledge of CPU architecture specifically pipelining, pipeline stages, superscalar organization and what not?

you're correct

*changes gender*
*submits a patch to the linux kernel*
*gets auto-accepted*
*changes back*
...
*captures signal*

dumb frogposter

Why do you do this?

How would a bank implement scaling?

ranidaphobic bigot

Attached: robert.jpg (576x768, 132K)

>Otherwise it will just call the copy constructor
Default move does memberwise move, so they're not equivalent.

Alright thanks anons, but yeah I've no clue about move semantics, gonna have to read some material on them.

python rocks!

Attached: snake.gif (400x480, 443K)

im going to move to india where i belong and i will lower salaries for all of you meanies

Attached: 1548568613265.jpg (380x376, 20K)

Good, good... HOWEVER
*presses hard reset button*

When you start needing to write code that goes really fast, at like the assembly level.

But like 90% of "fast code" needs to just be cache aware.

kys retarded frogposter

a search engine is more likely to get you serious advice than Jow Forums is

*keeps working thanks to Intel ME + your motherboard's clock battery*

Different user but if I wanted to think about move semantics I'd use RUST

Because Butts is the most powerful programming language.

Is this the full extent of your creativity for writing comebacks?

This is why I always create a new pid namespace so that my program is running as pid 1. It prevents this class of user errors and makes programs more reliable.

doesn't that destroy the purpose of a compiler?

The general knowledge on what CPU does will always help you, but very specific details are only useful in two cases from the top of my head:
1)You're writing ultra-fast SIMD stuff, with VTune and IACA by your side.
2)You're writing ultra-fast parallel stuff
Otherwise is right

Nobody asked.

>doesn't that destroy the purpose of a compiler?
The purpose of a compiler is to allow yourself to write high level code like C.
Because there's development time gains there.

Smart. I just disable buttons ctrl and c for them.

alright,thanks.

that's when you reach the point the compiler doesn't know enough to be as fast as you.

Compilers are pretty numb to details like that. That's why Itanium failed, it relies heavily on code being aware of such things and the compilers didn't generate such code.

>SIMD
Should you write a 'vector' class for it with operator overloading?

(You) should use one that already exists.

No, that defeats the advantages of SIMD.

use intrinsics.

As far as I understand, the point of "structure of arrays" is that often when iterating, you don't need all members, so it will be more cache efficient to lay things out like that. However I also recall that CPUs have some cache usage prediction algorithms. Would SOA not counteract those?

Which one?
How?

daily reminder that your computer is not a fast PDP-11

oh I am well aware
makes me think honestly

From what I remember it had no out of order execution, no? Yeah, that means a compiler hickup can potentially stall your cpu for a very long time.

That's more for the instruction cache. I have never heard of a CPU that prefetches data except in contiguous cache lines.

>CPUs have some cache usage prediction algorithms
Called cache prefetching. Likely you're thinking of hardware prefetching.
>Would SOA not counteract those?
No why would it counteract them? More likely you've just made the problem trivial.
When you pack for cacheline efficiency you avoid unnecessary stuff being pulled in.
If you have two fields that aren't SOA but you use them both in all relevant cases that's perfectly fine. The problem occurs when you have data you don't use in the relevant circumstances being brought in with data you do use.

>SIMD questions
This was a great talk.
gdcvault.com/play/1022248/SIMD-at-Insomniac-Games-How
No, check 14:00 for an explanation.

It was VLIW. Basically it was expected that compilers would take care of ordering instructions for each execution unit.

In other languages is very hard build new constructions or new target lang, in lisp just build macros and every neckbeard autist end up own undocumentated version lisp.

Is writing SIMD by hand a silly idea?

What are some interesting learning exercises for Haskell and/or other FP languages? I specifically am looking for things that highlight the benefits of FP over imperative programming like C, because while I can just rewrite all these exercises like that it's obviously the wrong way to use Haskell

Operating system

If you're really pushing for performance, it's justified.
Video codecs often write SIMD-accelerated assembly by hand.

GUIs

define "by hand"
if you mean asm, then just asking that question means "no, not for you"
Rerwriting and restructuring codebases to yield better SIMD code via compilers is a huge area of research though, and frequently yields highly scalable distributed/parallel codebases.