/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

etalabs.net/compare_libcs.html
github.com/rampantpixels/foundation_lib
twitter.com/AnonBabble

"The most powerful programming language is Lisp. If you don't know Lisp (or its variant, Scheme), you don't know what it means for a programming language to be powerful and elegant. Once you learn Lisp, you will see what is lacking in most other languages." -Richard Stallman

*haskell

I have decided to write a *nix desktop framework entirely written in Rust and Golang.

The DE will be free for buffer overflows and memory leaks.

However, writing a window manager for X is not a simple task.

#include
#include
#include

#include

int main()
{
Display *d;
Window w;
XEvent e;
int s;

if (!(d = XOpenDisplay(NULL))) {
fprintf(stderr, "Couldn't open display and I hate C.\n");
exit(1);
}

s = DefaultScreen(d);
w = XCreateSimpleWindow(d, RootWindow(d,s), 0, 0, 110, 20, 0,
0, WhitePixel(d,s));
XSelectInput(d, w, ExposureMask | KeyPressMask);
XMapWindow(d,w);

while (1) {
XNextEvent(d, &e);
if (e.type == Expose) {
XDrawString(d, w, DefaultGC(d, s), 5, 15, "Can you read me?", 16);
}
}

XCloseDisplay(d);
return 0;
}


^I hope it gives you an impression how unproductive C is.

in the current year of the lord
second for Rust

thanks user from prev thread
now if I had an array of 100 elements where would I input a print line to fill this all out

works for me

wow nu-male redditmod got so triggered

>mfw Sup Forumsutists got BTFO by based mod
MODS = GODS

>Xlib
Please user, it's 2017.
Use xcb instead.

But really, don't blame your own ineptitude on C.

This is the the face of a Perl program :3

You are not trolling me, user

is xcb available in lisp

>That gif
Jesus Christ, user. What the fuck?

Change line 20 to use print, then print whatever you want to fill the row with after that, using println.

What makes Xcb so special?

...

haskell is shit

no

D

The API is much cleaner, in my opinion.
Although I haven't done any "serious" X programming.

Rust

Well, if one wants to make an independent from GTK/Qt libraries X program, does Xcb provide him such possibilities?

yes

It's just an alternative to Xlib. It's not tied to any of the toolkits at all.

Does D have monads?

XCB is just a different API for X, it's functionally equivalent to Xlib.

post all the programming language paradigms you know

Hinduism

Not technology

What's good glib alternative for C?

You don't need to use a library that ridiculously bloated.

Well, it must be defined before what categories we are talking about at first.
I can name imperative and declarative programming, and say "That's all, I've named them all!".

I'm in second semester of computer engineering atm...
It's so stupid. Reports seem like such a waste. Half of the information in there is just filler text.

I'm at uni around an hour a week, and I am still ahead of the schedule.
I can finish a group assignment due in 3 weeks by myself on the same day it's given.
The only subject I struggle with is physics, which 99% of the students will never need in their job life. But hey, gotta generalise amirite.

I'm legitimately thinking about just trying to find a job, and quit uni if I find a decent one related to computers.

etalabs.net/compare_libcs.html

>second semester of degree
>I know everything

Don't drop out user, you don't know shit.

>but as I am the author of (((musl))), that may have influenced my choice of which aspects to compare.
>>>>>>>>>>>>>>>>>>>>>>

glib not glibc you stupid fucking nigger.

Never mind I think I found a good one
github.com/rampantpixels/foundation_lib

I'm not a know-it-all mate.

I am aware I don't know everything, but I have looked at and read a lot about what we are going to learn.

I know that I know everything this uni is going to try teach me. However, I'm not saying I know more than a veteran programmer.

I've been doing this for almost a decade now. I am not retarded.

>The only subject I struggle with is physics,

Why do you space your posts like that, redditor?

function query(slug, id)
{
fetch('/api/'+slug).then(function(response) {
return response.json();
}).then(function (jsonr) {
console.log(id);
output_response(jsonr);
});
}

for (i = 0; i < slugs.length; ++i) {
query(slugs[i], i);
}


How do you make this work like a sane person would expect it to (ie. the console.log in the fetch callback logs 0, 1, 2 ... slugs.length, rather than just repeatedly logging slugs.length)?

I don't know, I feel it's easier to structure easier that way. Maybe I'm autistic. Who knows.

I don't use Reddit, so I'm not sure what you mean. It seems you know all about it though.

use arrow functions and for each of, then consider fucking off and not using jablescript

Or rather, why not Go?

Lisp WASN'T built for functional programming.

emacs or vim?

Go should have been named Stop

Golang is Java and C# done right.

Waiting for that autistic microsoft shill to screech on me

Go has all of the disadvantages of a garbage-collected language and none of the advantages, and all of the disadvantages of a low-level systems language and none of the advantages.

> then consider fucking off and not using jablescript
I wish I could just do this. I fucking have Javascript and webshit in general.

How would arrow functions be used in this case? I tried looking them up on MDN but I honestly don't see how to make them work here.

Oh here we go, Im sorry pajeet but your shitty C# and Java are going to die once golang mobile goes mainstream

function(response) {
return response.json();
}
becomes
resp => resp.json()
and
function (jsonr) {
console.log(id);
output_response(jsonr);
}
becomes
jsonr => {
console.log(id);
output_response(jsonr);
}
also
for (let slug of slugs) {

I can't wait for C# and Java to die.

Jesus the Vulkan API registry is so bad.
>uses XML
>uses the same tag for different things, uses differentiated by an attribute, instead of just different tags
>uses for things that aren't types
>contains literal C code like "type *name" that isn't marked up accordingly and has to be parsed on top of the XML if you're not generating a header for C or C++
It's basically poorly marked up C.

this

what are you parsing it for?

Rust

Doing that results in the exact same problem. console.log output still only just prints slugs.length multiple times.

Reminder that pic related is correct

>Haskell
>Fast development

Python is good for rapid prototyping and so is Ruby.

Golang is more productive and faster than .NET and JVM languages. How about posting your epic fizzbuzz instead of your forced meme. Both are equally laughable.

>Hasklel
>Good for anything
I genuinely chuckled

Neither is missing Rust

>t. neo-Sup Forums "programmer"

t. ""rust artisan"""

>Works for me
I know, and yet I hate C. Do you see how ugly my code is?

t. (((expert))) C kernel hacker

Calm down

Toy programming project in C++ / OpenGL, next up I will generate vegetation with L-systems :)

#include

int main (void) {
const volatile static unsigned long long int hi = 0;
if (!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!hi) {
puts("Hi2u2!");
}
return 0;
}


>Current state of C

I need some advice Sup Forumsuys.

So I'm graduating this quarter with a bachelors in CS from a pretty good Cal state. I live in the LA area, so I've been able to apply to what seems like a fuck ton of jobs. I've already visited 2 companies for interviews and have been rejected from both. I'm worried that because I have no internship experience or on the job experience I'm not gonna get anything.

One of the companies said that I needed "more experience". Mind you, this was after a very lengthy interview process which included a take home coding project. The job was also described as being entry level, which is all I really apply for. I'd like to think I'm pretty good at not being autistic and presenting myself well at these interviews.

Am I just worried for no reason? Should I just keep using the shotgun approach and applying anywhere hiring "entry level" until something sticks?

>job was also described as being entry level,
>said that I needed "more experience"
Welcome to the job market, friend.

why not c and vulkan you casual

How many lines of code?

Is it normal to feel overwhelmed and miserable every day in a SD job? I have a feeling I am in for a heck of a career

And here I thought it was a meme

:(

There are some other qualifiers you could have thrown in there without just adding duplicates.

>tfw babby's first graphic programming
I already hate myself and everything

I just posted this code in the C thread. It's my intellectual property. Don't post it again or legal action will be taken.

>apply to programming job
>you need to know how to program
you don't say

you should have added a copyright warning

The only people who say that either got their job via nepotism or don't have a job

...

© me.

git gud

Too bad it wasn't GPL'd

I have a few decent projects on my resume that I always talk about, one of them being a first place prize (for some API) at a hackathon.

I enjoy some std every now and then. Id like to try out Vulkan but I'm still fairly novice with 3D graphics so I figured it's wiser to start with the easier API.

2251

you probably sucked at the take home coding project and at demonstrating technical knowledge. just because you can wrote code doesn't mean they don't have applicants who are orders of magnitude better than you

yeah! you're shit! this chronic negativity and piss taking has to end in the industry, and i'm not even a fag woman or anything

What did he mean by this?

you just need to git gud, fucking faggot. "idiot acceptance" might help protect your fragile ego but it probably won't get you a six figure salary

The take home project was like the third step of the interview process. They could have rejected me right after I submitted it but they passed me to the next step, which was the interview at their office.

So apparently there's this cool API called OpenCV that handles computer vision (e.g. webcam footage). This essentially boils down to tracking, gestures, depth analysis, et cetera.

Do you guys think it'd be cool to make a gimmick program that helps with gesturing actions? I know my case is very limited, but I hate having to get up and go to my computer when I'm trying to sleep with netflix on to either turn the volume down, fast forward, rewind, skip videos or movies, and so on.

I guess the real solution is to get a programmable TV stick that can do all these things much better than motion tracking but it has made me really think about the possibilities of using the web cam for helping automate tasks.

Any of you guys have any gimmicky ideas to use with OpenCV? I'm curious.

use your phone

hi notch

You probably weren't missing anything. Like legit life is more fulfilling as a neet than as a developer.

Oh yeah I forgot about that. I broke my phone though so I guess I've been kind of narrow minded lol.

I'm such a fucking idiot.

What the fuck is Neovim? Did I just waste time learning vim?