[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: 319
Thread images: 27

What are you working on, /g/?

Old thread: >>60021954
>>
>>60025489
First for D
>>
nth for b
>>
refurbing a macbook pro to resell. switching out dvd drive for a hdd caddy. bought a new battery off ebay, etc
>>
>>60025489
Lisp is the most powerful programming language.
>>
>>60025558
That's not programming you mong
>>
File: 1461855737131.jpg (209KB, 600x582px) Image search: [Google]
1461855737131.jpg
209KB, 600x582px
>>60025571
It can't even solve its own halting problem. It's garbage.
>>
>>60025592
What languave can sol e its halting problem?
>>
>>60025610
Any total language. But they are all trash.
>>
>>60025610
Any non-shit one can do that trivially.
>>
Are this languages memes?
>GoLang
>Rust
>>
>>60025691
Yes. The only programming languages worth learning are JavaScript and Java.
>>
>>60025691
Both are, yes.
One for being good or useful over anything else.
The second for already being c++ levels of bad in its infancy. And the daycare mentality of its community.
>>
>>60025628
What is this non-shit language?
>>
>>60025726
wew
not being*
>>
>>60025628
name one(1)
>>
File: tmp_9585-1491951578414-81213853.jpg (93KB, 553x936px) Image search: [Google]
tmp_9585-1491951578414-81213853.jpg
93KB, 553x936px
What happens if we remove pointer arithmetics from C?
>>
>>60025731
Any language in which you can write only terminating programs.
>>60025762
λΠω and anything based on it.
>>
>>60025592

Halting problem is unsolvable on any turing machine. Non-turing complete languages are garbage.
>>
>Non-turing complete languages are garbage.
>>>/r/abbit
>>
I'm studying C in-depth. I'm doing my own DS libraries and I'll start my final project from college soon. Also solving coding challenges to train for the programming marathon, which will happen later this year. Studying C using Ritchie's book made me realize how shitty my programming teacher is.
>>
>>60025891
If a language isn't useful, it is destined for the trash bin.
>>
>>60025489
getting naked and playing in the sun
>>
I've been assigned the task of building a secure browser for work so new hires can't watch YouTube all day.
>>
>>60025912
>useful
For whom? In what way?
Saying "useful" without any further clarification is pretty retarded, since you could easily claim that absolutely anything is useful.
>>
>>60025933
Non-turing complete languages are useless for everyone.
>>
first for Go
>>
>>60025707
javascript is the same as java dumbass
>>
@60025945
There exists at least one person who finds them useful, therefore this is false.
>>
>>60025965
This is completely impossible.
>>
>>60025924
Can't they just block websites like everyone else?
>>
File: IMG_0139.png (697KB, 750x1334px) Image search: [Google]
IMG_0139.png
697KB, 750x1334px
>>60025489
Anyone know of any good resources for starting out with C? I learned python for about a month, this last few days I've been learning c++, but after reading about C, I really want to give it a try. I think it will give me a strong understanding of the fundamentals to build off of before I go to college. I talked to a guy in the comp sci program there, apparently they start with Java, which I figure will be a walk in the park if I can get a decent foundation built before the semester starts.

Picture not related:
>>
>This is completely impossible.
I think you need to re-examine your assumptions.
>>
>tfw paying $20/month for Codecademy Pro
>tfw realized that there are tons of step-to-step codecademy tutorials on youtube
at least i get the extra practices and an access to a tutor, shit
>>
>>60025769
Why on earth would you do that? Also, by doing that, you would literally make arrays useless.
>>
>>60025982
I don't need to, because the assertion is obviously true.
>>
Perhaps if you're using some retarded definition of "useful". You haven't defined it yet.
>>
>>60025877
>Non-turing complete languages are garbage.
explain
>>
>>60026022
Non-turing complete languages do not follow any universally accepted definition of the word "useful." They serve no practical purpose. Therefore they are useless.
>>
>>60025981
https://www.tutorialspoint.com/cprogramming/
https://www.programiz.com/c-programming

Here you go fukboi. Get cracking
>>
Post the exact definition of "useful" you are using.
>>
>>60025945
>SQL
>>
I like your take on anime picture thread OP
>>
>>60026082
I'm not doing your work for you. You're an adult. I do hope you come to this realization eventually.
>>
I see, so you can't even properly define the things you claim to be true. As expected of a subhuman.
>>
>>60026121
You can put your head in the sand and pretend it cannot be, but eventually you'll have to accept reality.
>>
@60026154
this pic is really really cute
>>
>>60026178
Thanks!
>>
>>60025993
>you would literally make arrays useless
Well, leave pointer arithmetic for arrays only?
>>
>>60025489
right now I'm designing a heap in C++ using vectors and string rather than int and I have no idea how to implement it, do i just use void Insert(string element) rather than int?
>>
if i hate CS in university, will I hate the CS jobs for the rest of my life? I don't know what else to do though.
>>
>>60026322
Yes.
>>
>>60026334
damn i don't know what else to do though.

i really wish i went into engineering instead, i could've done chem eng
>>
>>60026322
Not necessarily, they are different kinds of bad.
>>
>>60026356
can you share your experience?
>>
>>60026249
Then you would remove the ability to pass an array to a function and use anything but the first element.
I don't know what you have against pointer arithmetic. It's just something that beginners/idiots complain about because they don't understand it or why its useful.
>>
>>60025904
Don't do C, it's old and nobody uses it.
Use C++, its old and everybody uses it.
>>
>>60025958
>American education

>>60025970
I find ASCII useful, and it isn't Turing complete.

>>60026067
Provide a "universally accepted definition" of the word "useful".

>>60026318
>not using templates for your data structures

>>60026402
>nobody uses C
t. Microsoft
>>
>>60026508
Did you reply to the wrong post?
>>
>>60026508
https://pastebin.com/D5jgVdxQ
The assignment doesn't want me to use templates, i get an error when i try to use void insert(string element) also
>>
What went so wrong? Why is Pascal not popular anymore?
>>
Is it worth learning Rust at this point? Are they still breaking syntax or have they settled down? Also anyone have the git themed expanding your mind pic?
>>
>>60026833
becase its shit
>>
>>60026839
Since v1.0, they have been retaining backwards compatibility
>>
>>60026843
You have to be at least 18 to be posting here. Get out.
>>
>>60026870
>lisp is good because its old
>>
>>60026508
Who the fuck would use C? If you are not burdened with using legacy codebase there remains 0 reasons to use that garbage
>>
>>60026887
>0 reasons
You clearly know nothing about C and why people use it.
>>
File: 1469826515769.jpg (48KB, 480x480px) Image search: [Google]
1469826515769.jpg
48KB, 480x480px
>>60026880
>le good
>>60026843
>le shit xDDddDxD
>>60026906
Oh? Let's hear your reasons for using it.

Does your mum know you browse 4chen?
>>
>>60026912
>le
>>>/r/eddit
>>
I came across this snippet in python and am absolutely mystified as to how it works.

Supposing that types is an array and x is a list of strings equal in length to types. Each entry in x corresponds to an entry in types and only one will be a non-empty string.
the next() call returns the index of the non-empty element in x, which is then used as an index for types.
types[next(i for i, e in enumerate(x) if e)]


As far as I can see next() takes an iterable object and optionally a default value to return if the end of iteration is reached. The arguments given here really don't make sense to me, and yet it works.
>>
>>60026934
Why are you linking me to /r/?
>>
>>60026942
Python was a mistake.
>>
>>60026942
>types[next(i for i, e in enumerate(x) if e)]

Looks cool post source?
>>
>>60026912
I'm just going to bring up the simple (and extremely important) thing C has had over every other language, and that is a feature that so many other languages seem to miss for some reason:
It has a stable ABI.
>>
File: 1474794030881.png (205KB, 3340x3176px) Image search: [Google]
1474794030881.png
205KB, 3340x3176px
>His language doesn't even have Generics
Is Go and C meant for brainlets?
>>
>>60026988
>What is void and void*
>>
>>60027000
Sorry excuses
>>
File: 1492666053187.png (20KB, 373x332px) Image search: [Google]
1492666053187.png
20KB, 373x332px
What's a good book on operating systems? I see a lot of jobs I want to apply for when I graduate asking for knowledge in operating systems, but not sure what they want employees to know specifically.
>>
hey /g/ Im working on a little quasi ai, and im having some trouble doing read at write functions into and from 2-d arrays. trying to read from a text file at the start, then write back at the very end. Any help would be nice
https://pastebin.com/taDtc2BV
>>
>>60026988
Although I have a lot of issues with Go's lack of generics, as I'm an Ocaml programmer, it's lightyears ahead of C.
>>
>>60026978
>C has had over every other language
>stable ABI
The C++ ABI includes the C ABI. In addition, it covers the following features:
> Layout of hierarchical class objects, that is, base classes and virtual base classes
> Layout of pointer-to-member
> Passing of hidden function parameters (for example, this)
> How to call a virtual function:
> Vtable contents and layout
> Location in objects of pointers to vtables
> Finding the adjustment for the this pointer
> Finding base-class offsets
> Calling a function via pointer-to-member
> Managing template instances
> External spelling of names ("name mangling")
> Construction and destruction of static objects
> Throwing and catching exceptions
> Some details of the standard library:
> Implementation-defined details
typeinfo and run-time type information
> Inline function access to members
Your next reply will be
"Well C and C++ are the same"
Lol
>>
>>60027084
>"Well C and C++ are the same"
No. I certainly do NOT think that.
>The C++ ABI includes the C ABI
And you can't use any of your shitty C++ features over it.
What you have is a shitty FFI, like basically every other language has.
>>
>>60027067
C is an easy target. Anything is light-years ahead of C
>>
>>60027100
You are joking, right?
>>60027125
Does it look like I was replying to anyone?
Also,
Are you used to being called a brain dead idiot?
>>
Let's say I have a function in C++ that takes a class as a parameter:

class MyClass
{
int x;
MyClass(int i) : x{i} {}
}

void function(MyClass whatever){}


How can I make it so that calling function with a integer value like
function(5)
won't work?
>>
>>60027164
You quoted nonexistent text.
>>
>>60027188
What are you going to do about it?
>>
>>60027210
About what?
>>
>>60027282
CRY LIKE LITTLE BABY
>>
>>60027175
https://stackoverflow.com/questions/4603717/stopping-function-implicit-conversion
>>
File: 1486667937313.jpg (9KB, 256x191px) Image search: [Google]
1486667937313.jpg
9KB, 256x191px
I just pushed a new version of my collab drawing web app.

Here's a room I created for you guys:

http://www.drawy.io/r/ssezs6c3ejh29xuw

Let me know what you think!
>>
>>60026744
bump, i know one of you find this shit simple
>>
>>60025976
I'm pretty sure anything that allows you to do that costs money other than the hosts file which wasn't a really plausible solution. So instead my program just blocks every other web browser and limits web use to only a few sites.
>>
Said birds
>>
>>60027175
if your constructor takes a single parameter, you should (almost) always put 'explicit' before it
>>
File: 1481938508364.jpg (24KB, 480x590px) Image search: [Google]
1481938508364.jpg
24KB, 480x590px
>Lambdafags who don't understand the concept of compilation think that machine code is lambda calculus just because it was compiled from lambda calculus.

I guess x86 machine code is also Java source code, since the JVM JITs to it.
>>
>>60028269
Who said this?
>>
>>60028322
My thoughts did.
>>
File: 1489162808503.png (701KB, 1080x1080px) Image search: [Google]
1489162808503.png
701KB, 1080x1080px
>>60026191
Equivalence is transitive. Anything which is equivalent to a Turing machine is equivalent to lambda calculus and vice versa.
>>60027946
Anything a Turing machine can compute, (untyped) lambda calculus can also compute.
>>60028010
>They might be.
One can simulate the other, it doesn't mean that they are literally the same thing.
>>
What is the best introductory book on computation and/or lambda calculus?
>>
>>60028734
sicp for computation 2bh, idr how heavily it touched on lamba calculus if at all
>>
File: 1491856626845.jpg (82KB, 408x600px) Image search: [Google]
1491856626845.jpg
82KB, 408x600px
>>60025489
Building a theorem-proving CPU using only implication gates.
>>
File: 1485678873171.png (924KB, 7528x2744px) Image search: [Google]
1485678873171.png
924KB, 7528x2744px
ded thread
>>
Reminder.
This is how stupid the people bashing on C are: >>60025712
>>
>>60028928
Rollex
>>
File: 1464675611886.png (681KB, 1280x720px) Image search: [Google]
1464675611886.png
681KB, 1280x720px
>>60028928
(You)
>>
File: 1489853838186.png (315KB, 1876x559px) Image search: [Google]
1489853838186.png
315KB, 1876x559px
>>60028935
Wtf I hate C now
>>
>>60028975
>now
Better late than never
>>
>>60028928
:^)
>>
>>60025489
Building a lambda calculus CPU
>>
>>60028975
If you hate C because of security then you'll hate Rust too.
Rust doesn't even check for overflow in release builds.
>>
>>60029041
C doesn't even have overflow checks on any builds.

Now add all those undefined behaviors, double frees and dangling pointers.

Result: Another C tard BLOWN THE FUCK OUT
>>
>>60029041
>>60028935
>>60029019
4U :^)
>>
>>60029062
>C doesn't even have overflow checks on any builds.
What is UBSan?

>Another C tard BLOWN THE FUCK OUT
I don't use C or C++.
I actually use and love Rust. I just hate it when people blindly bash on C for stupid fucking reasons and then go on to claim things about Rust that simply aren't true (such as unconditionally checking for overflow, which is blatantly wrong).
>>
File: 1481274914857.png (93KB, 320x252px) Image search: [Google]
1481274914857.png
93KB, 320x252px
>>60029115
Hold on, I got a meme for this
>>
>>60029142
Nice damage control, but sorry, not everyone who disagrees with you is a diehard Ctard.
>>
>>60029142
>a meme
A what?
>>
>>60029167
a meme
>>
>>60029172
That sounds preposterous to me.
>>
>>60029186
Ok that made me feel better. What can I do to make you stream your suicide?
>>
>>60029194
Defect from the GCHQ.
>>
>>60029194
Buy me a webcam
>>
File: my10x.gif (3KB, 79x77px) Image search: [Google]
my10x.gif
3KB, 79x77px
A Japanese cat taught me how to use Win32.
>>
>>60027724
How are you gonna do it?
>>
>>60028899
Lain is cute! CUTE!
>>
What is the shortest way to read a single u8 from stdin in Rust?
>>
>>60029976
stdin().bytes().next()
>>
>>60030128
stdin().bytes().next().unwrap()
*
>>
>>60030141
... as u8

:)
>>
>>60030312
No need to cast, because Bytes::next() already returns Option<Result<u8>>
Which means it should be
stdin().bytes().next().unwrap().unwrap()

>Rust
>>
>>60030312
Isn't that just type conversion?
use std::io;

fn main() {
let mut n = String::new();
io::stdin()
.read_line(&mut n)
.expect("failed to read input.");
let n: u8 = n.trim().parse().expect("invalid input");
println!("{:?}", n);

let mut n = String::new();
io::stdin()
.read_line(&mut n)
.expect("failed to read input.");
let n = n.trim().parse::<u8>().expect("invalid input");
println!("{:?}", n);

let mut n = String::new();
io::stdin()
.read_line(&mut n)
.expect("failed to read input.");
if let Ok(n) = n.trim().parse::<u8>() {
println!("{:?}", n);
}
}
>>
>>60029976
>>60030128
>>60030141
>>60030312
>>60030370
You're clearly not safe enough. Please write idiomatic Rust.
use std::io::Read;
use std::error::Error;

fn main()
{
let byte = {
let mut b: [u8; 1] = std::default::Default::default();
match std::io::stdin().read_exact(&mut b) {
Ok(()) => b[0],
Err(e) => panic!("Unable to read byte: {}", e.description()),
}
};
}
>>
>>60030388
>
std::default::Default::default()

Just Rust things :^)
>>
>>60030419
What? Is it too _safe_ for you?
>>
>>60030419
>>60030457
TOP WIT
O
P

W
I
T
>>
>>60030419
>namespaces are dumb
C-tards, everyone.
>>
>>60030504
Namespaces are dumb, though.
>>
>>60025945
HTML.
>>
It's all according to my Keikaku....
>>
>>60030506
That's why Rust has modules. Totally different from namespaces, I promise. Everything in the module is private unless you make it public.
>>
>>60030504
namespaces are P O O
>>
>>60030457
>>60030504
No. Default is in std::prelude you tard.
Just
Default::default()
is enough.

Also that's a shitty bloated way of reading a single byte. Here:
use std::io::Read;

fn main() {
let byte = match std::io::stdin().bytes().next() {
Some(Ok(b)) => b,
Some(Err(e)) => panic!("Error reading byte: {}", e),
None => panic!("Expected byte, got EOF");
};
}
>>
>>60030563
Fundamentally, they are a fucking useless feature.
They add no expressive power, and don't allow you to get away with writing less code.
It just lets you avoid the non-problem of symbol collision at the cost of your simple ABI and lets you sprinkle a bunch of shitty syntax (::) all throughout your code.
>>
>>60030588
>Relying on the prelude
You clearly aren't safe enough.
>>
>>60030607
What's so unsafe about the prelude?
>>
>>60030588
I can't tell what's memes and what's not anymore
>>
>>60030612
You clearly don't get it. Come back when you're safer.
>>
>>60030619
*puts on condom*
Ok what about now?
>>
>>60030633
>This is not a dick sucking competition.
-- Linus Tornvalds
>>
>>60030641
Who said anything about sucking? Bend down bitch.
Also who's "Linus Tornvalds"?
>>
>>60030669
>Also who's "Linus Tornvalds"?
These fucking rustfags will be the death to us all.
>>
>>60030641
Penises are inherently unsafe. You must remove it and swear allegiance to womyndom if you're ever going to get anywhere with rust.
>>
>>60030669
Linus torvalds is a youtube vlogger who does hardware reviews
>>
>>60030680
What?
I've heard of Linus Torvalds before since he has a similar name but I've never heard of Linus Tornvalds before.
>>
File: 1469499701817.png (97KB, 1934x1069px) Image search: [Google]
1469499701817.png
97KB, 1934x1069px
>>60030680
>>60030684
>Triggered C tards
>>
>>60030715
Who said this?
>>
>>60030724
>>60030731
You are being shadow banned so you can't see who said this
>>
File: back_to_reddit.png (9KB, 355x46px) Image search: [Google]
back_to_reddit.png
9KB, 355x46px
>>60030754
You have to go back.
>>
>>60030758
Your gate keeping sucks
>>
>>60030588
why is rust so complicated?

void main()
{
import std.stdio;
ubyte b;
readf(" %d",&b);
writeln(b);
}
>>
>>60030788
Not only Rust is complicated but also D is smooth af. No language is as comfy as D
>>
let num_of_float f =
let extract x =
let sign x =
if x < 0. then
-. x, -1
else if x = 0. then
x, 0
else
x, 1 in
let exponent x =
let rec divide accu x =
if x >= 2. then
divide (succ accu) (x /. 2.)
else
x, accu in
let rec multiply accu x =
if x < 1. then
multiply (succ accu) (2. *. x)
else
x, - accu in
if x >= 2. then
divide 1 (x /. 2.)
else if x < 1. then
multiply 1 (2. *. x)
else
x, 0 in
let mantisse x =
let rec loop accu x =
if x = 0. then
x, List.rev accu
else
let bit =
if x >= 1. then
1
else
0 in
loop (bit :: accu) (2. *. (x -. float bit)) in
loop [] x in
let x, sign = sign x in
let x, exponent =
if sign = 0 then
x, 0
else
exponent x in
let x, mantisse = mantisse x in
assert (x = 0.);
sign, exponent, mantisse in
let sign, exponent, mantisse = extract f in
let coef x = x */ Int sign in
let power x = x */ (Int 2 **/ Int exponent) in
let num =
let rec loop accu = function
| [] -> accu
| bit :: bits -> loop (accu // Int 2 +/ Int bit) bits in
loop (Int 0) (List.rev mantisse) in
coef (power num)
;;
>>
>>60030775
Why the fuck are you even here? If you're going to act like a fucking redditor, go to fucking reddit.
>>
>>60030788
Because it's a real systems language, unlike your toy language D.
>>
>>60030788
>>60030802
You people are sick. Get help.
>>
>>60030814
Give me a simple """rust only""" task.
>>
>>60030788
Where's the error handling?
>>
>>60030788
The code isn't equivalent, the original reads a byte from the stdin, not a string with a number in it.
>no error processing
Wew, lad.
>>
>>60030829
Code without garbage collection.
>>
>>60030812
>Why the fuck are you even here?
IDK, I just am. Are you some sort of fourchan police? If so you suck hard in gate keeping.
>>
>>60030829
A kernel.
>>
>>60030804
>let ... in
eww
>>
>>60030830
>>60030833
A few asserts.
>>60030840
@nogc
>>
I'm a huge faggot pls rape my face
>>
>>60030842
Do you go into a chess club then start shitting on all of the chess boards while screaming at the top of your lungs, then get offended when people tell you to fuck off?
You fucking millennial reddit fucktards are so fucking entitled. You have no idea how communities work, and think you have to right to act however the fuck you want.
Seriously, just piss off.
>>
>>60030864
>@nogc
Now write a program which also uses the standard library.
>>
>>60030849
So syntax is the most important thing?
>>
>>60030882
Theres @nogc standards you can swap out right now.
But its on the road to official,
>>
@60030872
You should fuck off too. The kind that replies to namefags belongs on plebbit.
>>
>>60030864
> A few asserts.
I see none tho. Also, what will the code do if I enter 257? Will it panic, or will it silently leave 0, or will it set it to 1? The code is minefield.
>>
>>60030894
So you can't. What a fucking joke.
You stupid necrophiliacs have been saying "we'll have an optional GC" for over a decade.
>>
>>60030890
Ocaml got many more problems than just the syntax so no, syntax is not the most important thing but once you got good implementation and somebody might actually consider that language then the syntax matters.
>>
>>60030916
>Ocaml got many more problems
Like what?
>>
Come on guys give me some desktop app project that I can do in python. I want to make something but i don't have any idea what.
I am beginner.
>>
File: 1489583154982.jpg (483KB, 1280x720px) Image search: [Google]
1489583154982.jpg
483KB, 1280x720px
Friendly reminder that if your language can't trivially run in a freestanding kernel-mode environment with no stdlib and runtime, it's fucking shit.
>>
>>60030901
25
>>
File: .jpg (162KB, 891x1200px) Image search: [Google]
.jpg
162KB, 891x1200px
>>
>>60030506
>>60030584
Boy, I sure love writing the same prefixes over and over again.
>>
>>60030923
No proper macro system, no native thread support, no generic arithmetic operations.
>>
>>60030933
A kernel.
>>
>>60030894
> Design a language around GC
> New, better language without GC appears
> Panic and make GC optional without changing the language and stdlib, without presenting an alternative like borrow checking to keep code memory safe
So, what's the point of using D with @nogc if I can just use C++17?
>>
>>60030953
Why are you spacing your posts like that, redditor?
>>
>>60030933
make app gives the users ideas for projects
>>
>>60030940
>A citizen is a country
>>
>>60030937
This is just sad.
>>
>>60030953
Because in most cases GC is more lucrative
>>
>>60030949
>No proper macro system
What for?
>no native thread support
Are you talking about multi core support, because native threads are supported? But it allows a fast and predictable GC. Look at what Jane Street does.
>no generic arithmetic operations
You doesn't like '+' and '+.'? Your problem, I miss those in any other languages. OCaml is an explicit language. If you don't like it continue to use your favorite language (which is?).
>>
>>60030965
Is that written somewhere? I don't see it.
>>
>>60030953
D didnt start its optional GC path from language wars. It started it from rightful community members calling walter out on being a dummy.
>>60030966
void main()
{
import std.stdio;
ubyte b;
readf(" %d",&b);
writeln(b,"|",b.sizeof);
}

25|1
Whats the problem?
>>
>>60030977
GIL
>>
>>60030982
Why the fuck would "257" turn into 25? That makes no fucking sense at all.
D is retarded.
>>
>>60030982
So if the string is '256' I get 256 in b, but if the string is '257' I silently get 25 in b without any error? This is some perl-tier bullshit.
>>
>>60031003
>>60031009
Oh, i genuinely thought he said 25.
Yeah it gets an overflow.
>>
Rust should have a read! or readln! macro like print!, println!
>>
>>60030991
Multicore is a great debate inside OCaml community (we don't care about GIL on single core, do we agree?).
JaneStreet explain how they can predict the GC. And they have one process for each core, with a non managed shared memory between those precesses.
>>
>>60031014
Is there any way to catch the overflow?
>>
thinking of writing a javascript OS in qemu arm64
would you like being able to do something like this
Device.ethernet[0].send("127.0.0.1,"hello","UDP");

or
Device.display[0].framebuffer(250,250,FFFFFF); //writes a white pixel to x 250 y 250
>>
>>60031038
That is one of the stupidest ideas I have ever heard.
>>
>>60031045
Stupid, but might be interesting.
>>
>>60031045
Not as stupid as shitposting 24/7 instead of doing something
>>
>>60025489
Working on barebones Forth system for Pi.
>>
>>60031045
And your real opinion? Not the one where you try to fit in with your /g/ big bros
>>
>>60031063
Forth is trash.
>>
>>60031063
... bare metal.
>>
>>60031074
Why?
>>
>>60031026
>(we don't care about GIL on single core, do we agree?).
You are not using Ocaml for microcontrollers so your machine is likely going to have at least 2 cores and now days even more.
>>
>>60031028
https://dlang.org/phobos/std_exception.html#enforce
https://dlang.org/spec/property.html
https://wiki.dlang.org/Is_expression
>>
>>60031074
Why
>>
>>60031083
>>60031087
Too many concentrated memes.
>>
>>60031083
>>60031087
Syntax is trash.
>>
>>60027008
Andrew Tanenbaum has written good books about operating systems
>>
>>60031085
Today I use multi processes and pipe to communicate between processes when I need speed. What is the problem?
>>
>>60031114
Microkernels are shit, though.
>>
>>60031051
>>60031054
<3
I could have the kernel as an exokernel to allow raw access to the hardware with just multiplexing security to prevent race conditions and stuff

If the device / OS functions are just bindings to a C api in the parser then this will be cost free, super fast javasript

could write a vim-like editor with autocompletion to write native applications, and add node.js compatibility maybe
>>
>>60031157
You are so fucking naive.
>>
>>60031109

What syntax? You're literally just stacking words on top of each other -- and that's literally the semantics of Forth.
>>
>>60031166
>You're literally just stacking words on top of each other
That in itself is syntax.
>>
>>60031166
Hence it's trash.
What's the fucking point of that? use a real language.
>>
>>60031176
What is a "real" language? How to tell if a language is "fake"?
>>
What programming language should I learn if I just generally want to program.
>>
>>60031038
Why not just make a javascript shell?

Which would literally be cancer, but fuck it.

Then if the time comes, you've done a lot of the work and can bolt it on your Javascript OS, if you're still interested in such an undertaking.
>>
>>60031121
This is awful, you have to syscall every time you need to read/write data to a pipe and you have to keep a buffer in the kernel and copy to it/form it on every access. With threads you can just use shared memory protected by a mutex or a clever atomic trick, which is way faster.
>>
>>60031183
pascal
>>
>>60031181
Some methods to tell if a language is fake:
- it's interpreted
- can't write a kernel in it
- garbage collected
- it's name is "forth"

Some methods to tell if a language is real:
- it's compiled
- can write a kernel in it
- is not garbage collected, and permits explicit memory control and manipulation
- it's name isn't "forth"
>>
>>60031164
That's a nice way to say that you're more depressed than me :p
>>
>>60030978
Inheritance is supposed to represent an 'is-a' relationship
His class says Citizen extends America, but it should be that a Citizen 'has-a' (composition) Country.
America is-a country - This makes sense
A Citizen is-a America makes no sense, he's clearly retarded aswell as a cuck.

Also, Emotional IQ isn't a thing, there is motional Quotient, and Intelligence Quotient. Another reason he is a retarded cuck.
>Interaction Designer
kek'd 10/10

No way this guy has ever programmed, his if-statment doesn't even add the ints to the floats, it ands then and then compares the result to 50.

He also doesn't have brackets around the if, and he never even uses the taxReturns string.

He never declares the variables that he initializes in the constructor.

His class and his isMyPresident function don't have closing braces.

His isMyPresident function doesn't use the Objec that it takes, which is is taking without a name (compiler error)

He has an if-else that just returns true/ false.
Should be:
>return (sumofshit > 50);

All in all:
>0.03/10 bait
>>
>>60031187
I never say the opposite. Just use a shared memory between processes. You'll have the same result.
>>
>>60031195
I think you should go see a doctor about your C/C++ cancer.
>>
>>60031205
I don't use any of those languages.
>>
>>60031183
Literally any fucking language.

Although Smalltalk might be a good choice if you just want to program for the sake of programming.

Otherwise, perhaps Rust or Go?
>>
>>60031185
>javascript is cancer
stop trying to fit in anon
node performs around 7 times more than python in benchmarks, and outperforms java 8 in some cases
>>
>>60031199
>>60030940
Forgot to reply to the original.
Also: Didn't realize I made that many typos, jesus
>>
>>60031199
>but it should be that a Citizen 'has-a' (composition) Country.
Maybe if you were the president.
For Citizen, it would be Country that has-a Citizen.
>>
>>60031219
Both those languages are trash though.
>>
>>60031219
I didn't say Javascript was cancer. What I did imply was using Javascript for things other than a scripting langauge -- ie. browser scripting -- would be cancer.

So, I guess a Javascript shell probably wouldn't be such a bad idea, but a Javascript OS? Fuuuuu.

What is cancer is using Javascript for everything.
>>
>>60031224
Nah, a citizen has a country in a child-parent sort of relationship.
>>
>>60031224
>For Citizen, it would be Country that has-a Citizen.
Maybe if you are a liberal cuck.
I have a country, it is my country, that doesn't mean that it can't also be someone elses country too. You can ask me what my country is, you don't have to ask every country to find out which one I belong to.
>inb4: What if someone lies about their country
Ya, people do that, that's why this is a better representation of reality.
The Country should also have a list of it's Citizens
>>
>>60031247
you'll change your mind when you get experience in programming
>>60031248
this is how I can tell you don't have much experience in programming, if you read the code for V8 example you'll find that javascript is actually a very simple language that could reach maybe Go or dare I say Bust lang level performance if you write a good JIT for it, combine this with native C bindings to OS / library functions then I could see the performance difference become unnoticeable
>>
>>60031257
Class fields express ownership, so I don't think so.
You don't own your country.
>>
>>60031272
If Javascript is so fast then why is the web so fucking bloated and slow?
>>
>>60031275
>Class fields express ownership, so I don't think so.
So a doubly linked list means every node owns the nodes on either side?
Nice bait
You can have a reference to an immutable object in your class, you own the ref, not the object
>>
>>60031272
>implies the only consideration in choosing a language is performance

This is how I can see you don't have much experience in programming.

Manage 10k+ LoC in Javascript. I fucking dare you.
>>
>>60031298
Maybe in Java and C# where ownership and borrowed content is ambiguous.
This is why Rust is superior in this regard. It's clear whether a field is owned or just borrowed.
>>
>>60031288
same reason why express.js can handle thousands of requests in a shitty 3 euro VPS versus a wordpress website taking a hour to load, using too many frameworks from slow sources and shitty programming.

Designated web developers load up the page with memory leaks and unfinished loops because of low skill + low interest in programming (desperate to make a rupee to eat)

For a good javascript app check out c9.io, it's a whole IDE made in javascript but you would think it's a native app because it was written by white people
>>
File: 1492939168807m.jpg (99KB, 760x1024px) Image search: [Google]
1492939168807m.jpg
99KB, 760x1024px
What did he mean by this?
>>
>>60031335
I think he meant read the thread first.
>>
>>60031335
>if ... return true else return false
this mother fucker I swear to fuckign goddaamn piece of shit get back to your country wetback pisesejoapice pendejo
>>
>>60031335
He is an America.
>>
File: IMG_6136.jpg (115KB, 1280x720px) Image search: [Google]
IMG_6136.jpg
115KB, 1280x720px
>>60031335
>trumpEmotionalIQ = 0
If only our society required an IQ of 130 or higher to build billions of dollars worth conglomerates
>>
>>60031311
I have done this in a web project, as long as you take care of your inheritance and code modularity I don't see the problem.
>>
>>60031195
>- it's compiled
>- can write a kernel in it
>- is not garbage collected, and permits explicit memory control and manipulation
Forth is all of that though.
So it's just the literal name 'Forth' which irks you?
>>
>>60031335
>interaction designer
Is that a thing?
>>
>>60031413
Yes, the field of UI design has become so complicated due to smartphones that it's starting to specialise into distinct professions.
Now you won't be able to create a mobile app without hiring a team of at least 10 liberal arts students.
>>
>>60031411
>So it's just the literal name 'Forth' which irks you?
That and purely stack based, and the syntax and constructs to manipulate the stack are completely retarded.
>>
can someone please explain motion estimation with macroblock matching to me?
>>
>>60031425
I just looked at the average salary. How depressing.
>>
>>60031428
Stack based makes it extremely consice and elegant (and forces out shitty programmers who can't factor correctly, i.e if you ever find yourself needing > 3 stack depth reaching, you've failed).
Thinking you need a bunch of stack juggling just means you've looked at shitty Forth code.
>>
>>60031199
>All in all:
>>0.03/10 bait
>he says after he just got baited
fucking idiot
>>
>>60030940
>if smt then true else false
>ishiggydiggydo
>>
>>60031459
It is.
Being from the Win32 era of UI interaction, I dislike mobile UIs in general.
>>
When did dark color schemes become the norm?
>>
Total newb here. I am just starting to learn C. Which projects should I contribute when I get gud?
>>
>>60031195
>- it's interpreted
>- can't write a kernel in it
>- garbage collected
>- it's compiled
No such languages exist.
>>
>>60031482
win32 era of UI interaction was absolutely fucking shit though. It made sense only to IT types who train on that shit and enterprise who don't give a fuck, and users just had to deal with the shit.

Not that I'm defending the trends of modern UI dev, but while Material Design is ugly as fuck,they're at least developing a good theory of UI interaction (even if they implement that theory in half assed ways).
>>
>>60031527
Try again.
>>
>>60031538
Try what?
>>
>>60031550
Try posting again. You fucked up your post and it doesn't make sense.
>>
File: JUST.jpg (27KB, 600x424px) Image search: [Google]
JUST.jpg
27KB, 600x424px
>got a programming job at a bank
>bug fixes and support for ancient software
>useless meetings almost every day
>talking to IT buzzword spouting "architects", "analysts" and "specialists" every day

I just wanted to be an autistic code monkey.
>>
>>60031525
Linux kernel.
>>
>>60031318
>Rust
Confirmed cuck
>>
File: 1462106708767.jpg (254KB, 2048x1536px) Image search: [Google]
1462106708767.jpg
254KB, 2048x1536px
>>60031335
>citizen is of type america
>>
>>60031569
Trust me, you don't want to be a one man army.
>>
>>60031569
Who are you replying to?
>>
>>60031531
UI theory has imporoved, but the actual implementation...yeah.
I mainly miss controls and looks being consistent. Take Windows 10 applications for instance, what a clusterfuck they are.
Worse than Linux imo and I use both daily.
>>
>>60031560
It does.
>>
>>60031599

Why not?
>>
>>60031651
No it doesn't.
>>
>>60031675
Yes it does.
>>
>>60031671
>"hey anon, iOS got feature X but I don't see it on Android"
>"what's feature X?"
>"oh, I forgot to tell you but it's a requirement for next release"
>"why didn't you plan a meeting to discuss this?"
>"silly anon, we don't do meetings here"
>>
>>60031694
No it doesn't.
>>
>>60031621
Windows 10 is the result of great UI theory that's made too many concessions for Win32 convention.

So, I'd agree.
>>
File: 1437169281028.png (414KB, 1298x1080px) Image search: [Google]
1437169281028.png
414KB, 1298x1080px
>>60031742
>>
>>60031742
MS never really had good UI design in the first place. Even Windows 8 was full of undiscoverable "surprises" that for some reason seem to be invading UIs lately.
>>
>>60031719

I can understand meetings between techs, but most of the meetings I have are literally just the managers spouting buzzwords about "strategy" and shit for 30 minutes.

My life right now is just one big Dilbert comic.
>>
>Python

>Open file in read mode
>Read
>Close file
>Open file in write mode
>Write
>Close file

Why isn't there just a read write mode?
>>
>>60031886
There is, idiot.
>>
>>60031753
your image supports his point
>>
>>60031886
'rw' doesn't work?
>>
Why is JavaScript such a bad language?
>>
>>60031753
Holy fuck I never realized it was that bad.

Originally I typed up about how Windows 10 is a victim of a transition period.

I still maintain it has good theory. It just turns out Microsoft is more retarded than I realized. You can just see the back and forth between devs, researchers, and management here.

>be dev
>submit work to boss
>boss sends back, says we need to make it good for stupid people
>talked to research team, make it good for stupid people, am proud, not bad, I'd use myself with some powershell in the background
>test team fucking hates it because new way to do things, sends back
>implement context shit, fuck, deadline, have to just hack it onto what's there
>boss gets fired, new boss
>new boss says people like dark theme, ok, do that
>released, fucking hate my work, users do too
>immense pressure to return it to win32 style
>try, but deadlines
>get fired
>tfw leave win10 in such retarded half-finished state
>>
>>60031870
I used to know that feel.
Then I went into high level support and stopped giving a fuck.
>>
File: 3983983983.png (3KB, 554x51px) Image search: [Google]
3983983983.png
3KB, 554x51px
>>60031906
Returns an error

>>60031894
How do you do it?
>>
>>60031935
Use r+ for both reading and writing
>>
>>60031935
Look at the damn documentation.
I'm not going to spoonfeed you.
>>
>>60031870
Daily meetings that last 30 minutes are indeed too long. I'd say 15 minutes per week is ideal.
I don't care about meetings between techs, I want to meet with the manager. This way I know what's going on between the client and the company.
>>
>>60031909
>C
>designed by two PhD gurus from based Bell
>Lisp
>designed by one of the founding fathers of CS
>Javascript
>designed in 10 days by a Netscape ""technologist""
Yeah
It's not that bad these days though, but still

Oh, and at some point js was called Mocha which literally sounds like "piss" in Russian
>>
>>60031950
No, but he will.
>>60031949
>>
>>60031982
JS is better than Lisp tho.
>>
>>60031886
>>60031914
>>60031982
If you're not joking, then could you give me the link to the full story you're quoting from?
>>
Time for a new thread. I am too lazy to do it.
>>
>>60032039
I don't have my pedo pictures with me.
>>
>>60031753
They standardised most of that now, the only thing they still have is the old context menu style on the desktop and in non-metro programs.
>>
Doing some retarded error handling in C
It does more or less nothing other than notify me that something went wrong, but w/e
>>
>>60032063
>>60032063
hop in my dudes
>>
>>60032066
>system("exit")
Please anon, stop being retarded.
>>
>>60031982
Either you don't know how to pronounce "piss" in Russian or "mocha" in Italian.
>>
>>60032066
Looks kind of like the thing i did to deal with HRESULT error codes from WinAPI.
>>
>>60032066
Use compound literals and/or macros.

throw((Error) { API_ERROR, "An API Error has occured.", -1});
Thread posts: 319
Thread images: 27


[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.