/dpt/ - Daily Programming Thread

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

Attached: 1541532591349.png (821x3109, 559K)

Other urls found in this thread:

google.com/');
github.com/DanilaFe/pegasus
youtube.com/watch?v=j6UoYi1EADs
youtu.be/cnaeIAEp2pU
twitter.com/AnonBabble

is there a way to make getch() non-blocking? working with pd/ncurses here.

Attached: 1533571913593.jpg (1440x1394, 700K)

Rust will soon be the standard for some of the C++ use cases.
But much of the enormous C++ code base still need to be rewritten for Rust

>inb4 Mozilla SJW cucks

Lisp is the most powerful programming language.

Why is this 2D girl so stupid?

>But much of the enormous C++ code base still need to be rewritten for Rust
isn't rust compatible with external C++ classes and functions?

she is smol, toaster bully her

No, you may be thinking of D. Rust only has a C FFI.

>D
a better c++, too bad it will never replace it

C is more compatible than C++
Also, using other languages' libraries kind of defeat some of the purpose of writing Rust code

i wanna put my pop tart in her toaster slot if you know what i mean

why would you put a pop tart in a toaster
that's dumb user

Attached: 1480528339096.png (1280x720, 448K)

nodelay(Window *, TRUE)

>he's never toasted his pop tarts

Attached: 1bdb73950576b0261104de217d9149981267042b5e2554d9e629293a0acef35c.png (640x640, 315K)

Attached: sleepy_choder.png (804x637, 64K)

surely those would be pop toasties

Attached: 1477076938213 (1).png (549x560, 258K)

Why do we even need more than one language lmao

There's something about category theory that I haven't been able to grasp:
How do you determine what is a good category for your use case?
For example, Haskell only has one category and it is the category of types supported by Haskell (???)
But why couldn't you say that Haskell has multiple categories, one for each type and that we have morphisms between categories, resulting in non-monoidal functors ad nauseum?

What are you even talking about lol

in c++ i'm creating a parent class that's supposedly need's to have nothing in terms of data, I'm very confused, what's supposed to go in the constructor?

it's not like there's only one category, it's just most interesting stuff in Haskell presently involves Hask
if you read type systems literature you'll see lots of stuff with different categories of types

nothing

You probably don't need a constructor for your base class. Or if you do (you don't) it can be an empty function.

You do know the category of categories is another category right, albeit a large one? The entire problem with Hask is that it sacrificed strict monoidality in order to be slightly useful. It's what happens when CS people pretend to know math.
Besides, why would anyone use anything more than a monoidal tensor (0,∞)-category for anything in CS? What do you think you'll accomplish? Go ahead, I'll wait.

Attached: smug_ran2.png (1000x1000, 495K)

we may not know category theory, but at least we're straight

you can do some nonsense calculation

thanks fine lad, i feel like a brainlet.

Attached: 1540868398886.jpg (247x326, 30K)

>but at least we're straight
That's a bad thing, straightoid.

Attached: smug_ran6.jpg (802x1240, 114K)

So what you're saying is that people can make different and almost arbitrary assumptions about the categories that Haskell "offers", and that literature around Haskell's categor(ies) merely involves Hask because it has convenient implications or is easy to reason about?

I don't even know what strict monoidality is.

>(0,∞)-category

Attached: 1541785187222.png (1073x535, 86K)

Shut the fuck up non-reproductoid

Attached: 1542143415262.jpg (360x360, 16K)

don't worry user, there is nothing wrong with being straight

No

Any category that has the required formal semigroupoid structure admits a natural surjection into to Hask. Hask is the "smallest" (i.e. bare minimum) such category and it is too large to be strict monoidal.
>doesn't understand the distinction between "can't" and "choose not to"
>what are surrogates
Yeah you're a CS tard alright.

Fuck forgot my smug Ran pic.

Attached: smug_ran.jpg (709x1063, 632K)

okay, what the fuck does this mean?
C:\Users\USER\AppData\Local\Temp\ccCVDUAE.o:closet.cc:(.text$_ZN11closet_itemC2Ev[__ZN11closet_itemC2Ev]+0xa): undefined reference to `vtable for closet_item'
collect2.exe: error: ld returned 1 exit status

>this pathetic response
>so worked up you forgot to avatarfag
absolute state of you
my kids will put a candle on your grave since nobody else will

>gets destroyed beyond recognition
>h-hurr p-p-pathetic!!!
>has the absolute gall to imply that anyone would willingly reproduce with his ugly ass
What did xe mean by this?

Attached: smug_ran5.png (529x735, 325K)

Go back to your /mg/ circlejerk.

both of you go back to

daily reminder that we are all friends who share a common interest

I am not friends with fascists.

oh, true, shun C++ users then.

Attached: 1541907660255.gif (500x375, 249K)

joke's on you I can't code. learning some html (baby's first attempt at writing)

that means C++ is retarded and instantiated the vtable in the wrong translation unit.

Probably an undefined virtual function. Post code.

Writing unit tests for my retro gaming library because I suspect palettes are not working consistently across all platforms.

would you like to be? I know some fascists, they're super friendly

I want hank to LEAVE

If they are antisemetic or racist then no.

hank is a very lonely person and needs /dpt/ for emotional support

Attached: DsBKxjsWsAAaLjx.png (796x1200, 578K)

Of course not. It's a common myth that all fascists are racists. In reality, fascism and racism have only correlated for a brief period in history. Treating fascism as ad hoc white supremacism is like doing the same to democracy because most democratic nations had black slaves at a time.

In reality, most modern political racism comes from libertarians and socialists. Modern fascists, however, have developed a meritocratic view and embraced people of all races, genders, orientations, and even retards and gypsies, as long as they see the truth that the will of fascism is superior and weak nations deserve to subjugated.

>developed a meritocratic view and embraced people of all races, genders, orientations
LOL

Use nix

Rust:
>C++ and C are insecure, use this memory safe language instead!
>80% of the standard library uses unsafe code

kek

>the intent is that as the programmer, you’ll ensure the code inside an unsafe block will access memory in a valid way.

So the exact same responsibility I have writing C++ already. Phenomenal.

Attached: index.jpg (90x90, 3K)

Type systems based on separation logic will save C++ users (from the devil)

Attached: Dqn6tP6UUAAdDfP.jpg (1000x1000, 59K)

>but what about rust users
can't be saved.

Attached: 12.png (300x100, 23K)

Going to make a switch from python to c++
what am i in for?

Have you read Dante's Inferno?

my life's already a inferno

>fascism and racism have only correlated for a brief period in history.
fascism only existed for about 10 years

Why is this:
while (j < Math.pow(10, l) && j < 1000000000)
Faster than this:
while (j

>fascism only existed for about 10 years
wrong.

educate yourself americunt lmao

anti-racism will only have had existed for about 100 years

I once went balls deep in c++ but ended up learning python instead.
what else should i go for then?

jogl is making me feel like a brainlet, maybe I should have learnt opengl with python

Common Lisp

> cat test.py
#!/usr/bin/python
import requests
r = requests.get('google.com/');

> python3 test.py
Traceback (most recent call last):
File "test.py", line 5, in
r = requests.get('google.com/');
AttributeError: module 'requests' has no attribute 'get'

> python3 ~/bin/test.py
Traceback (most recent call last):
File "/Users/username/bin/test.py", line 5, in
import requests
ModuleNotFoundError: No module named 'requests'

> which python3
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3

> which pip3
/Library/Frameworks/Python.framework/Versions/3.7/bin/pip3

> pip3 list
Package Version
---------- ----------
certifi 2018.10.15
chardet 3.0.4
idna 2.7
pip 18.1
requests 2.20.1
setuptools 39.0.1
urllib3 1.24.1

this is driving me nuts. any ideas? i've tried removing all versions and doing a clean install, but no dice.

A language that has a GC by definition cannot be better than C++ and cannot replace it.
D is not a systems programming language and is in a completely different domain than C++. It doesn't compete with C++ at all.

you can disable or even control it

I want to unit test with C but I have multiple targets. So I was thinking about using GNU Make for this. Here's the idea for my Makefile script:
1. Build the unit tests for every target. If the build fails...well there's the problem right there. This may take a while, not sure.
2. Run the unit tests for a couple of the targets. Unit tests will be executed by Make and even though the file will contain all of the tests, they will be executed by supplying a number from command line. This means ./unittest 1 will run a completely different test than ./unittest 2.
3. If the unit test fails on any of them, Make will error out on that test.
4. If the unit test succeeds, Make will succeed.

Please vary your images/characters and be mindful of art quality kudasai.

It's tightly coupled with the standard library.

Attached: 1542286376275.png (1920x1080, 1.7M)

Just got out of the military, so now I have my free time back and have gotten back up to speed in C and C++ and have learned a couple more languages for their utility (python, JavaScript)

I want to pursue my childhood dream of building my own programming language. I have to figure out how to transform my interpreter into a compiler. So I have hella reading to do. I am doing this for the sheer hell of it and just want to make it work.

God your taste is fucking shit.
Kill yourself.

>YOUR TASTE BAD
>MINE GOOD

Attached: index.jpg (300x168, 7K)

Redpill me on C#

spyware filled java clone

>NPC meme
Hey buddy fuck off.
>redpill
Hey buddy fuck off.

Only NPCs use NPC memes.

Attached: 1420601328038.gif (500x516, 152K)

Sure but no one uses the C++ standard library in a systems programming environment anyway. In both cases it's for application development.

Why might someone want to learn C++ in 2018?

What do you want to use it for? I never liked it. Used it way back when xbox360 had the xna framework to build games, but I hated how it manages memory with a garbage collector. Memory leaks out the ass if you have too much going on. It was pretty quick to get things up and running though compared to C++

bluepill me on NPCs

but your taste is bad
and his taste is comparatively good
the real npc thing to do would be to say all taste is totally individualised and there's nothing objective and all taste is somehow equal

Go back to /v/

How does /dpt/ prevent hemorrhoids while they sit and hack all day?

I get up to get more water every hour or so.

how do you get hemorrhoids? you have bad genes or something?

Fucks his asshole with a silicone cock and wonders why it hurts.

Because they want to work for video game.

Low level, faster than other languages. So, if you’re building a program that is only going to be ran a couple of times, the computer efficiency isn’t that important. Like say you were writing a program to analyze a data set. You’d use something like python so the programmer can get it written out quickly. But if you’re writing a tool that will be used frequently, like a software you plan on selling, you would want it to run as efficiently as possible so it doesn’t bog down the system. C++ is a good option for that.

Quit your job
Make Video Games

Attached: prometheus rising.jpg (194x259, 10K)

I want to make video games but I have to make my language first.

in the first while you're comparing THIS and THIS and in the second, just THIS.
so ya, it's slower

Working on a parser generator for C and Crystal.
github.com/DanilaFe/pegasus

I used it for a class assignment already, and it worked out pretty well.

He’s saying the second one is slower.

In the second one, you are subtracting one from I every single time the comparison is made which slows it down. It would be faster if you were to set a variable x = I-1 and then use x in place of I-1.

M E R R R Y
C H R I S T M A S

youtube.com/watch?v=j6UoYi1EADs

Attached: no smoking drinking eating.jpg (819x633, 175K)

>He’s saying the second one is slower.
youtu.be/cnaeIAEp2pU