/dpt/ - Daily Programming Thread

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

Attached: 1557948662567.jpg (1020x1020, 1.24M)

Other urls found in this thread:

github.com/JadeMatrix/SHOW
twitter.com/SFWRedditVideos

Programming a Remilia in Scheme.

Attached: 4b4f8ee0efb8e94611a0d57ed099f51e.jpg (666x1000, 91K)

LR(1) parser
got first sets done
woo
go me...

fixing everything that broke last time I did something

Attached: 1551320440997.jpg (224x225, 8K)

>not doing it right the first time

Working on a program that generates a random date within the next year and kills me on it.

Attached: 1529028700325.jpg (320x320, 18K)

Simple. It allows me to have a lot of animated grass on screen.
Traditionally foliage has been limited by the sheer number of draw calls, and with larger buffers to the GPU, the amount of foliage onscreen has been steadily increasing
But the foliage is static.
Without any proof, I claim that this is because no one wants to spend CPU time on cycling through grass animations.
But because developers use the engines they're given, they don't even think about offloading these animations to a separate thread because the engine works the way it's always worked--single threaded for the most part.

If we were to generalize and make every action of every kind parallelizable, then we create a tool that can be creatively applied to more than just animated grass without any additional effort on the part of the developers.

Procedural animation like grass is usually handled on the GPU, it's not an expensive effect. Grass is expensive because to draw good looking grass you need it to be alpha blended, and layering too many alpha blended things ontop of each other pushes the fill rate (not sure exactly what this is I'm not the best graphics programmer) too high and kills your performance. Nothing to do with the CPU. Most engines today are multithreaded and makes use of multiple threads for animation, animation is the part of game engines that parallelizes the best

Going through learn you a haskell for greater good

hmm if only there was a word for this kind of thing…

ganbatte

>videogaming

Post the date when you've made the program, I want to celebrate the death of a subhuman like you.

the whole point of a random date is so I don't know when its coming dumbass

In that case, another use case for things happening on-screen is entity-component-systems, which are a frequent topic for games that involve armies.
Really, everything was leading up towards this. A decentralized model where objects interact with each other using a graph is barely a step away from a data-oriented design.

But I'm not sure why we're focusing so hard on multicore. It's a side benefit of a natural model to express decentralized state that makes no assumptions about anything except that objects which influence each other should use locks on a multicore implementation.

hai, ganbarimasu

My dumbass company has been working on the same software for 30 years without a rewrite. How do I convince them to bite the bullet? This shit still has msdos artifacts.

overload the production server and blame the old code

Explain to them that their oldest engineers which are familiar with the codebase are nearing retirement and that you need to bring in fresher and cheaper blood while those old engineers are still around to explain how all this shit works.

sleep with you boss

Why hide the date from yourself? Are you this much of a fucking weakling?

Why is C so fat? In Jazzy if I want to return a byte array on the heap I just do
func =: @m[1 1 2 3]

In C this is
char * func() {
char * a = malloc(3);
a[0] = 1;
a[1] = 2;
a[2] = 3;
return a;
}

In real life you'd stick a dragon dildo up your ass.

Edgy

wow user you're a bad person

When I want to capture the current path in bash, why do I need to scream PWD instead of just saying pwd?

bash is like the sort of woman that loves to be abused

Read programming in Haskell

because one is an environment variable and the other is a command, meanwhile you're a retard

I see the summer kids found our secret hideout.

If you want intelligent discussion, try something a little higher level than "my hipster language is better than yours"
We're not all college frosh and I'd appreciate it if you didn't waste everyone's time on syntax.

Realtime things are rarely easy to parallelize and the speedup has to be weighed against the added complexity.
And regardless of generality, Amdahl's law puts a hard limit on how much of a speedup you can get in a sequential program regardless of your number of processors.

>my hipster language is better than yours
This is 90% of /dpt/ threads.

I claimed last thread that we're using Gustafson's Law, not Amdahl's.
Would you really put a hard limit on the amount of objects on a screen if you knew the player's system could handle more?

How rude

Attached: 0311DEA2-ACB7-4F53-8AA1-B053A2741F4D.gif (500x281, 124K)

Found a neat statement in Kotlin that I actually like, the `when` statement. I don't like case statements and this is easier than repetitive if statements. Neat!


when(value) {
1 ->
valueIsOne()
2 -> {
valueIsTwo()
whatDoIDo()
}
else -> {
foo()
bar()
}
}

Attached: when.png (561x610, 54K)

I thought it was a good question user-kun

you are a brainlet redditor trying to shit up /dpt/ with your gay memes and awful "takes"
>all languages are the same
>any language that you haven't heard of is "hipster"
>syntax doesn't matter

based

That is literally and objectively a case statement, and if you want to be an autist you could also call it pattern matching.

No, you miss the point. You're shitting up the thread with basic shit like "a = b + c is better than a = operator.add(b, c)"
No one fucking cares about your favorite implementation of l-values and r-values.

Try something like this instead:
char* func()
{
static char data[3] = { 1,2,3 };
char *a = malloc(3);
memcpy(a, data, 3);
return a;
}

>But I'm not sure why we're focusing so hard on multicore
Because single core speed isn't increasing so to maintain the illusion of progress we need to try and fit square pegs into round holes
In reality games are too complex to use one method of data modeling for anything, be it a scene graph or ECS system. Animations are embarrassingly parallel, physics is almost the opposite, game logic is a murky inbetween where you can keep trying to make it more parallel for more and more developer cost and less and less performance benefit

If reddit summershits are shitting up /dpt/ this bad I can only imagine how awful it’s going to be when the school year starts and the next wave of freshmen starts shilling their first language C and then we get to mock their undefined behavior with Satania memes.

Attached: 07002CD2-3DB4-4588-BA8A-37CA8347BFF1.jpg (681x384, 115K)

Stop pretending your homemade shitlang is an actual language, you almost fooled me a few threads ago

let a = sum b c

Anyone who brings up undefined behaviour is worse than the person they're mocking
It's the most boring and mundane programming topic imaginable

>That is literally and objectively a case statement
Yes, with a nice syntax.

This has literally nothing to do with l values and r values retard, not only have you proven yourself to be a redditor with poor taste in programming and in languages but also to know nothing about the supposed non-hipster languages with which you program

Did I convince you to use FALSE too or learn J for employability?

Attached: 6B0E5E1B-98C6-4783-A9C0-ADA3005C869C.gif (500x284, 1.75M)

Does your language automatically resize the array like a vector in C++? Can you actually do useful stuff with it?

I said almost

>redditredditreddit
If you're so obsessed with those retards, how about you go back there?
Get out of my face if you don't know what a Curry-Howard isomorphism is.
I don't care about your shitlang, I don't care about C, I don't care about any languages because they are all the same from a category theory perspective.

If you're going to bait people with shitlangs and hipsterlangs then at least have the audacity to bring up examples of NEW concepts that older languages have trouble expressing.

>Curry-Howard isomorphism
>category theory

Attached: 533.jpg (680x551, 38K)

Attached: 1558121844477[2].jpg (387x437, 41K)

imagining being both a braindead retard who is incapable of forming a good opinion relating to programming AND every C programmer stereotype of le ivory tower autist

It doesn’t have native vectors. It’s lower level than C. It can solve project eulers quickly and I made connect 4 in it so it has actual uses.

Imagine being so hurt about being told that your shitlang opinions don't matter that you've managed to stray off-topic from your shitlang all thread long.
You're so insecure.

I have a feeling you guys haven't read the 4channel CoCk yet. No bullying is allowed.

i'm not the dude who you were originally replying to. i get this is your first time off of reddit, but just because you can't downvote things doesn't mean you need to post these dumb replies telling everyone how much you don't care

user what is your definition of "lower level"

stupider

See, you're having a hard time understanding that you receive no insightful responses because your attempts at discussion are child-like at best, and I am trying to assist you in understanding, but there is something to be said about trying to teach the willfully ignorant

>let us discuss the intricacies of X programming language versus Y
>huh this syntax is too verbose for me
>well actually i think i prefer being more explicit
>NO YOU DONT GET IT THEYRE THE SAME FUCK YOU I ONLY CARE ABOUT CURRY HOWARD LMAO MEME LANG VS SHIT LANG LVALUES RVALUES HOW DARE YOU DISCUSS THIS IN MY ENLIGHTENED PRESENCE

>It’s lower level than C.
Doesn't sound like a good idea. If you need something "lower level" than C you use assembly.

It's one guy who pretended to make a language shitposting about it being replied to by another guy who thinks he's smart because he took a CS class

>intricacies

Attached: 1501986476967.gif (506x283, 3.43M)

Can someone tell me what are the best algorithms books around for a retard?

Attached: 68568686586848.jpg (1064x672, 492K)

Attached: remilia_sicp.png (1020x1020, 1.93M)

im programming a blockchain-based chatting app similar to discord, called peercat. im using rust, ruby, and js

How is rust for webshit APIs? Considering using Rocket for my next project.

i doubt he's even taken a CS class

>Curry-Howard isomorphism
>isomorphism
In what category?

endofunctors

ur mom

hask

Attached: devilish.gif (425x481, 1.51M)

"endofunctors" is not a well-defined category.

Assembly is too long.

endofunctors in what category?

No such category.

too long what

monoids

I am making a web front-end to editing foobar2000 playlists for a retarded reason. A component called beefweb already exists that does this and more, but it has I believe 755 dependencies in its yarn.lock file. Figured I didn't care to run that shit and just make a simple and garbage component without requiring node shit.

This is such an awful project but it's been fun figuring things out working with the foobar SDK, and the component code is almost done. Good refresher on C++ too since I might need to use it again soon. The HTML/CSS/JS is gonna be a pain in the ass for certain things I am sure.

Anyone else bothered working with the foobar2000 SDK?

My dad is a computer

Attached: dad.jpg (1200x675, 74K)

d-do you need a lightweight sepples webserver by any chance?

Careful what you wish for. If they do a rewrite, they will do a parallel one which is worse. They will try to keep backwards compatibility and support as much of the old stuff as they can so they can (supposedly simply) roll things over, but this never happens.

Read about this before you suggest anything, rewriting legacy software has consumed many hours, souls, and occasionally careers.

I decided to go with yhirose/cpp-httplib but I am willing to switch it with something else if there's good reason. Did you have one built you want to spread around, or just a recommendation?

Why is the C internet defense force more prominent during summer time?

why didn't you just let it be and leave yourself with some shred of dignity

monoids in what category?

endofunctors

yeah I have one, it's header-only too, but a bit lower-level than that one
it's a server only (may expand it to a client later since it's not much more work), and doesn't support HTTPS because it's supposed to be set up behind a reverse proxy you trust
github.com/JadeMatrix/SHOW

I’m hardly the only person on /dpt/ criticizing C. I use the language regularly and because of that I see its flaws. The people who defend C are strange and act like redditors or shills.

see

>Why is C so fat?
It isn't. It's a language that does very little for you behind the scenes. That means you've got control over the detail of what your program does, but you have to write the code to do it.

Or use a library, and you get to choose which instead of having to put up with the language's builtin runtime which might be OK or might be shit.
>Protip: in life, most defaults are shit

I don't see anyone defending C

I don't give a shit about that. People who use debuggers don't deserve a good debugging experience.

Thanks user, I'll look into it. I don't need it to be super high level, I just couldn't be arsed to set up things using Boost/Beast.
My component is meant to be access via the local network only as well so TLS support is not an issue. Client also does not matter in my case.

If you want a high-level language, C is not for you.
If you want a low-level language, C is about as low as you can go without becoming very annoying indeed.

Where are you getting these images user? They're so cute!