/dpt/ - Daily Programming Thread

What are you working on Jow Forums?

previously

Attached: prog.jpg (2048x1536, 126K)

Other urls found in this thread:

doc.rust-lang.org/book/second-edition/
rustbyexample.com/
doc.rust-lang.org/nomicon/
github.com/EmilHernvall/dnsguide
youtube.com/watch?v=WO23WBji_Z0
pastebin.com/raw/PQPCrtQT
en.cppreference.com/w/cpp/numeric/random
twitter.com/SFWRedditGifs

I can't read

Learn Rust.

doc.rust-lang.org/book/second-edition/
rustbyexample.com/

*not for brainlets*
doc.rust-lang.org/nomicon/

Hi. Please use an anime image next time.

Attached: 15296.png (644x611, 322K)

fuck opengl

Weekly reminder to use #![feature(nll)].

Reminder to use meme-lang of the tri-annum.

nigger

No :)

>What are you working on Jow Forums?
ncurses

this, please.

Weekly reminder not to use Rust.

>w-w-weakly reminder
Cniles, you're well on your way out.

is that book a meme only perpetuated by Jow Forums, like Install Gentoo, or is it something actually worth reading?

/go samefag to your hugbox >>>/github/

in C++ socket server
can I use non blocking select() for a socket while using epoll() ET for another socket
at the same time(in the same program)

Depends on you.

Attached: 1520090344292.png (600x603, 137K)

Well honestly expected this trip/post a long time ago.

Does Jow Forums cook at home and bring food to work?

Whats on the menu today?

camelCase, PascalCase or snake_case
which one do you fa/g/s prefer?

i've been posting here for years.
you just haven't been paying attention.

go learn Rust.

remove-kebab-case

cC 4 ever

It's an outdated meme, not even the shills have the patience to read past Chapter 3.

PascalCase.

depends

Depends on the language. Usually I follow that language's conventions.

Usually I use PascalCase for types, camelCase for procedures and snake_case for variables.

Daily reminder that Rust should be avoided like plague; its user base is feminist and anti-white.

{-# LANGUAGE DataKinds, GADTs #-}
data Nat = Zero | Successor Nat
-- datakinds lifts this to the type level

-- let's just be clear that these are types and not values
type TZero = 'Zero
type TSuccessor = 'Successor

data Vec n a where
EmptyVec :: Vec TZero a
NotEmptyVec :: a -> Vec n a -> Vec (TSuccessor n) a

data Fin n where
FZ :: Fin (TSuccessor n)
FS :: Fin n -> Fin (TSuccessor n)

at :: Vec n a -> Fin n -> a
at (NotEmptyVec a xs) FZ = a
at (NotEmptyVec _ xs) (FS n) = at xs n
-- the GHC type checker is not perfect
-- what if the input vector is empty?
-- if the input is an EmptyVec
-- then n = TZero, in this case
-- but if n = TZero, then our second argument, (Fin n), is (Fin TZero)
-- Fin TZero is uninhabited - you cannot (consistently, without non-termination) create a value of this type
-- thus we shouldn't need to handle the case (but GHC can't tell)

all me btw.

Are there any documents that detail the benefits of using this constrained environment (non-unsafe code) in a practical way?
Ideally I'd like an example of a real project from a person with an established programming style they lay out upfront and then they explain how the development process has improved, from prototyping to finalizing the software.

Doesn't have to be a huge project, just something that exercises the features of the language.

AHHHHHHH
where can I find simple openSSL client example
using TSL 1.2 with non blocking sockets

IDontFindCapitalsAnAptReplacementOfHorizontalSpacing-case

Huh I never noticed, but I already tried Rust. Sweet mix of imperative and fp.
Compile times were a bitch. VSCode plugin was also a bit goofy from time to time. People are currently recommending IDEA, but yea I moved on.
Ownership wasn't that hard. Lifetimes made everything a bitch, so I just clone()'d whenever. Might try it again after SIMD stabilizes and they do more about ccompiletimes(besides incremental).

>filter Rust
>can't filter C.
oops.

Name a more advanced programming language than Clojure.
Protip: you can't

Attached: Meme.png (595x760, 64K)

github.com/EmilHernvall/dnsguide

>Name a more advanced programming language than Clojure.
Clojure is not even a real Lisp. How can it be advanced?

Explain why a language has to abide by strict Lisp orthodoxy in order to be advanced.

> dynamically typed lisp dialect
> "advanced"

Do not respond to lisp autists

Trying to bring up a useable Go development environment on my Chromebook. Well, more than useable; one that I like and can use in comfort. Tried CodeAnywhere and Codenvy, haven't tried C9 yet. Crouton just flat out doesn't work for me, and when it does install everything is broken.

I could just install Gallium on it but that's cheating, I was just curious what I could achieve with a CB.

Anything lisp can do λ can do better
λ can do anything better than lisp

Static typing reduces expressive power, ie advancement. Are you a slave to the red borrow checker by any chance?

>Explain why a language has to abide by strict Lisp orthodoxy in order to be advanced.
If your language needs to use [] or {}, it's not advanced enough. () is more than sufficient.

can confirm this.

Rust sucks

I haven't read all of it but why does this look way better than every other piece of Rust I've seen?

so does your mom, i don't judge.

youtube.com/watch?v=WO23WBji_Z0

>can't defend his language without personal insult
wow

Cmon user, we both know that cloud-only computing is retarded.

>being able to express and verify the most important attribute of a value reduces expressive power

>can't handle the banter
pythonistas, everyone.

>Static typing reduces expressive power
You could have a static type system and syntax that lets you work with the Any type conveniently, so it would only increase expressive power.

Because half of the Rust code being posted itt is a garbage made-up by haters.

kek

>once again resorting to lying, insulting and slandering

How's the story of Nim's garbage collection? Is it still unsafe by default? Do we really have to use bdwgc instead?

>Rust sucks

yea, well maybe have an actual argument and i'll consider taking you seriously.

That's just a minor quibble on how different people like their sexpr readers. On top of it's not even operationally valid since CL has [] and Racket has #(). By your logic why don't we get rid of ` and '?

>being unable to directly express some otherwise correct programs anymore doesn't diminish expressive power
You're mildly retarded, but I guess the above isn't an inherent limitation of static typing, but rather of most static type systems.

>unsafe
I meant thread unsafe

Shut up, tranny faggot.

>CL has [] and Racket has #()
Not real Lisps.

>why don't we get rid of ` and '?
Because they're not [] and {}. There's only enough room for one kind of parentheses in a true Lisp.

What problem is so hard to solve that we can't have web browsers which aren't memory hungry pieces of shit?
1. jit off by default 2. js alloc limit, a few MB per page
Wouldn't that just solve the browser shittiness? or would there be something else?

lol cry more, sperg.
go fire up that mr. robot season 1 and kali linux, script kiddie mouth breather.

[, ], {, } are not reserved symbols in CL you fucking retard.

>Wouldn't that just solve the browser shittiness?
I think the problem is in the people who write the software.
Give them the constraints and they simply won't make the webpages.

It's every static typing system that has ever existed and will ever exist because they will never find the perfect one. Ergo static typing at best doesn't increase expressivity it can only decrease it. End of story.

What book for learning to program in a practical way ?

You're violating the CoC right now. Asperger's Syndrome is not a laughing matter, and I have to ask you to stop marginalizing people with that lifestyle.

Daily reminder that there's only one namefag on Jow Forums, using different aliases. Ignore this faggot like the plague.

Do C programmer use GLibC to stay productive?

If that's the cost of not having to write even more unit tests and limiting the way retards can fuck shit up, so be it.

C programmers aren't productive period.

What unit tests are eliminated by the use of static typing?

>Go watch mr. robot! you're not a real techie!
>heh go fire up kail linux (a tool used by security professionals around the world)
You sound like a newfag wannabe.

I made this for the guy I was arguing with about dependent / non dependent:
pastebin.com/raw/PQPCrtQT
You can typecheck it with Agda.
As you can see, it's virtually the same, except in one case Nat is a Kind (and thus n is a type) and in another case Nat is a Type (and thus n is a term)

>still seething
just let it go.

There is a number of very serious projects written in C. I don't like C itself either but I'll give the credit where its due.

>It's every static typing system that has ever existed and will ever exist
Wrong. There's literally nothing stopping you from having a language where the default type is Any, which could contain any value.

> Ergo static typing at best doesn't increase expressivity it can only decrease it.
Wrong again. Even if the above was impossible, static typing still increase expressiveness by letting you express compile-time constraints. Whether that would be a net win or a net loss is down to personal opinion and the type system in question.

Some C programmers make their libraries to not even rely on libc.
But are you talking about the general purpose utility library Glib made by gnome or C standard library implementation glibc made by GNU?

>still namefagging
gtfo out, you stupid nigger

My impression is that we have established environments for their domain or they don't need it. But I can't speak confidently about the general case, I'm not a consultant.
At my work we use GlibC for sockets and a few libraries provided by some of the hardware vendors.
Depends on what you mean by productive.
Writing a python script can quickly accomplish a task but that doesn't mean it fulfills the requirements you have as easily.

lol "no"

>What unit tests are eliminated by the use of static typing?
All of them, if you express every constraint of your program using the type system. None if your type system is like that of C++, Java, C# etc.

does Ruby still post here, btw?

>being this much of a new fag that he gets trolled by an obvious troll
you're the stupid nigger.

Ruby died

No he got doxxed.

*she

Depends on how strong your typing is. Often times you can at least prevent having to test edge cases by not allowing them in the first place.

Why am I getting mindfucked trying to figure out how to generate a random number the C++ way? In C I can just do srand time rand
Should I just give up and include the C libraries?

Attached: 1517728834032.jpg (400x379, 41K)

>being this obvious when samefagging

Attached: 1521011214182.png (550x543, 18K)

cope.

Attached: Screenshot_2018-03-29_09-44-26.png (1241x1274, 254K)

>>>/general/rules/11

Why SO full of "Why would you do that?" and "Nobody do that low level thing anymore. Use this lib to wrap it for this unrelated purpose" answers?
It really looks like no one should try to make something new at all.

whats complicated about it

wait, what are you trying to do? The normal "C++ way" would be to just do what you said.

C++ has its own huge rng library.
en.cppreference.com/w/cpp/numeric/random