[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: 326
Thread images: 25

File: hidamari_dpt_waifu2x_traps.png (2MB, 1618x1308px) Image search: [Google]
hidamari_dpt_waifu2x_traps.png
2MB, 1618x1308px
Old thread: >>60937009

What are you working on, /g/?
>>
Haskell!
>>
C++ belongs to garbage bins
>>
File: 1495381440380.jpg (27KB, 335x335px) Image search: [Google]
1495381440380.jpg
27KB, 335x335px
>>60942063
Is having a sub-60 IQ a requirement for participating in these threads?
>>
>>60942078
Thank you! Simon Peytones sends love!
>>
>>60942063
**+ is strictly forbidden ITT. You can post those nonsense in /trash/
>>
>>60942097
what am I allowed to post?
>>
File: 1490967074861.jpg (112KB, 1280x720px) Image search: [Google]
1490967074861.jpg
112KB, 1280x720px
>>60942078
>H*skall
Please do not mention H*skall ITT. Spamming is not encouraged

>>60942097
>**+
Please do not mention **+ ITT. Spamming is not encouraged
>>
Reposting before the shitposters come out again.

I am learning the basics of OOP in Python and I am wondering what's going wrong. This minimal program works as intended: Each of the Beatle objects is destroyed when the main() function ends:

#!/usr/bin/python
class Dude:
def __init__(self, name):
self.name = name
def getName(self):
return self.name

class Beatle(Dude):
def __init__(self, name, instr):
self.name = name
self.instr = instr
def __del__(self):
print "%s is ded." % self.name

def main():
Dude1 = Dude("Hans")
Dude2 = Dude("Franz")
Beatles = []
for (name, instr) in zip( ("John", "Paul", "George", "Ringo"), \
("Keys", "Bass", "Guitar", "Drums")):
Beatles.append(Beatle(name, instr))
return 0

if __name__ == "__main__":
main()


However, in this longer program (https://pastebin.com/y48Pa8py) I wrote prior to this stripped-down version, this is not the case. It seems that none of the Guy objects in the Guys list report their death, while a single Guy object does. What's going on?
>>
>>60942097
So I guess we can only talk about Java, C#, Python, VHDL Fortran, Pascal and Rust in here?
>>
seriously?.lisp
(defvar duck '(1 2 3 4 5))
(defvar frog (cddr duck))

(print duck)
(print frog)

(setf (cddr duck) '(8 9 10))

(print duck)
(print frog)

output
(1 2 3 4 5) 
(3 4 5)
(1 2 8 9 10)
(3 4 5)

When did you realize Lisp was shit?
>>
>>60942119
Anything but that garbage
>>
>>60942124
>OOP
>Python
We don't like your kind around here.
>>
>>60942125
Yes. That """language"""(!) is not allowed here
>>
>>60942143
Too productive for you, right?
>>
>>60942125
>Java, C#, Python, VHDL Fortran, Pascal and Rust
Please do not mention Java, C#, Python, VHDL Fortran, Pascal and Rust ITT. Spamming is not encouraged
>>
>>60942121
>sp*mming
pl*ase d* n*t men*ion sp***ing i*t
>>
>>60942155
>languages are """"""productive""""""
This is your tiny little brain on Python
>>
I am working on ISO 7816 Smart Card library for Rust.
>>
>>60942124
you're doing oop in python
>>
File: 1484881866119.jpg (34KB, 853x480px) Image search: [Google]
1484881866119.jpg
34KB, 853x480px
>>60942174
>>60942175
>>60942183
R*st and p*thon are strictly forbidden ITT.
>>
>>60942143
>>60942183
So how are you liking your first week away from /b/ so far?
Seriously, why is Python getting so much hate here? It's easy to read, easy to learn, useful for everyday shit. As for OOP, it certainly is annoying for small programs, but gets really useful for certain applications. One of the projects I am working on would benefit a lot from an object oriented approach, so I'm trying to brush up on it.
In school I learned OOP basics in Java and C++, I haven't tried it in Python yet.

I found some peculiarity, I asked here because I'm trying to learn instead of getting my answers spoonfed to me, so why are you being so hostile?
>>
>>60942195
I don't even hate python, I just hate oop in Python.
>>
>>60942192
Anything is tolerable than **+
>>
@60942195
>why is Python getting so much hate here?
Because it's a shit language. Not everyone here is a drooling retard (though most "people" are).
>>
>>60942200
I am starting to see why. Still I'd like to understand exactly what's going on.
>>
We are making a web browser http://magicpackets.net:3000/proudfeet/netrunner

To join the team contact [email protected]
>>
>>60942043
And people say that H**k**l is unreadable.
>>
>>60942192
def main():
while True:
print "Blow it out your ass, anime poster."
>>
>>60942226
You seem to be new here. All the *chan websites are born out of anime culture.
We apologize that seems to intrinsically trigger your plebbit sensibilities.
>>
>>60942226
*th*n isn't even that good
>indent based syntax
>>
>>60942226
Forgot
if __name__ == "__main__":
main()
>>
>>60942247
Just import it.
>>
Is there a single non-retard who willingly uses python?
>>
>>60942265
Steve Jobs.
>>
>>60942246
You should indent your code anyway, might as well make them meaningful beyond just eye candy. I think you're just upset you can't claim to be superior to someone else for knowing it because it's easy to learn and allows people to get shit done instead of adding \ns to their printfs and semicolons to their lines all day.
>>
>>60942213
>gmail.com
Why would I want to help a government agent?
>>
>>60942219
in haskell that's just

data Either a b = Left a | Right b

either f _ (Left a) = f x
either _ g (Right b) = g b

id x = x

main = exitWith (either id round (Left 0))

exit' 0 = ExitSuccess
exit' n = ExitFailure n


+- some imports
>>
>>60942276
Didn't he create it? Or was it some other guy?
>>
>>60942276
He said non-retard.
>>
>>60942210

It's just ugly.
>__init__
>__del__
>self.foo
>No way to determine what instance variables there are except investigating every member function
Basically if you're using a scripting language for a program of sufficient complexity that you need to use anything more complex than block scoping, you're doing it wrong.

Still, at least it's not as bad as PHP.
>>
>>60942265
It's good for quick FS operations and webpage parsing, among others.
>>
>>60942276
see >>60942296
>>
>OOP
Does its users not see how poorly coupled their code is?
>>
>>60942285
>Comparing with **+
That's pretty low of you, anon
>>
>>60942293
Ritchie, the creator of PHP was a huge collaborator in it.
Just googled it, no it wasn't Steve, it was some guy who hates the reduce function.
>>
File: 1489048595255.gif (364KB, 500x375px) Image search: [Google]
1489048595255.gif
364KB, 500x375px
>>60942312
OOP is strictly forbidden ITT. Spamming isn't encouraged.
>>
>>60942265
I do. But that's because of a nice library a find. It's more that I use the library and python sadly comes with it.
>>
>>60942317
C++ is the height of programming languages, afterall.
So of course you'd compare your language with C++.
Even Rust markets itself as a C++ replacement.
>>
>>60942327
Why is *** forbidden?
>>
>>60942330
Prove your non-retardation.
>>
>>60942301
That is not what I am asking. I am stuck with Python, I am stuck with an object oriented approach, I want to make it work. Now, can you tell me why the objects from the list in the small program report their "deaths" and the ones from the large program don't, or are you just going to autistically list your minor gripes with a perfectly fine programming language again?
>>
>>60942317
There's nothing wr*ng with comp**ing haskell to (3*)
>>
does make sense. are you retarded?
>>
>>60942335
Yes it seems to be the minimum hurdle(!) to pass
>>
>>60942340
Do you mean POO or C++?
>>
File: 1484627060141.jpg (18KB, 480x270px) Image search: [Google]
1484627060141.jpg
18KB, 480x270px
>>60942063
Trying to create a program which given a programming language outputs the complete opposite of that language.
I will use this to create the best language.
>>
>>60942375
What's the difference?
>>
>>60942375
Those are the same thing, idiot
>>
>>60942375
>>60942121
>>
>>60942382
Are you going to feed it Haskell?
>>
>>60942131
A pair is made of two values: car and cdr

When doing cddr duck, you retrieve the value of (cdr (cdr duck))
You set that value to frog.
You then change the cdr value of (cdr duck)
But frog still hold the previous value.

Nothing is wrong here.
>>
>>60942265
Everyone who's above their sophomore year CS course that's realized that writing everything in a lower level language is completely unnecessary when it's a better idea to prototype in the easy language and build in the lower level language later. Also data scientists.
>>
>>60942386
>>60942401
If you're doing OOP in C++, you're using C++ incorrectly.
>>
>>60942419
depends on what you mean by OOP
>>
>>60942406
I'm going to feed it some POOlang. I'm thinking J*va or C* right now.
>>
>>60942419
If you are programming C++ thinking like a c programmer, you are doing it wrong.
>>
>>60942419
If you are using C++, you are doing the incorrect thing
>>
so what language isn't forbidden in these threads?
>>
>>60942419
>If you're doing OOP in any language, you're using that language incorrectly.
ftfy
>>
>>60942425
C++ is supposed to be used procedurally.
Procedural code can still make use of objects, it's just syntactic sugar for accepting a self parameter, afterall, which is a common practice in C.
>>
>>60942439
Crystal
>>
>>60942439
Anything but C*+
>>
>>60942408
This is good, Thanks for Insight.
>>
ITT: A bunch of first year comp sci students who have only ever used one language so they get really insecure when people criticize "their" language and start attacking others.
>>
>>60942439
VHDL, Pascal, Ada, FORTRAN, java and C#.
>>
>>60942433
No, you're an idiot.
Using C++ procedurally does not mean C with classes.
C with classes is an even more incorrect way to use C++.
>>
>>60942439
C+-
>>
>>60942439
Lisp since Lisp is for real programmers.
>>
>>60942431
>C*
C#?
>>
>>60942341
Can't be bothered. I scored 131 IQ through SAT to IQ conversion. Which I know isn't the best of measures but still. Not actually retarded.
>>
Would you use this?
>>
>>60942382
Will it it work for smaller parts of languages? Like individual features.
>>
>Thinking language choice matters
>Not designing a well built program that accomplishes the task quickly so you can do more important shit
It's going to be fun when you graduate from NEEThood and realize deadlines are more important than chimping out about language wars.
To stay on topic: making some scripts so I can easily compare commits over git forks. People really need to mark what their working on in the issues section otherwise it becomes difficult to not redo someone else's work.
>>
>>60942551
>well built program
Simply impossible in a lot of languages.
>>
>>60942551
Thanks for the update Vishnu, now please go back to your cubicle and POOlang
>>
>>60942529
Is this a tool that converts code to C or are you presenting the syntax for the upper language and explaining it using a language everyone knows, C?
If the latter I'm not sure I'd ever use something like the above. To me it seems way more inconvenient than the C version. And that's not because I like C.
>>
>>60942467
I am still correct though. I am not a fan of C++ but what I said still holds. Programming c++ while having a C mindset gives you the worst of both worlds.
I even dare to state that teaching people C as an intro to C++ makes them a worse programmer than when you learn them to program C++ without C first.
>>
>>60942551
>well built program that accomplishes the task quickly
Only possible in a language based on either C or Lisp.
>>
I am learning C by reading the book "C programming: A Modern Approach" by K.N. King. It has a lot of interesting stuff and I have already learned a lot. Sincere thanks for recommending it!

Are you supposed to do *all* of the exercises after each chapter or just the ones you find interesting?
>>
>>60942576
Lisp is superior than C in terms of syntax.
>>
File: 1491315995045.jpg (36KB, 233x215px) Image search: [Google]
1491315995045.jpg
36KB, 233x215px
>>60942537
Even if it won't you could do multiple passes to get a result closer to what you want.
The only problem is that using the last output as the new input might not be the same as the last input.
>>
What is the first set of utilities you implement in any language if it's missing?
For me it's a deference system. Usually it's just a function pointer/reference for the work to be done, a pointer/reference to data to operate on and a function pointer/reference to a condition function that determines if its time to execute.
Then I throw a function in that just iterates a list of these and calls the function that does stuff when necessary.
It's very nice.
>>
>>60942529
https://github.com/tomhrr/dale

https://github.com/carp-lang/Carp
>>
>>60942625
Seems good anon. Keep it up.
>>
File: 1466738715701.png (152KB, 500x500px) Image search: [Google]
1466738715701.png
152KB, 500x500px
>>60942529
>(use io)
>Would you use this?
No.
>>
>>60942576
Why is it inconvenient?
It has better constructs and nice features like storing the length of the array using a "fat" pointer using #.
>>
>>60942628
Frob
>>
>>60942653
He's asking if you would use use io, not if you would use io
>>
File: 1492112615402.jpg (5KB, 168x160px) Image search: [Google]
1492112615402.jpg
5KB, 168x160px
>>60942647
And there's no way this program is guaranteed to terminate.
>>
>>60942653
>IO isn't just a luxury in his language.
>>
>language fighting
This is always the most retarded shit. It's a fucking tool, not a dogma. This is like arguing that only idiots use a wrench or that screwdrivers are elder god tier.
>>
>>60942679
IO simply isn't part of my language.
>>
>>60942680
You probably use Scratch.
>>
>>60942662
I don't know what that is.
>>
>>60942680
>It's a fucking tool
You have just accepted that languages can be utter garbage.
>>
Real programmers only use ALGOL-58.
Honestly you don't NEED input/output, you can easily do anything you want with just manipulating data if you're intelligent enough.
>>
>>60942601
K.N. King was my professor in college. Knowing him, I would say you not only have to do all of the exercises, but you also cannot be creative whatsoever.

He was a bit of an asshole who only accepted one correct answer. He had these stupid fill-in-the-blank sections on his tests, and if you didn't memorize the answer EXACTLY it was counted as entirely wrong.

The worst example of this was when the answer to a question was "byte-code", but a student put "byte code" (no hyphen). The whole fucking question was counted as incorrect.
>>
>>60942674
I'm sure there's a way to figure out if it's likely to terminate or not and warn the user.
>>
* is the worst "programming language".
Prove me wrong.
>>
>>60942715
and where will you get the relevant data without input, you scum?
>>
>>60942729
Is there a star programming language?
>>
>>60942694
H***e*l?
>>
>>60942729
If it's the worst programming language why does it have a compiler for most platforms and is used to write a lot of serious software?
>>
>>60942729
I have never heard of the language * before so I can't really say good or bad things about it.
>>
File: udNsWyq.jpg (675KB, 2400x1800px) Image search: [Google]
udNsWyq.jpg
675KB, 2400x1800px
>>60942729
*++ is worst
>>
>>60942742
H***e*l is strictly forbidden ITT. Please refrain from mentioning it here.
>>
>>60942745
All one letter langs.
So, C, D, Go, etc..
>>
Not really sure where to ask, but I'd imagine someone here would know

Are there any text editors that I can use on Windows that allow editing remote files? Using FTP to edit then upload isn't too bad but I'd be great if it was done automatically in realtime
>>
File: 1492843424659.gif (227KB, 600x600px) Image search: [Google]
1492843424659.gif
227KB, 600x600px
>>60942529
Only if it isn't Turing-complete.
>>
>>60942529
Name of colorscheme?
>>
>>60942753
Haskell
>>
File: jdc.jpg (264KB, 1240x824px) Image search: [Google]
jdc.jpg
264KB, 1240x824px
hi /g/

challenge: what does this code do ?

float xxx( float number )
{
long i;
float x2, y;
const float threehalfs = 1.5F;

x2 = number * 0.5F;
y = number;
i = * ( long * ) &y; // evil floating point bit level hacking
i = 0x5f3759df - ( i >> 1 ); // what the fuck?
y = * ( float * ) &i;
y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration
// y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can be removed

return y;
}
>>
>>60942785
>code
I don't use "code".
>>
>>60942785
inverse square root
have you been living under a rock or something?
>>
>>60942785
It is some kind of hacker code used for stealing nude photos! Stay away!
>>
>>60942740
>>60942745
I censored the name so you wouldn't get triggered.
You should be able to figure out which one I meant.
>>
>>60942795
If those are not 16 lines of code than what the hell is it?
>>
File: 1488096576426.png (245KB, 1465x1209px) Image search: [Google]
1488096576426.png
245KB, 1465x1209px
>>60942766
>one letter
>Go
>>
>>60942834
poetry
>>
>>60942822
Oh, I see you meant Trashkell.
>>
>>60942578
Why are you bringing C into this?
If you're claiming that OOP is the proper way to program C++, you're wrong.
>>
>>60942736
Punch cards if one must have additional runtime data added to the program, but in general this is a scenario that should be avoided.
>>
>>60942785
You know what I don't get?
Why does he define threehalfs when he could just put 1.5F whereever he uses it?
>>
>>60942768
GNU Emacs has a Windows version.
>>
@60942836
>ribbit the reddit frog
I don't want reddit stink nearby. Fuck off.
>>
>>60942868
>GNU
So in other words it's shit?
>>
>>60942850
punch cards are still input, you tard.
>>
>>60942768
Honestly you should ask on >>>/g/sqt/
>>
>>60942874
>@
>thinking pepe didn't start on /vip/
retard
>>
>>60942874
Haha holy shit how did you know I'm from reddit? Are you a fellow redditor? Haha lol it's cray how us epic memers recognize each other.
The narwhal bacons at midnight bro lmao
Long live kek
>>
>>60942736
It should be there at compile time. I don't really care how it gets there.
>>
>>60942901
Yes punch cards are input but they are not IO in the usual sense of definition. ALGOL-58 has support for compile-time punch card input but not runtime IO as introduced years later. If you know anything about programming history you'd know this.
>>

>>
>>60942921
you are still providing input to the compiler
>>
@60942905
>@
Is it your first day here?
>"""pepe"""
Why do you keep denying being a redditor? Fuck off.
>>
>>60942720
>The whole fucking question was counted as incorrect
what the fuck
>>
>>60942940
>not understanding the different between 'input' as in 'giving data to a computer' and 'io' as in 'giving and receiving data from a running program
>>
>>60942940
The language itself doesn't need to have a notion of IO for that. Which is the only thing that matters.
>>
>>60942933
if you know programming history, you would have know it's the same. this is why we are saying terminal _emulators_, because they are emulating old punchcard based terminals.
>>
>>60942938
newfags can't triforce
>>
>>60942836
dumb frogposter
>>
>>60943036
dumb progfoster
>>
>>60942956
it's virtually the same. receiving input from a device (keyboard) or from the network is the same as receiving input from another program. incoming data is incoming data, the way of convoy is irrelevant.
>>
>>60942963
That is actually incorrect. Terminal emulators are called as such because they are emulating real terminals, which were satellite computers connected to mainframes similar to modern "cloud desktops". In a broader sense the word 'terminal' could be referring to ANY piece of hardware that handled input and output from a machine instead of passing that data onto another device (ie the terminal is where the data 'terminates').

Linux's command line interfaces (before starting Xorg) are actual virtual terminals, not terminal emulators. That being said, this is all rather tangential to the actual discussion because the point is about compile-time input versus runtime input, not digital input versus analog input.
>>
This isn't strictly programming, but I figure it's the best place for it.

In vim, how can I make it so a search only targets the current piece of the file being displayed to me? I'd like to use it to jump my cursor around exactly to where I want it without needing to monkey around with normal cursor movement too much.
>>
>>60943061
Vim is useless, use ed.
>>
>>60943061
>This isn't strictly programming
Use some other thread then.
>but I figure it's the best place for it
What kind of retarded reasoning led you to this? I didn't read the rest of your post, but you should probably ask on >>>/g/sqt/
>>
>>60943046
Giving anyone who can use a keyboard unbridled access to input data into my software at will is dangerous and must be avoided. In only accepting data from itself or other pre-configured formats such as databases or other software, the data entering the software can be at least somewhat regulated for quality and correctness. Not in that the data itself is monitored, but in that (for example) grabbing data from a database and then formatting it at runtime means that the data from that database is almost assured to have already been input correctly for the requirements of that database, which will be known at compile-time, and thus can be accounted for.
>>
>>60943061
Vim is useless, use emacs.
>>
>>60943061
Vim is useless, use Windows's `edit` command and do things line-by-line like real programmers.
>>
>>60943061
Vim is useless, use nano.
>>
>>60943061
Vim is useless, use Notepad++.
>>
>>60943061
Vim is useless, use vi.
>>
>>60943060
https://www.wikiwand.com/en/Teleprinter
>>
The only languages you need are C++, Lisp, and C for interop between the two.
>>
ITT: NEETards who can't identify the best tool for the job.
>>
ITT: REtards who can't understand that there are tools which aren't the best for any job
>>
>>60942083
>C++ belongs to garbage bins
I agree.

>>60942078
>Haskell
Haskell is useless.
https://www.youtube.com/watch?v=iSmkqocn0oQ
>>
>>60943209
Quite. Tools like any dynamic language that isn't a Lisp.
>>
>>60943220
>Haskell is useless.
Good
>>
I expected no less. Thanks /g/, you guys truly are one of the few last bastions of 4chan. Keep doing what you're doing, and keep the spirit of /l/ alive.
>>
>>60942092
It's not a requirement, but it helps to make you better understood by those who participate in the.
>>
>>60943226
Every single Lisp is trash though. I'm not sure if it's an inherent property of them, but it seems to be.
>>
>>60943292
Thanks for your opinon.
>>
>>60943193
Truth.
>>
>>60943233
What did we do?
>>
>>60943313
It's common knowledge.
>>
>>60943292
Correction, every Scheme derivative is trash with the possible exception of Guile.
Clisp is trash in some situations and good in others. Its design is rough, though.

The idea behind Lisp and its syntax is good but ravaged by poor implementations and fractured environments. Clojure is good though.
>>
>>60943327
Argumentum ad populum.
>>
>>60943292
Write a formal proof.
>>
>>60943334
I've heard Clojure isn't a Lisp.
>>
>>60943334
>Clojure is good though.
Not while it runs on the JVM.
>>
>>60943233
>invasion
How so?
>>
>>60943350
Take one look at a Clojure source file and say that it isn't Lisp.

>>60943351
You can run it on the CLR too.
>>
>>60943369
>You can run it on the CLR too.
That doesn't make it any better.
>>
>>60943334
>Lisp and its syntax
But it has no syntax.
>>
>>60943339
The second axiom of this thread.
>>60943334
Every Lisp is trash. This statement doesn't need any corrections.
>>
>>60943390
t. butthurt hasklet
>>
>>60943396
Every hasklet is trash as well by the third axiom of this thread.
>>
>>60943390
>The second axiom of this thread.
/dpt/ has no axioms. Kindly piss off.
>>
>>60943390
How does one determine whether something is garbage.
>>
>>60942781
looks like gruvbox
>>
>>60943408
One man's trash...
...is another man's Haskell
>>
>>60943407
It has though.
>>60943408
I have an algorithm which answers this. What language would you like to know about?
>>
>>60943408
Whether it restricts the user for zero gain
>>
>>60943334
>G*ile
Even more trash.
>>
>>60943425
>It has though.
If it did, you'd list them, but it doesn't, so you can't.
>>
>>60943408
If the garbage collecter picks it up, it's garbage.

C++ has no GC though so all C++ nis good.
>>
>>60943431
What is "restricts"? What is "gain"? Who determines if the "gain" is "non-zero"?
>>
>>60942174
>>60942155
>>60942192
>>60942244
this is the same faggot who uses LISP in 2017.

Python is beautiful coming from any other language. Fuck all other languages.
>>
>>60943450
If C++ had garbage collection, it would collect itself.
>>
>>60943453
Python is ugly as sin.
>>
Is it time to die if I write code like this?
    (loop :with words = (custom-split xstr :key #'.simple-char)
:and line = (cons nil nil) :with ref = line :and used = 0

:do (let1 pop (pop words)
(debind (str . len) pop
(if (<= (+ used len) width)
(progn (incf used len)
(rplacd ref (cons str nil))
(setq ref (cdr ref))
)
)

)
)
)
)



Don't mind the misplaced echoes, Its just so its easier for me to write.
>>
>>60943457
C-- is C++ with garbage collection and it works quite well as a backend to Haskell.
>>
>>60943390
>The second axiom of this thread.
Hmm okay let me go and look at the second axiom of this thread.
"What are you working on, /g/?"
Wow, that's a shitty axiom.
(For anyone curious, the first axiom is "Old thread: >>60937009 →")
>>
>>60943446
Write a simple loop which lists the natural numbers. All of them are going to be somewhere in there.
>>
>>60943450
>C++ nis good
So C++ isn't good? If you're going to use Middle English then use it for the whole sentence, or at least provide some indication that you're switching languages.
>>
>>60943453
I doubt it's a lisp fag. The lisp fags in this board are either learning it and posting questions about it, or just saying stuff like "Learn Lisp." or "Lisp is the most powerful programming language."
>>
>>60942063
Is there a programming language tier? Like what would be the easiest to learn, I'm slow.
>>
>>60943463
Don't write Lisp as if it's C.
In C it's common to put end-brackets on newlines.

Don't do that in Lisp. It's very poor form and makes your code look dumb.
>>
>>60943470
I see you're not using the special /g/ interface.
>>
>>60943483
>don't mind the misplaced echoes
>>
>>60943477
C++ interops with Middle English just fine, so I have no need to declare my intentions prior.
>>
>>60943475
I did that, and I found "/dpt/ has no axioms" in there.
>>
>>60943453
L*SP is strictly forbidden ITT.
>>
>>60943480
Easiest to learn would be x86 Assembly. Hardest would probably be MIPS Assembly. Most powerful is definitely POWER8 Assembly.
>>
>>60943513
I supported your meme until you attacked my favorite language.
I'm sorry, I'm going to have to drop support.
>>
>>60943463
What are you trying to accomplish here
>>
>>60943508
Run the program for a little longer and you'll find "/dpt/ has axioms"
>>
>>60943541
I did, but a little while later I got "/dpt/ doesn't have any axioms, don't believe the others, they're lying to you"
>>
>>60943528
>your meme
I don't use ``memes".
>my favorite language
Your favorite language is strictly forbidden ITT.
>>
user=> (type 6)
java.lang.Long
user=> (type '6)
java.lang.Long
user=> ('type '6)
nil


Why does this happen?
>>
>>60943559
>Your favorite language is strictly forbidden ITT.
Why? Because you tried SICP and failed? Are you upset that Python is shit?
>>
>>60943453
If it's so beautiful why do I have to spend more time looking up how to avoid for loops instead of writing meaningful code.

checkmate snakes
>>
>>60943453
Python is too slow to like.
>>
>>60943528
What I like about his meme is that it can't be used against my favorite language, because its name is only one letter long, so he can't put an asterisk to "censor" it.
>>
>she doesn't write her programs in LLVM IR assembly
>>
>>60943555
You need to wait a little for "/dpt/ has axioms, don't believe the others, they're lying to you" to appear.
>>
>>60943591
Why should I believe that one? I've already been told that it's a lie.
>>
No memes, tell me what's wrong with PHP, Java, and Javascript
>>
>>60943563
you forgot the closing apostrophe
>>
>>60943567
>Why?
Because it's garbage.
>Because you tried SICP and failed?
No. I didn't try it, it uses a shit language.
>Are you upset that Python is shit?
Why would I be upset because of something self-evident?
>>
>>60942063
Reading through this shit on linkers

https://www.airs.com/blog/archives/38

On part 4 about shared libraries. This shit is mind melting. Is it just me or is the whole process overly complicated? It's hard to understand and more work on the system's part.
>>
>>60943530
Being able to have lists that can shrink.
The loop macro is convenient in that when it collects, appends, or nconcs, its O(1) since it does what I'm doing by keeping a reference to the last element, allowing it to grow the list fast i.e. no traversing the entire list from head to tail just to grow it.
However, I can't do something like (setq list nil) i.e. can't shrink it, because the loop macro keeps an internal reference I can't change.
>>
Reminder that most of /dpt/ cannot program without GC
>>
>>60943610
I'm not making strings.

My question is why does
(type '6)
result in Long instead of symbol when
('type)
always results in nil?
>>
>>60943577
>>60943609
>meme
I don't want reddit stink nearby. Fuck off.
>>
>>60943609
Something something, popular, something, pajeet, something, disgusting syntax, something, made by non programmers.
>>
>>60943626
Not even that, most of /dpt/ doesn't even know what GC does or why you wouldn't want it.
>>
>>60943621
>No. I didn't try it
I see. There's no point in trying to reason with the willfully ignorant.
>>
>>60943626
What is an ``GC"?
>>
>>60943653
What is an ``FROB''?
>>
>>60943653
Something you need to not go insane.
>>
>>60943622
>overly complicated
Not that much when you know the shit a kernel needs to go through to properly load an executable, it's actually fairly sane. Low level just has so little abstraction.
>>
>>60943672
RAII
>>
File: 1479060927420.png (751KB, 1274x1308px) Image search: [Google]
1479060927420.png
751KB, 1274x1308px
>>60943666
Go back to hell, Satan
>>
>>60943672
RAII
>>
>>60943650
Why would I use a beginner's book? I guess it's fine for beginners such as yourself, not for me though.
>>
>>60943475
>>60943508
>>60943541
>>60943555
>>60943591
Y'all are idiots.
Here's what you get if you write a simple for loop that lists the natural numbers.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

etc

If you're arguing your axioms are somehow encoded in that sequence, that's horse shit. The only axiom encoded in that sequence is a bunch of gibberish, and it goes like this, once in all caps and once as shown:
abcdefghijklmnopqrstuvwxyz


Alternatively you might be talking about the fact that every number is a string when rewritten in 256ary. In which case, what you're saying is still a load of bull. No standard data type is wide enough to hold a string of the kind of length you're talking about.

OR, you might be saying we should use a character array and TREAT it as a number. In which case, yes, the messages you're describing would eventually emerge, but even so, that would not be a list of axioms. It would be a list of all statements, including true statements, false statements, nonsense statements, and nonsense that isn't even statements.

Fuck you you stupid pieces of shit. You have sullied muh Logic-chan.
>>
>>60943672
RAII
>>
>>60943695
Dude are you alright?
>>
>>60943625
Can you show an example? Also, how is append constant time? It constructs an entirely new list. I could see nconc being constant.
>>
File: 1470910645307.jpg (157KB, 1024x576px) Image search: [Google]
1470910645307.jpg
157KB, 1024x576px
>>60943695
>zero isn't a natural number in his language
How does it feel being a double-digit?
>>
>>60943694
I agree, it might be too high-level for you. A pre-beginner book might be more appropriate for someone of your skill level.
>>
To all pythonfags in here:
Last thread y'all proved that python can easily generate and sum all primes below two million.

How about you generate and sum all primes above two million? This is trivial for lower-level languages such as Clojure, C# or ALGOL. How does Python fare?
>>
i know this is probably a frequent shitpost but what is a recommended beginner's book? is SICP a beginner book or should i read about the language, like C programming language
>>
>>60943742
>python can easily generate and sum all primes below two million.
Hardly. Python expends a stupendous amount of effort doing it.
>>
>>60943695
>If you're arguing your axioms are somehow encoded in that sequence, that's horse shit.
They are. It's actually one axiom.
>>
File: a90.png (24KB, 200x200px) Image search: [Google]
a90.png
24KB, 200x200px
>>60943718
What are you even talking about? My language doesn't have a notion of natural numbers at all. The only languages that do are dynamic trash. My language has numbers from 0 upward, sure, but it doesn't call them "duurrrrrr NATural NUMbers hurhurhur" it just calls them unsigned. I was just arbitrarily choosing a side in this classic debate that far greater minds than you or I (inb4 "you maybe" -- no, I am strictly talking about both of us) historically can't fucking agree on. I didn't choose that side to reflect what I believe, I chose it to reflect my ambivalence.
>>
>>60943717
Constant in the sense of not needing to traverse the entire list.
Whatever the O() of the operation is, there's no baggage.
I understand the terminology I used was inadequate.
>>
>>60943718
Zero is not a natural number regardless of the language. If your language tells you it is, it's wrong.
A natural number is a positive integer.
>>
>>60943766
>It's actually one axiom.
Indeed: "/dpt/ has no axioms".
>>
>>60943760
Read Real World OCaml
>>
>>60943760
SICP is a beginner's book, yes, but it's a textbook too which is why it's referenced a lot.
CPL is definitely not a beginner's book, nor is it a book to learn how to program. CPL is a reference for the language itself and was designed with the audience of programmers making compilers for the new language, not individual users.
>>
>>60943609
php and javascript are both horridly designed languages. every layer you peel back reveals a hideous design choice.
Java is actually kind of robust, but it's no fun to program in, requires a lot of boilerplate and boxes you into doing things in certain ways.
>>
File: hjmgtfrd.jpg (89KB, 1280x720px) Image search: [Google]
hjmgtfrd.jpg
89KB, 1280x720px
>>60943766
Now you're just moving the goal posts. You two were CLEARLY fucking talking about MULTIPLE FUCKING AXIOMS. Which there FUCKING AREN'T. Except there ARE, but GIVEN THAT THERE ARE, there's NO way to DEDUCE from that information WHICH ARE AXIOMS and WHICH ARE GARBAGE. It's BASICALLY ALL GARBAGE.
>>
>>60943776
Non-English speakers always seem to have that strange misconception.
>>
>>60943680
>raii
>concurrent programming
kek, you guys are truly retarded.
>>
>>60943776
>Zero is not a natural number regardless of the language. If your language tells you it is, it's wrong.
>A natural number is a positive integer.
see: >>60943767
Sorry, but the question of whether the natural numbers include 0 is undecided. Accept that or leave.
>>
>>60943785
>>60943790
thank you so much Anons
>>
>>60943808
shared_ptr
>>
>>60943829

reference counting is worse than raii or real gc
>>
>>60943829
Enjoy your shitty performance
>>
>>60943776
>Zero is not a natural number regardless of the language.
it is according to the international standards.
>>
File: Untitled.jpg (5KB, 858x725px) Image search: [Google]
Untitled.jpg
5KB, 858x725px
>>60943808
>what am hte mutex
>momy i canot comperheeeend mootex
>momy i am dum
>yfw
>>
>>60943801
Yeah, French people, for example, teach their kids that 0 ∈ ℕ
>>
>>60943767
>My language doesn't have a notion of natural numbers at all.
Seems like it's complete garbage then.
>The only languages that do are dynamic trash.
What is "dynamic trash"? You do you mean "dynamic typing"? My language isn't dynamic garbage and it has natural numbers.
>historically can't fucking agree on.
It's not a matter of agreement. It's the way you define it. I'm just making fun of you for defining "natural numbers" as something which "starts" from one.
>it just calls them unsigned
It's irrelevant what your language "calls" them.

>>60943776
>Zero is not a natural number regardless of the language
This doesn't make sense even remotely.
>A natural number is a positive integer.
The natural numbers aren't defined in terms of integers.

>>60943800
It's just one big conjunction.

>>60943819
>the question of whether the natural numbers include 0 is undecided
I just decided it to be a natural number. Accept that or leave.
>>
>>60943839
The international standards of butthurt innumerates?
>>
>>60943855
https://en.wikipedia.org/wiki/ISO/IEC_80000
>>
>>60943847
And that's why their kids turn out French.
>>
After re-reading it twice more I understand why they need to do all they do. But goddamn. Really most of the complexity in that comes from the fact that you need to include everything in the PLT in the GOT because of the implicit overridability of functions. There are much easier ways IMO.

For example, it's easy enough when the linker encounters a conflict (static link) for the user to decide which version they want to be bound. It's kind of silly to think they designed this system so you don't actually have to bind the library to the executable. All you have to do is load a file and hope the dynamic linker glues shit together right. It's fucking asinine.
>>
>>60943801
>>60943847
This doesn't even make sense. I genuinely hope you aren't actually this retarded.
>>
>>60943798
This doesn't really help. "Why is PHP and JS bad"

"because they're bad!"
>>
>>60943872
>Ctrl+F
>"natural number"
>nothing
Nice try, Wolfgang

Is this another result of continental Europeans being unable to handle things that aren't in base 10?
>>
File: lol.png (103KB, 955x320px) Image search: [Google]
lol.png
103KB, 955x320px
>>60943854
>It's not a matter of agreement. It's the way you define it. I'm just making fun of you for defining "natural numbers" as something which "starts" from one.
It IS a matter of agreement, because whether or not 0 is a natural number decides whether or not you're justified in making fun of me for arbitrarily deciding that for the purposes of an unimportant computer program it isn't.
>It's irrelevant what your language "calls" them.
No, it's not. If a language doesn't call unsigned integers "natural numbers," it does not have a CONCEPT of "natural numbers." It HAS natural numbers THEMSELVES. THAT'S NOT THE SAME THING. In fact, IT DOESN'T EVEN HAVE THE NATURAL NUMBERS THEMSELVES, BECAUSE NO ONE IN THE ENTIRE WORLD HAS ENOUGH MEMORY TO STORE THEM, YOU FUCKING CLOD.
>It's just one big conjunction.
No, it's "there are natural numbers and here's what they are."
>I just decided it to be a natural number. Accept that or leave.
No. I don't accept your supposed authority to make that decision, and I won't leave, because I don't accept your supposed authority over who's allowed here.
>>
>>60943841
dumb frogposter
>>
>French person visits England
>is flustered by imperial weights and measures
>writes angry tweets and posts on social media
>they're in French so nobody reads them
>>
>>60943742
>How about you generate and sum all primes above two million?
the limit of f(x) as x approaches to infinity ( > 2 million) is infinity, where f(x) = sum of primes up to x. No language can compute that sum because they run on computers without infinite memory.
>>
>>60943947
>>yfw
that's supposed YOUR face you dumb asshole
that makes YOU the dumb frogposter
and you're only supplying greater evidence right now tbqfhfamalamadingyfuckingdongy
>>
File: 2017-06-17-180209_990x604_scrot.png (96KB, 990x604px) Image search: [Google]
2017-06-17-180209_990x604_scrot.png
96KB, 990x604px
>>60943922
http://www4.ncsu.edu/~jwilson/files/mathsigns.pdf
>>
>>60943972
>French """person""" tries to invade England
>realises he is hopelessly outmatched when he encountered one (1) single English squirrel
>retreats

ftfy
>>
>>60943925
>whether or not 0 is a natural number
What is a "natural number"? My definition explicitly states that whatever you call "0" is one (it's fucking irrelevant what symbol you use to start out). You either accept it or you don't (in which case I will make fun of you).
>If a language doesn't call unsigned integers "natural numbers,"
I couldn't care less about what your shitlang calls something.
>IT DOESN'T EVEN HAVE THE NATURAL NUMBERS THEMSELVES
Being able to produce any one of them in finite time is as good as having them as far as I'm concerned.
>I don't accept your supposed authority to make that decision
In which case you should be laughed at like the retard you are.
>and I won't leave
You should though. That way you won't be embarrassing yourself.
>>
>>60943985
double sumOfPrimesAboveTwoMillion() {
return Double.POSITIVE_INFINITY;
}
>>
File: soge.gif (2MB, 427x306px) Image search: [Google]
soge.gif
2MB, 427x306px
>>60944000
>.edu
>acceptable source
nice try goyim
>>
trying to slimline my init boot time with openrc and initiate from a sqfs
>>
>>60944014
>doesn't print "Hello World!" to the console
I would not pass this.
>>
>>60943808
the fuck? we're talking about garbage collection not concurrent programming. Garbage collection does not guarantee safe concurrent programming.

Rust uses RAII and with ownership semantics to support memory safety in the sense of memory leaks and data races, but /dpt/ is full of pajeets who hate languages that aren't java.
>>
>>60944007
>What is a "natural number"? My definition explicitly states that whatever you call "0" is one (it's fucking irrelevant what symbol you use to start out). You either accept it or you don't (in which case I will make fun of you).
>I, by the power vested in me as anon, do declare this thing
>I will enforce it by lulz
get out
>I couldn't care less about what your shitlang calls something.
>C is a shitlang
get out
>>
>>60944000
>http://www4.ncsu.edu/~jwilson/files/mathsigns.pdf
>partially written in French
>published in Switzerland
Very "international", more like a continental love-in.
>>
>>60944040
>Garbage collection does not guarantee safe concurrent programming.
it does, actually.
>>
>>60944007
>What is a "natural number"?
My definition, which is more authoritative than your definition by virtue of its lesser specificity, is this: a natural number is either any integer greater than or equal to 1, or possibly 0, but also possibly not, because that particular debate has not been settled by anyone influential enough to have the authority to settle it, and it probably never will be.
>>
>>60943675
They do all this shit with making indirect call tables. But really you can just overwrite the function with a jump into the dynamic linker at load time if you need to override it. Piss easy.
>>
>>60943808
It's amazing what people think they can get away with in parallel computing. It's like they haven't even read their architecture guide.

Amazes me every day.
>>
>>60943911
I'm no expert on JS but I've used PHP a lot and I can tell you that it really is an awful language.
>The only collection is the "array". It isn't an array. It's an ordered hashmap, like std::map.
>The standard library is an absolute mess. No consistency. is_null but isempty. array_search(needle, haystack) but strpos(haystack, needle).
>Weak typing. Several functions can return 0 on success but false on failure. Or they can return null on success and null on failure, and you have to call an errno() function instead.
>Vomit-inducing OOP syntax. -> for member access even though pointers don't exist. :: access to static members. $this->foo but self::$foo. Objects are passed by reference even though the language already has references and no other type, including "array", is.
>>
>>60942628
>1 reply
Basically this thread is filled of people writing toy code all the time. Or coding some basic code monkey shit.
>>
>>60942768
Use ssh and edit remotely.
>>
>>60943808
>>60944089
It's like you've literally never heard of a mutex.
My god, how does one even achieve this level of brainlet.
>>
>>60942766
>one-letter langs
>Go

your IQ must be at least 30 to post in these threads
>>
>>60944042
.>I, by the power vested in me as anon, do declare this thing
"natural numbers" is just a definition for a thing. It's irrelevant whether or not humans think it """starts""" from the symbol "0". You will just have to live with the retardation of "1" being the identity for "+".
>C is a shitlang
C is a complete joke. Nobody should care about it.
>get out
I'm not the one using images which appear to be from "facebook" (?)

>>60944077
What is an "integer"? What does it mean for an "integer" to be "greater than or equal to" another "integer"(are "0" and "1" integers?)?
>that particular debate has not been settled by anyone influential enough to have the authority to settle it, and it probably never will be.
It's not a "debate", you retard. It's simply a matter of definition.
>>
>>60944040
>memory leaks
The Rust devs don't care at all about memory leaks
>>
>>60944000
The term "natural number" refers either to a member of the set of positive integers 1, 2, 3, ... (OEIS A000027) or to the set of nonnegative integers 0, 1, 2, 3, ... (OEIS A001477; e.g., Bourbaki 1968, Halmos 1974). Regrettably, there seems to be no general agreement about whether to include 0 in the set of natural numbers. In fact, Ribenboim (1996) states "Let P be a set of natural numbers; whenever convenient, it may be assumed that 0 in P."

I hope this settles the issue, you are both kind of right.
>>
>>60944002
>Europeans mass move to the UK to leech from it
>the UK votes to leave the EU, refuses to guarantee those Europeans can stay
>Europeans butthurt
>>
New thread:
>>60944120
>>60944120
>>60944120
>>
>>60942785
knawlidge:

https://stackoverflow.com/questions/1349542/john-carmacks-unusual-fast-inverse-square-root-quake-iii#1349572
>>
>>60942860
it makes the underlying mathematics clearer
>>
That was the fastest thread in a while
>>
>>60944110
mutexes are error prones.
>>
>>60944110
>I put mutex in my codes so now it's all great!
No mutexes are slow af.
>>
>>60944135
>>60944136
>>60944142
>>60944158
>>60944161
Stop posting in the old thread and post here:
>>60944120
>>60944120
>>60944120
>>
File: 17 - 1 (2).gif (505KB, 1080x1080px) Image search: [Google]
17 - 1 (2).gif
505KB, 1080x1080px
>>60944115
>It's irrelevant whether or not humans think it """starts""" from the symbol "0".
It's entirely relevant what humans think. There is a thing which includes all integers greater than or equal to 1, and a thing which includes all integers greater than or equal to 0. These are both real things. "Natural numbers" is just a name. It's entirely up to humans' discretion what that name applies to, because we are the sole arbiters of names, and without us, there would be no names for anything ever.
>C is a complete joke.
kill yourself
>facebook
>>>/trash/
>What is an "integer"? What does it mean for an "integer" to be "greater than or equal to" another "integer"
If you don't even know this, you don't deserve to be here.
>(are "0" and "1" integers?)?
Yes.
>It's not a "debate", you retard. It's simply a matter of definition.
Yes, and the particular matter of definition which it is, is which definition to use. And surrounding the issue of which definition to use, there is an ongoing debate that has reached a stalemate and will probably never be resolved. How is this so difficult for you to understand?
>>
>>60943761
#!/usr/bin/python
import math, sys
primesum = 0
for i in range(2, int(sys.argv[1]) + 1):
prime = True
for o in range(2, int(math.sqrt(i)) + 1):
if i % o == 0:
prime = False
if prime:
primesum += i
print primesum


:^)
>>
>>60944188
>integers
Undefined.
>greater than
Undefined.
>equal to
Undefined.
>"Natural numbers" is just a name.
Indeed. And someone who thinks the symbol (the name) "1" should be the identity for "+" deserved to be ridiculed.
>If you don't even know this
I don't know your retarded definition of those words. You seem to keep using non-standard definitions.
>Yes.
Are those the only "integers"? Are they "equal"?
>And surrounding the issue of which definition to use
"x + 1 = x" or "x + 0 = x". The choice is entirely up to you.
>>
>>60944179
Anon fuck off i post where I want.
>>
>>60943761
>>60944245
And if you dislike loops:

#!/usr/bin/python
import numpy as np
import sys
N = int(sys.argv[1])

primesum = 0
nums = np.array(range(2, N + 1))
for i in range(2, int(np.sqrt(N)) + 1):
nums[np.where(np.logical_and(nums % i == 0, nums != i))] = 0
primesum = np.sum(nums)
print primesum
>>
>>60943985
Sounds like you're on a mac.
Thread posts: 326
Thread images: 25


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