/dpt/ - Daily Programming Thread

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

Attached: 1544465403005.jpg (1302x1500, 453K)

Other urls found in this thread:

en.wikipedia.org/wiki/X86_assembly_language
en.wikipedia.org/wiki/X86_instruction_listings
learnopengl.com
khronos.org/registry/vulkan/specs/1.1/refguide/Vulkan-1.1-web.pdf
github.com/3b/cl-vulkan
twitter.com/NSFWRedditImage

Thank you for using an anime image.

You're welcome.

To answer my own question:
I'm continuing to work on my Wayland compositor.

Attached: 1539486739799.jpg (317x574, 35K)

Is it true that the more gay you are the better you program? I'm starting to believe that is the case. Rust was made by gays and trannies. C was made by a closest gay. My two fav languages, both commonality - gay.

OP does not love lain, do not thank him.

You bastard.

Attached: 15142219025850.jpg (1920x1080, 264K)

>next generation proprietary memory allocation techniques.

Attached: 1544573070054.png (699x701, 269K)

Where is the benefits of your "next gen"?

>Using only stack auto memory
Is this what is meant by new gen?

...

please do not post pictures of my wife
thanks

>Tasked with improving an ancient codebase
>For loops are abstracted behind define macros
>Those define macros are often referred to in other macros
>Those macros often are nested inside other macros
>This process repeats itself so much there are entire macros dedicated to representing certain chains of other macros
I'm gunna fucking kill myself.

You keep bumping that thread and I still don't know what you're on about.
20 words or less bucko

Attached: 1514060155790.jpg (330x337, 20K)

And how does that differ from other GCs?

Good. Lain a shit and only retards like her.
She is not cute at all and her show was trash.

>Tasked with improving an ancient codebase
what's the job *really* about?

I'm interested in learning assembly where do I start?

not much to learn, pal

no, and lain was Jow Forums long before you got here.

Literally that. I did my MSc Thesis on loop chain optimization so I got hired as a project contractor to make a major application run more gooder.

Where should I begin with the little amount that there is to learn then

google nand2tetris

so go make some optimizations, champ!

how much are they paying you? probably not worth the time..

which assembly?

>lain was Jow Forums
Jow Forums has shit taste so that makes sense.

I'll look into it.
I suppose x86.

Idiot

I intend to, I just have to unwind the byzantine nightmare that 30 years of biologists have created.
I'm contracted for a year initially at 138k with potential for bonuses depending on how much improvement I can squeeze out. It's very worth the price tag. Plus I won't have to work for 5 years afterwards if I don't wanna.

en.wikipedia.org/wiki/X86_assembly_language
en.wikipedia.org/wiki/X86_instruction_listings

whats wrong with that? its not genuine asm but you could just as easily do it in it. you could do it in any language you wanted.

Working on my site: xefig.com
I'm finally at a stage now where I can start adding features and plugins, as the base part of the site is done.

there should be a way to get the code after preprocessor macros

why does no one like Florida?

you're a shit

Attached: tk lain.jpg (1920x1080, 413K)

It fucking sucks there. Don't move there. You'll be surround by idiots there.

why are some of the most widespread C style libraries typically so fucking crap
It isn’t actually C’s fault despite its age, vulkan’s C API is so nice, expressive, and self documenting i didn’t realize the examples I was reading were C and not C++ until I read someone criticizing that specific tutorial

whereas every other C style api/library i have had the displeasure of using is not just clunky (which is forgivable and sometimes preferable) but completely inexpressive and vague.

Like how they usually handle errors, instead of using something with a nice interface or even a C implementation of something like a monad they just use excessive amounts of magic numbers and macros.

I always knew that there was nothing actually wrong with C even if it was old.
I didn’t know the problem was with C programmers.

but aren't you from there?

I am also gay

>from there?
No, I'm from Virginia, and I moved back. I was in Miami for almost a year. It was okay, but Florida is still Florida. It was a lot more lax, but man, I was surround by stupid and ignorant people. I was constantly getting pissed off. I almost got into a fight with some homeless retard over nothing.

I fail to see the relevancy between a state and my site.

>Registrant Name: Moniker Privacy Services
>Registrant Organization: Moniker Privacy Services
>Registrant Street: 2320 NE 9th St, Second Floor
>Registrant City: Fort Lauderdale
>Registrant State/Province: FL
>Registrant Postal Code: 33304

Reminder that C programmers don't actually give a shit about performance and efficiency.
Everyone who does and doesn't have a dildo up their ass uses C++.
(The ones who do have a dildo up their ass 24/7 use rust).

the hell is this

Attached: xxx.png (843x597, 16K)

How do I make the botnet?

Whoops! I fucked up the theming! O_O

...

Lol, that's just to mask information. kek "Moniker privacy services." Namecheap has a similar whois protection service they do free now.

>Reminder that C programmers don't actually give a shit about performance and efficiency.
Not that's not true. Though C++ makes OOP a hell of a lot more easier. Seriously thinking about making the switch. Not sure if I want to invest the time to learn all of the type qualifiers and some of the paradigms C++ has to offer.

C errors have always been a mix of different styles, none of them good.

>the errno/lasterror style
>error return code, return value in parameter
>setjmp garbage
>callback on error
>just dump warnings and errors to stderr
>some abstract error type which tries to abstract all this shit and even implement Maybe but is slow as shit and tedious to use

Which one does vulkan use?

>68888889
so close

Old retards from out of state retire here because of the heat and no state tax and make life living hell.
The only time florida is bearable is the time shortly before, during, and after a hurricane.
They all all leave, and all you’re left with are the rather nice people who actually live here.
The out of state retards are either so dumb they don’t know Florida has really fucking good building code so hurricanes do fuck all, or they're massive pussies.

Also besides the cubans who are fine, putting up with hispanic people can get irritating especially when they don’t even try to speak english.
Oh and organized crime, general weirdness, and constant road construction.

t. florida man

C++ zero overhead deterministic exceptions proposal is literally the best error handling method.

the beach seems nice

Attached: xxxxxx.png (893x505, 759K)

>Also besides the cubans who are fine, putting up with hispanic people can get irritating especially when they don’t even try to speak english.
I'm Peruvian, so I actually fit in well in Miami. Wasn't a problem, it was weird that I could completely get by in Miami by only speaking Spanish.

>Oh and organized crime
Never saw any of that.

>general weirdness
True dat.

>and constant road construction.
Holy shit, it seemed like nothing got done construction wise. Funny enough, I lived like mile away from that bridge collapse in Miami, a few months ago. I used visited that very campus every day.

which language is good to make a script to gather metadata from an image?

Thanks for the report - I completely forgot to check the registration page! -_-

sh

Python, look up PIL.

The entire selling point of C at this point is it's FAST.
This, combined with it being REAL fucking old, means that the generally accepted standard of C is pre-2000s for interop with massive, still-used-today legacy codebases.
This means no nice modern features can be included or used. Which means error codes have to be defined based on the function.
-1 is *usually* the safe bet, but sometimes it's NULL depending on what you're doing. When you build a library/API, you get to decide what an error is. This leads to huge variations and inconsistencies even within the API itself, and there's really not a good fix for it.

It's not the fault of C programmers, it's more of a consequence of the age of the language and the desire to stay fast and usable. Returning "some value that should be checked" is WAY fucking faster than using any kind of interface or any implementation of error types or monads or anything.
C want go fast. C need go fast. Get rid of fast, why use C?

Huh, I never looked closely at the registered office of my DNS provider. I'm a good few thousand miles away from Florida

>xefig.com
already saw the fix. nice.

what is infolinks.com doing in your site? based ublock origin

Reasons not to use Rust?

Lisp is the most powerful programming language.

Didnt thought in sh, somebody recommended me exiftool

Borrow checker

Attached: 33.png (1143x609, 54K)

i wanna fug mikoto

english?

Well, gotta fund the site somehow... I'm trying out infolinks as a possible advert source. I'll probably go through a bunch of them before I find one that I'm happy with: not intrusive, but does the job

Can any C++ guru tell me how to specialize bar? Yes it's homework, but I just can't get it.

template
struct Foo{
template
void bar(){}
};

That’s part of one of vulkans best features and it’s complicated to explain because I’m pretty sure validation layers are a completely separate thing that are just enabled but not actually exposed by the C API. I don’t actually know.

Vulkan is so explicit if you make an error, it just won’t work, and if it doesn’t work in a final application you could apparently crash the driver.
Vulkan layers are things that intercept code being sent to the GPU and do something to it.
The standard validation layer library adds safety to the development environment and very detailed debugging.
In other words, if you want your renderer to work, you can’t make mistakes, but diagnosing the mistakes is extremely easy for a developer because the information the standard validation layers provide is so detailed.

take this with a pinch of salt because I’m new to vulkan

That's it? I gladly accept the borrow checker if it prevents me from shooting myself in the foot like I would do in sepples

i agree, lets hope it makes it in by 2023

Are there any good books/guides to Vulkan?

Like going from little knowledge about OpenGL to full grown Vulkan experado?

template
template
void Foo::bar(){};

something like that i think. dont remember exactly if it can be done with 1 template

In Python, how can I make nested dictionaries interact?

>program reads data from two CSV files, one for bank accounts and one for bank account transactions
>got the first half done of reading the files and assigning everything into lists
>supposed to perform operations between them now
>don't know how to make the two lists "interact" with one another

For example: both lists contain dictionaries which both contain an
"account_number" field. I'm supposed to match them up and execute the
transaction, modifying the balance of the original dictionary entry.
No idea how to actually use the dictionary keys as the variable
though

(Yes I know I am a brainlet. I’m learning)

Attached: 7DF17D9B-4695-4654-9F03-CE6E772DE2AE.jpg (307x462, 22K)

This is a really good book on rendering with opengl. It’s also recent (2017).
learnopengl.com
After you understand that vulkan really isn’t that hard at all.
In fact I’d say it’s easier to understand and learn vulkan than opengl, it’s just a fuckload more work to actually use it at the beginning whereas opengl is quick results.
That does not apply to memory management, that’s the hard bit, GPUs are complicated.

Also you don’t have to deal with 500+ manufacterer and OS extensions all loaded in different ways for non-core features.
From what I remember from the specification, I think there’s like two pages of them in rather big font and most are official khronos group ones and the rest related to smartphones.

Is there an official Vulkan only guide? I went through most of that learnopengl site

#define MAX 1024
char s[MAX];
int dp[MAX][MAX];
int len;

int f(int n, int k)

{
if(k < 0) return 0;
if(n == len) return (k == 0);

if(dp[n][k] != -1) return dp[n][k];

if(s[n] == '(')
return dp[n][k] = f(n+1, k+1);

if(s[n] == ')')
return dp[n][k] = f(n+1, k-1);
return dp[n][k] = (f(n+1, k-1) + f(n+1, k+1)) % 301907;

}


How to do that iteratively? Should I build a binary tree? I do fairly understand the recursion if I draw it, but iterative solution does not come up in my head. Thoughts?

Attached: 14985584441790.png (811x480, 132K)

The book would be thousands of pages long. Just read examples and reference the docs.

There’s a readme in one of the khronos group’s vulkan related github pages that has links to tutorials they recommend.
I can’t remember which.

wtf, that just gave me full blown AIDS.

Here's the quick reference, enjoy.

khronos.org/registry/vulkan/specs/1.1/refguide/Vulkan-1.1-web.pdf

Is it possible to do Vulkan in Common Lisp or does it need to be a C language?

Attached: 1463696945268.png (396x400, 25K)

Google common lisp compile to C.

Any language worth a shit can call C functions, which is why every important library uses a C interface.
Also, stop posting your stupid gay frogs/

delete this

>CLiCC
I thought you were going to refer me to ECL at first. How does CLiCC compare to SBCL?

Wait I just remembered the SDK does come with a step by step walkthrough, though I think it ends at hello triangle. There were also some miscellaneous walkthroughs in there.
Getting to what is normally the first step in learning a graphics API doesn’t sound like it actually gets you far, but it does.
Vulkan is all about the setup, it’s bottom heavy.
You can barely change anything at runtime.

Not him, but then why does C get shit? Also, frog website.

idk, I don't use gay-ass lisp.

Attached: pepedator.jpg (499x499, 120K)

github.com/3b/cl-vulkan

>Partially done
>last commit: 2017

it's dead jim

keep it in c my [racial slur]

I still don't see the point of Vulkan when OpenGL4+ works just fine.

I've been given the task to make a windows desktop application which launches another program, uses a database for saves and player profiles, eventually will use a web service. The company treats me like shit with below market pay so I'm looking to get some job security and ask for higher pay... I have as much time as I need to develop it. What are some less common C++ desktop frameworks or techniques you'd use in my position?

I'd use Java 11
and sqlite

Why do all these web api deal with json parsing and all that garbage? Associative arrays containing associative arrays of associative arrays of arrays of strings referencing other associative array members.

It's completely nuts. I don't understand why this became a thing. What's wrong with a nice header and a block of binary data? It'll get you what you want quicker and it nests just as well.
I also hate how they're completely in love with json aswell. It's not 'nice' that what you give one label or position in an array can have any type. It implies the client has to untangle your mess. Which usually implies figuring out a canonical way of representing the garbage you gave them or having infinite branches and code duplication. There's good reason why file formats that stand the test of time don't have a header with a textual format.

...

>Why do all these web api deal with json parsing and all that garbage?
Because they're meant to be consumed by javascript, which can parse JSON natively.

Because webshits don't deal with languages that handle binary data well. It's always some unpack-like shit interface, stored as a dynamic value that isn't the same of size as your field.

javascript has no means for binary parsing of data.

What's the nicest human-readable text based file format for structured data?