/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Previous Thread:

Other urls found in this thread:

en.wikipedia.org/wiki/List_of_concurrent_and_parallel_programming_languages
en.wikipedia.org/wiki/Real-time_computing
twitter.com/AnonBabble

the monad as interpreted by functional programmers is the ultimate embedding of imperative programming within functional programming and represents the pinnacle of 20th century programming innovation, uniting imperative programming, type theory, category theory, first class functions, custom data types, procedural and imperative concepts along with continuations and the lambda calculus to perfect the concept of the pure typed programming language. it is the cherry on top of the proof within the pudding that functional programming is strictly superior to imperative programming.

philistine memesters need not reply

First (OP doesn't count) for using namespace *;

but SPJ created Haskell...

Recursive post hiding for my liveposting board. Fuck JS. I bet this will make thread loading slower.

>when your project grows in size and demands cognitive load far greater than yours

minecraft after very early alpha stages in a nutshell

rewrite by proper devs when

>programming in C
better use this algorithm and doing it this way saves 1 sizeof(int) in each struct.
>programming in anything else
who cares if the algo is n^n it's slow anyways

But monads still are far from perfect. They are hard to compose and to reason about. I didn't get the "hard to reason about" part well, but I think it's because you barely know anything about a monad until you see its implementation.

>that functional programming is strictly superior to imperative programming.
He says while praising Monads for introducing imperative programming into FP.

amen brother

ganbatte!

Question for all light color scheme senpaitachi: how do you deal with bright colors like green and yellow?

8/8 fresh copypasta

Where does his post mention Shitkell?

>still
What did she mean by this?

has anyone ever put a good effort at a tool designed to ease the cognitive load of working with large, unknown codebases?

it's incredible to me that we have the resources to make open source kernels with tens of millions of LOCs but we aren't able to understand at a glance whatever we want from a 100kloc project with the help of a computer.

some code is just indecifrable unless you're a guru in that specific field. take luajit for example.

and you know what they say about code being the best docs? yeah, that would be true, if it was literally as easy as browsing some docs. and i think it could be...

it's a project i always wanted to do, but ironically i'm not competent enough to understand llvm docs, but if i had something like this i might be able to understand how other compilers use llvm and quickly grok the api... maybe i'll start with python, i think the stdlib provides a nice AST api.

this is how i'm feeling right now, prototyping an O(n^3) audio algorithm that has to run on n >> 1 million. in python.

>she
can you stop with this meme

CUTE

What if you have a utility that displays all functions and global variables in your translation unit scope scope, sorted by frequency of use?

Dynamic type-checking, OOP and Shitkell are compelling arguments for eugenics.

struggling to try to learn modern opengl

>modern opengl
You should learn opengl 2 and opengl es 2 because it has the best platform support.
Once you got that down you can start optimizing with modern opengl.

Is opengl 2 the one with the glBegin()/glEnd() everywhere, or does it at least have VBOs?

Memeth for Meme.

>Memeth
>Meme

Using variadic inheritance for comfy polymorphism.

#include

struct A { void print() { printf("A\n"); } };
struct B { void print() { printf("B\n"); } };

template
struct D : Ts... {};

void print_a(A& a) { a.print(); };
void print_b(B& b) { b.print(); };

int main()
{
D d;
print_a(d);
print_b(d);
}

Already played around with some opengl2 and did all the glBegin glEnd stuff now I want to move on but there are a lot of concepts to learn and wrap your mind around before you can even draw something simple.

I'd say that would be an extremely small but not even close to sufficient step in the right direction. You could probably already do that with off the shelf tools.

>OOP

What's so hard about programming? You're literally just typing text. Any braindead retard can do this. There is no reason programmers should be making any more than minimum wage.

>didn't fall for the programming/computer science meme when I was younger
>25, sign up for FCC and github
>get in the chat
>some 14 year old asking for help in some of the advanced sections
>meanwhile I'm still stuck on the first section of the second chapter

welp

Is idris worth learning or is it just another meme?

Use real polymorphism instead

You're not even wrong desu.

Worth learning

What is ``real polymorphism"?

>ribbit the reddit frog
>ribbit filename
>meme
>welp
I don't want reddit stink nearby. Fuck off.

>meme
see

ideally λπω

Are there any programming languages based around concurrency and actors similar to Erlang/Elixir?

I think you mean λΠω

en.wikipedia.org/wiki/List_of_concurrent_and_parallel_programming_languages

your anime picture is cute so i guess you're right

Scala is a shit, but it has the Akka library. I believe Clojure has something similar.

Malakes

XDD have my upboat :d

int* x = nullptr;
int& y = *x;

sasuga C++

Gonna get started on screeps. A mmo rts where you write a program that controls all your units and buildings. Picked it up in the steam sale for 12,74 €

>mmo
>rts
>steam

sounds cool but like it'd be easily hacked

...

scheme

let me elaborate on this.

i want semantic information on every single variable, constant, function, magic number, i want semantic information on every fucking space or semicolon, i want information on every damn token.

i want to know when a function call was added recently to that function in a git commit, i want to know if that function's code was added recently, i want to know if that function call was actually a piece of code that was refactored.

i want to know if that function gets called everywhere in the codebase, if it gets called a few times or if that's the only call. I want to know where the arguments usually come from, counters? arguments passed to the caller passed again to the callee? are they usually the return value of a single function or do they get manipulated? how does that differ from this call?

i want to know what actual value the function usually gets at runtime, for scalars i want the range, the median value, the average value, same for the length of strings, t/f count for bools, graphs of the distribution for each of those.

i want to know every single while loop in the program and how much time is spent in it at runtime. i want to be able to query the runtime info for a number of iterations... if i'm analyzing a dsp project, and I have a buffer size of 128, i want to know every single loop that has 128 iterations.

i want to know every single loop that continues or break, as well as every single loop that might continue or break but never does at runtime.

i want to have so much information that it wouldn't fit in 10 posts and i want it to be displayed intelligently based on good heuristics. i want to be able to do custom queries on everything.

fuck this, i'm dropping my DSP project and working on this

i thought that was a fun idea that would have never worked in reality and then i realized you're not talking about building it but playing it... so it's cool that it exists but stop playing and make your own mmo

>stop playing and make your own mmo
gamedev is for dweebs. playing a programming game just sounds like fun

Autism

>he needs static typing

let x: *const usize = std::ptr::null();
let y: &usize = unsafe { std::mem::transmute(*x) };

>he needs types

>he concerns himself with boring housekeeping instead of letting the compiler do it for him

>laughing_anime_girls.apng

>need
>want

>he needs variables

>he hates performance

>he needs a programming language

Python is all you need.

>he needs a language

>he needs to exist in the real univese

>he needs thought

>he

Fucking hate xkcd.

C programmers use C because they think the speed of C will make up for their mediocre algorithm. Plain and simple.

wow! flying right now to your place to to suck your dick.

>null pointer dereference
dumbass
i bet you watch anime also

Wow, that's an odd way to spell real-time programming needs to be fucking real-time.

It's always been garbage. These days it's garbage with a blatant left wing political agenda.

Better get ready bitch.

null pointers were a mistake, maybe types are superior

>real-time programming
What is this """real-time programming""" you refer to?

>he reads xkcd

programming without relying on kernel interrupts to lessen the effects of your shit code.

I actually call an undefined function instead of sys.exit in python when debugging

but haven't you heard? go solved the gc problem

stay poor, bonus xkcd to trigger and

I was pointing out my own habit of thinking while programming.
C program will likely be faster regradless so I should not care that much. When programming in python, php, js some stupid implemetation can cause the page load to take few seconds which is way too much.
Kind of hard to care about performance with scripting languages when you know the underlying functions are inefficient as fuck.

woah i'm with her now!

Go optimized its GC for latency at the expense of everything else
A GC is a GC, nothing will change that

I'm trying to write an arithmetic expression parser in Javascript for a web page I'm making. It's oriented in evaluating the same expression with different values for its variables many times; and possibly delegating that task to the GPU.

At the moment, it can tokenize and parse parenthesis flawlessly, but I'm stuck on how to parse operators next.

en.wikipedia.org/wiki/Real-time_computing
I want first-year CS students, gamers, and NEETs to leave Sup Forums

>go
I hope you're joking, even C is more pleasant to program in`

>maybe type
>wrapper around a plain pointer
or
>waste memory when value isn't present

programming was a mistake

>underlying functions are inefficient as fuck
but they aren't, it's literally the opposite... user code is inefficient as fuck, builtins and most potentially cpu intensive operations in the std lib are programmed in C, fortran or even asm

don't understand sarcasm, i would ironically post that tBBT image but that's too much of a shitpost even for me

programming is the same thing as computing? so when a program adds 1 + 1 and returns 2, it's programming itself to do that? that really DOES sound pretty advanced

this is why you make maybe a part of your language rather than a pure code wrapper, the same optimizations that apply to sentinel values like NULL can be made

You either understand this on some metaphysical level that I do not or you are completely confused and wrong

Sorry, Go is a triggerword for me

>programming without relying on kernel i
How can you program wiyhout using a kernel?
>
C program will likely be faster regradless so I should not care that much. When programming in python, php, js some stupid implemetation can cause the page load to take few seconds which is way too much.
This why I said

>Real-time_computing
Why did you post that?

``go" is not for real-time programming

what's a good book to read to develop fundamentals for computer networks and security for someone going from computer science undergraduate to a graduate program in information security? i took one networks class but that's it. cyb/sec is just roleplayers

>C program will likely be faster regradless so I should not care that much.
True. C programmers only use C so that their piece of shit algorithm is implemented fast

>real-time programming
What is "real-time programming"?

>How can you program wiyhout using a kernel?
I work as an embedded systems developer, no kernel here. The C standard library has a fair bit in it, and a lot of dev boards are nice and give you a UART you can talk over.

Because she asked what real time programming was

Tanenbaum is what we read in college

you even quoted a piece of what you decided to ignore: "interrupts". how is "not relying on kernel interrupts" the same as "not using a kernel", and have you never heard of a microcontroller anyway?

>I work as an embedded systems developer, no kernel here.
I'm guessing your compiler doesn't requite a kernel just because you are an "embedded systems developer"?

>builtins and most potentially cpu intensive operations in the std lib are programmed in C, fortran or even asm
Which is why you should call those functions from C so you can avoid the JIT FFI thunking overhead of calling them from a scripting language.

They're saying that programs perform computing, and if you need to perform real-time computing, you want to write your programs in a language with a minimal runtime.