/dpt/ - Daily Programming Thread

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

Attached: 73128071_p0.png (1500x1298, 1.26M)

Other urls found in this thread:

meguca.org/assets/images/src/b43d365655d99ea9ac2fb072edb01db059ae504e.webm
stackoverflow.com/questions/1281184/why-cant-i-set-a-global-variable-in-python
twitter.com/NSFWRedditImage

Cute!

C# über alles

This JavaScript things looks very nice! Can you show me some more?

Attached: cc118d4340dd8f518505348b637786b6.jpg (1000x1500, 116K)

>
Anyone?

Show me your cunny first.

>

>forced OOP
>superior
meguca.org/assets/images/src/b43d365655d99ea9ac2fb072edb01db059ae504e.webm

ocaml

Attached: ocaml.jpg (225x225, 8K)

The S programming language to kill Rust

Haskell for supercomputing

Attached: D1572FA9-C2C7-45D3-A6E4-C88494A87771.png (658x855, 617K)

Retardedly wasteful.

god i wish that were me

Is that what it takes for Haskell to compete with C++ on low end hardware?

Ich stimme dir oder jedem anderen zu Der mehr von OPs bildern posted

English:Post more pics like OPs and we can start taqlking

...

anime ist eigene scheisse

Attached: 1532835280524.png (362x362, 172K)

Zeig mir 3D Frauen die erwachsen sind aber den Körper einer 14 jährigen haben die aus dem Himmel hinabsteigt.
Am besten steigt sie so ausm Himmel hinab das ihre 14 jährigen unverbrauchten göttlichen Füße direkt in meinem Mund landen.

anime website

Attached: 1553371170813.png (282x326, 20K)

3D fuss > 2D fuss
C# thread

Dumb nazis

>g*rman

Attached: 1557369930400.webm (600x336, 1.46M)

la luz extinguido...

What do I have to do in order to look like the guy on the right? I like his look (besides the stroke he's having).

Did people make fun of the degenerate lower station of jesters the same way we scoff at these clowns for debasing themselves?

Be jewish

u want to be a neck beard onions faggot?

multi-paradigm language you nigger.

I'm writing a machine learning library in Haskell utilising dependent types.. and right now I'm ripping my hair out trying to understand why compiling with -O2 makes some floating number calculations all messed up

You can't opt out of OOP though.

drink onions twice a day

This might be a long shot, but have you compiled it with "-O2 -fexcess-precision"?

In python I have a global (shudder) variable that I need to set at startup and access from other files in the project. Stackoverflow stackoverflow.com/questions/1281184/why-cant-i-set-a-global-variable-in-python says that this should work:

t1.py
def myFunc():
print("inside myFunc")
global hello
hello = "helloworld"

t2.py
import t1
t1.myFunc()
print(hello)


But it says that hello is undefined. I could, to make it work, just place hello in the global scope and then assign it in the function, but that would make hello run each time I import the file, which is not helpful. I actually had a way to fix this, which is to set something like
hello = myFunc()

and have myFunc return hello if hello is already set, or do some calculations otherwise. The problem with this is that the function is ran whenever the file is exported, instead of when I want it to run.

Any suggestions on how to do this? Or any other solutions for my problem?
Again: The problem is that I need to do a check on program startup (it's just a distance measurement which sets a multiplier), and then use that multiplier in other parts of my program. I don't want to have to pass it around in functions because I would have to refactor the entire codebase, and it would just make a mess out of things since pretty much every function would have it.

print(t1.hello)

oh my god I'm so FUCKING stupid

What static analysis tools do you use and for what languages?

Attached: 173151a28a0b6b5ceb15ae9fc739d178f42f9640cb3457d0cf32e4c7123d9af2.png (255x255, 4K)

it's retarded tho

Sounds like python.
I only did this in python because I needed pyautogui and couldn't find a similar library for any other language, but I really am not enjoying this.

none because i dont make mistakes

My brain does sophisticated borrow-checking and type-checking automatically.

does this mean if more programmers had brains we wouldn't need to use rust and haskell anymore?

Correct. Types are crutches for bad programmers and brainlets, just like variable names and documentation.

Rust and Haskell are limited by what the language designers feel is suitable for the average retard's brain-power. So yes.

If more programmers had brains then we would rule the world.

Attached: D13CD730-41A9-4B48-90AD-B169EA368B6D.png (1280x738, 1.23M)

*social skills

I second this.

This is why all of the smartest programmers use C. They don't need some compiler to baby them.
All of the dumbasses complain that "C is unsafe", but the reality of it that they are just too stupid to use it properly.

Attached: 1557391869098.jpg (200x250, 19K)

>This is why all of the smartest programmers use C++

Attached: F90F23D3-2984-4806-B058-8FF105AB7CA1.jpg (499x431, 134K)

No, only the most retarded of programmers use C++.

>This is why all of the smartest programmers use C
Forth*

Attached: 1550944312339.jpg (600x620, 214K)

The smarter programmers use C++ to speed up their development time with the same or better performance.

Attached: 5629169B-7316-44DD-A7DF-91EE9C67E0E1.png (543x435, 128K)

The smartest programmers don't program

>there are actual Cniles that unironically have this opinion

>They don't need some compiler to baby them.
Yeah, the C standard doesn't baby the programmer at all.

Who decided on the multipart/form-data encoding?
It's fucking retarded.
Everything about HTTP is just fucking retarded.

probably someone smarter than you

Anybody try making their own primitive OS ? Should I buy a raspi so i can run it on real hardware ? Or is it just as satisfying running on a VM ?

>grug no understand thing
>thing must be stupid because grug is not stupid

Attached: 3b6.jpg (353x400, 20K)

Ask stack overflow

lmoa rek

How did you know my name was Grug?

If you do
from t1 import *
Instead of just
import t1
Maybe print(hello) will work

yeah, I've tried that already, and every other optimization flag vaguely related to numeric computing. I found some GHC ticket which mentions problems relating to -O2 when it comes to realToFrac, but I'm not using that anywhere. possibly the underlying array library..

Trying to figure out how to write a hello world program on an old-ass borland compiler

What size are your floating point numbers? Are you using -ffloat-store?

Accidentally posted in other thread

gitlab.com/ryukoposting
(Some of my repos are private so it might look different for you)

this

I read through the OCaml runtime and the GHC runtime in order to build my runtime :) I'm now almost to 20,000 lines of C in my sexy managed system

Try rewriting it in JavaScript. JavaScript numbers work pretty well.

>ryuko
based

>Who decided on the multipart/form-data encoding?
The same people that invented SMTP and early 2000s banking protocols. You only understand how shit they are because there are examples of better protocols now.

too fat

faggot

Making a silly neofetch-like thing for my operating system. I should have gone to sleep but instead I am doing this. :)
Earlier today I added window maximization which turned out pretty good.

Attached: Screenshot at 2019-05-13 05-01-26.png (1920x1080, 804K)

i made a small program that replaces one or multiple bytes in a number.
you give it starting point,replacement bytes and it will generate the new number.
pic related

Attached: Capture.png (585x250, 9K)

I fucking love Endro.

cute

Can someone help a brainlet with gdb? How do I watch all the value changes of a variable in a random source file in the program. I feel like watch path/to/file.c::var_name should work but I just keep getting the "no symbol in current context" message.

It's not about babying yourself it is about babying other people so they don't make your life a living hell.

I work in open-source software, so that is far less of an issue. If your code isn't up to the usually harsh standards of the maintainers, it's just not going to get merged.

Okay well types are also just cleaner and they look sexier.

I have yet to see a language with sane syntax for types.

I have. It is Haskell, the most perfect language of all time there is no reason to code in any other language anymore. Eventually programming will just be synonymous with Haskell we will call it Haskelling.

I don't speak Nazi but if you said 3D Feet > 2D Feet you must be a raging gay homosexual with a huge black ape cock inside your anus.

There is literally nothing better in this universe than cute young 2D feet apart from maybe Heroin mixed with Cocaine

It's definitely not Kotlin
import kotlin.experimental.shr
import kotlin.experimental.and

var i : Int?
object : HandlerThread() {
companion object {
const val foo : String = "bar"
}

override fun run()
{
if (i != null and i!! < 100) {
i!! shr 8
} else {
i = 1
}
var baz : String? = foo
Log.d("Info", baz)
}
}

I don't see what is wrong with c

int i = 0;


Reads, "My integer named `i`, is equal to 0"

yes

haskell and nim

Attached: tumblr_pbg3mbY6cu1xz9074o7_400.jpg (333x333, 28K)

1. int i = 0;
"Integer `i` is equal to 0"
2. i: int = 0;
"variable `i` of type `integer` is equal to 0"

Personally i prefer the second way since i can find variable name first and then determine type from that (also it looks more formal and mathy). The other way i have to look for type first and then determine variable name. They both compile to the same thing anyways though so its not like it makes much of a difference.

void* myFunc()
{
return something();
}
...
int i = myFunc();

Now that is freedom

Attached: 1473987915997.png (400x400, 439K)

Rate my implementation of the game of Nim
#include

int
main()
{
int total = 12;
int ptake, btake;
while (true)
{
printf("P: ");
scanf(" %d", &ptake);
total -= ptake;
if (total

It takes you longer to type 2 and thus it is less intuitive. I wonder if you come from a spanish speaking background or speak some other language that puts the noun before the adjectives if that makes type 2 more preferable.

I prefer the latter too, because you actually get to declare functions with the word function, instead of just a tiny parenthesis after the name of a variable.

>switch (ptake) { ... }
Gross

>1: -= 3
>2: -= 2
>3: -= 1
why would you do this

C really is the JavaScript of systems development.

Jesus christ user, work on your coding style.
I seriously hope you weren't mixing tabs and spaces for indentation.

Every language that uses the second syntax I know (Rust, Typescript, Kotlin, Swift, Go) has type inference, so, not really.
int i = 0;

var i = 0 //4 bytes integer by default

A compiler would warn for that, idiot.
Assigning a pointer to an integer (without an explicit cast) is an error.

>tfw your language allows you to get work done and assumes you are competent and aware of consequences of your coding decision.

Attached: 1556914072437.jpg (640x480, 63K)