[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 343
Thread images: 22

File: 1418240370165.webm (2MB, 1280x720px) Image search: [Google]
1418240370165.webm
2MB, 1280x720px
What are you working on, /g/?

Old thread: >>59365904
>>
Programming sans I/O.
>>
>>59371769
>the communication between an information processing system, such as a computer, and another information processing system
yes, that is i/o you fucking retard
I'll repeat: compiling in itself is i/o
>>
File: 1484627060141.jpg (18KB, 480x270px) Image search: [Google]
1484627060141.jpg
18KB, 480x270px
>>59371786
truly this.
>>59371808
>the communication between an information processing system, such as a computer, and another information processing system
Yes, the computer itself performs I/O. This doesn't mean that the language has any notion of I/O.
>compiling in itself is i/o
No, you retard. A compiler is simply something which maps source code to a program, there is literally nothing here which requires I/O.
If most implementations of compilers use I/O it does not somehow mean that a compiler is inherently tied to I/O.
>>
A program without I/O could be used for testing hardware stability. I/O doesn't matter. All you need to know if your computer crashes or not.
>>
Programs sans I/O are also the ultimate proof that you're programming recreationally, just for the the aesthetic qualities of source code.

Recreational programming with I/O is basically for poseurs.
>>
A program without I/O could be used for exactly nothing useful
>>
>>59371911
>addition cannot be used for anything useful
>>
>>59371851
>Yes, the computer itself performs I/O
this is what I was arguing. I mistakenly implied I was talking about the language. you all should be saying "a programming language sans I/O" not "programming sans I/O" then
>>
>>59371911
This is by definition false. Unless you want to argue that the following is false of course (heads up: it's true)
"Something which has a use is useful."
>>
Let's stop this now. The retard posting about I/O just wants a syntax for input into a static analyzer. It's not a programming language since it doesn't program anything. Stop giving taking about it.
>>
There's a distinction between a language and how programs written in it are interpreted.
>>
>>59371911
see
>>59371858

A program without I/O can be used for hardware Q/A.
>>
>>59371923
>>addition cannot be used for anything useful
It is if you can't see the result.
>>
>>59371970
what's wrong with testing hardware stability with i/o?
>>
>>59371945
Programming something in a language is programming [with or without I/O].
Programming something in a language with no I/O is programming with no I/O.
>>
Is webpy the way to go if I want to make a simple web interface for a python program?
What would be the best way to make one if not?
>>
>>59372014
>Programming something in a language with no I/O is programming with no I/O.
>Yes, the computer itself performs I/O.
hmmm
>>
Does this program do I/O?

data Console a where
PutStrLn :: String -> Console ()
GetStrLn :: Console String

putStrLn :: String -> Free (Coyoneda Console) ()
putStrLn s = liftF (liftCoyoneda (PutStrLn s))

getStrLn :: Free (Coyoneda Console) String
getStrLn = liftF (liftCoyoneda GetStrLn)

program :: Free (Coyoneda Console) ()
program = do
putStrLn "Please enter your name:"
name <- getStrLn
putStrLn ("Hello, " ++ name ++ "!")
>>
>>59371958
>It's not a programming language since it doesn't program anything.
Are you retarded? How is programming in a Turing complete programming language somehow not programming something?

>>59372058
"Programming with no I/O" implies that you are programming something while not making use of I/O, you could do it in any language which has even a single non-I/O function. Unless you are a retarded ESL you should be able to understand this.
>>
>>59372096
Fuck off.
>>
>>59372093
>Does this program do I/O
>>program = do
>> putStrLn

"no", the "computer that executes the program does I/O"
>>
>>59372096
>"Programming with no I/O" implies that you are programming something while not making use of I/O
how does it do this if computer itself performs I/O?
>>
>>59372096
>Turing complete programming languages aren't I/O
You're fucking brain dead
>>
to elaborate on anon's post

all you are doing is describing an effectful program, the language itself merely allows for pure transformations and reductions to take place

effectively, you end up describing a program as a value within the module

this is different to something like an imperative language, because the "effects" are actually just a part of the value. you can discard the effects, modify them, repeat them, etc.

the compiler then searches the Main module for a "main" value, that describes a program, and then compiles it to an actual program.

so in >>59372093 , program IS just a pure value (and assuming it was just IO) that the compiler will convert into the actual program
>>
>>59372179
>Reddit spacing
I didn't even bother to read your post, because I already know it's fucking stupid. Piss off.
>>
>>59372135
"Writing a program with no I/O" is by definition the same as "programming with no I/O". This sentence doesn't say anything about the machine executing the program. A non-ESL should get this.

>>59372169
What are you even on about? When did I/O become a fucking requirement for being Turing complete?
>>
>>59372169
A language being Turing-complete does not imply that it can do I/O, and vice versa.

The lambda calculus is Turing-complete and cannot do I/O.

The following language can do I/O, but is not Turing-complete:

Expr ::= Expr + Expr
| Expr * Expr
| Print Expr
| Expr; Expr
>>
>>59372217
Oops, forgot the base case:

Expr ::= Int i
| Expr + Expr
| Expr * Expr
| Print Expr
| Expr; Expr
>>
>>59372211
>"Writing a program with no I/O" is by definition the same as "programming with no I/O"
wrong
>>
/g/ can't even average 2 ints dans une langue sans Entrée/Restitution
>>
>>59372217
Exactly, you could also define a language which can't do basic control flow but can still do I/O.
>>59372250
Right.
>>
>>59372208
>reddit spacing
I hate this reddit meme
>>
>Turing complete
Oh lord
Without dynamic I/O, you've got nothing. Both in the real world and mathematically. The Turing machine really is quite limited in functionality. If a computation happens and no one can use it, does it really compute? Never underestimate the importance of dynamic I/O. It's what makes everything possible. The entire idea of a Turing machine will steer you in the wrong direction.
>>
What are some quirky languages :3?
>>
>>59372103
Only valid response to this hyper autism semantic argument, tbqh
>>
Odd how none of the "no I/O" babies have replied to >>59371999
>>
>>59372319
apl
>>
>>59372304
>Without dynamic I/O, you've got nothing.
There is so much wrong with this statement that I won't even address it as something valid.
>Both in the real world and mathematically.
Are you implying that mathematics exist in some kind of "fake"(?) world?
>The Turing machine really is quite limited in functionality.
Why does it matter?
>Never underestimate the importance of dynamic I/O.
It's fucking garbage.
>>
>>59372344
Read the previous thread. There's a response to something very similar.
>>
>>59372358
>It's fucking garbage.
There is so much wrong with this statement that I won't even address it as something valid.
>>59372374
Mind pointing it out to me?
>>
>>59372391
Just read the thread, it's where some stupid person decided to claim that you can't see the result of evaluation therefore you don't know the result.
>>
>>59372409
How do you know the result then?
>>
Daily reminder that hardcoding values into the source code is I/O.
>>
>>59372422
Daily reminder that hardcoding instructions into the source code is I/O.
>>
>>59372414
How do you know the result of writing "1 + 1" on a piece of paper?
>>59372422
>>59372435
It is (usually) done through the use of OS (an editor) I/O but it isn't I/O itself.
>>
>>59372450
>inputting something
>not input
>writing something on paper
>not output
lol
>>
>>59372450
How did you write down 1 + 1 without in input of your hand and a pen?
>>
Daily reminder that according to /dpt/, pure code does I/O otherwise it is useless
>>
>>59372450
By reading it with my eyeballs.
>>
>>59372462
Where did I claim that?
>>59372465
Why would you be writing it down without input? That simply isn't possible by definition, nor did I claim that it is possible.
>>59372484
But how do you know the answer? The expression itself can be evaluated provided you know the language it's written in. You don't need to write "2" to know the answer to "1 + 1"
>>
File: haskell quote.png (1MB, 790x960px) Image search: [Google]
haskell quote.png
1MB, 790x960px
>>59372093
purepill me on coyoneda
>>
>>59372501
>You don't need to write "2" to know the answer to "1 + 1"
Sure but it will take a long time for a human to just read code to get an answer. That's the whole point of running code on hardware.
>>
>>59372533
Depends on the human, obviously someone who is so retarded as to think that a string is somehow I/O will have a hard time.
>>
>>59372515
me too
>>
Hey mates. Trying to make 4chan API works with axiosjs. But I'm getting the following errors:

> [Error] Refused to set unsafe header "Origin"
> [Error] Refused to set unsafe header "Referer"
> [Error] Failed to load resource: Origin http://0.0.0.0:8000 is not allowed by Access-Control-Allow-Origin. (catalog.json, line 0)
> [Error] XMLHttpRequest cannot load http://a.4cdn.org/b/catalog.json. Origin http://0.0.0.0:8000 is not allowed by Access-Control-Allow-Origin.

I know that this has to do with CORS and the Headers I'm passing. But I don't know how to fix it properly :/
>>
>>59371808
>the communication between an information processing system...and another information processing system...is i/o
Is calling a function i/o?
>>
>wasting server space with this shitty ""debate""
>>
>>59372620
If it's outside of the program
>>
>>59371858
Crashing can't be detected if it doesn't generate i/o.

>>59371970
The "A" part of Q/A cannot exist without I/O. What's the point of testing hardware if you're unable to tell if the hardware passes the test or not?
>>
>tfw /wdg/ is deader than usual
c-can I talk about javascript here
>>
>>59372093
>Does this program do I/O?
It depends on what software you use to execute it.

>>59372647
So a function ceases to be an ``information processing system" if it's part of a program?
>>
>>59372634
>what is lazy evaluation
>>
doing tetris in x64 assembly (with I/O)
>>
>>59372740
Sure, that seems like that statement needs definitions attached to it, but I don't honestly care.
>>
Hey /g/
I'm learning C and I've written a game of life implementation, but my code looks like shit. This is mainly because I can't understand how to pass a multidimensional array between functions.

Is there an easy solution to this or is it simply a bitch to do?
>>
>>59372809
pass its pointer
>>
>>59372809
C doesn't natively accept arrays being passed between functions. It will just give you a pointer.

I suggest using a linked list instead.
>>
File: Capture.png (117KB, 1475x1792px) Image search: [Google]
Capture.png
117KB, 1475x1792px
Why is my layout looking like this? I want each button to have equal height...
<GridLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_columnWeight="1"
android:columnCount="3"
android:rowCount="4">

<Button
android:layout_columnWeight="1"
android:layout_gravity="fill"
android:gravity="center"
android:text="a"/>

...and another 11 Buttons below
>>
So last thread I wrote about a java NcR implementation with the Pascal's Triangle, so I decided to actually do it. It's my first attempt at doing memoization as well.

Aside from me not using BigInteger (cases larger than n=35 start overflowing Integer) how did I do?

package fastChoose;
import java.util.*;

public class NChooseK {
TreeMap<Integer,Integer[]> tri;

public NChooseK(){
//creates the reference map
tri=new TreeMap<Integer,Integer[]>();
Integer[] first={1};
Integer[] zero={0};
Integer[] two={1,1};
tri.put(0,zero);
tri.put(1,first);
tri.put(2,two);
}

public Integer[] makePascal(Integer num){
//generates rows of the pascals triangle up to num and stores them in tri and returns the row
if(tri.containsKey(num)){
return tri.get(num);
}else{
int n=(int)tri.lastKey();
for (int i=n;i<num;i++){
Integer[] prev=tri.get(i);
Integer[] next=new Integer[i+1];
next[0]=1;
next[next.length-1]=1;
for(int g=1;g<prev.length;g++){
next[g]=prev[g-1]+prev[g];
}
tri.put(i+1, next);
}
return tri.get(num);
}

}

public void display(){
int times=(int)tri.lastKey();
for (int o=1;o<=times;o++){
Integer[] ray=tri.get(o);
for(int h=0;h<ray.length;h++){
System.out.print(ray[h]+" ");
}
System.out.print("\n");
}
}

public Integer get(int n, int r){

if (tri.containsKey(n))
return tri.get(n)[r-1];
else if(n==0)
return 1;
else
return makePascal(n)[r-1];


}

public static void main(String[] args){
NChooseK n=new NChooseK();
System.out.println(n.get(40, 20));

n.display();


}
}

>>
Rustfags will defend this:

https://chrismorgan.info/blog/rust-fizzbuzz.html
>>
>>59372809
[spoiler]Use malloc.[/spoiler]
>>
>>59372862
>Recursive Pascal's Triangle
Wew
>>
>>59372913
>Rust
literally who?
>>
>>59372809
like dis?

typedef struct matrix {
int *data;
int n, m;
} matrix;

int fillMatrix( matrix *a )
{
int n = a->n, m->n;

a->data = calloc(sizeof(int), m * n);

for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++)
a->data[i * n + j] = 0;
}

int main( void )
{
matrix m;

m.data = 0;
m.m = 5, m.n = 4;

free(m.data);

return 0;
}
>>
>>59372923
I dont recall putting in recursion. It's memoized so if I call it multiple times it wont have to remake the entire triangle.
>>
>>59372922
Which helps how? You're still stuck with just one pointer to the start of the memory chunk. Doesn't help with a 2d array at all.
>>
Trying to reverse some VC++ malware that apparently makes use of the entire boost library. Help?
>>
>>59372851
Fucking finally found it.
I was missing this from each button:
android:layout_rowWeight="1"
>>
>>59372982
elaborate
>>
>>59372998
No
>>
File: Why is it being retarded?.png (211KB, 2561x1285px) Image search: [Google]
Why is it being retarded?.png
211KB, 2561x1285px
>>59371757
>Make basic function to find the highest common factor of two arguments
>No bugs - great
>Doesn't fucking work; it just skips to the return b statement, I assume.

What's wrong with it /g/, other than it being on Xcode?
>>
>>59372998
Maybe
>>
>>59373026
>a = b
>b = a
now sit down and think
>>
File: description_of_a.jpg (97KB, 782x441px) Image search: [Google]
description_of_a.jpg
97KB, 782x441px
>>59371757
Thanks for not using an animuh im-
>>
>>59372839
>linked list for a 2D grid
>items aren't being removed or added
kys
>>
>>59373026
lol
>>
>>59373026
Your swap algorithm in the first block of HCF() is faulty. It copies B to A, then copies the NEW value of A to be. You need to be storing the temporary value somewhere.
>>
>>59373026
>if (a < b) {
> a = b;
> b = a; // a was already equal to b, so you're doing b = b, clever.
> }
>>
>>59373026
a ^= b;
b ^= a;
a ^= b;
>>
>>59373102
Idiot.
>>
>>59373026
if (a < b) {
int tmp = a;
a = b;
b = tmp;
}
>>
>>59372998
Ransomware written in C++ for Windows. It's a whole megabyte and I can see some debugging symbols. I'm using radare2 but as far as I can tell there isn't a way to automatically link the debug symbols to their respective functions. Pic related.
>>
>>59373102
yeah, bitwise xor is exactly what we need here
>>
>>59373084
>>59373102
>>59373085
Thanks, I also did it in the second block which is why.
>>
>>59373130
thats a hacker as fuck UI you got there
>>
>>59373130
Is that i3 ?
>>
>>59373130
definitely not helping you with a rice like that
>>
>>59373168
Blackarch i3 config
It used to be blue but I bought this laptop back when I was an autist so it's a red gaming laptop. My OCD therefore requires a red theme.
>>
Does anyone know of any good forums or boards that are actually pretty active for people that didn't start programming yesterday?
>>
>>59373193
How is blackarch compared to Kali ?
>>
>>59373218
GitHub.
>>
I promised myself this time I will do every single excercise from CPL.
>>
>>59373254
start with SICP instead
>>
>>59373254
what's cpl
>>
>>59373329
C the Programming Language.
>>
>>59373220
I didn't install the blackarch ISO. I added its repo and download individual tools when I need them. AFAIK it's the same to Arch as what Kali is to Debian: a modded UI and more tools installed. Correct me if I'm wrong on this though.

As for the actual tool comparison, the ones I use are on both BA and Kali repos, so there is no real difference to me. I don't like Kali because of the fact that they will shove your whole applications menu one level down for their tools (on a traditional DE) but since the same tools are available on both it's not a big difference.
>>
>>59372809
You can pass an array and its stride
#include <stdio.h>
#include <stdlib.h>

// the first dimension of A is actually sort of ignored
// in reality the compiler sees it as char *A[w]
// That's still good enough, the compiler knows stride is w in length
void print2d(int h, int w, char A[h][w]) {
putchar('\n');
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
putchar(' ');
putchar(A[i][j]);
}
putchar('\n');
}
putchar('\n');
}

// if you prefer a different argument ordering, you can use
// old-style C function declaration syntax
// To make it interesting, lets make this one print transposed
void print2d_alt(A, h, w)
int h, w;
char A[h][w];
{
putchar('\n');
for (int i = 0; i < w; i++) {
for (int j = 0; j < h; j++) {
putchar(' ');
putchar(A[j][i]);
}
putchar('\n');
}
putchar('\n');
}

int main(void) {
// Static, Stacky

#define N 8
char checkerboard[N][N];

for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
checkerboard[i][j] = (i+j) & 1 ? '+' : '-';
}
}

print2d(N,N,checkerboard);

// Dynamic, Heapy, Grody
printf("Input height and width, separated by a space: ");
int h, w;
scanf("%d %d", &h, &w);

char *b = malloc(h*w);

for (int i = 0; i < h*w; i++) {
b[i] = 'a' + (i%26);
}

//this will warn, due to the types not *quite* matching
// print2d(h, w, b);
//you can subvert the warning with an ugly cast
print2d(h, w, (char(*)[h])b);
// this one doesn't need a cast - why?? ;-)
print2d_alt(b, h, w);

free(b);
return 0;
}
>>
>>59373026
Someone get the "swapping expert" screenshot
>>
>>59372913
>getting to choose whether your allocate strings on the stack
This is great for systems programming languages. Doesn't matter for scripting languages and thus you don't have to worry in languages like Python. Also, anyone porting Python code to Rust is probably an idiot.

In C++, you don't get much of a choice and it's annoying
std::string my_string = "Fizz"; // this is unconditionally heap-allocated

There are emerging libraries (e.g. boost) for "string views" but this isn't standardized
>>
>>59373500
The location of a std::string is not defined (in c++) to be in the heap.
>>
>>59373500
std::string<my_stack_allocator<>> my_string { my_stack_allocator<> { }, "Fizz" };
>>
>>59373500
Isn't that just Small String Optimisation?
>>
>>59373500
C doesn't have this problem.
>>
>>59373642
C has other problems related to strings and memory management in general.
>>
>>59373661
wrong
>>
>>59373661
You being too stupid to manage your own memory is not a "C problem".
If you have a decent understanding about pointers, lifetimes, and ownership, memory management is fucking easy.
>>
>>59373671
>>59373681
Well C++ can do C strings so C isn't any better than C++.

>If you have a decent understanding about pointers, lifetimes, and ownership, memory management is fucking easy.
Of course, but Rust is easy as well when you know about that stuff.
>>
>>59373607
edit: looked it up, apparently the syntax is more like this:
std::basic_string<char, std::char_traits<char>, my_stack_allocator<>> my_string { "Fizz", my_stack_allocator<> { } };

anyway if you were to use this you'd probably do:
using stack_string = std::basic_string<char, std::char_traits<char>, my_stack_allocator<>>;
my_stack_allocator<> alloc { };
stack_string my_string { "Fizz", alloc };
>>
>>59373694
>Well C++ can do C strings so C isn't any better than C++.
That is a fucking retarded thing to say.
>>
>>59373718
If C doesn't have the problem, neither does C++, really, because you don't have to use std::string.
>>
>>59373694
>Of course, but Rust is easy as well when you know about that stuff.
the trade off is that rust is ridiculously big and inefficient
>>
What books can I read on C++, if I know C?
Is there some C++->C translator, so the program could possibly be ported on any platform?
>>
>>59373728
>inefficient
wrong Rust is the MOST efficient language in fact
>>
>>59373728
It's a hell of a lot more efficient to write, and currently C is the only language that's faster according to the benchmark game.
>>
>>59373729
Don't even bother with C++. If you want to learn a "higher level" language than C, there are much better, more modern alternatives.
>>
>>59373729
https://www.youtube.com/watch?v=kdlIlIIHCz0
>>
>>59373500
Ada has the novel concept 30 years ago.
>>
>>59373661
>Idiots who use C like it's one of their meme languages have other problems related to strings and memory management in general.
FTFY
>>
>>59373742
>It's a hell of a lot more efficient to write
You spend most of your time in Rust just fighting the compiler, trying to get whatever the fuck you wrote to just compile.
>>
>>59373739
>>59373742
aaaaaaaaaaahahahaha the delusional rustfags have arrived
>it was fast in this one specific benchmark therefore it is fast and lightweight
>>
>>59373745
Please, I need a book to read.
A book. Not video.
>>
This is by far the most retarded thing I've ever seen be argued about on /dpt/.
A program that does zero I/O is fucking completely useless.
>hur dur no I/O can do hardware QA
No, you're fucking wrong. How will you know if the program executed correctly on the hardware if it doesn't output anything?
>>
>>59373772
Sorry chumbo but us Rustaceans are the best programmers *snibbedy snabs your bp*
>>
>>59373694
>Well C++ can do C strings so C isn't any better than C++.
Nobody claimed that C++ was better. All that's being claimed is that the C++ library is full of enterprise bloat that's not suitable for a systems language. Which is fine, because C++ isn't a systems language; it's an application language based on a systems language.
>>
>>59373785
>A program that does zero I/O is fucking completely useless.
>>59371950
>>
File: smug_anime_face.jpg (39KB, 724x720px) Image search: [Google]
smug_anime_face.jpg
39KB, 724x720px
>>59373772
I don't understand why Rustfags think that Rust is going to replace C. Rust will NEVER replace C. C is too ingrained in the computer world for software that needs speed. If anything, Rust will replace C++. Dare I say, good riddance.
>>
>>59373766
Not if you know about ownership and borrowing, which is what you need to be good at C anyway. Every case of someone complaining that they have to fight the compiler is due to them designing a poor API (admittedly the standard library suffers from this sometimes) that borrows too much of a structure when you could have multiple disjoint borrows instead. If you need to borrow disjoint regions of a slice, for example, there's an API for that (split_at[_mut]).

>>59373772
It's fast. Idiomatic Rust is not as lightweight as C, but you can disable exceptions (panics will just abort) and not use the standard library and you cut your executable size way down.
>>
>>59373794
yes, good. run away from what he is actually saying and instead interpret a figure of speech literally, that'll make you look really smart
>>
>>59373694
That is probably most retarded thing I have ever heard a rust fag say. Be proud, that's quite an achievement.
>>59373789
This
>>
>>59373807
Who says Rust will replace C? Cfags can't shut up about Rust but Rust people only compare to C++, Ada, etc.
>>
>>59373843
>Who says Rust will replace C?
Where the hell have you been?
>>
>>59373843
lel, where have you been where all the rustfags make bait thread about Cfags being NSA shills.
>>
>>59373850
I mean, Rust is obviously safer than C but C definitely has use cases that Rust can't touch. Realize, though, that a lot of people in this general use C where it's not needed, and Rust would be a much better choice then.

>>59373858
I don't think that guy is a Rust user, he's just a faggot who wants to stir up shit.
>>
>>59373794
That argument depends on it being possible that a program with no I/O has a "use". What possible "use" could there be for a program with no I/O? You wouldn't even be able to determine if such a program even executed.
>>
>>59373828
>run away from what he is actually saying
I didn't "run" away from what he said since that's the only thing in his post which applies to me.
>instead interpret a figure of speech literally
He literally said something false. Modifying it so that it's true wouldn't take that long so it's obvious he is either stupid or deliberately lying.
>>
>>59373794
You're completely right about that. Now let me tell you something:
A program which accepts no input and outputs nothing has no use, and is therefore useless.
The ONLY reason your languages operators, keywords, functions, and such exist is to be outputted in some form later.
If you don't output anything, then whatever you're doing in the program is equivalent to nothing and replacing the entire program with a ret is a 100% valid optimization that your compiler will do if it's smart enough.

I'm sorry m8, but I don't think programming is for you. Just stick to pure maths.
>>
>>59373825
I've written a somewhat non-trivial program in Rust.
I had a several hashmaps with multiple (2) threads that needed to access and modify them.
I did manage to get it working, and I see where the logic in it comes from. It just seems so damn heavy-handed; all sorts of unnecessary scopes introduced, annotations put on all sorts of shit, and I even needed a cargo package for a "threaded scope". It was all just a pain in the ass.
>>
>>59373897
>replacing the entire program with a ret is a 100% valid optimization that your compiler will do if it's smart enough
GCC will actually do this, at least if your program is contained in 1 translation unit.
>>
>>59373917
I know, but I highly doubt that he'd be using C.
I assumed he would be using some shitty special snowflake language that 2 people on this earth know about, hence why I said "if it's smart enough" (it isn't).
>>
>>59373898
>all sorts of unnecessary scopes introduced
They're not unnecessary. If they were, you wouldn't have to use them. They are looking into using liveness analysis instead of just lexical scoping, but how else do you want to tell the compiler that a borrow is finished?

>annotations put on all sorts of shit
Probably you're not using inference to its full potential. You can use underscores judiciously to specify only the ambiguous part of a type while inferring other parts, for example.
>>
What programming languages do they use in China?
>>
>>59371757
Re-implementing pipes with no I/O.
>>
>>59373883
Me having a use for it is by definition a use. Even running it would be useful for me.
>You wouldn't even be able to determine if such a program even executed.
You can't monitor the resource usage of your computer?

>>59373897
>A program which accepts no input and outputs nothing has no use, and is therefore useless.
This contradicts your first sentence. Me wanting to run a program is already a use, therefore it useful.
>The ONLY reason your languages operators, keywords, functions, and such exist is to be outputted in some form later.
Are you retarded? How can this possibly be the case in a language which doesn't output anything? It's self-contradictory.
>inb4 i wasn't talking about YOUR language even though i literally said that XDDD
Only a complete retard could think that. A programming language is used to build programs which compute something. Output is merely an optional feature of most languages.
>If you don't output anything, then whatever you're doing in the program is equivalent to nothing
So "2" is "something" and "1 + 1" is "equivalent to nothing"?
>your compiler will do if it's smart enough.
It won't. I'm not a retard and I won't make my compiler do that.

>I'm sorry m8, but I don't think programming is for you.
Don't refer to me as your "m8". I don't associate with your kind.
>Just stick to pure maths.
Why? I'm more interested in programming.
>>
>>59373929
There is no reason why you couldn't write non-I/O C.
>>
File: comfy_anime.png (167KB, 376x328px) Image search: [Google]
comfy_anime.png
167KB, 376x328px
>programming in ruby using vi

Who here /comfy/?
>>
>>59373960
There is only one use for the trivial or "return 0" program, and that is to test that your toolchain is working.
Beyond that, there is literally no reason to write such a program.
>>
running a program guys. why you might ask? not for any phony output, contrary to popular belief. I am running it because I want to. and that is its use!
>>
>>59373254
the correct abbreviate is K&R, pleb.
>>
>>59373807
C is trash though, it doesn't even have unit testing
>>
Is this guy just really really bad at explaining how his I/O is done through a free monad that is then interpreted by the runtime (the caller of the main function)?
>>
>>59373955
the same ones they use in the US. mostly 3GLs and a few 4GLs where a DSL isn't applicable.

even 'newer' 3GL languages like Go are rather popular among the FOSS groups.

historically, they only have a handful of non-English based languages. Like Chinese BASIC. BASIC but with characters inputted via Cangjee. But that was when //e / z80 clones and such were popular.

otherwise its the same usual languages, but with comments/documentation in whatever dialect a specific community uses (zh, hk, tw, etc)
>>
>>59373960
>Me wanting to run a program is already a use
Explain how it is useful to you. Don't just state it, I won't believe you otherwise.
Go on.

>So "2" is "something" and "1 + 1" is "equivalent to nothing"?
If you don't output it, yes!
I'm glad you're finally starting to understand!

>It won't. I'm not a retard and I won't make my compiler do that.
Why not? there would be literally no difference at all in terms of (lack of) result.

>Why? I'm more interested in programming.
If you were interested in programming, you'd be interested in I/O.
Programming is ALL FUCKING ABOUT I/O you retard. If you don't like I/O, stick to mathematics. Plain and simple.
>>
>>59373960
>Me having a use for it is by definition a use. Even running it would be useful for me.
What use do you have for it?

>You can't monitor the resource usage of your computer?
That would be a form of I/O.

>>59373980
Yes but the compiler would be free generate the same code for every single input program, making the whole thing pointless.

>>59373987
Even return 0 counts as I/O.
>>
How do I switch postgresql user? I accidentally switched the user from "postgresql" to "root". I can't even remember how I did it.
>>
Nim v1.0 when
>>
File: 54771773_p0.png (506KB, 533x788px) Image search: [Google]
54771773_p0.png
506KB, 533x788px
>>59373986
>tfw my program takes 3 days to run
Yeah this is great dude lmfoa I'm so comfy right now
>>
gcc 7 when
>>
>>59374000
rust doesn't have a strict description of its semantics or even a fucking memory model
>>
>>59374029
su
>>
File: smug_animu.png (349KB, 477x530px) Image search: [Google]
smug_animu.png
349KB, 477x530px
>>59374000
That's the point retard. If you have to ask, then you don't even understand and C is not for you.
>>
>>59374027
>Even return 0 counts as I/O.
Yes, but by definition (at least according to Unix-like OS's), every program must return a code. So anon's craptastic journey of writing an I/O-free program was flawed to begin with.
>>
>>59373729
dudes please help
>>
>>59374056
>a strict description of its semantics
Can be found in their book, what are you on about?
>>59374058
C is only for hipsters
>>
File: fencing.jpg (34KB, 624x351px) Image search: [Google]
fencing.jpg
34KB, 624x351px
Project Euler... I'm running into problems when it comes to arbitrarily large numbers, and I'm trying to learn how to use GMP (Gnu's Multiple Precision library).

I have a question.. If I make the following variable:
    mpz_t counter;
mpz_init (counter );


Will counter be as large as it needs to be? Or will I need to know when to increase its size?

I feel like I'm getting sucked into a wormhole
>>
File: 1456007784488.gif (18KB, 340x340px) Image search: [Google]
1456007784488.gif
18KB, 340x340px
>>59374000
>Unit testing
Get a fucking load of this pleb.
Real programmers formally prove their programs to be correct.
>>
>>59371757
Please do not use an anime image next time, thanks.
>>
>>59374061
Was it ever specified that ``anon's craptastic journey" would involve a Unix-like environment?
>>
>>59373987
>There is only one use for the trivial or "return 0" program
False. There is definitely more than one, I would even say there's an infinite amount of them since you could always find some new use, however stupid it may seem to some.
Also you for some retarded reason assumed that my compiler will be as shit as GCC and will reduce my programs to a mere ret. It won't.
>test that your toolchain is working.
For you that might be a use. Don't think that everyone else agrees.

>>59374015
>Explain how it is useful to you
Evaluating some expression. How is that not a use?
>If you don't output it, yes!
You have to be a drooling retard to think that "1 + 1" is somehow not equivalent to "2".
>Why not?
Because it's retarded.
>there would be literally no difference at all in terms of (lack of) result.
Computing a value and not computing a value are by definition different states.
>If you were interested in programming, you'd be interested in I/O.
I'm obviously interested in one and not the other so your """""""""""""""""""""""""logic""""""""""""""""""""""""" seems to be a little faulty here.
>Programming is ALL FUCKING ABOUT I/O you retard.
Incorrect.
>stick to mathematics
How would I "stick" to something I don't even do? I would have to start first, and I don't want to.

>>59374027
>What use do you have for it?
I want to compute something.
>Yes but the compiler would be free generate the same code for every single input program, making the whole thing pointless.
Yes, a retarded compiler. I'm sure you could make a better compiler.
>>
>>59374056
Isn't Rust's memory model evident from the semantics of affine vs. Copy types and the kinds of references?

Unless you're talking about what happens inside unsafe code with raw pointers specifically.
>>
>>59374080
true. real programmers develop programs in machine codes and they do not even need to test their program before publishing like a hardcore expert kernel hacker master
>>
>>59374076
>I'm running into problems when it comes to arbitrarily large numbers
wrong.

use math or strings (e.g. calculate the factorial of 100000 is possible using strings) to handle big numbers
>>
>>59374027
>That would be a form of I/O.
Yes, where did I say that I don't want to use any OS I/O, you fucking retard? Do you even read the posts you reply to? I want to program in a language without I/O. How the fuck does this imply "My O/S won't do any I/O"?
>>
>>59372319
Pony
>>
>>59374117
Do you realize how stupid your comment is?
>>
>>59374117
Do you even know what correctness is?
>>
>>59374075
>>59374114
rustfaggots in a nutshell
>>
>>59374132
Yes, D and Rust focus on correctness more than C does.
>>
>>59374149
D is fucking trash. It's even worse than C, and that's a pretty hard thing to pull off.
>>
>>59374149
You are fucking retarded. A comment that stupid doesn't even deserve a proper response.
>>
>>59374158
>>59374159
>C tards in denial
This is what you look like when you are out of any arguments
>>
>>59374175
>worse than C (implies that C is trash)
>C tards
huh?
>>
Hopefully I can convey this in the right way. You know how when you are programming with languages like Java or Python there is official documentation you can look at about the language and its standard library ? Well for C++ does anything like that exist officially ?
>>
>>59374183
In what way is D worse than C(ancer)?
>>
>>59374198
you mean aside from it being complete garbage?
>>
>>59374189
http://www.cplusplus.com/reference/
>>
>>59374189
cppreference.com
>>
>>59374189
>official documentation
Read the standard.
>>
>>59374131
Do you realize how stupid your comment is?
>>
>>59374215
You have to be a literal retard to think that. C(ancer) is statically typed, which means there are hundreds of languages which are automatically worse than it. And that's saying a lot considering how shit C(ancer) is.
>>
if C is so bad why has it yet to be replaced?
>>
>>59374215
>what is Visual Basic
>what is Mumps
>what is Pretty Hopeless PHP
>>
>>59374183 F
>>59374189 #
>>59374198 C
>>59374204 K
>>59374208
>>59374215 Y
>>59374224 O
>>59374234 U
>>
>>59374254
>in some communist country
if communism is so bad why has it yet to be replaced?
>>
>>59374254
It's popularity is falling more than any other language in the history. C is already dead.
>>
If you don't want the thread get shitted (again), please ignore the C-hater spam and report it.
Keep /dpt/ clean!
>>
>>59374242
D is statically typed as well. Plus it's not C(ancer)
>>
>>59374273
Are you sure? Any evidence? Or is it that web has completely eclipsed the niche that C is used for?
>>
>>59374215
>>59374242
Please go. Some people actually have jobs in something other than web """"development"""" here.
>>
>>59374273
hmmm don't think so
>>
>>59374283
Tiobe
>>
>>59374274
Clean like that slut's asshole after I've enemablasted it with 2 litres of everclear, fagdip?
>>
>>59374282
>D is statically typed as well.
So? That just means it's technically possible for it to be better. Sadly it isn't.
>>
>>59374208
>>59374224

yeah I have used these and they are sufficient but they aren't official. I was just curious about an official thing.

>>59374234
I am guessing that's where the official say ends at the standard ? Everything else is just handled unofficially by the community and individuals?
>>
>>59374287
What, promoting exploitlang (aka 'c')? Go right ahead and make the NSA proud
>>
>>59374307
Yes. There's no official documentation because it would just be a watered down version of the standard.
>>
>>59374287
Where did I say anything about w*b"""dev"""? Has C(ancer) robbed you of your ability to read?
>>
>>59374310
Write a kernel in rust without unsafes everywhere.
I won't bother waiting.
>>
>>59374306
Anything that's not C(ancer) is a good language.
Even Python is better than having C(ancer)
>>
>>59374322
inb4 this retard mentions rustos lmao
>>
Lisp is the greatest language of all time, and it's not statically typed.
Really gives you a think, doesn't it?
>>
>>59374320
>its another shill pretends hes not a shill episode
You aren't fooling anyone.
>>
>>59374322
Why would I cater to a C(ancer) apologist and write a kernel?
>>
>>59374329
Python is dynamically """"typed"""", therefore it's literally equivalent to a pile of shit and is worse than anything statically typed.
>>
>>59374338
But Lisp is webdev tier scripting trash.
>>59374345
Yeah, I can see that C(ancer) has severely damaged your language abilities.
>>
>>59374329
>I tried to learn C but it was too hard for me and I couldn't understand pointers.
>>
>>59374367
>lisp
>webdev
>trash
You could make your shilling not so obvious, CIA nigger. Watch out when you cross the street.
>>
>>59374367
Now I KNOW you're a low IQ moron, little bobby two digit IQ!!! hahaha!!! Go on, tell me your IQ if you dare, fricking chump IQ cockhead
>>
Serious Question in OOP Java how are you suppose to structure your code in the main class?

Say you have to create 15 objects and all of them calling different methods from different object classes. What is the best way to structure this kind of OOP design?
>>
>>59374274
Akari hates 'c'
>>59374384
I learnt 'c' when I was young and naive.
>>
>>59374329
And what is Python implemented in nigger?
>>
>>59374394
extremely broad question. it depends
>>
File: akarin_akbar.jpg (590KB, 2188x2860px) Image search: [Google]
akarin_akbar.jpg
590KB, 2188x2860px
>>59374274
>>
>replying to the obvious troll
stop
>>
>>59374402
>trash is implemented in trash
Not surprised there.
>>
>>59374269
Communism HAS been replaced in basically every ``Communist" country. China has adopted many aspects of capitalism, and North Korea's Juche ideology strayed from Communism long ago.
>>
>>59371757
How much does LLVM optimize the IR you give it before generating machine code?
>>
>tfw you miss Haskell-anon becaise he was inspiring you to look into Haskell and actually provided quality responces
>>
>>59374427
For me, it's easier to develop something else rather than fucking with obsolete featureless languagelet like C(ancer). Using C for anything but micro controllers and kernels is pants on head retarded, specially GUI. GUI is MEANT for Object Oriented Programming and C doesn't have that level of sophistication. Developing in C is literally a worthless timesink because C does not have anything to offer but timesink: C has no templates, operator overloading, exception handling, type checks, runtime checks, constructors, lazy evaluations, monads and the list goes on. If you are not hacking the very language itself with macros shitting all over the source files you wouldn't trivial things such as get function overloading.
C does not have exception handling. It's meant for 80's computing and the projects that are written in C are unironically stuck in the 80's: like GTK+
Even after you have gone through the agony of using a language that is a disservice to the intelligent programmers (Linus doesn't count, he's on a different level and not everyone is Linus), you have to worry about memory safety.
C is not memory safe. As if the timesink development was not enough pain, you have to test your program for possible security vulnerability. When K&R came up with C, it was an ancient time. C's priority was being able to produce binaries that can run in an 800MHz processor with 64MiB RAM that can fit into floppies. Security was NOT a concern.
>>
>>59374413
Of course it isn't hard
Which makes it even funnier that you failed to learn the language
>>
>>59374431
>>59374433
>every high level language is trash
Wew
>>
>>59374447
remember the based lisp general that died a few years ago? basically the same with me and lisp. lispanons were great
>>
>>59374410
depends on what?
>>
>>59374453
Some of my C(ancer) codes have been merged into the mainline Linux since 4.3
>>
>>59374335
Pretty sure that's why ``without unsafes everywhere" was specified.

>>59374347
>admitting that Rust can't compete with C in C's main use case
This is just plain embarrassing.

>>59374413
Rust was LITERALLY created because so many people find it ``too hard" to use pointers properly.
>>
>>59374338
Not to mention you can add in types when you want.
>>
>>59374468
Rust is not trash and neither is D. The other anon may differ but we both agree that C(ancer) must die
>>
>>59374449
>GUI is MEANT for Object Oriented Programming
Never go full retard.
>>
>>59374501
>This is just plain embarrassing.
Why? Who claimed otherwise?
>>
>>59374481
Oh really? Post them here
>>
File: .png (3MB, 1920x1080px) Image search: [Google]
.png
3MB, 1920x1080px
This thing scrapes whatever board you put in the url and returns iframes of
https://www.youtube.com/embed/<video id>

There has to be a better way to display these. I tried using this
http://www.youtube.com/watch_videos?video_ids=
but I guess there is a limit.
There are only 100 here because it crashed the tab when I loaded it the first time. heh
What do you guys think?
>>
>>59374507
That's really more of a suggestion than a true type system, you invertebrate.
>>
File: 1487620202295.png (152KB, 1948x858px) Image search: [Google]
1487620202295.png
152KB, 1948x858px
>>59374480
literally everything in your program. what are you trying to write?
>>
>>59374527
The people who are advocating Rust as a replacement for C.
>>
>>59374449
>GUI is MEANT for Object Oriented Programming
Except that IMGUI thrashes RMGUI any day of the week. IMGUI gets even better in functional languages as you can build up a GUI description with a GADT and get well-typed user input and occlusion by running it all at once.
>>
>>59374501
I think this C tard has had his brain damaged by C(ancer).

People don't find it hard to learn about your super secrit double pointer trickz.
People forget to check their code since 'c' lacks any form of safety checks. Get the fuck back to your CS101 class, little boy.
>>
>>59374531
neat
>>
>>59374449
>he doesn't know how to use GLIB and function pointers
>>59374514
>D
>GC
>not trash
"No"
>C
>must die
Enjoy having no kernels or any system software that is performs reasonably well.
>>
>>59374537

a web browser tab manager to manage all the different tabs
>>
>>59374545
Where?
>>
>>59374555
Why do 'c' tards associate D with GC? Are they retarded?
>>
>>59374551
>people don't find it hard to use pointers
>people are unable to use pointers in a way that doesn't lead to ill-formed programs
Choose one.
>>
>>59374438
Now imagine this """""""argument""""""" being made in let's say 1950s USSR.
>>
>>59374565
In this thread.

>>59374570
D has a garbage collector
>>
>>59374588
Can you quote one?
>>
>>59374574
>>people are unable to use pointers in a way that doesn't lead to ill-formed programs
Little boy, you seem to forget that people make typos not because they don't know how to use a keyboard, it's because they are people, not bots
>>
>>59374585
Let's also imagine people making this argument about C in 1987.
>>
I know what IMGUI is but what's RMGUI?
>>
>>59374588
>D has a garbage collector
And?
>>
>>59374570
Literally what?
D has a garbage collector.
>shill doesn't know the language he is shilling
Color me suprised
>>
>>59374614
Retained-mode GUI. The "standard".
>>
File: 1486985855680.jpg (58KB, 620x451px) Image search: [Google]
1486985855680.jpg
58KB, 620x451px
How much does LLVM optimize the IR you give it before generating machine code?
>>
>>59374592
not my job to educate u

>>59374600
People can also review and test their code. Rust fanatics seem to forget this.
>>
>>59374624
As much as you tell it to.

>>59374625
Not an argument.
>>
>>59374617
That's why people associate it with garbage collection.
>>
>>59374628
>As much as you tell it to.
pls elaborate
>>
>>59374625
>People can also review and test their code
Little boy, you seem to forget how we let security vulnerabilities slip through our review.
>test
C doesn't have any unit tests
>>
>>59374638
When you run LLVM you specify the optimization passes to be run.
>>
Whats wrong with garbage collection?
>>
>>59374617
>he doesn't understand why a GC on a low level language is bad
You really need to go back
>>
>>59374633
I still don't get it, 'c' tard. Why does D binaries have to have Garbage Collection?
>>
>>59374639
>C doesn't have any unit tests
And Rust does?
>>
>>59374653
Prevents manual memory management. Almost always is global and so you get pauses when it has to collect. More efficient than naively allocating and freeing from the heap constantly (even more so if there's reference counting), but less efficient than anything else.
>>
>>59374661
Because D is a garbage collected language.
>>
>>59374661
...
Because it is built into the language?
>>59374653
It ruins performance. The program has to stop while the GC cleans up all the references.
Not even Rust is retarded enough to use GC.
>>
>>59374657
Oh another 'c' tard. see >>59374657
>>59374664
D has them. At lest Rust has tons of other features that are already there, unlike a languagelet like 'c'

'c' is a disservice to intelligent programmers.
>>
>>59374621
>>59374621
Just read about it. Sounds shit.
IMGUI sounds a lot better
>>
Name one thing wrong with Java

pro tip you can't and will all list things that do not matter in real programming
>>
>>59374675
>>59374679
Does a 'typical c' tard know how to avoid D using clear, detailed and well documented official instructions ?
>>
>>59374690
Forced exception handling
>>
>>59374664
The ubiquitous cargo build system does.

>>59374683
Yep. Too bad 99.9% of GUI stuff is RMGUI and so people have no idea there's any other way to do it. Of course, everything was IMGUI to start and then RMGUI was invented because computers were slow as shit and took a while to repaint the entire screen.
>>
>>59374695
>>59374680
>he doesn't even refute my point
>he just calls me a 'c' tard
Sounds about right.
No one is convinced with your shilling, CIA nigger.
>>
>>59374690
>real programming
As opposed to "fake programming"?
>>
>>59374690
null
>>
>>59374701
Exception handling is bad?
>>
>>59374716
Exceptions are basically goto's
They have their uses, but if they are misused they make code unreadable.
>>
>>59374712
(C)IA shills C(ancer) FYI.

Now, read this very carefully >>59374695

And tell me what does GC have anything to do with D binaries?
>>
>>59374701
>>59374713
>>59374715
just what I thought you guys know nothing about programming and list things that do not matter
>>
>>59374702
Wait, how is RMGUI faster than IMGUI?
>>
>>59374727
>Exceptions are basically goto's
>goto
We are not talking about your C(ancer) language here
>>
>>59374713
>fake programming
Yes, aka 'c' """"""""programming"""""""" or web """"""""dev""""""""
>>
>>59374730
IMGUI relies on a loop constantly running and repainting the entire UI, since you specify the GUI elements from scratch each time.
>>
>>59374716
>>59374729
Exception handling isn't bad. But refusing to compile because an exception wasn't handled is bad
If I want the program to crash when there's an exception then don't fucking get in my way and force me to litter my code with disgusting try-catch blocks
>>
>>59374729
>exceptions are always better
Wew
>>59374728
Well I am going to go out on a limb and say D binaries call a garbage collector. It's literally a feature of the language, CIA nigger.
>>
>>59374748
>goto isn't a thing in other languages
Confirmed for never programming anything
>>
>>59374680
>intelligent programmers
>needing a compiler to do their job for them
Nice meme

>>59374695
>doesn't support unsigned integers
>no operator overloading
>garbage collected
>standard library involves unnecessary OOP

>>59374695
>Does a 'typical c' tard know how to avoid D using clear, detailed and well documented official instructions ?
Yes, you simply write your programs in C instead.

>>59374728
>And tell me what does GC have anything to do with D binaries?
Why don't you tell me what the eax register has to do with x86 assembly language?
>>
>>59374772
(C)IA shills C(ancer) FYI.

> D binaries call a garbage collector.
Why would a D binary call a garbage collector unless your low IQ 'c' tard brain tells it to do so?
>>
>>59374771
>wanting a program to crash

you never want a program to crash. See this is why you guys know nothing about programming
>>
>>59374785
>you simply write your programs in C instead.
>C(ancer)
Oh no. Unless I am writing a software well prepared for the NSA to exploit
>>
>>59374790
This better be fucking bait.
>>
>>59374786
>C binaries have security vulnerabilities
Why would a C binary have security vulnerabilities unless your low IQ 'pointers are hard' brain tells it to do so?
>>
>>59374785
D has function overloading, C doesn't
D has generics, C doesn't
D has lambdas, C doesn't
D has exception handling, C doesn't
D has unit testing, C doesn't
D has somewhat of memory safety, C doesn't
C = garbage bin
>>
>>59374531
Did this with lazy loading now I can load every one of them.
Still probably going to poop out when I load a ton of videos.
>>
>>59374790
>t. programmer from 1968

>>59374798
Okay, then write it in COBOL, BASIC, Fortran, Java, C++, C#, Pascal, PHP, Javascript, Python, Ruby, Lua, or ALGOL. It's trivial to avoid D without resorting to C.
>>
>>59374786
Wew lad.
That was the most retarded thing I've ever heard the CIA say..
>>
>>59374790
What if your program is designed to crash because another program needs a program that crashes as an input?
Didn't think about that one did ya champ.
>>
>>59374810
>pointers are hard
Tell that to Linus, little 'c' tard. You are depending on people's unintentional mistakes to make your point that looks similar to your little c toddler brain
>>
>>59374818
Function overloading != operator overloading
>>
>tfw to intelligent to use a computer to do menial tasks for me
I love C!
>>
>>59374808
>>59374837
>>59374837
>>59374829
this would never happen name one program that you want to crash
>>
>>59374847
But C = garbage bin
>>
>>59374818
>implying any of things are good
>implying using var args macros doesn't basically act like overloading
You should kill yourself
>>
>>59374851
C is like a worthless timesink like Arch

>>59374870
And here is an Arch fag's sour grape syndrome
>>
>>59374841
>damage control
>>
So I have to implement RDT over UDP in any programming language of my choice.
I decided to do it in Python because it seemed that socket programming in Python was piss easy at the time.
The problem is, I need to send and receive data simultaneously, ie regardless of whether a new UNACK'd packet came in or not, I should be able to send a response back to the sender for a previously received packet.
How would I do this?
The only socket/networking related import I can use is socket. Can import pretty much anything else as long as it doesn't make the socket programming aspect easier.
Any help would be greatly appreciated, thanks.
>posting in an autosage thread
>>
>>59374861
Let's say you're training an AI on how not to build shit, you pass them a program that crashes.

Also, when you make very clear instructions not to do something and the retard does it anyway. Fuck you, you get a crash.
>>
>>59374883
Did that look like a """"damage""" to your little 'c' toddler brain.

Hillarious. Just accept the fact that 'c' is trash and c.ry in the corner
>>
>>59374690
The Blub programmer, everyone.
>>
>>59374861
If it crashes, I can run it in a debugger to inspect the conditions at the time of the crash. If it keeps going, I'm out of luck.

>>59374870
>simulating zero overhead ad hoc polymorphism with run time checking and branching
Sasuga C! The most efficient language!
>>
>>59374861
>this would never happen name one program that you want to crash
Anything that has fatal errors. There's literally no point in trying to ``recover from" an error that is by definition impossible to recover from.
>>
>>59373873
> Rust is obviously safer than C
That's pretty much the problem of most languages. You spend a lot of time on language hiccups that stops idiots from doing something stupid. That slows you down when you're not an idiot.
>>
>>59374927
And C slows your development productivity in an exponential rate on the process
>>
>>59374927
If you're not an idiot, you don't get stuck on the language. When you need to drop down to get more flexibility, there's "unsafe" in Rust.
>>
>>59374904
Why are you using a kernel written in trash?
>>
>>59374690
Lack of operator overloads.
Lack of unsigned, apparently even with bytes. How the fuck do you get negative bytes? Dunno, java knows though.
Swing.
>>
NEW THREAD:

>>59374952
>>59374952
>>59374952
>>59374952
>>
>>59374950
Same reason why I am using the web dev "technology"

Hopefully Redox gets more development
>>
>>59374890
Isn't that just basic multi-threading?
>>
>>59374963
>implying redox is in any way safer than linux
"no"
Just wait until it gets features, it will be just as
>>
>>59374993
Less prone to memory exploits by default
>>
>>59375004
>unsafes every other block
"no"
>>
>>59372319
lambda prolog
>>
File: Y37QbdH.jpg (3MB, 3264x2448px) Image search: [Google]
Y37QbdH.jpg
3MB, 3264x2448px
>>59373743
what do you recommend?
Thread posts: 343
Thread images: 22


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.