/dpt/ - Daily Programming Thread

Last thread: Lisp is the most powerful programming language.
What are you working on, Jow Forums?

Attached: Lisp.png (2880x1800, 562K)

Other urls found in this thread:

godbolt.org/z/IVuoOr
devblogs.microsoft.com/cppblog/game-performance-improvements-in-visual-studio-2019-version-16-2/
vandenoever.info/blog/2015/07/12/translating-haskell-to-c .html
twitter.com/SFWRedditVideos

>tranny is one letter away from tyranny
the big thought

kmeans is all i need to get 40k from boomers a yr

I program in C++ on occasion. It's a breath of fresh air after spending all day debugging Python "applications". And then you run into some horrible shit left over from C or C++98 and it just fucking ruins your day.

godbolt.org/z/IVuoOr

example(1) compiles

I signed up for IBMs learning mainframe and it's pretty neat. Uses ISPF heavily, hopefully they show off Endevor eventually.

So what's the problem now?

Attached: Annotation 2019-08-08 213543.png (1281x589, 73K)

Yes I know. That makes it all the more rage-inducing.
>we special case the literal 0 to be implicitly castable to any pointer value because nullptr didn't exist until C++11, but have to maintain backwards compat with shitty hacks that make writing generic code difficult

modern C++ is an abomination anyways, don't see why you bother with it if you're not required to.

Just trying to wrap my head around Clojure's loop/recur construct right now.
(defn new-message
"test"
[message count]
(loop [cnt count
msg message]
(println msg)
(if (< cnt 0)
msg
(recur (dec cnt) (str msg cnt)))))

Attached: Screenshot from 2019-08-08 20-35-29.png (482x233, 20K)

It's several orders of magnitude better than it was, has copious documentation and support, and is actually used by people which is kinda important if you are writing libraries.

Out of all the languages I've done serious development in, it's somehow (realistically, not idealistically) the best. I really enjoyed Go's concurrency as a primitive, but the rest of the language needs serious work. Rust is pure autism. Dynamic typing is a fucking cancer, I deal with Python every hour at work and it's so frustratingly useless I want to shoot myself. Functional languages will always be a meme, thank god we just took the bits we cared about and ignored the rest.

>I deal with Python every hour at work
Me too, but I love that shit homie. What's so bad about Python? Then again I love C++ too, so I dunno. Only mainstream languages I actively refuse to work in are JavaScript, PHP, and Ruby. (I don't consider shit like rust or functional languages mainstream.

I want to apply for an internship and they're looking for a resume, which I don't have. I thought internships were supposed to be about getting experience?

I also work with python on a regular basis.
Python's package ecosystem tells you all you need to know about how terrible Python can really be.
Have you seen Amazon's python libraries? They're a fucking cancer. Imagine mashing types together at RUNTIME
"Fuck your IDE buddy, better get used to reading docs if you want to know what functions are available for this higher-order type :DDDD"

list projects, education, known technologies instead of experience

Should I slip a Haskell interpreter the codebase I'm working on so I can work in an enjoyable language?

no

Of course. Job security through obscurity!

Attached: 1543220433575.png (923x713, 45K)

It's probably just the usecase.
>yeah lets just throw that shit fucking everywhere: scripts, automation software (ugh), long-running simulations
>what you don't like knowing you typo'd an attribute name after your simulation ran for 30 minutes?

You mean like the AWS shit? It's been a while, but I would imagine that it reflects more an AWS being fucking cancer than Python. After Java, Python has my 2nd favorite ecosystem in existence. So many great libraries...

Ohhh noooo, I have to read docs and can't just spam tab? What a shit lang

Well imagine you don't get to use any of those libraries and you have to write real software with it. Do you still like it?

Yes, it's my favorite language to write in. I wouldn't use it for literally everything though, right tool for the job and all that.

Is there compression algorithms that have very low processing requirements for encoding but still high throughput. Decode performance is not all that relevant.
Intuitively it feels like you couldn't save compute on the encoding side.

>What are you working on, Jow Forums?
Regretting not learning lisp when I had more opportunity to.

There are no elegant solutions in bracket langs. That's something Python and Haskell will always have over them.

shut up nerdboy
brackets are elegant as hell

Attached: 1558533161107.jpg (432x324, 32K)

And Ada, Erlang, Lisp, and many others.

Yeah it is a shit lang
Any lang that isn't optimized for static analysis is shit.
Type systems are your friend.

((((((((((((((((((((((such)))))))elegance)))))))))))

Brackets are whatever. Having to write work with edge cases or be unnecessarily explicit is what is unelegant.

That's invalid syntax.

There's good languages that are statically typed.

explicitness is great, fuck you
every API should be designed like vulkan

Ada and erlang are pretty noisy, but not as bad as sepples.

>very low processing requirements for encoding but still high throughput
Uhhh the tradeoff is typically ratio vs encoding speed, if that's what you mean.
lz4 and snappy are a couple famous ones designed to maximize compression speed at the expense of ratio.

Every language should have rust-style const by default

C++ is not bad

Attached: 1560547765148.png (1251x136, 8K)

Python users should be gassed.

all of the ones with an ASIC/FPGA implementation of an encoder

>gas
*farts in your face*

In what way?
By not using inference?
like always, rust didn't start that

He means making everything constant unless said otherwise.

thank you for your opinion

#define 「 {
#define 」}
#define 〔 (
#define 〕)
void func〔params〕「
//more langs should use esoteric braces

「ホモラング」

microsoft's engineer finally reached the loop unrolling chapter in textbook

devblogs.microsoft.com/cppblog/game-performance-improvements-in-visual-studio-2019-version-16-2/

Where can i buy a keyboard with those?

vectorizing is not the same as unrolling.

yes, and the SIMD chapter is right after

>posting the edit

not everyone is ready to embrace the full glory of our lord and savior bjarne

Attached: long_bjarne_is_long.png (603x324, 365K)

Attached: bjorne.jpg (494x423, 27K)

how dare you imply C++ is anything like java

wonder how bjarne feels being stuck with sepples forever.
Figure most people would get burnt out and want to do a new language, but maybe he just stopped caring

You're right,it's morphed into something worse than java syntactically.

template metaprogramming is not that hard to understand

understanding and being horrific and ugly as sin are two different things.

but how can you think it's ugly if you understand it
it's so elegant and beautiful

Sea and sepples are ugly.
>NOOOOOO YOU JUST DONT UNDERSTAND

Attached: F500F2AC-685C-40E2-BC7D-B50801E0FA27.png (785x1000, 261K)

shut up pythonfag, you're opinions don't matter

Cope

ducks are retarded, python is based around duck typing, and when you write code you type
ergo, people who use python are retarded
seethe more snakefucker

quack

Shush, you're triggering him.

#include "main.h"
/*#include "paths.h"*/
#include
#include
#include
#include

extern int monitorID; /* defined in multicaster.c */
extern int my_FLOW_PORT;
extern int verbose;
extern int nPages;
extern char * cmd_name[];
extern unsigned int total_pages, real_total_pages;
extern off_t total_bytes, real_total_bytes;

/* buffer for receiving complaints */
char flow_buff[FLOW_BUFFSIZE];
int *code_ptr; /* What's wrong? */
int *mid_ptr; /* machine id */
int *file_ptr; /* which file */
int *npage_ptr; /* # of pages */
int *pArray_ptr;/* missing page arrary */

/* receive socket */
int complaint_fd;
#ifndef IPV6
struct sockaddr_in complaint_addr;
#else
struct sockaddr_in6 complaint_addr;
#endif

/* status */
char *missing_page_flag=NULL; /* arrary of size nPages -- dep on the files */
int *last_seq; /* array of size nMachines -- seq number of complaints */
/* *** watch out the max seq = 2e9 */
int *total_missing_page; /* array of size nMachines -- persistent thru life of program*/
char *file_received; /* array of size nMachines */
char *bad_machines; /* array of size nMachines -- persistent thru life of program*/
char *machine_status; /* array of size nMachines for ack */
int *missing_pages; /* array of size nMachines */

int nMachines;
int has_missing; /* some machines have missing pages for this file (a flag)*/
int has_sick; /* some machines are sick for this file (a flag)*/
int skip_count=0; /* number of files that are not delivered */
int quitWithOneBad=FALSE; /* default: continue with one or more (

what's the accepted onomatopoeia for white noise
kssshhhh?

Attached: 1558104779365.jpg (341x341, 27K)

We're not all autistic here. You can see ugly and understand it in the same face.

why isnt Lisp spelt as Lithp?

The faggotry in this thread only proves me right.

Attached: unabomber_sketch.png (247x329, 59K)

I would have sworn you're baiting but I know better.

have code

Learn Haskell
vandenoever.info/blog/2015/07/12/translating-haskell-to-c .html

Attached: haskell vs tmp.jpg (673x280, 23K)

>onomatopoeia for white noise
lock her up

Attached: 1528599950280.png (250x250, 92K)

>types were a mistake
>infix was a mistake
>header files were a mistake
>libraries not packaged with the executables were a mistake
>structs can be imitated with macros
>low memory use is more important than page alignment
>CISC was a mistake
>relying on the standard library is a mistake
>functional langs should've tried to be efficient from the get go
>Lisp's only problem is syntax
>Assembly should've been standardized
>Assembly should be first lang taught in cs1 to keep out undesirables

Attached: BC24BF82-9C99-4393-AE21-2B75A0A066F3.jpg (620x465, 33K)

>>types were a mistake
just because you abstract them away doesn't mean they don't exist
>>Lisp's only problem is syntax
dynamic typing and performance as well

>literal nonsense: the post

Lisp is faster than Go.

Attached: 3BAAD6CF-0E5C-4D15-BA0C-B3EE3C4BAC91.png (345x194, 60K)

>t. Assemblet

>a tortoise is faster than a slug
gz?

>Assembly should've been standardized
The only way you could say something so nonsensical is if you have almost zero understanding of assembly languages and computer architectures yourself.

slugs are cute though

I don't mean what you think I mean. I mean Assembly should've stayed the standard for systems stuff not that every Assembly should be the same.

Ah. You're also bad at expressing your dumb opinions.

You just have shitty reading comprehension.

kek. Wrong captain autisimo. By way of analogy
>English shouldn't been standardized
Normal-functioning people would interpret this sense to mean
>There should be one standard/official English variety.
not
>English should've stayed the standard for a relatively obscure technical task, not that every variety of English should be the same.

>English should've been standardized
whoops obvious typo, let's see if he spergs over it

Sounds like something someone with shitty reading comprehension would say.

>I go out of my way to say something demonstrably stupid which highlights a lack of basic communication skills
>you just can't understand my writing

Attached: thanks.jpg (211x239, 8K)

Has anyone here needed to synchronize data packets made by scratch through, lets say, asynchronous wireless serial communication? In other words, making the receiver know where the start of the data is. I made a version of this with small data packets where I forced the first bit of each byte to zero then I added a prefix at 255. This worked good but when the packet is larger this is not a good idea since recomposition is hell (on another project Im making). Since I have a byte in the packet which cannot take values above 4 I was thinking in just sending a preamble the size of the data packet with all bytes at 255 in order to not confuse with all possible partial packet combinations but this seems kinda retarded. I have no idea of what to do.

Attached: tin-foil-hat-antenna-400x300.jpg (400x300, 14K)

*I am assuming ofc that all other bytes can take any value from 0 to 255 (unsigned).

>>structs can be imitated with macros
what?

Dude if it sounds like retarded bullshit that's just your lack of reading comprehension skills, move along.
kek

have you read your WEPSKAM today?

Attached: What-Every-Programmer-Should-Know-About-Memory-OpenLibra.gif (450x591, 77K)

What fucking retard writes add like that in C++?
It's not even a fucking function like it claims.

>Table of contents:
>Chapter 1 - What is memory? (2)
>Chapter 1 - What is memory?
>It's all 1's and 0's, lol
>Acknowledgments
>Your mom

If only writing books was as easy as soundcloud rapping

it is a function, fool
templates are a programming language

>the preamble itself an be confused with previous bytes
Im so fucked

In C++17 this is just template
auto add = a + b;