/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

docs.unrealengine.com/latest/INT/Programming/Slate/Architecture/index.html
spectreattack.com/spectre.pdf
vusec.net/projects/anc/
support.google.com/faqs/answer/7622138#chrome
myrlang.org
twitter.com/SFWRedditVideos

reposting
What the fuck is "opaque cache" and "low-grain invalidation"?
docs.unrealengine.com/latest/INT/Programming/Slate/Architecture/index.html

Which one is better, /dpt/?

Whichever is more appropriate for your use case.

I bet you like cock too

And for a second I thought that adequate discussion was possoble in dpt. Thank you for disproving my delusion right away.

They are both shit because they have so little syntax that they become hard to read. Also they reserve too many keywords.

Having said that, python is good for writing quick throw away programs... but then, you do have to context switch from whatever you are using, so maybe not even worth it. Depends if you are using another high level language at the time or something that isn't appropriate for quick scripts so need to context switch anyway.

>they have so little syntax that they become hard to read
>Also they reserve too many keywords.
>t. template[](){}

array
&array[0]
array+n
&array[n]
*array
array[0]
*(array)
array[n]

>Having little syntax is bad
Opinion discarded. I bet you dislike C too.

>pointer to start of array
>pointer to start of array
>pointer to start of array + n
>pointer to start of array + n
>first element of array
>first element of array
>first element of array
>nth element of array
>this is difficult for some people

You don't?

array decay and indexing as pointer arithmetic were a mistake desu

What happened with intel chip?
Why suddenly everybody talking about it?
I feel really out of the loop, without knowing anything about it

int *ptr = &* (int*) 0;
Is this undefined behavior?

>array decay and indexing as pointer arithmetic were a mistake desu
`array` is apparently just a pointer. Otherwise `array + n` wouldn't work. There's literally nothing wrong with any of those examples, though. If you want something to complain about:
n[array]
0[array]
&(0[array])
//etc.

But even that is internally-consistent (albeit surprising).

intel chip no take poo to loo
it shit bed

Arrays are not equivalent to pointers, they contextually convert to pointers.

>dereferencing a null pointer
Yes, that's undefined behavior.

>Arrays are not equivalent to pointers, they contextually convert to pointers.
Nobody said "arrays" (as the C compiler understands them) are equivalent to pointers. I said the array in his case is actually a pointer as far as the compiler is concerned, otherwise array+n gives an error. Nice try regurgitating /dpt/ wisdom.

>I said the array in his case is actually a pointer as far as the compiler is concerned
You don't have the context to say whether that identifier is an array or a pointer.

How are you meant to pass std::arrays as parameters in C++? It requires a size but wouldn't giving a literal as a size create problems?
i.e.
void foo(array {}

Typical retarded response from this site. Keywords like and, or, either, etc are reserved making it hard to develop APIs that rely on those words. The lack of syntax is in reference to not being able to determine code blocks easily from visual inspection, not being able to determine different types of things. You just have a bunch of words without any structure when you look at the code.

>You don't have the context to say whether that identifier is an array or a pointer.
Then I guess I'm misremembering something, because I don't think trying to do pointer arithmetic on an array causes it to decay. Is this not a syntax error?
int arr[100];
int *x = arr + 3;

It is bad because it is like reading a book without paragraphs, full-stops, commas, etc. There is a good amount of syntax and python has too little. That is why you see new languages like golang, etc, all keeping various syntax like function { } etc. They know that python went too far. But you dumb shits are smarter than all the programming language developers in the world obviously...

Intel added a "feature" to their chips which uninstall gentoo automatically.

isocpp.org unironically suggests this.
template
void foo(array);
Don't do that unless you're calling the function with very few size parameters or you'll get tremendous code bloat.

You could use the array::data method to extract the data pointer and pass an explicit size parameter the C way, but then there's almost no point in using a std::array.

You could create your own slice class containing the data and size parameters. For some astonishing reason this isn't standard in sepples.

1)Templatize by array size
2)Accept a pointer and size (I'd use this)

Would it not just be easier to use a vector in that case?

Easier, sure.
But if you're using C++ you probably are concerned about efficiency and the heap allocation + indirection of vectors will slow things down.

In Common Lisp, if I have a list of complex numbers like
(#C(7 8) #C(0 9) #C(1 3) #C(6 7))

Is there any way I can use format to convert it into a string like
(7,8) (0,9) (1,3) (6,7)

The docs on format don't seem very helpful regarding complex numbers.

>Keywords like and, or, either, etc are reserved making it hard to develop APIs that rely on those words
Then don't develop APIs that rely on those words. You're talking as if there are hundreds of random and obscure keywords that make for good and descriptive function names. Somehow this is only an issue with retards like you.

>The lack of syntax is in reference to not being able to determine code blocks easily from visual inspection
You just went full fucking retard, because in Python, the only way to determine code blocks is from visual inspection, and it's every bit as in any other language, because people determine code blocks by indentation, not by counting braces.

>But if you're using C++ you probably are concerned about efficiency and the heap allocation
y-yeah r-right !

That's because arr converts implicitly to an rvalue pointer.
The conversion is implicit, but it's equivalent to this.
int arr[100];
int *x = ((int*) arr) + 3;
It's not splitting hairs or an insignificant difference. Being an rvalue means you can't assign to it, and the decay doesn't occur when you use the sizeof or & operators. A struct that has an array as a member is entirely different in meaning to a struct that has a pointer as a member.
int arr[100];
int *x = arr;
printf("%zu %zu\n", sizeof arr, sizeof x);

You are smarter than the Python developers obviously.

Are we winning the war against OO?

>it is like reading a book without paragraphs, full-stops, commas, etc.
What a completely retarded analogy. If you want something closer to reality, reading your shitlang is like,reading,a,book,
that,is{written}
(like)
like,this;{}
Completely superfluous visual noise, and an artifact of poor language design.

we all are

OOP is defeating FP the way it has defeated procedural programming before it. Embrace, extend, extinguish.

>Are we winning the war against OO?
Spoiler: nope.

>OOP "embraced" and "extinguished" procedural programming
Let me guess: you're a retard who conflates "imperative" and "procedural".

Imperative is basically procedural with syntax sugar for calls to subroutines.

>conflataes
>look at me guys, I'm so smart, I know big words

>Imperative is basically procedural with syntax sugar for calls to subroutines.
user, procedural programming is imperative programming organized using subroutines. OOP is imperative programming organized using objects. These are two different organizational principles, and one is not an extension of the other.

who gives a shit
just use c++

>had to look up the word "conflate" in the dictionary
>thinks it's a "big" word because of that
>projects his insecurities onto others
Your illiteracy is your problem.

>organized using subroutines.
Only through main. Real programmers inline everything.

eat my dick faggot nigger kike

>doing procedural programming without breaking the program down into procedures
That's... not how it works.

I still realize how can somebody inplat code to run on my computer since javascript doesn't offer features that can lead to usefullness of this bug, and I don't install everything I see just because it's antivirus, just like windows users, so... Literally no problem with any bug. It's been here for years and people looking at me masturbating must be bored, nevermind.

>the absolute state of this board

>Then don't develop APIs that rely on those words.

Wow, fucking genius.

>You're talking as if there are hundreds of random and obscure keywords that make for good and descriptive function names.

There are a significant number compared to other programming languages. I am speaking from real-world experience where the API for python had to be different to all the other languages and was just shit.

>Somehow this is only an issue with retards like you.
The library I wrote has thousands of stars on github. You are some random person.

>You just went full fucking retard
Now I know you are a child. This site gets tiring when you realize everyone on here is less than 20 years old.

>because in Python, the only way to determine code blocks is from visual inspection
The keyword being EASILY. It is just a little bit of an indent. Then you have tabs put in there instead of spaces and whoops (not possible with python 3 finally) you can't tell there is even a bug. Then there is all the other syntax missing, which means people who can read code fast (not you) can't skim through with obvious visual indicators. if blah is true is just a bunch of words, it is missing structure and visual cues. Hence why new languages use more syntax than python.

>C++ is responsible for the popularity of OOP
>C++ is a procedural language extended with objects
>OOP did not become popular by extending procedural programming

How do I write an app for android and how to put ads on it?

>javascript doesn't offer features that can lead to usefullness of this bug
proof ?

I don't like golang, just using it as an example of a new language.

>that,is{written}
>(like)
>like,this;{}

Except code needs more syntax then a book because it is highly structured, much more than a book.

>poor language design

All the best and most popular languages are c-like (javascript, c++, java, etc). Python is good for throw-away scripts and social media bullshit.

spectreattack.com/spectre.pdf
section 4.3

>javascript has unbound pointers that can be offset anywhere in browser process memory
wtf

>I am speaking from real-world experience where the API for python had to be different to all the other languages and was just shit
It's almost guaranteed that you were doing something retarded. Which keywords were you conflicting with?

>The library I wrote has thousands of stars on github. You are some random person.
Actually, I am the CEO of a software mega-corporation, and you're just a random loser lying about his github. Prove me wrong.

>Then you have tabs put in there instead of spaces and whoops (not possible with python 3 finally) you can't tell there is even a bug
Nice try moving the goal post. Your claim that it's "hard" to distinguish code blocks without syntax is still absolutely moronic, because people don't rely on syntax to distinguish code blocks. They rely on indentation.

>Then there is all the other syntax missing
> which means people who can read code fast (not you) can't skim through with obvious visual indicators
So you're telling me that you can't figure out the structure of code without visual noise, and then telling me that I can't read code fast?

>it is missing structure and visual cues
You repeatedly confuse structure with syntax because you are mentally retarded. This discussion is closed on account of your lying and failing to address the arguments.

>Except code needs more syntax then a book because it is highly structured, much more than a book.
Conflating structure with syntax again... you're a fucktard.

>the best and most popular languages are c-like
>javascript, c++, java
These are some of the worst languages ever conceived, with vast amounts of superfluous syntax. Good job completely discrediting yourself.

Will LISP ever be surpassed?

>muh C++ is multi-paradigm
>that means OOP is an extension of procedural
So many retards ITT today...

No because people like ()[]{}:: way too much.

I didn't read the papers, since I'm a brainlet, but if they can exploit ASLR, why wouldn't they be able to the same with Spectre ?
vusec.net/projects/anc/

>It's almost guaranteed that you were doing something retarded. Which keywords were you conflicting with?

You would be retarded if you think you can predict how users will want to use python. It is like the communism of programming languages. "You are using it wrong". It isn't up to the programming language to determine which keywords I use. In a fluent-style API, keywords like and, or, of, etc, make a lot of sense.

>Actually, I am the CEO of a software mega-corporation
Except you aren't.

>Nice try moving the goal post.
reddit-tier debating

>because people don't rely on syntax to distinguish code blocks. They rely on indentation.

They rely on everything at their disposal. I am not sure how I am moving the goal posts. Do you not understand that visually tabs and spaces do not have any difference???

>So you're telling me that you can't figure out the structure of code without visual noise, and then telling me that I can't read code fast?

Python is for shitty throw-away scripts that you never look back on. That was the entire purpose of python according to its own creator.

>This discussion is closed on account of
cognitive dissonance and needing to avoid being wrong.

>obvious false-flagger who doesn't realize that the all-caps spelling implies LISP 1.5, which nobody considers good

Nobody said that OOP was founded in procedural programming, only that OOP became popular by extending procedural programming.

Nope, they are great languages. You ask many experienced developers and they will say they love javascript. That is why every single thing from bitcoin to neural networks is rewritten in javascript. It has the most people who like it.

>thinks `and` and `or` are good descriptive function names to expose in an API (a cross-language API, at that)
>It isn't up to the programming language to determine which keywords I use
>It is like the communism
>has no arguments, has to lie about having written anything useful in his life for credibility
>moves the goal post, gets called out, spergs out
>people count curly braces to figure out code blocks!

>quality is based on popularity

>OOP became popular by extending procedural programming
The fact that C++ supports both procedural and OO programming doesn't mean that OOP "extends procedural programming" in C++, or anywhere else. Also, source on your claim that OOP is popular due to C++. Java is probably more popular than C++ and it's quite clearly not procedural.

what does a purely object-oriented language look like

>You ask many experienced developers and they will say they love javascript
Now I know I'm being trolled.

>doesnt understand what a fluent-api is.
>thinks linq and SQL were poorly designed APIs because where and from are not "good descriptive function names"
>is literally a first year university student that was just taught "descriptive function names"
>thinks a grown adult lies on the internet because he is still a child and doesn't have any other perspective
>doesn't understand the term "moves the goal posts" or thinks tabs and whitespace look different and hence satisfy "python visually determines code blocks". How do you visually know that indentation is not a tab you stupid fuck?
>makes up some argument about counting braces I never used because he read it somewhere.
>uses stupid Sup Forums arguing points.

Smalltalk.

>has never met anyone with any experience because he is still at university

>more incoherent spergouts
>i'm a bigshot guise, i swear

this, smalltalk is amazing if you're into OO

>thinks SQL is a poorly designed API because "where" is not a descriptive function name.
>everyone "spergs out" when he loses an argument

C++ was conceived and named as C with Objects. How does that not constitute OOP extending procedural programming?

It can. Listen to the internal Intel conference call for investors - Intel specifically says they're working with browser vendors directly to help 'mitigate' the exploit.

Furthermore, Google lists some additional steps needed to make Chrome safe: support.google.com/faqs/answer/7622138#chrome

>C++ was conceived and named as C with Objects. How does that not constitute OOP extending procedural programming?
Because it literally doesn't "extend" procedural programming. It just provides an alternative to procedural programming within the same language.

>ulta lazy evaluation
>liquid state machines
>compiler is an AI
>goal-orientated
Why isn't this a programming paradigm?

int arr[100];
int *x = ((int*) arr) + 3;

>javascript and SQL are amazing in my opinion, and this proves that my other opinion is a fact

If you like C/Go, myrlang.org is worth checking out.

>Myrddin is a programming language. It aims for control and simplicity. It features strong type checking, generics, type inference, closures, and traits. It aims to fit into a similar niche as C, but with fewer bullets in your feet.
>Myrddin does not aim to explore the forefront of type theory or compiler technology. It does not focus on guaranteeing perfect safety. It is satisfied to be a practical, small language.

>>goal-orientated
You mean like Prolog?

>type inference
might be cool
>strong type checking
oh it's shit

>Classes are augmented structs
>Methods are just functions in a class
>Pointers are now handles to polymorphic objects
C++'s understanding of OOP is a retroactive rewriting of procedural concepts. The semantics of the existing procedural constructs have been changed. I definitely see it as an extension rather than an (ignorable, irrelevant) alternative.

>compiler has already generated your program before you even wrote it

>type inference without strong typing
wat

>Myrddin currently compiles for x86-64.
It's already obsolete, arm is where it's at.

You just made a stupid argument that all functions or methods should be some long, descriptive, specific word. You are blatantly wrong, you just can't admit it. Every api everywhere has simple words, push, pop, etc. It is just a dumb argument that your stubbornness can't backtrack from.

use std

const main = {args : byte[:][:] /* a slice of byte slices */
std.put("Hello-世界\n") /* prints to stdout */
for a : args
std.put("arg = {}\n", a)
;;
}

what the fuck is this sepples done by Guido or python done Stroutrup? Anyways it's ugly as hell

>They are both shit because they have so little syntax
What's easier to read?

for (int i = 0; i < array.length; i++)
for i in array:

i didn't know flask was THAT lightweight holy shit, i love it. if i knew about it before i learned
>django
it would've saved me a lot of unnecessary work

DMD 2.078 brings struct destructors to betterC
RAII here I come

>wanting that shit
gay

no u

automated intrusion analysis from pcaps. it neat