/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Last thread:

Attached: 1537603883058.jpg (496x1122, 204K)

Other urls found in this thread:

tomshardware.com/news/john-Carmack-DirectX-OpenGL-API-Doom,12372.html
news.ycombinator.com/item?id=10263964
twitter.com/NSFWRedditGif

fuck opengl

fuck vulkan
sexually

Working on motivating myself.

So far no luck.

there is a better way
tomshardware.com/news/john-Carmack-DirectX-OpenGL-API-Doom,12372.html

Attached: 7fa3c4a74bcdccd8741475b522ee8cdf1[1].jpg (1920x1080, 757K)

I don't know about vulkan, just that the way opengl versions handle deprecation and just the state machine in general is shit.

user get to work.. or ELSE!

Post stacks.
I'm nix + rust now.

*ahem*

>Why yes I do program in Rust
>how did you know?

Attached: 17133746-portrait-of-happy-transvestite-man-cross-dressing-isolated-on-white-background-.jpg (866x1300, 120K)

Algol 60 on my PDP.

Attached: dec_pdp_11.jpg (800x1000, 127K)

Or else what?

Attached: 242435234.jpg (601x508, 31K)

KEK, I admit I had my gf use a strapon on me once.

>rust programmers

Attached: die_joubu.jpg (1280x939, 195K)

Why is Python so superior? Why even bother using anything else?

that's not scheme

C isn't blo-
$ equery s gcc
* sys-devel/gcc-8.3.0-r1
Total files : 1578
Total size : 367.09 MiB
$ equery s clang
* sys-devel/clang-7.1.0
Total files : 998
Total size : 70.03 MiB
$ equery s llvm
* sys-devel/llvm-7.1.0
Total files : 1939
Total size : 130.04 MiB
$ equery s glibc
* sys-libs/glibc-2.29-r2
Total files : 1826
Total size : 55.27 MiB


$ equery s sbcl
* dev-lisp/sbcl-1.4.9
Total files : 55
Total size : 42.27 MiB

Why are people so focused on scheme?

it's slow

Post moar anime girls coding, if you've got 'em.

gcc and llvm include support for other languages, so it's not just C there.
sbcl requires that you include the runtime in your program, unless the user has sbcl installed which is unlikely compared that every operating system has standard c library with it.
glibc's size is bit questionable but then again they have good points why it is so.

I'm almost done reading The Racket Guide.
I'm not sold, Haskell seems like the better alternative:
- Static typing
- Infix functions
- Pure
- Lazy
- Lack of OOP constructs

SICP YOU FOOL

they're not.

FACT: VB.NET is still more popular than your favorite language.

No it's not.

#lang hackett

So what text editor /dpt/ uses?

I always use gedit with plugins, never felt I need any other editor, they dont have any feature thats worth the bloat.

>static typing
That's good reason, I also hate scheme/lisp because they are dynamically typed.
>pure
Do you really care? The optimizations that it allows seem to me not that impactful.
>Lack of OOP constructs
lack of feature might be good but compared racket I would say no.
>lazy
scheme can also be lazy and with macros can provide at least as good support for lazy as haskell.

thank god nothing relies on C

Attached: 1535305103470.jpg (1280x720, 84K)

define stale

...

Because they are interested in Lisp in general, but still bear the scars of having been meme'd into the "small, pseudominimalist good, large bad" mindset and don't realize that Common Lisp provides everything they could ever want from Scheme and much more.
Nearly every Scheme program I've seen ends up reimplementing most of the "bloat" Common Lisp would have given them for free.
Don't get me wrong, I like Scheme, and I find it better as a configuration/extension language (see Guix) since it has an arguably cleaner, more consistent syntax. But if you are going to do anything more than that, Common Lisp is the better language.

hypnosis can work
if you want it to

>The optimizations that it allows seem to me not that impactful.
wrong
there's so much more optimizations that *can* happen because purity allows for more aggressive inlining and therefore exposing optimizations opportunities.

>lack of feature might be good

None of you will ever be an anime girl.

>small, pseudominimalist good, large bad
explain r6 then

still no call/cc c:

Hey guys, got a final project to do in Java that's the eight queens problem on an 8x8 board. I have no idea how to go about doing it, so what's the best way to learn how?

If I googled the code for it, it'd be cheating, so I don't think I can do that.

You don't have to google the code, you can google the problem itself.
Whatever the problem is, in these cases always make sure you understand how to solve it before you start coding. You're just wasting time otherwise.

>WIP implementation of a Haskell-like Lisp in Racket
>WIP
>Do you really care? The optimizations that it allows seem to me not that impactful.
It allows for more aggressive optimization.
>lack of feature might be good but compared racket I would say no.
Why?
>scheme can also be lazy and with macros can provide at least as good support for lazy as haskell.
It's not lazy by default.

Feature might require something from the runtime libraries or it might just create code that some would consider bad.
For example adding lambdas to C would require tramboline support from clib. Some would argue that having lambdas just hurts code readability compared to having function for the task.

This.
+Put your plan in writing if possible.

Have you done it before and that was how you got it done?

>It's not lazy by default.
and that's a good thing!

What's wrong with it?

For a homework exercise, it's good to try figuring it out yourself first, but if all else fails then seek hints like the prior user suggested.

I don't know what any of what I've learned is for. I've just got a lot of coding knowledge for big company software engineering and no personal projects.

how do I do trees without recursion?

Attached: mondays.jpg (185x163, 9K)

why would you do trees without recursion?

every language feature has trade-offs
news.ycombinator.com/item?id=10263964

pick the best trade-offs for your use case

What do you want to do exactly?

I mean, I'd assume that you just make 8 row arrays with 8 column elements, but I've ready that it uses recursion and everything to ensure they never interact and I just have no clue how to think of an algorithm for that.

Why cant you just answer the question?

isn't it supposed to be better?

Bloat is good

More features, good
Not reinventing wheels, good

Who gives a shit about memory, get 64 GBs of RAM and dont think a milisecond more about muh minimalism

First for technological libertarianism
If the compiler doesn't do what I say and make this the first post, it doesn't value programmer freedom

It depends on your needs. Recursion without caching is space intensive, and even with caching is still space intensive. But if you don't care about space, recursion can lead to more elegant code and faster executions. Even then, some solutions (what're you specifically trying to do?) can be done faster iteratively.

Any approach you take is going to be emulating recursion while storing the equivalent of the call stack frames somewhere else. E.g. using a stack data structure allocated on the heap, or even intrusively in the tree itself.

If your only concern is stack overflow and your language has lambdas and tail call optimization then you can use continuation passing style to guard the recursion using the heap.

Stackless coroutines

If there is a stack frame, that means there is also a heap frame, rite?

>Why yes I do represent strings with a linked list of individual characters, how did you know?

kind of but not really

store a linked list within the tree, ie each node not only has pointers to its children, it has a pointer to its siblings and uncle (parents parents next child) so you can iterate through by following these pointers
generally a limited and kind of pointless thing to do, being afraid of recursion is for brainlets and you should only do it if you really need the extra iteration speed

no

Anime girl and her binary calculator.

Attached: Moomiji.png (1002x1596, 163K)

someone recommended me this anime saying it was better than new game and it was fucking garbage

Sorta. But no. The heap is a general space allocated per application for reference types to sit. There's only one application level heap frame. That's it, and it's always there. Stack frames are created when data is pushed to the stack. In the case of a function call, the function and its parameter and bookkeeping data comprises the stack frame. Many stack frames, one heap frame.

That's not what you would call it. The structure of the heap differs wildly from that of the stack. There's no strict analog to stack frames on the heap. Why would there be? After all, stack frames are necessary to partition stack memory based on what function call we're in, and the definitively useful feature of heap memory in the first place is that it doesn't depend on what function call we're in. The heap does have partitions, but they aren't called frames, they're called nodes. Or objects, depending on who you ask.

Yeah or what this guy said. I should have put quotes around heap "frame", because while it's scoped to the application, it's not the same structure as a stack frame.

>whitespace based syntax
Looking for nothing is harder than looking for something, even begin/end is better than the way python handles it.
Ensuring proper indentation and code structure is best left to tools, like clang tidy.

tabs arent hard to see
the problem is it forces you to into a spacing style

I use GTK and I have successfully got child window to show with
gtk_widget_show_all(child_win);

But even though this shows the window the code doesn't stop executing. What function do I need to use so to show window but that will not return until window is destroyed?

byte

Attached: 1560138721508.jpg (1040x1212, 302K)

no you're just retarded

>language does what it's told to do
>OMG THIS LANG IS RETARDED

>What function do I need to use so to show window but that will not return until window is destroyed?
you should use a noose and a stepstool
modal windows need to die in a fire

fix is trivial
it's also easier to add strictness to lazy by default langages than the opposite.

Not very helpful.

based intelliretard

Attached: yehaw.jpg (353x195, 16K)

>Hey here is a really difficult program
>Get hundreds of students to work on it
>Give the winner a 50 dollar Arby's coupon
How do people even fall for this?

Attached: 1560332497082.png (645x773, 11K)

thanks for the explanation

nvm i figured it out

>using pajeetware for white man software development
you shan't complain

holy shit her tits are fucking huge what is wrong with her why would she grow them that big fucking slut

found the homosexual who probably prefers baboons

unless VR can use all 5 senses then ya you’re right and it’s so obvious it’s not even worth mentioning.
in short, fuck off normie

you just had a bruh moment, wanna talk about it?

ld hl, my_penis
ld de, girl_in_op_image
ld bc, 0
ldir

Hey guys, newbie here. I want to write my version of a Snake game on C, however, I was wondering if I could write it without using any libraries, besides the basic C ones. Is this a dumb way to go about it? Should I use the libraries to ease the process? I just feel like cheating when using graphics/input libraries like SDL, Raylib, and stuff.

Attached: 1552059196582.jpg (534x486, 58K)

you definitely can, you can even do it without using the standard library

you are going to have to use libraries
it's just a matter of how barebones you want them to be, and whether or not you want to use platform independent ones, or platform dependent ones
The most barebones platform independent setup would be to use GLFW for window and input handling, a graphics API, like opengl or vulkan, and some form of function loader library for the graphics API (unless you use vulkan's C++ api, which has a function dispatcher), because there's no reason to even want to do that manually

I see! What would be the required knowledge to do it this way?

Yeah, from a practical point of view, it makes a lot more sense to use libraries. I just wanted to get that "made from scratch" feel. However, they do say we should not reinvent the wheel.

>Yeah, from a practical point of view, it makes a lot more sense to use libraries.
i'm not even talking about practicality, unless you want to write your own operating system, no matter what, you're going to have to use some kind of library at some point

>not writing your own operating system

Attached: 1510171400278.jpg (468x589, 226K)

you need to know how to link and use the native API of your platform as well as how to replicate any functionality from the standard library you would otherwise need.

G*d I hope that racist retard is being raped in his incel asshole by a pack of black bvlls in hell right now.

Refactoring some piece of undocumented scientific software. Researchers can't write worth shit