/dpt/ - Daily Programming Thread

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

Attached: 72478562_p0.png (2508x3541, 3.72M)

Other urls found in this thread:

en.wikipedia.org/wiki/AI_winter
en.wikipedia.org/wiki/Halting_problem
twitter.com/AnonBabble

First for Erlang is for trannies, Elixir is better

C# tictactoe

A basic neural network

Woah! Cute Cocoa!

Hey Im working on that
actually im just wasting time texting a girl and browsing dpt

Should I learn Ocaml or Haskell?

>and it only happens exactly when you tell it to.
This is the only valid argument against GC, and in fact, the only reason why GC, as it is often implemented nowadays, is absolutely infeasible for hard real time applications.
Now, pay attention: REAL TIME means REAL TIME, not necessarily high performance, embedded, all the nice things LARPers like to spout without even understanding to impress zoomers. They are all different things.
The most important goal in hard real time applications is predictability: a certain task must absolutely be completed under a certain amount of time. We need hard guarantees.
Garbage collection, while overall much faster than it used to be, is still usually unpredictable and nondeterministic. This effectively destroys guarantees: a deallocation invoked at the wrong time may cause a tiny delay which causes a missed deadline.
That said, GC is bad for real time, but so is dynamic allocation in general, hence why it's often minimized. Sometimes, no dynamic allocation at all is used, not even stack allocation, everything is statically allocated. This avoids potentially running out of memory during allocation.
With that said, if your application doesn't have to support real time guarantees, whatever it is, stop being autistic about GC and make your life easier. Managing dynamic allocation manually doesn't make you smart, also because, as I already said, applications where it actually matters try to use it as little as possible anyway.

c++/c#/Python is where the money is

Haskell. OCaml is ded.

But I'm rich already, I want to learn a functional language because they look interesting.

oh and SQL

If you're used to imperative programming you might find OCaml as a nice intermediate language before learning Haskell. If you already know C#, F# is a (crippled) analogue of OCaml.

[^file: "]([A-z]|[/:.])+

gib som money :((

I fucking hate concurrent OOP

It is a pain in the fucking ass to find even the simplest bugs

b-but jane street

that's where you're wrong, kiddo

Then go back to playing in the sand and banging rocks together with the Fortran faithful

Just making some scripts for automatic VPS backups, with Yandex.Disk REST API

Attached: meta.png (732x580, 33K)

is SQL really considered, professionally, a "language"? i thought it was just something that every programmer working with a database (i.e. most programmers) should know

i mean what else is there to know about it other than how to query a database?

Why do so many people want to get into artificial intelligence?

Attached: Haskell karen.png (1280x719, 818K)

hype and money.

a lot of unexplored territory and tons of new opportunities.

lack of intelligence

People are in love with the idea of recognizing images because they think it will lead to general intelligent ai

You can make a lot of money by p-hacking your papers

en.wikipedia.org/wiki/AI_winter

AI has been mostly a joke for an entire century. Now, with the conception of neural network, support vector machines, and other tools which have demonstrated actual solutions to long-standing problems, AI is making a comeback.

This is the decade of AI. Not much else has accelerated this quickly since 2000.

many people can't get the gf of their dreams

You're right for databases up to 10k records in size.
Above that you have to get into some crazy optimizations and abuse the potential of obscure SQL functionalities to their maximum extent in order to get a result in acceptable time.

I mean, if we are going to be super pedantic, SQL technically is a formal language.
By no means is it a general-purpose programming language, though.

wouldn't that be part of db design though? like normalising and refactoring the data? i don't think improved response time should be primarily due to the query, but i don't know shit other than how to do joins and selects.

It's mostly because people are much smarter these days and I say this unironically. If you go on Linkedin and look at Master's/PhD students at say... Stanford or Caltech and scroll down to their 'publication' section, there's a ton of stuff and most of them are in their early 20s.

This.

Attached: alicesicp.jpg (480x640, 80K)

Async and multithreading were a mistake. I want to go back to writing code that just fucking executes in a predictable fashion on a single thread.

About Haskell or in general?
So I guess Haskell just isn't expressive enough considering the amount of shitty hacks that use Template Haskell.
Template Haskell not being as bad as C++ isn't much of an achievement and considering that you'll constantly run into it if you're actually using the haskell ecosystem, I don't get just handwaving it.
Use the FFI and it should instantly become evident that absolutely nobody cares about it. It's genuinely one of the worst FFI I've ever seen.
GC will always give you trouble for real time systems, but Haskell's GC prevents you from using it in any situation where the latency spike caused by major GC is unacceptable and it (at least theoretically) doesn't have to be this way
Base isn't great, but it's pretty small and moderately easy to ignore.
That just means you don't know much about them.
Unless you count extracting a program from a proof assistant like Isabelle, there is no way to fully verify a program without dependent types.

People have peaked in their 20s in mathematics and computer science for a LONG time. This is nothing new.

When you flip a switch in the program, and instead of stuff happening an event fires off that notifies five different things who all fire off their own things, and they all seem to be working individually but nothing works that's not normal

Template haskell is a bad joke that nobody really uses.

I/O multiplexing is the solution, at least for the programs where it makes sense to be structured that way.
Multi-threading should only ever be used for programs performing very expensive computations, and should only be used in a job pool. If one of your threads has a "main loop", you've fucked up,

Attached: 61646126_p0.png (1462x1934, 1.45M)

>Async and multithreading were a mistake
It seems to me that this is a ridicolous combination. IO is at least 10000x slower than any CPU computation you could reasonably do. Any N-core speedup would be noise in comparison to that.
Async IO should be single threaded for simplicity. Debate me.

Is the purple book as good as people say it is?

Attached: 1560486558569.png (1920x2443, 1.58M)

Just use pen and paper you dumb zoomer.

Attached: Edsger_Wybe_Dijkstra.jpg (1200x1600, 799K)

if they had to go back many years ago with the knowledge they have today they couldn't just replicate that work in due time because most the libraries they used weren't even being developed. then there is the computational power etc. someone who barely knows how to program can make really powerful and useful programs pretty easily with a lot of the libraries and advances available today.

>I want to go back to writing code that just fucking executes in a predictable fashion on a single thread.
async/await allows you to do that,

it's okay
could be a lot better and shorter
but it's okay

Is Dijkstra the Euler of CS? It's hard to believe a single man made so many contributions to a field.

I'd go as far as to say that Dijkstra is also the Newton of CS for the _influence_ of his ideas too.

Books are bloat. Just read the doc lmao.

It confounds me to no end

Attached: 1559857519934.jpg (900x944, 57K)

Attached: file.png (960x724, 427K)

not to talk shit about him or anything but he was in the field when there was alot of low hanging fruit to pick
if he didnt discover those algorithms someone else would have

that picture is too optimistic, if you had enough water you could extinguish the sun

Please refrain from posting low-quality Facebook/Twitter memes on /dpt/.

and what is the alternative anime girls holding books?

Correct.

better than black twitter jokes

That's true but then again almost every "polymath" type person (somebody whose contributions span widely) was around when fields were in their infancy. There isn't going to be somebody as prolific as Euler in traditional fields any more.

I think Thomas Young might be the last person in history to be an actual polymath unless a bunch of new fields suddenly emerge.

Half naked anime schoolgirls potentially holding books

i'm not sure polymath means what you think it means
it just means you're skilled in multiple fields

Come on nigga thats funny.

>when fields were in their infancy
this
the low hanging fruits are no more

Actually yes

Attached: monika.png (849x1200, 1.2M)

The last time I tried to use async/await was in JS. It never worked and made me want to kill myself. Maybe that was just another "JS is fucking retarded" thing though.

there are, just not in science and engineering at the moment

Except, you know, tons of libraries? Even just using something like lens will force you to come into contact with it.
It's decent and by far the best Haskell book/Haskell learning resource, but it's not 'one of the greats'.
Are you genuinely retarded or just arguing in bad faith?

Yes I know, that's why I put it in quotes. What I mean is the days of an individual making contributions to physics, chemistry, biology, geography, mathematics in one lifetime are over. You need a lifetime of specialisation just to get anywhere now because of the accumulation of knowledge.

Oh and I think that Mandelbrot might actually have been the last polymath not Thomas Young.

does art count or does it only apply to science?

The problem is that most people who contribute to multiple fields within the arts do so because their fame and reputation in one area allows them to expand to other areas, and furthermore, their achievement in one area "primes" us to think they are good at other areas too.

Example: musician gets famous, becomes actor, we think he's a good actor because we like his music.

Art hasn't been nothing but nepotism the last 150 years

Are there any books or resources that touch upon function overloading in C++ in detail? Like, candidate vs viable functions, etc.

Multithreading is irrelevant when doing async IO. Prove me wrong.

Try cppquiz for pedantic shit like that

Multithreading is irrelevant when doing nearly anything

Is there a program that you wish existed but it doesn't exist?

I will literally build it right now. I have the whole summer off.

I agree with that aswell. I am convinced it is this unnecessary complexity people add to their software, simply because they can.

the opposite is true. Water contains hydrogen, which is more fuel for the sun

what if you had a whole solar system full of water

Zoom harder.

woah you're playing bug now huh
well I think the huge gravity would make the water collapse, break the water molucules and cause a gigant star or potentially directly turn into a black hole

Any form of cute anime girls is allowed. It helps to keep the quality of these threads up.

Attached: 68882807_p0.png (1825x1930, 1.23M)

>want to break a loop depending on enum value
>want to use switch
>breaks just the switch

Attached: schopenhauer.jpg (1024x768, 117K)

A program to determine whether an arbitrary program terminates.

labelled break

Add pthread support to TCC perhaps

but user, that is impossible
en.wikipedia.org/wiki/Halting_problem
use goto

Don't be so pessimistic.

Thanks, I'll give it a look

A C++ implementation of path expressions for concurrency control

Hamilton way calculator

Shit language held by a shit girl in a shit game

it's also a shit picture

Modern scientific computing disagrees.

notice it says nearly anything and not anything

you're hitting levels of wrong that shouldn't even be possible

t. Emacs dev

How do you overcome programming burnout /dpt/?
I keep procrastinating watching yt, playing games and lurking ibs, and barely can write a few lines a day. Need some help please.

Attached: programming-burnout-670x335.jpg (670x335, 62K)

exactly user

It's great for finding primes
One thread checks the odd numbers, the other thread the even ones, it doubles the work

multithreaded text editor? are you serious?

listen to music or read a book

Bite me.