/dpt/ - Daily Programming Thread

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

Attached: 74957767_p0.png (2039x2894, 1.96M)

Other urls found in this thread:

juxt.pro/blog/posts/native.html
nevercode.io/blog/flutter-vs-react-native-a-developers-perspective/
medium.com/@mswehli/why-dart-is-the-language-to-learn-of-2018-e5fa12adb6c1
twitter.com/SFWRedditGifs

Last for nim

Oh sorry about that then.

Do either of you have an algorithm you would like for me to try that would sufficiently benchmark C and Haskell on fair grounds?

Quicksort.
The real, in-place kind.

Attached: 1560308184287.jpg (850x721, 91K)

average two ints

This. Benchmarks simply don't scale to serious software like an OS, game engine, or web browser. They're only good for knowing which language can fizzbuzz the fastest.

So I should just write my graphical program that needs to be capable of hitting 144 FPS in as little CPU usage as possible in Python?
I guess I just wasted all of that effort doing it in C.

Attached: 1369446960901.png (256x310, 20K)

Is my plan and projects shit or a good idea?

Attached: 1559435664925.gif (1152x1152, 2.55M)

Of course not, but the only way to know that is by looking at real software written in various languages. And even then, it can only tell you the minimal potential of the language, which might be a far cry from what you actually achieve.

This
best true benchmark is the kind where you write a usable selection of code in two languages and then compare them.

considering you're using webshit to do a job that isn't webshit, posting in the thread that hates webshit, yes

But, since you're in it for the money and not the respect, fun, or dignity, I'd say there's not that much wrong with it as far as projects go.
It's large and complex enough that demonstrating that ability to maintain something like that would be worth a lot to the right people.
Then again, it's webshit so you could just be offloading 90% of the work to some "framework."

the only true "benchmark" is actually understanding how the languages work, not comparing any sections of code

Good

Fair point.
How does Haskell and C compare, in your opinion?

I haven't used Haskell but seeing Haskell is an extremely abstract functional language its performance is going to be worse than C without a doubt, but seeing it's statically typed and compiled it's probably faster than dynamic scripting languages

Woah! Cute Rize!

Just submitted my indie game as a credential to a job application.

If you know how to use strict code, you can build extremely fast Haskell code. But you really have to know what the compiler does behind the scenes, how it actually builds the computational graph. Then, you can specify which parts of the program need to be strict and which ones need to be left alone(lazy).

In the last few months Serenity has been on the front pages of HN, Jow Forumsprogramming, osnews.com and various other places.
People seem to generally like the system, although there was a very salty developer from another, much more mature OS (one that you all probably know of), showing up in multiple places to tell everyone what a waste of time Serenity is. He even sat on the IRC channel for weeks, occasionally letting out some rant about how we're all wasting our time.

Attached: 1559342058350.gif (660x780, 201K)

lol what's he doing with his own time?

why is it x86 instead of x64?

Because I knew x86 quite well already so I could go fast instead of slow. Most design decisions have been about maximizing my own productivity.
x86_64 can be added later, but to me it’s just another feature

Attached: 20C4E69B-0055-4F6C-9790-BAAA79BDBFEE.jpg (750x937, 117K)

good thinking

Whos the cutie

Operator

>Nobody genuinely confuses it with bitshifting
except actual programmers who aren't command line monkeys

I bet you are confused by if(x) f(y) too

So I wrote a program in Python with a nice Qt GUI and everything, but I really want to make this into an Android app.

Should I start learning how to do this in React Native, or Flutter?

I've already started learning react native but I didn't realize till just now that Flutter does basically the same thing, and is apparently just as fast & responsive, and Dart might be potentially even easier to learn. Redpill me on either.

Attached: flutter-mobile-desktop-web-embedded[1].png (400x200, 13K)

>because shell using the same
The way shell uses

Attached: 1560423599764.png (606x800, 786K)

juxt.pro/blog/posts/native.html

how is that confusing

I forgot to mention that I don't know any Javascript already. So I'm reading that article and yeah I'm actually already set up using Expo, which is nice, but now that I'm reading this:
nevercode.io/blog/flutter-vs-react-native-a-developers-perspective/
and this article linked in the comments:
medium.com/@mswehli/why-dart-is-the-language-to-learn-of-2018-e5fa12adb6c1

I'm starting to wonder if I should just ditch all JSshit. Dart unironically looks like a much comfier language to learn, assuming I know neither of them to begin with.

Rose. From GochiUsa.

I heard you should never use ints because longs are the register size and therefore faster. So why do so many modern C programmers use ints?

They're smaller.

Completely non-portable and retarded assumption. For example, on windows x86-64 and Linux x32, long is 32-bits, while the real CPU size is 64-bits.
Also, x86-64 computers and perfectly capable of handling 32-bit values very efficiently.

int basically is the the "natural" integer size for a computer that's going to execute efficiently. Unless you have a specific size requirement, or another type makes more sense (e.g. size_t), int is just the default that you should use.

>on windows x86-64 and Linux x32, long is 32-bits
Wait wut
Then what size is an int?

Also 32-bits.

Whoever told you that is a retard. longs are faster individually since their size doesn't have to be converted before being operated on, however, if you're operating on lots of numbers, using longs will cause more cache misses which will lose more time than they gain. If you're crunching big data, you should use the smallest type that's suitable.

Attached: D0BD2D51-C14E-4527-AEF4-77A2A0E72FA1.png (1500x952, 159K)

>the blind leading the blind

Attached: 85841379-BAA3-4046-8749-F5BBB2C98470.jpg (700x700, 87K)

>Nobody genuinely confuses it with bitshifting
Yes, we know. That's not the issue.
int i = 17;
std::cout

Im not sure what part I posted couldn't be apart or use web coding. Also still kinda new to Jow Forums and didn't know web was looked down upon in these threads so my bad.
>in for the money not the fun
I would love to do stuff with IoT, sysadmin, and infosec. But I got a degree in web design and I would like to not be cashiering/delivering food in the next year so I need to play to my strengths; kinda shit, but whatever.
>offloading work to a framework
I have noticed web tends to like to rely so heavily on frameworks that trying to do anything custom feels like you have to beat it over the head; I hate it.

I appreciate your response though.

Thank you.

What you're looking for is a long long, not to be confused with the extralong or the long long long.

Nice ancient reddit maymay. Do you mind if I save it?

Attached: 62560137_p5.png (1218x2026, 764K)

At least he is not a child molester

cout sucks, but it's not because they chose

Is there a type guaranteed to be 32 bits on 32 bit systems and 64 bits on 64 but systems?

I’ve already spent 8 years working on an alternative to those two browsers. You can use it right now (WebKit)
But as far as making a completely new browser to compete with them.. I’m not super motivated.
That said, I did start working on a very simplified HTML implementation for rich text stuff. Who knows, maybe it’ll spiral out of control. :)

Attached: 6DAAFA67-1C54-4A03-9B89-1FFFE5752498.jpg (484x583, 36K)

long long short unsigned static virtual inline int dumbass, haven't you read the C standard?

uintptr_t is the closest you'll get. I don't know why you'd have such a requirement, though.

making a screen saver is so simple* you should be able to do it using just a c-abi compatible language and a graphics API
whereas a calculator does require some level of effort because making your own GUI system is retarded, but not enough that it requires the bloat of a browser

*in terms of overall computer science skill required; it's still non-trivial software, so it demonstates project management skills

also the mobile friendly part, not so much (mostly because of apple)

probably size_t

A language that uses it should be a shell-script that interfaces with the OS,

>applying for job at Bloomberg
>have 5 years of experience
>WHAT IS YOUR GPA?

Why do companies do this?

Attached: 1560330687729.png (384x390, 320K)

If you apply for big businesses you will be treated like cattle

>applying for bloomberg when your name doesn't end in berg

>found many local jobs in programming
>dad wants to kick me out of comfy neet life to work
Guys, I’m fucking scared. What if I autism and screw up socially at work? I was able to socialize in college well. Will work be the same?

Attached: AB13AF48-D7D1-4635-8A5A-22EB9A27D0A1.jpg (500x279, 23K)

>guaranteed
>different sizes in different environments
can't help you there. There are guaranteed sizes, and guaranteed minimums, but I don't know of any standard types that distinctly guarantee those sizes for those environments.

>error: 'long long long' is too long for GCC

I am a programmer and half of my coworkers are autistic, and the other half are boomers. We just silently look at each other and have one word conversations while the boomers talk about cars and fucking jailbait

Is there a programming board I can go to where I can talk to boomers instead of hackernews basedboys and autistic linux users?

high iq thread

Attached: [SallySubs] Gochuumon wa Usagi desu Ka 2 - 08 [BD 720p AAC] [E534DF23] (00:15:43.776) 0002.png (1280x720, 3.78M)

you'll have to join actual forums.
Have fun with that shit.

That’s actually exactly what I want. Is there a signed variant.

forums are too fucking slow

Liking loli is k-selected and based

*snap*

Yes, it's simply intptr_t.

then you'll have to slog through IRC

How to force a garbage collector in a garbage collected language to collect an object that's still reachable?

you can't. make it unreachable

Liking GochiUsa you mean.

Attached: [SallySubs] Gochuumon wa Usagi desu Ka 2 - 04 [BD 720p AAC] [935279DE] (00:04:32.147) 0001.png (1280x720, 2.9M)

But I want to reach it invalidly after it's collected

New to programming. I've been going over the basics of C# to use with Unity. I don't want to be a professional gamedev or anything, I just want to fuck around with my own projects in my spare time. A game dev friend of mine mentioned that "data oriented design" is a better philosophy for game development than OOP. Obviously the online courses I've been doing and books/guides I've been reading are all grounded in OOP. Are there any detailed guides or resources for understanding how to write code according to a data-oriented philosophy? I've found a ton of articles explaining DOD generally, but really nothing specific that actually details how to write code or what data-oriented programs should look like. I've found absolutely nothing that is specific to C#, either.

why are you even using a GC then

The venn diagram of the two audiences form a circle

Would it work to grab the object's address, make the object itself unreachable, and somehow convert the address back to an unmanaged reference?

Your friend is repeating memes like an idiot, stick with OOP
if you must know DOD is running functions on structures and I'm not sure C# even has support for that, it forces you to use classes

What are you trying to do to Java, pajeet?

Yes, but you have no idea how long that pointer will remain valid before it's overwritten by something else

Do haskell people have a vendetta against parenthesises?

doesnt matter unless you're writing high performance shit. you have to think about how your cpu will cache data and laying it out for sequential reads and all that. I wouldnt do it unless you know why you're doing it.

They didn’t want to repeat the sins of the father, Lisp.

some do but I add clarifying parenthesis to my Haskell code all the time. I dont like the $ operator.

You don't have to use overly-terse sugar operators. You could even just >>= everything if you wanted. Or use regular f(x y)

>functions on structures and I'm not sure C# even has support for that
wut

I don't think C# has support for free functions

>although there was a very salty developer from another, much more mature OS
Which one?

What does >>= even do? The best explanation I found says it works like a list comprehension but even that doesn’t explain every use case.

static methods

Obviously my goals are A) to generate garbage data and B) to introduce a risk of completely bringing down the underlying runtime environment e.g the jvm
figures but i don't mind if something else is there when i reference it again, so what i have to do is
1) get address from reference
2) set reference to null
3) manually invoke gc
4) get reference from address
how do i do 1 and 4? most gc languages i know of really don't like letting you convert between addresses and object handles

I just go with what is nicer to read Sometimes that means point free autism, other times a couple of parens.

Did you get gcc working on it yet?

entirely depends on the language you're using

I made it segfault once. Don’t remember what I did though. Getting garbage data from the jvm sounds hard because it zeros every allocated strip.

if you have container type that's a monad (like a list or a maybe or whatever), >>= takes the value inside that monad and applies it to a function to it that returns that a monad. it also applies any special sequencing rules that apply to that monad.

Sounds like map but I have a feeling that’s not quite it.

I'm mad that Jonathan Blow didn't get to explain the details of how he did the frame recording and compression thing for the rewind mechanism because of the dumb fucks at GDC

>>= is very similar to map. map takes a function that takes in a value and returns a value. >>= takes in a function that takes in a value and returns a monad.

>/dpt/ - daily programming thread
>programming thread
>programming
>as in making programs
>"people" in this itt are talking about breaking programs instead
>that person happens to be a javeet
like pottery

simple delta compression is more than enough for compressing game commands, you only store change over time instead of the entire state