[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: 313
Thread images: 29

File: dpt_flat.png (102KB, 1000x1071px) Image search: [Google]
dpt_flat.png
102KB, 1000x1071px
Old thread: >>60580178

What are you working on, /g/?
>>
File: young-bill-gates-001.jpg (30KB, 460x276px) Image search: [Google]
young-bill-gates-001.jpg
30KB, 460x276px
I came up with a way to do inheritance in javascript:


function foo(){
//public member
this.x = 2;
//private member
var y = 4;
//protected members
var protected = {};
protected.z = 3;
return protected;
}

function bar(){
//inherits public and protected members
var protected = foo.call(this);
this.m = protected.z;
return protected;
}

var abc = new bar();
console.log(abc.m); //outputs 3



Try saying js isn't oop now fuckers
>>
>>60586844
rust is the language of numale cucks
>>
>>60586844
he looks evil, even back then
>>
>>60586860
That post didn't have anything to do with Rust?
>>
https://pastebin.com/J7ML00yi

how bad is this code on a scale from 1 to 10
>>
File: dlang_chan.jpg (139KB, 470x545px) Image search: [Google]
dlang_chan.jpg
139KB, 470x545px
Threadly reminder that dlang-chan is not dead; she's going to have her GC tumor removed (eventually); and she's super duper cute and easy to prototype in! Say something nice about her, /dpt/!
>>
File: 1453306116180.png (58KB, 313x196px) Image search: [Google]
1453306116180.png
58KB, 313x196px
>>60587146
>"" instead of <> for system headers
>setjmp
Why?
>>
>>60587153
I like hajry phssy
>>
>>60587234

>setjmp
Perhaps Anon is trying to mimic exceptions?
>>
>>60587303
mostly to simplify error handling so i dont gotta check for errors, it's just a toy, so hacks are fine
>>60587234
> "" instead of <> for system headers
idk just habit, you didn't give a number btw
>>
>>60587303
At least he acknowledges that it's a hack, but I really think there is no valid reason to use setjmp.
>>
>>60587348
for generated code, maybe it makes sense in some contexts

actually, yeah, chicken scheme uses it to hack proper tail-calls into their compiled output.
>>
cant imagine wasting my time in the current year still using a dated language from the 80s
>>
>>60587348

>there is no valid reason to use setjmp
At least not in this program. A common use for it is in signal handling, however.
>>
File: 1491372602136.jpg (62KB, 600x621px) Image search: [Google]
1491372602136.jpg
62KB, 600x621px
I love GOTO now. Cleanup on errors has looked so good!
>>
>>60587397
Jumping out of a signal handler is just asking for all sorts of trouble.
The actual things you're allowed to do in a signal handler is extremely limited. While POSIX eases those restrictions up sightly, it's probably still going to lead to all sorts of undefined behaviour.
>>
why do Erlang's semantics suck so much?
>no nested modules
>no "import all"
>no real type-checking
>no constants
>functions are not treated equally as values
>>
File: dlang_chan.jpg (173KB, 468x544px) Image search: [Google]
dlang_chan.jpg
173KB, 468x544px
Threadly reminder that dlang-chan is not dead; she's going to have her GC tumor removed (eventually); and she's super duper cute and easy to prototype in! Say something nice about her, /dpt/!
>>
>>60587542
you already posted this
and we dont care
>>
File: 1492831891533.png (341KB, 556x561px) Image search: [Google]
1492831891533.png
341KB, 556x561px
>>60587153
>>60587542
>Posting your shitty propaganda twice
>>
File: 1489613614530.png (45KB, 236x350px) Image search: [Google]
1489613614530.png
45KB, 236x350px
>>60587558
>>60587561
That wasn't me, you retards; this >>60587542 is marked as a new IP. Plus, as I've mentioned in my posts, they're threadly. I've never made duplicate posts in the same thread.
>>
>>60586810
No, what you did was ignore my original question and offer bullshit. My six ITS certs give me a comfy understanding of hardware and firmware. I know some assembly stuff as well.

I was asking for programming projects in some relation to my current skill-base.

Your solution read like: "Hey, I know you're an active programmer using some of the industries top-used languages, and your question was asking for projects possibly related to said languages, but instead I'm going to offer the idea that you should ditch those interests and pursue an entirely different language that you have already worked with in college, but maybe this time you should really go deep with it. Otherwise, give up on being a real programmer."

Man, I was just looking for more serious side-projects to work on. My job has me developing software for a medical information system, which is cool and all, but I wanted to see if you guys had any ideas of what I could write, at home, as a more involved project. Instead, I got shit.

Oh well, back to the Stack Exchange / Reddit. At least the levels of glorified smart-ass are a bit lower on those sites.
>>
>>60587618
Nobody cares, you fucking spammer. Nobody gives a flying fuck about your deadlang.
>>
>>60587618
you still could have noticed there was the same exact post made by another poster (if that's even true)
>>
I need to build a parser but I have no idea where to start, I already have the lexer built, and all I need to validate syntactically are variable declarations and arithmetic operations.

Can anyone recommend me some resources that will help me implement this quickly? I don't have much time left.
>>
>>60587696
https://en.wikipedia.org/wiki/Recursive_descent_parser
If you already have the appropriate (LL(1)) grammar, this is pretty quick to do.
>>
>>60587696
Use a parser generator or some combinators
>>
File: dlang_chan_7.jpg (75KB, 383x491px) Image search: [Google]
dlang_chan_7.jpg
75KB, 383x491px
>>60587632
>one anon put some effort into a zombie edit of my dlang_chan image
>it's now unthinkable that some other (or the same) anon is now false flagging with a nearly exact copy of my image
Well, it doesn't matter. dlang-chan is immune to shitposting.
>>
What's the best programming language in current year, /g/, and why is it C?
>>
>>60587696
a parser is more or less a lexer that operates on tokens instead of characters. design it as you would design the lexer
>>
>>60587768
>a parser is more or less a lexer that operates on tokens instead of characters
No. That is completely wrong.
A parser models a pushdown automaton (assuming context-free language), while a lexer is really just a finite state automaton, which just serves the purpose of making parsing a bit cleaner.
>>
>>60587808
You're completely wrong to make either of those assumptions.
You could have a context sensitive lexer.
>>
>>60587727
Because it literally requires you to be smart, you can't be dumb and program in C, it's not possible. Programming in C is the ultimate litmus test to prove you're smart.
>>
>>60587834
>context sensitive lexer
Jesus christ, why would you do that?
Anyway, a lexer fundamentally doesn't change the power of a parser, it's only to simplify it.
You can have more complicated lexers, but having it more powerful than a DFA is just a bad idea.
>>
>>60587863
By that logic Haskell is da best though
>>
File: 1495510388344.jpg (155KB, 450x425px) Image search: [Google]
1495510388344.jpg
155KB, 450x425px
>>60587420
>there are people ITT right now that has fallen for the goto is bad meme
>>
>>60587863
somehow i doubt you've actually programmed any real world program in c
>>
dynamic typing
>>
>>60587898
you don't need to be smart to program in Haskell
>>
Any meme programmers around?
I'm trying to limit the number of concurrent threads in golang because I'm reasonably sure it's causing a DDoS protection from the site I'm hitting, but I can't find any kind of clear description (like everything else in this fucking language) on how workergroups operate
>>
File: penn-jillette.png (68KB, 200x200px) Image search: [Google]
penn-jillette.png
68KB, 200x200px
>reading resume
>languages: C/C++
>>
>>60587880

Well, I think C++'s lexer now has to be context sensitive. If you see >>, it could be interpreted as two separate > tokens (for closing template parameters) or as a right shift operator.
>>
File: 1492162071346.jpg (78KB, 1024x576px) Image search: [Google]
1492162071346.jpg
78KB, 1024x576px
Whenever I'm researching a subject(like a new programming language, some algorithm i need to use) and I find a video on it, the second I hear a fucking indian accent, I fucking close that shit. Same thing if I see an article/forum post and it's written in the classic indian broken english and you look at the author and it's some fucking Dinesh Sihauhasihuali Hatwadir, it gets fucking discarded without even giving it a chance. I hate that shit. Annoying ass fucking accents and they can't explain shit.

Anyone else do this?
>>
If you think using goto isn't a bad practice, then you are simply being contrarian.
>>
>>60587971
I wouldn't take C++ as an example of good or even remotely sane language design.
>>
>>60587998
I use goto for error handling, fight me.
>>
>>60588023

C isn't good design either you zealot
You need to feed the symbol table back into the lexer simply because the indirection operator exists and is lexically indistinguishable from scalar multiplication.
>>
>>60588028
Give an example
>>
>>60588049
I didn't even mention C, but I'm aware of C's parsing issues. However, there are actually other ways to design around this.
For example, clang doesn't treat types and identifiers separately, and they determine which it is later during semantic analysis.
>>
File: ss-2017-05-26-03-28-45.png (137KB, 1294x735px) Image search: [Google]
ss-2017-05-26-03-28-45.png
137KB, 1294x735px
why haven't you switched from C to CJava yet?
>>
File: cool.webm (2MB, 640x480px) Image search: [Google]
cool.webm
2MB, 640x480px
worked all day on this
>>
>>60588128
ugh, for what purpose tho
I have jni if want to call my c shit from my java
>>
File: 1470848122768.jpg (53KB, 349x445px) Image search: [Google]
1470848122768.jpg
53KB, 349x445px
>>60587899
>>
>>60588146
what is this suppose to be? Can you write any sort of text and it will get animated like that?
>>
>>60587715
stop posting that ugly boy
>>
>>60588174
no it just takes the red pixels in an image and makes them play conway's game of life
>>
>>60588174
game of life, input image is memefeld
>>
File: Venice_Beach_3_L.A..jpg (586KB, 1200x1600px) Image search: [Google]
Venice_Beach_3_L.A..jpg
586KB, 1200x1600px
Why the use_cout of shared_ptr s is 2.
It didn't point to any object when it was initialized.
#include<memory>
#include<string>
#include<iostream>
#include<typeinfo>
int main(){
std::shared_ptr<std::string> s;//Default initialized to null
std::shared_ptr<std::string> p(new std::string("Jesus"));//direct initliazation;

s = p;
std::cout<<"s = p "<<"Means use_count of p will increase to 2"<<std::endl;
std::cout<<"\n use_cout of s was zero, it will increase to 1"<<std::endl;
std::cout<<"s.use_count "<<s.use_count()<<std::endl;
std::cout<<"p.use_count "<<p.use_count()<<std::endl;
return 0;
}


s = p Means use_count of p will increase to 2

use_cout of s was zero, it will increase to 1
s.use_count 2
p.use_count 2

>>
/dpt/, what's the name of the really shitty lisp dialect used to write makefiles?
>>
>>60588146
Wha did you use? Directx12 or OpenGL?
>>
>"exceptions are garbage"
>uses goto as a error handling technique
>>
>>60588237
SDL2

my next goal is to do this with OpenGL shaders
>>
>>60588237
>DirectX or OpenGL for simple pixel manipulations
He probably didn't use either.
>>
>>60588069
Not him, but here ya go. This is rather trivial, but it gets the point across.
Something* create_something() {
Something* something = malloc(sizeof *something);

if (!something) {
goto END;
}

if (!(something->stuff = malloc(sizeof *something->stuff))) {
// ...
goto CLEANUP_STUFF;
}

if (!(something->more_stuff = malloc(sizeof *something->more_stuff))) {
// ...
goto CLEANUP_MORESTUFF;
}

if (!(something->last_shit = create_shit(/* ... */))) {
// ...
goto CLEANUP_LASTSHIT;
}

// set some defaults for shit that doesn't need to checked
// ...
goto END;

CLEANUP_LASTSHIT:
free(something->more_stuff);
CLEANUP_MORESTUFF:
free(something->stuff);
CLEANUP_STUFF:
free(something);
something = 0;
END:
return something;
}


>>60588184
Don't bully her, rude-kun.
>>
File: 1453303319472.jpg (149KB, 1920x1080px) Image search: [Google]
1453303319472.jpg
149KB, 1920x1080px
>>60588260
>Which is better: Invisible gotos or visible gotos
>>
>>60588267
Why not just use switch?
>>
>>60588292
There is no switch member function for shared_ptr?
Is there anything like std::switch?
Can u answer my question?
>>
>>60588287
>"invisible goto"
please explain yourself. I keep hearing this but it makes no sense as an argument against exceptions.
>>
>>60588218
How do people defend this language?
>>
>>60588292
Educate yourself on switch control, anon-kun~: http://en.cppreference.com/w/c/language/switch
>>
>using goto
>using exceptions

>not just returning an error code
>>
>>60588331
Here is a block of code.
function1();
function2();
function3();

Tell me where the code jumps out.
>>
>>60588355
Use both. There is no single solution to error handling.
>>
>>60588267
>2017
>manual memory management
>goto
In the trash.
>>
>>60587561
It's not shitty propaganda, it's delightful propaganda and it brings a little personality to these threads. I'll never actually use D, but Dfag-sempai is nonetheless one of the people who make this thread a little less drab.
>>
How exactly are exceptions better than errno?
>>
>>60588381
To clarify: that segment is plain C. So manual memory management is to be expected.
>>
>>60588358
>what is a stack trace
>what is "throws" as part of a method / function's API
>what is being forced by the compiler to handle the exception using a try-catch or re-throwing it
>>
>>60588341
What is the problem with shared_ptr?
It helps you safely manage dynamically allocated memory.
>>
is it bad that i am excited to find bugs in a competitor's software?
>>
>>60588358
Here is a block of code.
if (condition1()) break;
if (condition2()) break;
if (condition3()) break;

Tell me where the code jumps out.
>>
>>60588417
At least I know the code CAN jump out.
>>
>>60588355
>Forcing yourself into one solution
Stay cucked
>>
>>60588403
Noob question: Does C has exceptional handling?
Is exceptional handling inspired from errno?
>>
>>60588409
>>what is being forced by the compiler to handle the exception using a try-catch or re-throwing it
So in those languages you have to provide some kind of exception handler (even if it's just a rethrower) in any function that calls a function that may throw? Why exactly is that better than checking the return value?
>>
>>60588382
How some anon posting literally the same shit over and over again interesting?
It's not even anything worth replying to.
>>
>>60588428
No. You have to do everything the "hard" way. and somehow this deludes some programmers into thinking they're better or more intelligent.
>>
https://github.com/guillermocalvo/exceptions4c
hmmmmmm
>>
>>60588218
use_count of p is increased to 2
s is assigned value of p and inherits the use_count
>>
>>60588403
Exceptions require you to handle them, whereas you can ignore the error code in C. Ideal is not having error returns and statically verifying your functions are meeting their pre condition.
>>
>>60588445
It adds flavor and he's not annoying
I like to think that it's actually Andrei hanging around with us, he looks like a guy who likes anime
>>
>>60588428
If you need something, there's a library for it. This is the glory of C. For example, https://github.com/ThrowTheSwitch/CException
>>
Just enrolled in professor Hal Abelson's Structure and Interpretation class at MIT. I used a computer before and I hear it's an entry level class so it shouldn't be hard. Wish me luck!
>>
>>60588428
It has setjmp, which can be used to implement faux exceptions, but it's not a function which is commonly used and is generally considered to be pretty shit.

>>60588485
>Exceptions require you to handle them
Java checked exceptions are a fucking hassle and everybody complains about them.
It leads to incredibly verbose code, and just checking a return value ends up being quicker a lot of the time.
>>
I'll take the D-shill any time over the gatekeeper and the super autistic type-theory dicks
>>
File: 1467663665086.png (1MB, 1280x720px) Image search: [Google]
1467663665086.png
1MB, 1280x720px
>>60588501
good luck
>>
>>60588503
>Java checked exceptions are a fucking hassle
That has literally nothing to do with what I wrote
>>
>>60588485
Seems like that would just encourage people to start putting trivial (and useless) exception handlers everywhere. It wouldn't actually encourage people to make safer code.
>>
>>60588409
Are you really checking your fucking stack trace at runtime?
>>
>>60588522
The gatekeeper is far worse than the type theory idiot.
>>
>>60588553
>Exceptions require you to handle them
Java is the primary example of a language that requires you to handle most exceptions. Most other languages allow you to ignore them, so if you're not talking about Java, I don't really know what you're talking about.
>>
File: 1452120313531.jpg (78KB, 444x460px) Image search: [Google]
1452120313531.jpg
78KB, 444x460px
>>60588501
>Hal Abelson's
MIT student visiting /g/. What went wrong anon
>>
>>60588557
The same way they'd have trivial and useless tests for an error return? Additionally, exceptions only cause performance issues when they are triggered, usually.
>>
>>60588482
lol u dnt know shared_ptr mate.
>>
>>60588501
godspeed faggot
I wish I could study there
>>
>>60588069
An example of goto is state machine. Taken from the "Programming in Lua, 4th Edition"
::s1:: do
local c =io.read(1)
if c == '0' then goto s2
elseif c == nil then print 'ok'; return
else goto s1
end
end

::s2:: do
local c = io.read(1)
if c == '0' then goto s1
elseif c == nil then print 'not ok'; return
else goto s2
end
end

goto s1
>>
>>60588657
When the hell did Lua get goto?
>>
>>60588675
In Lua5.3, though most Lua stuff is still on 5.2.
>>
>>60588615
>The same way they'd have trivial and useless tests for an error return?
Yes, but trivial exception handlers fill your code up with boilerplate.
>>
>>60588642
But you can!
https://ocw.mit.edu/
>>
>>60588682
>exception handlers are boilerplate
>manual memory management and if( error ) goto for every possible error condition isn't boilerplate
>>
>>60588682
So does your switch block, if you want to avoid your program becoming erroneous, then verify you meet the requirements of the function to operate properly, this is the most efficient solution as it avoids the function needing to test your input to see if it needs to return an error or exception and then you testing the output.
>>
>>60588739
>>manual memory management
Is orthogonal to the presence or absence of error handling.

>>if( error ) goto for every possible error condition isn't boilerplate
Except that ISN'T present when you DON'T provide error handling facilities. Whereas forced exception handling means even trivial handlers that do literally nothing add boilerplate to your code.
>>
>>60588739
Go exists and doesn't use exception handling or manual memory management.
>>
>>60588782
>when you don't provide error handling facilities
ok, then just don't catch it and add "Throws RandomException" to the method signature, which is what you wanna do to let the calling code know that your method might throw that exception
>>
Exceptions are useless when there's std::Option and std::Result
>>
>>60588810
>add "Throws RandomException" to the method signature
That just pushes the problem somewhere else.
Often one can reason that a function will not fail, as they have complete control over the input, so error handling can be omitted. Checked exceptions force you to deal with that shit anyway.
>>
>>60588831
Yes! Rust is truly an amazing language.
>>
>>60588782
>the benefit of not using exceptions is the ability to ignore them, allowing for invalid programs
Strong argument...
>>
Fun fact: Exceptions were invented because languages lacked good type systems.
Rust doesn't have this problem.
>>
I enjoy Rust, C, and Java. What now /dpt/?
>>
>>60588877
>Rust
>Good type system
>>
I'm having trouble with this.

list=[("a", "b"),("1",2")]

Is there a way to reverse all the values inside the list, so it reads:

list=[("b", "c"),("2",1")]
>>
>>60588898
explain yourself, child of summer.
>>
>>60588894
You are only 2 thirds reasonable.

>>60588898
>His language has to use exceptions because his language can't properly express results and error codes in the return type.
>>
>>60588914
Sorry, I meant:

list=[("b", "a"),("2",1")]
>>
>>60588916
Demonstrate this exceptional type system for me. Persuade me.
>>
>>60588831
Those are just object-oriented syntactic sugar for errno.
>>
>>60588916
There is nothing to explain. It's complete trash which is only barely more advanced than the simply typed lambda calculus.
>>60588923
What are you referring to? I don't use ``languages" with exceptions.
>>
What's a type system lol
>>
>>60588914
iterate through the list and call reverse function on each n-tuple? or make your own reverse function? not a super complex problem.

what language btw?

>>60588935
No no no. You were the one who decided to mock Rust's type system fucker. Back your mockery up.
>>
>>60588877
Rust's error handling could be trivially implemented in C. For some reason they chose not to follow that path when they expanded the language to C++.
>>
>>60588914
What language?
>>
>>60588942
>not a super complex problem
i know but im new, and its python

>>60588947
Python
>>
>>60588936
Kek, you have no idea what you're talking about.
errno is global and is error prone (>his languages primary error handling method is prone to errors. Kek). This is not.
>>
>>60588914
>>60588928
In Haskell, this is just
map swap [("a","b"), ("1","2")]
>>
>>60588942
You made the claim first, therefor you need to back it up, shitposter.
>>
>>60588937
Hello gatekeeper. You don't even have to gatekeep for me to know it's you.
>>
>>60588945
>Rust's error handling could be trivially implemented in C
Go ahead a try, and make it just as nice as it is in C.
Go on.
>>
>he needs error handling
just write good kode family
>>
>>60588956
That's not how it works. His claim is pretty blatantly false, you could easily show that.
>>60588958
Is this a special ed class?
>>
>>60588952
How exactly is it prone to errors? And global errno is fine in well-formed, single-threaded programs. And I mean errno as the general concept, i.e. setting a specific variable when an error occurs. You could implement the same mechanism as a local variable.
>>
>>60588974
Here is Option<T> where T is a pointer:
T *ptr;
>>
>>60588974
>and make it just as nice as it is in C
Rust*
>>
>>60588951
>but I'm new
Ok, that's respectable. I would say look for a reverse function in the Python API somewhere, and try to write some code that calls reverse on each tuple in your list. DuckDuckGo / Google is your friend. Good luck.
>>
>>60588951
tuples inside that list are immutable so to reverse them you will actually need to overwrite the elements inside the tuples.
>>
>>60588974
>Go ahead a try, and make it just as nice as it is in C.
So you think C's error handling is better than Rust's? Lol.
>>
>>60588983
I just wanted him to admit he has no idea what he's talking about, and it is up to him to prove claims he made.
>>
>>60588985
>How exactly is it prone to errors?
It will change when you call another function that sets errno.

>>60588987
>Forcing yourself to heap allocate
I thought C was efficient and allowed you to write fast code?
Try again.
>>
>>60588987
Option is just a tagged union reference.
>>
>>60589015
It's not a reference, dumbfuck.
>>
>>60589010
>>60589015
>Claims to be a Rust fag
>Doesn't even know about the null pointer optimisation
>>
So anyone gonna explain how Rust's type system is trash?
>>
>>60589010
>It will change when you call another function that sets errno.
In a well-formed program, you will check for errors after every call to a function that may be subject to errors, and in doing so, will reset errno.
>>
>>60588914
map (lambda t: (t[1], t[0]),list)
>>
>>60589021
You need to implement it as a reference because values are not nullable.

>>60589025
It doesn't support real numbers.
>>
>>60589047
Give an example of a real number that Rust wouldn't support.
>>
>>60589047
>It doesn't support real numbers.
It's impossible for a computer to truly support real numbers.
>>
>>60589025
I'd rather have someone try to explain how it's good.
>>
>>60589075
Good thing Rust isn't a computer then :^)
>>
>>60589025
It has general recursion.
>>
>>60589047
Still waiting on that example of a real number Rust wouldn't be able to support.
>>
>>60589118
Oh? What's wrong with general recursion?
>>
>>60589025
HIGHER KINDED TYPES
I
G
H
E
R

k
I
N
D
E
D

T
Y
P
E
S
>>
>>60589108
>:^)
Rust is exactly the sort of language I'd expect human trash like you to love

>>60589120
https://en.wikipedia.org/wiki/Chaitin%27s_constant
>>
How long until other languages decide that C#'s LINQ is so fucking good they implement their own version?
>>
>>60589120
2^4096.
>>
>>60589131
It allows you to implement any type signature.
>>60589134
This can only be true if higher kinded types imply that a type system isn't trash. Which is clearly not the case.
>>
>>60589108
Computers are limited to Q.

>>60589120
sqrt(2)
>>
>>60589136
Name a language that can support that real number.
>>
>>60589147
Having HKT does not make a type system good, but every good type system needs HKT.
>>
>>60589165
There isn't such a language.
>>60589171
Or rather HKTs are implied by any good type system.
>>
>>60589178
Ok, well you gave that as a response to why Rust's type system is trash. So are all languages type systems trash then?
>>
>>60589138
what do you use it for
>>
>>60589206
Or whoever wrote the 2^4096 post was a shitposter, I'll let you decide.
>>
>>60589206
>Ok, well you gave that as a response to why Rust's type system is trash
I didn't. I just showed you a real number not "supported" by Rust.

Rust would be trash because it's a new language which makes the mistake of adding some good type system features while still staying in the 70s by implementing merely System F. A new language can't do that and still claim it has a non-trash type system.
>>
>>60589237
Collection queries. Hands down the easiest way to do one liners to sift out specific data you want.
>>
File: 1495709610079.jpg (255KB, 1000x1398px) Image search: [Google]
1495709610079.jpg
255KB, 1000x1398px
Is Rust just C with forced unique_ptr semantics?
>>
>>60589157
>Computers are limited to Q.
See >>60589108
>>
>>60589275
Rust is C with actual strings
>>
>>60589047
>Hur dur look at me, I don't know how Option works.
>>
>>60589275
Post more utsuho
>>
Is there a general programming thread that doesn't include high level non-practical computer science masturbatory bullshit?
>>
>>60589275
>>60589287
Rust isn't C because Rust has bindings to C.
>>
>>60589304
/dpt/ died a long time ago
>>
>>60589304
Yes.
>>>/g/wdg/
>>
>>60589307
X isn't Y because X has Y wrappers
>>
>>60589287
and O(n) access
>>
>>60589304
>He thinks this thread is about programming
>>
>>60589325
To what? Strings? Nice. I like strings
>>
>>60589319
A non web or game development, general programming discussion thread without all the graduate level CS masturbation.
>>
>>60589304
No. This thread is just about autistic shitposting
>>
>>60589335
You are free to create one anytime. I don't think this thread has any ""graduate level"" discussion though, so it might just have something to do with your retardation.
>>
>>60589361
Undergrad level*
Sorry for the mistake
>>
>>60589325
Isn't that the fastest one?
>>
>>60589369
aaaaay
>>
>>60589366
Even that isn't true. Which tells me all I need to know about you.
>>
Why are C, Rust and C++ the overall fastest languages?
>>
>>60589275
Rust is C++ with even more awful shit piled on time.
>>
>>60589361
>You don't understand System F? You must be mentally retarded.
>>
>>60589382
It is though, judging by your post pattern you are probably a high-schooler.

Either that or you are a drop-out.
>>
Option<u8> has no fucking references, dumbfuck whoever claimed that Option is "just a nullable reference"
The above type has 2 bytes: the discriminant (wether it is Some or None), and the actual u8 value.

And yes, Option<&u8> can use NPO to remove the discriminant and treat NULL as the None case, but only when the type is a fucking pointer.
>>
>>60589383
They are compiled to native code. Ada would be as well, but no ones bothered to update the programs since new techniques have been discovered recently.
>>
>>60589402
That sounds like a solid strategy.
>>
>>60589398
You must be mentally retarded to claim that a type system is good without understanding it. That's all I'm really saying.
>>
>>60589415
Ada is at the same performance level as Chapel or Java. Compiling to native code is does not guarantee speed.

Look at **kell, it's even slower than Python
>>
>>60588831
Exceptions are a bad idea in every language I've faced them in. Its not a high standard to beat.
>>
>>60589411
Yes, but Rust is still trash because it doesn't implement System Z, and doesn't have trans-dimensional A-types and according to the Curry-Howard correspondence, any type that implements a Huffman-Powell B-type must conform the the isomorphism of all A-types.
>>
File: 1493782414910.jpg (26KB, 500x281px) Image search: [Google]
1493782414910.jpg
26KB, 500x281px
>learning and developing in an SJW programming language
>>
>>60589439
Did you read only half of my post?
>>
>>60589398
if you can't understand simply typed lambda calculus + polymorphism you might actually be retarded though
>>
>Being a pedophile anime watching manchild
>>
>>60589452
No.
>>
>>60589325
It has O(1) access if you assume the string to be ASCII, like in C.
>>
>>60589465
C doesn't have strings
>>
>>60589465
Isn't O(1) slower though? O(n) is bigger for almost every case, no?
>>
>>60589463
Ada isn't as slow as Java, the programs used in the bechmark are old and not identical to the other systems languages.
>>
>>60589473
Why?
>>
>>60589453
oh, you mean "of average intelligence". fuck this meme where highly intelligent individuals think that everybody else is retarded.
>>
>>60589446
Fuck off
>>
>>60589458
Anime is the fundamental part of imageboard culture and being disgraceful to the anime must be a punishable offence.
>>
>>60589480
>the programs used in the bechmark are old
And? You are free to give your newer code as long as you follow the algorithm instructed.
> not identical to the other systems languages.
How?
>>
>>60589494
>oh, you mean "of average intelligence"
No, I literally mean mental retardation, as in a medical condition.
>highly intelligent individuals
I never claimed this, I would consider myself average-above average.
>>
>>60589500
>Anime is the fundamental part of imageboard culture
I bet you also believe your disgusting cum covered "wifeu" pillow has life, autistc lump of shit.
>>
>>60589447
Rust is for straight white men
>>
>>60589275

Rust is basically all of the good parts of C++ minus the trivial porting of C libraries, but with a more coherent language structure. It doesn't have HKTs or the ability to compute anything in the type system, but then again, it doesn't really need to.

>>60589325

Rust strings can be coerced into a vector of u8 in O(1) time, which can then be used to access characters in ASCII strings in O(1) time, just like in C. If there were unicode characters, you're SOL for O(1) access, but then again, that is the case in every language that matters. There is simply no way in any language to access unicode characters in O(1) time unless UTF-32 is used, and I don't think anyone wants to do that.
>>
>>60589500
>>>/a/
>>
>>60589514
A mentally retarded person could not possibly be competent enough to post on 4chan and solve captchas.
>>
>>60589507
I know I'm free to, I've submitted two. I just can't be asked.

Someone figures out how to do a function faster and then everyone copies it to not fall behind. It's just no one has bothered with keeping the Ada stuff up to data this year.
>>
>>60589537
You don't need to solve captchas to post on 4chan
>>
>>60589537
At least a week of being here should be enough to convince anyone of the opposite.
>>
>>60589489
It has string literals, which can be assigned to char pointers

>>60589477
That's not how it works.
>>
>>60589543
>I've submitted two.
Which two?
>>
File: millennials.jpg (80KB, 532x796px) Image search: [Google]
millennials.jpg
80KB, 532x796px
Friendly reminder that the conditional ternary operator was removed from Rust because it was deemed "too difficult to use".
>>
>>60589553
First part meant to respond to >>60589473
>>
>>60589383
C, Rust and C++ are the fastest languages because they don't use garbage collection which removes the overhead from bookkeeping objects in memory.
>>
best binary search tree?
>>
>>60589571
source?
>>
>>60589578
How come you don't have to do manual memory management if Rust doesn't have garbage collection?
>>
>>60589597
Because RAII
>>
>>60589561
The source code with the contributors is on the website. I'm sure you'll be able to figure it out.
>>
>>60589597
RAII
>>
File: robpikegolang.jpg (133KB, 1394x884px) Image search: [Google]
robpikegolang.jpg
133KB, 1394x884px
>>60589571
reminder that go was literally designed for retarded children
>>
>>60589617
>>60589621
C++ has RAII too, but you still have to manage memory? wtf?
>>
>>60589631
If you rely entirely on RAII, no you don't.
>>
>>60589649
Nice. I'd love C with RAII. But C is handicapped in many cases. Is C++ as productive? What about Rust?
>>
>>60589617
>>60589621
RAII is a meme. It doesn't work.
>>
>>60589687
C++ is more productive than C, and Rust is more productive than C++
>>
>>60589692
>meme
>>>/v/
>>
>>60589692
sigh...please elaborate.
>>
>>60589701
/v/ is a meme
>>
>>60589439
***kel is ``compiled" in the same sense that Visual Basic is ``compiled".
>>
>>60589692
It works perfectly well, retard.
Is everything you don't understand a meme?
>>
>>60589697
Hmm. I'm intrigued.
How popular is Rust? I mean IDE support, forum support etc?
>>
>>60589477
O(1) means you have constant access time. O(n) means it grows to the length of the string.
There's no talk about overhead for these things. BigO notation is just for analyzing the extremes.
All we know is if we adjust the size of the string eventually o(n) will be slower.
>>
>>60589715
I don't know, I just use a text editor, and I don't browse the forums nor do I care about them.
>>
>>60589514
>I mean retarded retarded
I'd agree. Its simple stuff.
>>
>>60589715
Rust has the Rust Language Server. Which means Rust has IDE independent niceties maintained by the Rust team itself. So all official features present in Visual Rust (VS) are available to any IDE RLS supports.

Rust forum is pretty helpful but I think #rust-beginners is more helpful
>>
>>60589731
Jesus. It's one thing to call people who don't understand these concepts idiots or bad programmers or even "stupid", but to literally call them actually seriously mentally retarded? Have you ever seen an actual retard?
>>
>>60589701
Nice meem my mang
>>
>>60589571
>>60589692
aaand two more hit and runs! They love to talk shit on Rust, but can never back it up or elaborate further.
>>
>>60589752
fuck off retard
>>
>>60589752
>but to literally call them actually seriously mentally retarded
Someone who can't understand the idea of applying functions and the idea of simple polymorphism is actually medically retarded (assuming that person isn't underage). It's not just incompetency.
>>
>>60589750
Perfect. I'm thinking of giving Rust a try. What IDE do you suggest?
>>
>>60589752
We're not talking about 'haven't learned' here. This is about being unable to learn. Its very simple abstract concepts. Adults should handle these.
>>
>>60589786
I personally use VS code. There are Vim plugins for it too
>>
>>60589778
https://www.youtube.com/watch?v=33wG1nRjNL0
These are mentally retarded people. I doubt they could even use a web browser or even a keyboard and mouse let alone post on 4chan and discuss programming languages.
>>
File: rust.png (181KB, 1250x915px) Image search: [Google]
rust.png
181KB, 1250x915px
>>60589715
about this popular
>>
>>60589807
I'm pretty sure a good amount of people on some boards here are actually straight from that video.
>>
>>60589812
How large is the community?
>>
File: rust is a safe space.png (18KB, 802x136px) Image search: [Google]
rust is a safe space.png
18KB, 802x136px
Have you read your Rust Code of Conduct today?
>>
>>60589807
Anon those aren't even close to the limit of retarded people. Remember that picture of a black man arguing that computers should be like TV and its the white mans fault they're hard? Almost certainly retarded. Do you think he'd be a special needs kid though? Most actual retards aren't obvious. I hadn't realized how lucky I am to be born to engineers and gone to nice schools. Because in college when I went to more public parties there were some people there that were just awful. If you look at retardation as defined and you're gonna realize how this claim is more accurate than you might think.

The problem is that you group average people with the retards. That's very unfair.
>>
>>60589842
That's a shitty font rendering, my man
>>
>>60589812
That's more popular than I expected.
>D
>disfavored on stack overflow, favored on git
Yep. Seems about right.
>>
>>60589842
You're missing the problematic part.
>>
>>60589861
Does that mean more people write D than shitpost about it?
>>
compiling to erlang makes me wanna bash my skull in
>>
>>60589842

I don't really interact with the community, so I don't have much of an obligation to read the code of conduct. I might end up creating an issue on the rustup github asking them to please make binaries for arm-linux-androideabi and aarch64-linux-androideabi available in the repositories, but I don't think that would require doing anything that would break the CoC.
>>
File: Dlang convention.jpg (192KB, 1200x888px) Image search: [Google]
Dlang convention.jpg
192KB, 1200x888px
>>60589940
This is a picture of dlang convention in berlin, this is likely the largest concentration of D programmers on planet earth, and considering that the only active D codebases on github consist of the D compiler and the D standard library, you are most likely looking at all of the D programmers on planet earth.

Also their convention was so small they're literally borrowing space from another larger language con I forgot which one.
>>
>>60589970
The rust code of conduct also applies to all projects written in the rust language.
>>
>>60589982
Does that mean more people write D than talk about it in a party?
>>
>>60590018
So if I don't use Rust and post manchild cartoons I am a master hacxor?
>>
>>60590018
>hating a language because of some dumb culture wars reddit shit
you're a retard anon
>>
>>60590063
Isn't that hypocritical? He calls out dumb fuck SJWs while he himself masturbates to cartoons made for 12 year olds.
>>
>>60590000

Rules do not apply where they cannot be enforced.
>>
File: rust-test.png (10KB, 472x177px) Image search: [Google]
rust-test.png
10KB, 472x177px
If Rust is so good, explain this
>>
>>60590086
Rust has testing? Nice
>>
>>60590080
so says you

enjoy being torn apart on twitter by angry trannies calling your employer to get you fired when you don't play by their rules
>>
>>60590029
Anime is the fundamental part of imageboard culture and being disgraceful to the anime must be a punishable offence.
>>
>>60590109
>Anime is the fundamental part of imageboard culture
No, it never was. There are containment boards for weebs just like there are containment boards for furries and faggots
>being disgraceful to the anime must be a punishable offence.
Anime is a leftist propaganda and your fascism is showing. Get out
>>
So I'm trying to throw a underflow exception:
throw std::underflow_error("clear";

But I keep getting "terminate called after throwing an instance of 'std::underflow_error'
what(): clear
this application has requested the runtime to terminate it in an unusual way. Please contact the application's support team for more information."

What do?
>>
>>60590109
Don't talk shit about my naruto faggot. Otherwise my senpai will notice you >:(
>>
>>60590122
I really don't understand your motivation. Why are you on anime site yet you despise anime fans? Why are you wasting your life away arguing with anime fans?
>>
File: 1441684460338.jpg (92KB, 1280x720px) Image search: [Google]
1441684460338.jpg
92KB, 1280x720px
>>60590127
>C++
>Exceptions
>Windows
>>
>>60590122
>Anime is a leftist propaganda
No. Anime is white and based.
>>
>>60590155
Fuck off back to >>>/a/ with your mental illness, sick pedo
>>
>>60590164
Anime turns whites into faggots and cucks
>>
>>60586810
You fucking autistic spergs don't understand that some people are actually looking for a fight that has some challenge to it.
>>
@60590166
@60590176
I don't want reddit stink nearby. Fuck off.
>>
Neetdom litmus test

     C
Go
Rust
Haskell
Common Lisp
>>
>>60590198
What is the order here though?
>>
Looks like some autistic anime watching pedo fuck nigger faggot lost its way to twitter
>>
File: Yakumo.Ran.full.2040274.jpg (483KB, 700x980px) Image search: [Google]
Yakumo.Ran.full.2040274.jpg
483KB, 700x980px
>Haskell is difficult
>>
Also...

>The enforcement policies listed above apply to all official Rust venues; including official IRC channels (#rust, #rust-internals, #rust-tools, #rust-libs, #rustc, #rust-beginners, #rust-docs, #rust-community, #rust-lang, and #cargo); GitHub repositories under rust-lang, rust-lang-nursery, and rust-lang-deprecated; and all forums under rust-lang.org (users.rust-lang.org, internals.rust-lang.org). For other projects adopting the Rust Code of Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion.

Basically, it only applies to IRC channels, forums, and github repositories owned and managed by the Rust team, and they encourage that those who WISH to use the code of conduct mention so explicitly. In other words, there is no implicit assumption.
>>
>>60590230
Fuck off, weeb manchild
>>
>>60590219
>>60590236
If you're going to act like a fucking redditor, go to fucking reddit.
>>
>>60590325
Get the fuck back to your daycare board, autistic weaboo. Or do your parents a favor and shoot yourself in the head, the society already is burdened with the leeches like you and your kind.
>>
Imagine a board without weebs and autists. I swear to god I want to beat the shit out of these pedophiles so bad
>>
@60590344
@60590358
Reddit is fucking shit. The users are fucking shit. Keep your filth away from here.
>>
NEW THREAD!!!

>>60590360
>>60590360
>>
>>60590361
Go fuck off back to your weeb SJW lgbt hugbox site fucking degenrate
>>
>>60589715
Rust isn't very popular, I believe only last month or so they added syntax highlighting in vim
Thread posts: 313
Thread images: 29


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