/dpt/ - Daily Programming Thread

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

Attached: 1551584821194.png (960x1340, 2.72M)

Other urls found in this thread:

stackoverflow.com/questions/310974/what-is-tail-call-optimization
twitter.com/SFWRedditVideos

Cute!

That's a very cute programmer. What language does she use?

C++2a of course

Are you a python dev or are you a jobless boomer??

I don't take people with jobs seriously.

>sick
>tired barely keeping eyes open
>need to program
tasukete kudasai

Attached: 1445834971284.jpg (512x600, 222K)

im confident you can do it fren
also get well

Attached: 6410716802723d039a8a7703d3574ddf.gif (500x481, 1.87M)

>Compute the sum of absolute differences (SADs) of quadruplets of unsigned 8-bit integers in a compared to those in b, and store the 16-bit results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). Four SADs are performed on four 8-bit quadruplets for each 64-bit lane. The first two SADs use the lower 8-bit quadruplet of the lane from a, and the last two SADs use the uppper 8-bit quadruplet of the lane from a. Quadruplets from b are selected from within 128-bit lanes according to the control in imm8, and each SAD in each 64-bit lane uses the selected quadruplet at 8-bit offsets.
Why is this an instruction? How many ridiculously specific instructions like it are there?

Attached: 140804488.jpg (1536x864, 473K)

Drugs make you a worse programmer.

Attached: 1544626503027.png (745x1304, 67K)

Can someone just please straight up tell me how the fuck I'm supposed to get new values into a list in Clojure if the list is immutable?

(def nums [0])
(doseq [i (range 0 10 2)]
(conj nums i))
(println nums)


^ I need this create a list that has the number 2, 4, 6, 8, 10 in it.

Please don't say recursion. I tried recursion in a real example and got a stack overflow because it can't handle more than few hundred levels.

good luck with that

What language would you use if you were programming a mars rover?

C and design by contract.

How do you think? You can't change the original, so you have to create a new one. Luckily in FP languages it's generally very efficient, and you'll only need to replace a part of the linked list, not the whole thing

So you should use .map (idk closure exactly, but i'm sure it has it)

You can't change the value of something immutable.
You have to instead create a new thing, based on the immutable thing.
I don't know Clojure, but if you got a stack overflow it's probably because your function wasn't tail-call optimizable.
stackoverflow.com/questions/310974/what-is-tail-call-optimization

Forth

what's the best way to learn programming? should i start from a language or should i start from programming logic?
if i should start from programming logic, what's the best way to learn it?

CompCert Cminor + Coq

I understand that I can do this

(def nums [0])
(doseq [i (range 0 10 2)]
(def nums (conj nums i)))
(println nums)


But this feels like it's going against the grain of the paradigm. This is essentially the same as using mutable variables in any other language.

(def nums (vec (range 0 10 2)))

>algoeithm excercise
>they call double "real numbers"

Attached: 1554913403213.png (600x450, 222K)

imaginary my shock

Attached: 10262051_10202271916658945_1058480794194592846_n.jpg (600x611, 53K)

In lisp dialects CONS is generally to prepend new items to a list.
(set! new-list (cons new-atom old-list))

I don't know clojure specifically but there may be a "collect" technique for building lists via an iteration.

Study and work at it everyday, with possible breaks for the weekend and holidays. Just like a student enrolled in school goes to school most every day.

Is tracing GC ever faster (throughput) than smart pointers?

Depends on the workload.

(def nums (->> (range 5) (map #(* 2 %)) (vec)))

I just submitted my first pull request to an open source project.
Officially an open source contributor now.

Attached: futo_sunglasses.png (891x1065, 1.11M)

What if it gets rejected?

heh. this is what you get for only learning programming and not math. this is why CS grads will always be superior to self-taught neets.
nothin personnel... kid

Why do we have a discord tranny constantly making the stupid questions thread?

i can't enroll in schools, i can do it only by myself, that's why i was asking the best way to learn it!

Double are not real numbers.
They cover about 0% of real numbers

i never said they were
i read his post as him not knowing what a real number is until he realized he just needed to use a double

even less than 0%

As far as I know the maintainers like the idea. If it doesn't entirely sit well with them, I'd be asked for revisions instead of outright rejected.

>even less than 0%

Attached: AFmCWSe.jpg (221x250, 6K)

>he
It was me.
I'm fine with them calling doubles rational numbers, but calling them real fires my autism

why?
they're neither rational nor real desu senpai

You can write FP like it's not FP, you'll just be replacing the values every single time, or being inefficient in general.

A nice way to think of it is more like data transformation, and you just write functions that take in a value and transform it to something else, but you chain them all together in a row.

So in theory you could write it like

numbers = [1,2,3]
numbers = someFunction1()
numbers = someFunction2()
numbers = someFunction3()
numbers = someFunction4()

And keep "updating" the old one with what you want to change it to after, but it should look like this:
numbers = [1,2,3]

fixed_numbers =
numbers
|> someFunction1()
|> someFunction2()
|> someFunction3()
|> someFunction4()


And you are just writing functions to take in a value, and return a new one, and each time you pass the result to a new one, until you eventually have the output you wanted

Sure. A copying GC takes time proportional to the number of live objects, so if you have a lot of garbage then it can beat a destructor approach (which of course takes time proportional to the number of garbage objects).

well it's big finite number / bigger infinity than size of natural numbers

>learning C#
>decimal - It's a primitive; a slower double, but more accurate
This is pretty cool, why don't more languages natively do this?

Basically because C# was designed by the god of programming languages, Anders Hejlsberg.

long double

I wonder the same thing about pattern matching.
def handle_call(:pop, _from, []) do
raise RuntimeError, message: "Cannot pop from an empty stack"
end

def handle_call(:pop, _from, [head | tail]) do
{:reply, head, tail}
end

def handle_cast({:push, item}, stack) do
{:noreply, [item | stack]}
end

Long double has rounding errors decimals don't have

How do I become a fullstack developer? What does it truly mean? I assume it meant you can do websites and whatever nonwebsite stuff. I really don't want to be a webdev for my career, and I think I would find it more fulfilling working on anything and everything.

What shitlang is this?

It's a meme word that doesn't really mean anything.
But if it mean anything, it would be someone who is able to create and deploy a web application by themselves.
That includes some sort of backend, some sort of frontend, and some sort of dev-ops/infrastructure configuration.

it would appear to be r*by but i'm not a girl so i wouldn't know

Why is your pattern matching so ugly? It looks much better like this

match myStack with
| [] ->
raise RuntimeError("blah blah")
| head :: tail ->
stack

I just remember being at a job fair and I was getting flack for wanting to do everything and not specialize and be a fullstack dev.

Do people actually get jobs at job fairs?

I don't know, I have yet to get a real programming job.

Saved.

But being a fullstack dev is "doing everything", not specialization.

Imagine being such a buttmad engineer you spend an hour typing this down

isn't that elixir

i don't know

What makes you qualified as a fullstack dev?

(def nums (->> 5 (range) (map (partial * 2)) (reduce conj [])))

Yeah looks like elixir

You take that back you ugly whore

>(partial * 2)
yikes

>want to write a GUI application
>spend tons of time trying to get it to work
>keep failing

>pull out a notepad
>draw out every window, with every object and their size
>code it down in 10 minutes

Is this normal or am I just a brainlet?

Isn't Elixir just Erlang with Ruby syntax?

Why every "real software" seems just like glued lines of code that eventually work? Everything is ugly, not elegant and messy. I think my math degree is the root of the problem, everything is just elegant, simple and straightforward in mathematics. The only way for me to appreciate programming is either doing small non bloated fizzbuzz-like programs or solving SICP useless exercises. I can't touch any languages that is not C or Scheme. Am I just autistic?

less than 0% is a negative
dumbass

>Isn't Elixir just Erlang
yes it's a collection of elixir macros

>with Ruby syntax?
it's similar to python and ruby but not quite the same

Give me a number n verifying (n >= 0 && n < 0) then.

I think the differences are the syntax, some better tools in general, and I know there is some weirdness in Erlang when it comes to following functional programming principles which elixir tries to fix, can't remember what it was though.

>yikes

Attached: soyboy.jpg (600x600, 55K)

kys reatrd

What are some examples of "real software" which, in your opinion, meet these criteria?

Attached: 1538149564243.gif (241x328, 3.89M)

it depends on the ordering, 0 or less than 0 might not even make sense in a certain context, what we have is like 2^64 / |R|

-0

-0

bite me but he looks cute

your mom

throw someBigArray;

How about that Vim? Now that was a real piece of software.

Attached: boomer meme.jpg (550x550, 32K)

You should learn Haskell

>similar to python and ruby
I know you're telling memes but there's a pretty big gulf between Ruby and Python and it's clear even to a casual observer which side Elixir was poured on

i
like
you
cause youve
got
that
sth

Web browsers are classic examples.

ok?

Yeah, but you have to blame the Web itself for Web browsers being the monstrosities they have become.

Isn't Vim famous for having god awful source code?
Emacs' code is supposedly pretty good.

why does he hate quiches

I spent years working on web browsers. Can confirm that they are pretty well-engineered for the most part.

i'm so tired

Attached: 5f1.png (200x200, 66K)

go to bed

Attached: consider the following.jpg (600x600, 32K)

Nothing, it's not a like it's some certificate you can take an exam for. Like I said, it's a meme word.
I would probably call myself a fullstack dev if I was pressed on it, or applied for a position like that, because I have worked professionally on an entire technology stack from web front-ends to hardware drivers.

Drink some Red bull

but theres so much work to be done and its only 7pm
no thats bed for keeping a proper sleeping schedule. I got some melatonin pills today, hopefully they'll help with falling asleep

linux kernel
>. A 'traditional' male might enjoy the not so exotic egg-and-bacon pie if his wife served it to him; a quiche-eater, or Sensitive New Age Guy is alleged to make the dish himself, call it by its French name quiche, and serve it to his female life partner to demonstrate his empathy with the Women's Movement. Presumably, he would also wash up afterwards.

same

acceptable
fuck the french