/dpt/ - Daily Programming Thread

Last thread: What are you working on, Sup Forums?

Other urls found in this thread:

stackoverflow.com/questions/29791031/what-happened-to-libgreen
asahi-net.or.jp/~cs8k-cyu/
github.com/rollbear/variant_parse/blob/exception/calculator.cpp
twitter.com/NSFWRedditVideo

stackoverflow.com/questions/29791031/what-happened-to-libgreen

Lisp is shit. Prove me wrong.

indexed monads

i can't because it is shit

prove yourself right

is there something like wcswidth for utf8 stored in char arrays?

Is it possible to make a hyperbolic rendering engine?

Yes. boost/locale/utf.hpp
it has a utf8 decoder working with pointers. from it you can deduce length.

>thinks his arbitrary subjective opinions warrant consideration
Don't use it if you don't like it, user.

C++20 is getting template lambdas.

// generic lambda, operator() is a template with two parameters
auto glambda = [](T a, auto&& b) { return a < b; };

// generic lambda, operator() is a template with one parameter pack
auto f = [](Ts&& ...ts) {
return foo(std::forward(ts)...);
};

It's spelled J A V A dummass

That's pretty
std::cool
XDDDDD

I can only think of two ways to run a program on startup. Any other ways to do that?

1. Add a registry key on Run or RunOnce keys
2. Place a shortcut on Startup folder (appdata)

cool when is it getting fast delegates though
yeah. groovy baby

Gay shit, we already have auto lambdas.
(yet we don't have auto in regular functions except as a g++ extension? dumb shit)

Which means now C++20 lambdas are the first syntactic structure in C++ to use all four brace types: [](){}

c++ is the greatest language of all time

=[](,&&){;};
= [](&& ...) {
::()...);
};

I want out of this nightmare...

>all four
You wait until C++23

what's place best website/platform to learn exactly how to program, right down to the core?

guess they'll go full «french» for c++2x

there are way more than that on a microsoft windows operating system. scheduled tasks, services, dll apinits, windows explorer hooks.
you have a ms tool sysinternals autoruns that checks many vectors of code execution at startup.

Templates, use more templates.

kek
and (people (complain (about lisp)))

auto lambdas literally do use templates, just without the syntax noise.

C++ sucks

I wish there were something like C++ except good

its opens new ways of artistic expression. c++ could get its own ioccc contest.

Rust
*runs away*

You need to go through the motions. Stroustrup says you have to.

>c++ could get its own ioccc contest.
I'm shocked that it doesn't have one. It has a lot more potential there than C.

Danke, I'll start looking up what those are.

t. brainlet

>openly declares himself a brainlet
At least you admit it.

Has many good ideas, not as mature or flexible, borrow checker a shit.

uh
maybe D?

D or just straight C.

>recommending meme language with no future
D has been around for TWO DECADES and no-one has used it to develop anything relevant yet.

Freeware games.

All true, except for the borrow checker. The idea is nice, but it's way to conservative. Non Lexical Lifetimes will ease those restraints though.

>a n y t h i n g
>r e l e v a n t

I don't want it around at all. Unless I can put a whole module in an unsafe block I don't care.

games made by this japanese guy. pretty nice actually. nice to see the website still up.
asahi-net.or.jp/~cs8k-cyu/

>responding to retards who think their unspecified and subjective opinions about what's "relevant" are an objective criterion

"freeware games are not relevant" is not a subjective opinion

Fair enough. You could put everything in an unsafe block, but that defeats the purpose of Rust.

It is a subjective opinion, but your IQ is clearly too low to tell the difference between the fictions in your mind and external reality.

oh boy more anti-objectivists
are you an atheist too buddy?

>he doesn't exclusively use exceptions for his control flow
What's that user? Too much of a brainlet to handle proper abstraction?
github.com/rollbear/variant_parse/blob/exception/calculator.cpp

Not for me. I want C++ but with more sensible fundamentals and fewer retarded accidents and hacks.
When I can tell the borrow checker to fuck off completely, I'll be happy to use Rust.

C++ but unironically

>throwing a char*
d-does this work?

>anti-objectivists
You're the one who has something against objectivity. You're the one attempting to redefine what objectivity means to align better with your subjective opinions. I can tell the difference between external reality and my opinions and live with it, unlike you, sweetheart.

Of course, but it's probably a const char * and not a char *.

Is Laurence Fishburn white, Sargon?

...

He's not throwing chars but C. The only requirement is you need to be able to construct the object from your throw expression, the type gets inferred (with no cv qualifier).

That's all? How come no-one wrote a high-integrity RTOS in D that's used in critical systems yet? I thought it was a systems programming language?

C++ devs in a nutshell

You could write an RFC to propose an opt-out from the borrow checker, but I doubt they'll accept it. The borrow checker is their pride and joy.

pic unrelated: none of them use C++

Yeah you can throw absolutely anything, it's allowed, just unusual

You sound like you're having some kind of mental breakdown at the revelation that what's "relevant" to you may not be relevant to someone else, and vise versa.

Just tried it, it only matches char const * and not char *

I had no idea you could actually catch things that didn't inherit from std::exception.

Dude, pattern matching, lmao.

>words are a part of local cultures therefore all facts can only be subjective opinions
woah so this is the power of scepticism... thanks i'm a radical rational centrist now, thank god i don't have to have any views on anything
clearly there are no objective facts like "freeware games are not relevant"

You can even throw and catch int.

How is the runtime able to know if a handler exists for the type of a thrown primitive?

exceptions = teleports behing you and object space time travel

>What's that user? Too much of a brainlet to handle proper abstraction?
That's a retard-tier use of exceptions, but his use case reminds me of a parser I wrote once for a context-sensitive grammar that used try-catch to try all possible paths.

>his "arguments" devolve into outright hallucinations
Looks like the realization about your nigger-tier IQ is really shaking your psyche.

RTTI. The C++ implementation sticks a type tag on throw sites and on catch sites and sees if they match afaik

>realization
>-tier
>post about IQ
>psyche
unintelligent post, you can do better than this

Idris is a good language.

>retard-tier use of exceptions
btrainlet spotted

Why are modern programmers so bad? My computer back in the mid 90s was faster and more responsive than the garbage software we use today.

>durr u dumm because i don't like this word
>iq dont reals
Unintelligent post. You can't do better than this.

it's a good language if you enjoy masturbating to types

I used to be a competent full stack web dev with PHP, MariaDB, HTML, Vanilla JS and CSS.

After 2 years writing some shitty propriety language as a software Dev with only other exposures being bash and powershell...What should I do?

What language should I pick up and get a new career with because I really am not enjoying my job anymore, it was interesting at first, learning the language, finding issues and fixing the compiler (written in C) but I just do large projects in their own language and its fairly boring, I am underpaid and last year was not given any room for salary negotiation (Everyone just got the same standard pay raise of 1.2% (Inflation was 2.7%)).

Should I go back to webdev picking up some 'flavour of the month' JS frameworks or go for a software language like C# or Java as they are more common.

>price is what the market will bear
>lagginess is what the market will bear
there ya go
the much wider demo (i.e. normies) nowadays put up with much laggier software

>tfw no good rule 34 of cute 2d anime anthropomorphised types

Is that what typelets think Idris users do? More evidence that typelet implies brainlet.

>2 years writing some shitty propriety language as a software Dev with only other exposures being bash and powershell
great job allowing them to push you in a career dead end
go for c#/java pajeet shit, it's less of a wild west than the cowboy "full stack" webshit

rust is not for you

Want to know how I can tell that you're a poor programmer?

show me a high-throughput ACID SQL database engine written in idris that performs better than MSSQL or PgSQL

>Want to know how I can tell that you're a poor programmer?
Spoiler: because he doesn't share your cool opinions.

>But how to flip the bit from high to low and low to high??
>I know I can just check whether the bit is high or low and call the appropriate function, but it seems extremely inefficient
void set_high_low(char * data, int loc){
if(loc > 7 || loc < 0)
return;

*data = (*data & (~(1

Well, that too, but principally because he admits that he's not good enough to use the full power of C++ and yet thinks he's good enough to program in Rust without the borrow checker.

Can't it just be *data ^= 1

>he admits that he's not good enough to use the full power of C++
Who exactly is "good enough to use the full power of C++"? Not that C++ is remotely powerful, but who exactly remembers all of its retarded rules, and is able to deduce from them what is possible in C++?

>who exactly remembers all of its retarded rules, and is able to deduce from them what is possible in C++?
Mid-level programmers.

I had to reread how XOR works.
You're completely correct.
I was concerned that 0 ^ 0 might produce 1.

C++ is amazingly inexpressive considering its complexity. Memorizing the 5+ different ways to initialize an object, how they interact and why they exist is not exercising the full power of the language. It's learning where the mines are so you don't tread on them.

this

It is worth it, for when you need those 5+ ways of initializing an object, they will be there.

yes, it's really necessary to have


T x { ... }
T x = {...}
T x(...)
T x = T(...)

>Mid-level programmers.
I guess "mid-level" C++ programmers practically don't exist, then, because I could ask you a dozen simple questions and watch you mumble and hand-wave as you slowly realize you have no idea how to answer them.

Go ahead and use a more limited language then, kid. Just don't say I didn't warn you.

We are but apes scrambling around in the dirt before Bjarne's monolith.