[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: 350
Thread images: 36

File: 1491847875566.gif (2MB, 500x491px) Image search: [Google]
1491847875566.gif
2MB, 500x491px
What are you working on, /g/?

Old thread: >>60015283
>>
S2 HYPE
>>
File: 1461180526665.jpg (80KB, 602x602px) Image search: [Google]
1461180526665.jpg
80KB, 602x602px
>>60021954
Umaru~
>>
File: 1488170445656.jpg (217KB, 700x878px) Image search: [Google]
1488170445656.jpg
217KB, 700x878px
>>60021954
Should I buy programming socks?
>>
>3 posts too early
Delete your life, umaru fag
>>
>>60021954
dubs decides my next project
>>
>>60021954
>What are you working on, /g/?
I'm cleaning my apartment.

More specifically, I'm throwing away stuff I don't need and trying to rearrange stuff so I can put stuff in the basement storage.

Minimalism 4 lyf
>>
>>60021993
Umaru killing simulator

n.b. you are killing umaru and not the other way around
>>
>>60021993
4HC - 4chan haskell compiler
>>
File: 1428092353038.jpg (171KB, 800x600px) Image search: [Google]
1428092353038.jpg
171KB, 800x600px
>>60021993
Rewrite the Linux kernel in Javascript.
>>
>>60021993
an IoT ass-dildo
>>
>>60022022
winrar
>>
>>60022022
neat
>>
>>60022022
I'll make the logo.
>>
File: bugs.webm (2MB, 1920x1080px) Image search: [Google]
bugs.webm
2MB, 1920x1080px
I'm lost trying to figure out a bug in my VM.
>>
File: unix.jpg (63KB, 800x450px) Image search: [Google]
unix.jpg
63KB, 800x450px
Hey /g/, why do we still write C/C++ header files by hand? why not generate them automatically based on the main file as part of compilation? It duplicates work, but maybe there's a reason I'm missing?

Say the rules for generating headers are like so:
- if you see a function declaration or definition and it's not static, copy its prototype in your output.
- if you see a global variable that's not static, add extern and output it, same thing.
- if you see an inline function definition, output it in its entirety.
- if you see a C++ class, change the method definitions into declaration if they're not inline, then output.
- for macros, dunno, maybe we should have a separate header file for those?
- if the main file is including headers, maybe include them, idk but there's probably a 99.9% of the real-world cases solution.

thoughts?
>>
File: 1491126557492.png (38KB, 501x586px) Image search: [Google]
1491126557492.png
38KB, 501x586px
>>60022022
> started as a joke
> will end up the most bought sex toy thanks to cam girls
>>
>>60022139
lol who uses c languages
>>
>>60022182
versions already exist that vibrate a certain amount depending on the size of the tips on chaturbate and other cam websites
>>
Can you recommend me some challenging programming books?
I mean, something like SICP, not CS degree tier but difficult enough to be intellectually stimulating
>>
>>60022225
cracking the coding interview?
>>
>>60022225
so, introductory books?
>>
>>60022139
For one thing, there are quite a lot of things which exist only in the headers, like struct or enum definitions, or preprocessor stuff like macros.

For another thing, there are lots of projects (Linux being among them) that don't have a 1:1 correspondence between C files and header files, but instead actually group definitions according to what you may want to include into a certain C file.

Given those objections along with the fact that maintaining the duplicated portions is an issue of very straight copy-and-paste, and also that it doesn't really happen that very often, it's understandable that noone has bothered to produce a potentially quite complex solution to an almost non-problem.
>>
I'm new to programming, what are the basic memes that I should be aware about it.
>>
Classes in Python are kicking my ass, /g/.
OOP is fucking gay.
>>
>>60022272
Elements of programming interviews is better imo
>>
>>60022281
iteratives is more simple to understand than functional
>>
>>60022281
C and Haskell are good tier
Rust is meme tier
>>
>>60022281
"""""apps""""""
>>
File: 1492587533263.gif (867KB, 480x336px) Image search: [Google]
1492587533263.gif
867KB, 480x336px
>>60022295
>python
>OOP
>>
>>60022139
You have no understanding of C. The preprocessor runs as a separate step that modifies the source code before it gets compiled.
>>
>>60022273
Yes?
I'm just an hobbyist bro
>>
Any good resources on LuaJIT?
Gonna need to write some nginx modules/extensions soon, need to read up on it.
>>
>>60022182
Did you reply to the wrong person?
>>
File: OOPs.png (315KB, 1680x740px) Image search: [Google]
OOPs.png
315KB, 1680x740px
>>60022281
It was originally called OOPs programming but they changed it for obvious reasons
>>
>>60022424
Nice of you to include Pajeet in the bottom left
>>
>>60022281
OOP and web development
>>
>>60021954
A pantie remover for Umaru
>>
>>60022281
There are far more Indians in your area than you thought
>>
What the fuck is the point of OOP? Is it even necessary? Seems like it's just a bunch of bullshit made to confuse the fuck out of people.
>>
>>60022527
OOP is synonymous with code reuse. Without OOP, you are forced to copy and paste the same code, or worse, retype it and maybe get it wrong.
>>
>>60022527
It came around at a time when program/system complexity was much less of an everyday issue, and programming was still trying to figure out how to be "sexy" and "expressive"

Now, of course, we've realized the mistake but it's too late, the damage is done.
>>
>>60022527
To simluate the real world. For instance: you can call deposited and withdraw on BankAccount.
>>
>>60022527
To keep managers employed
>>
>>60022554
>Without OOP, you are forced to copy and paste the same code, or worse, retype it and maybe get it wrong
Are you retarded? Do you know what a function is?
>>
>>60022139
>Hey /g/, why do we still write C/C++ header files by hand?

Because those languages came from a different era. Sane people already moved on.
>>
>>60022630
There was no such thing as polymorphic functions before OOP.
>>
>>60022654
2/10, almost thought you weren't trolling
>>
r8 my Aarch64 (ARM 64 bit assembly)
.text
.globl _start

_start:
mov x3, 4
ldr w1, uart
ldr w2, =message
//load byte into w3, increment message, print, repeat
b loop

loop:
ldrb w3,[x2]
strb w3,[x1]
cbz w3, finish
add w2,w2,1
b loop

finish:
b .

uart: .int 0x09000000
message: .asciz "niggers tongue my anus"
>>
>>60022554
You couldn't be more wrong. Thanks to OOP we now have thousands of people who copy their code and get it wrong.
>>
What's with the hate on Javascript? Any language sucks if you write shitty code, it's popular for a reason
>>
>>60022527
In theory, makes larger projects easier to be controlled and harder to fuck everything up.
>>
>>60022281
see:
>>60022554
people in software loves to talk about code reuse but nobody reuses shit, hence, a meme
>>
>>60022720
JS is the only option for web. That's why it's so popular.
>>
>>60022720
Because you can only write shitty code in JS
>>
>>60022720
If a unicycle is the only way of transport, everyone would ride one.
>>
Rate my javascript

var Y = function(proc) {
return (function(x) {
return proc(function(y) { return (x(x))(y);});
})(function(x) {
return proc(function(y) { return (x(x))(y);});
});
};
>>
>>60022593
Well, you can withdraw loads of things, it doesn't really make OPP appropriate.
This would be handled by associating some data with an action. i.e interface.
OOP gives us much more bloat: Polymorphism, inheritance.
These don't really make sense alot of the time, and that's why we are seeing the push to things like 'composition over inheritance'.
This is essentially data containing data, nested objects instead of inheritance.
OOP isn't really a good representation of the real world, althought I'm not aware of a better alternative.
>>
Writing code without objects leads to 4000+ line long as fuck files that do 180 different things each. Spaghetti code basically. It's a fucking nightmare to debug. It's complex and fragile.
>>
>>60022801
What is FP?
>>
>>60022708
10/10 kek'd
>>
>>60022785
I never said OOP was a good thing. I only told you what OOP is.
My problem with OOP is that data and logic are fused into one thing: a class.
>>
>>60022810
It's new paradigm that will take a while to be a substitute
>>
Turing machines were a mistake
Lambda calculus was robbed
>>
>>60022840
now we're talking
>>
>>60022838
FP was here before OOP. It's not new.
>>
>>60022822
I STILL don't understand how the mixing of state and behavior that uses that state into a class unit is a bad thing.
>>
>>60022817
<3
>>
>>60022871
Make your program multi threaded and you'll know.
>>
>>60022881
what is synchronization? what are singletons? what are static variables / functions?
>>
>>60022840
>Lambda calculus
Which one of them are you referring to?
>>
File: nessa.jpg (58KB, 420x271px) Image search: [Google]
nessa.jpg
58KB, 420x271px
I want to write a personal assistant AI that isn't utter shit (Cortana and Siri and others)
How do? Where do I go to learn the stuff? Any links or resources to recommend?
>>
File: vinny.jpg (60KB, 628x353px) Image search: [Google]
vinny.jpg
60KB, 628x353px
>>60022920
the church of Church
>>
>>60022920
All of them, the mistake was the acceptance of a (necessarily stateful) machine as a model rather than modeling by processes
>>
File: baby steps.webm (305KB, 824x504px) Image search: [Google]
baby steps.webm
305KB, 824x504px
Hello, world!
>>
>>60022944
>All of them
Most of them are fucking garbage. I need more specifics.
>>
>>60022952
What is it?
>>
>>60022903
did you ever made a multi threaded program in your life?
>>
>>60022822
Know of any good languages that use objects without the inheritance shit?
>>
File: baby steps 2.webm (183KB, 578x638px) Image search: [Google]
baby steps 2.webm
183KB, 578x638px
>>60022952
vid related
>>
>>60022965
>good languages that use objects
Impossible.
>>
>>60022960
Fine, then typed. But the important distinction is turing machine vs lambda calculus, despite their equivalence
>>
>>60022965
just dont do multiple inheritance and only go one level deep.
>>
>>60022962
A virtual machine implementing an ISA I came up with. See >>60022971 for telnet output.
>>
>>60022278
>For one thing, there are quite a lot of things which exist only in the headers, like struct or enum definitions, or preprocessor stuff like macros.
There's nothing special about headers, the same declaration has the same effect if it's read directly from the .c file. What I'm proposing is to move all that into the .c file, have it *not* include its own .h file, and have the .h file contain the relevant info to be included by other .c files in the project. This avoids some repetition and even gives a nicer look to C++ files: would you rather have
class something {
int some_attr;
void somemethod() {
...
}
}

or
void something::somemethod() {
}

and need to lookup attributes in the .h? The traditional approach seems kind of btfo there.

>For another thing, there are lots of projects (Linux being among them) that don't have a 1:1 correspondence between C files and header files, but instead actually group definitions according to what you may want to include into a certain C file
Yes maybe, grouping declarations is meaningful, especially given that C has no namespaces.

My question is why has is no one using and contributing to http://www.hwaci.com/sw/mkhdr/makeheaders.html or doing any thinking-outside-the-box ? That program seems to have a different model than I do tho.

>Given those objections along with the fact that maintaining the duplicated portions is an issue of very straight copy-and-paste, and also that it doesn't really happen that very often, it's understandable that noone has bothered to produce a potentially quite complex solution to an almost non-problem.
That's cause people are forgiving. Copy pasting is bad and should be done via #include directives or another abstract process. DRY. Period. Also that solution is called pretty much any other compiled language: I'm sure they have a compilation step that involves extracting declaration from source files in order to resolve references in other files.
>>
>>60022980
>Fine, then typed.
Which one though? A lot of them are pretty bad.
>despite their equivalence
Any good lambda calculus isn't Turing complete.
>>
>>60022903
>synchronization
Absolute shit.
>singletons
>static variables / functions
Pay attention in class kid.
>>
>supposed to be learning python for this dumb class but can't stop reading about lambda calculus and turing machines and FP and shit
fuck you /dpt/
>>
>>60023029
try to write the most functional python ever
>>
>>60022965
Any language that doesn't allow functions in data structures. So most functional programming languages.
>>
>>60022963
of course a smug snarky answer as a reply. yes I've made / worked on several "mutli-threaded" programs in popular OOP languages. so tell me - how is synchronization a problem when there are many ways to deal with it?
>>
>>60023005 continued
>I'm sure they have a compilation step that involves extracting declaration from source files in order to resolve references in other files
But one of them doesn't. Can you guess which? You're right, it's haskell ! When files have cyclical references, you need to write some sort of fucking header file yourself. Not kidding
>>
>>60023015
Which typed lambda calculus would you say isn't bad then and why? I've reached the limits of my understanding necessary to continue talking out my ass
>>
>>60023028
>Absolute shit
why?
>Pay attention in class kid.
how about you explain yourself instead of resorting to shitty insults.
>>
>>60023057
infinitely parallel operations will be nearly impossible to implement in stateful languages
>>
>>60023029
porque no los dos?
>>60023042
aka the most inefficient python ever
>>
>>60023076
Any typed lambda calculus would be fine assuming it doesn't have general recursion (no Y or omega combinator and no fixpoint bullshit).
>>
>>60023089
>why?
Threads will wait to acquire a lock on the reasource. In the mean time, they just sit there doing nothing. So you eventually run out of threads in your thread pool.
>>
>>60023057
nvm, you're clearly a genius, i cannot argue. Why you don't just program straghit in binary code since you are so secure to rely on static variables to do multi threading
>>
>>60023043
Never warmed to Haskell because of the lack of state. Computers are inherently state based, so I never really understood the concept to the point that I could implement useful shit in it.
>>
>>60023118
>>60023094
>infinitely parallel
>run out of threads
this isn't an issue in 99% of applications
>>
>>60023101
what's wrong with general recursion? Also I wouldn't have connected fixed point with recursion but it sort of makes sense glancing at wikipedia and seeing its connection to a terminating condition
>>
>>60023147
>Computers are inherently state based
is this so?
>>
>>60023166
i didn't specify that 99% of applications would benefit from infinite parallelism (:
>>
>>60023147
>Haskell
>lack of state
What did he mean by this?
>>
>>60023166
Run a web server and make each request acquire a lock on some data. Before you know it, it grinds to a halt.
>>
>people who attend linus talks just to tell him to be nicer
>>
>>60023273
>rust "developers"
>>
>>60023174
>what's wrong with general recursion?
General recursion in lambda calculus implies logical inconsistency.
And if you want a total language, you would have to do something like Idris does with its totality checker, which would limit the range of valid programs (when the checker can't prove termination).
>>
>>60023332
So a non terminating program is a valid program?
>>
Is my code right or am I retarded? Trying to implement insert for BST.

 

BSTNode *new_node = new BSTNode(num);
Node *temp_root;
temp_root = root;

//No Nodes in Tree
if(root==NULL)
{
root = new_Node; //Root pointer points at the New Node
}


else
{

//Iterate until temp_root is NULL
while(temp_root!=NULL)
{

if(num < root->num) //When Node's # is less than Current Position in Tree
{

if(temp_root->left == NULL) //If there's no Child
{
temp_root->left = new_Node; //Make one
}
else
{
temp_root = temp_root->left; //Otherwise place the pointer at that Position
}

}

else if(num > root->num) //Same but other way
{
if(root->right == NULL)
{
temp_root->right = new_Node;
}
else
{
temp_root = temp_root->right;
}
}


>>
>>60023005
>There's nothing special about headers, the same declaration has the same effect if it's read directly from the .c file.
Of course. My point was just that structs that are shared between several C files are normally only defined in a header file.

>What I'm proposing is to move all that into the .c file, have it *not* include its own .h file
Normally you want a C file to include its own headers. In the case of manually maintained files this is mostly to confirm that the header-file matches the C file, for which one might argue there'd be less reason with automatically generated files, but it would still be kinda nice just to verify that the system is working properly, and also that whatever declarations you're using in the C file to determine eg. whether a struct definition should be exported or not are correct.

>My question is why has is no one using and contributing to http://www.hwaci.com/sw/mkhdr/makeheaders.html or doing any thinking-outside-the-box ?
And again, my answer would be that the need is so limited. Maintaining C header files is really quite minor work, so not adding a complex system to do it is preferable.

>DRY
I agree in principle, but the thing with header files is exactly that they're a mix of repeated and unique data, and it's not bad enough that it's really worth introducing complexity to remove the repetition.

>C++
That's an entirely different beast altogether, and I couldn't care less about it.
>>
Struggling through SICP... This program runs forever and I'm not sure why (or how to format what I display)

;;Finds the roots of a function, f
;;Given that f(a) < 0, and f(b) > 0
(define (Half-Interval-Method f a b)
(display a)
(display b) ;;For debugging purposes

(let ((x (average a b)))
(cond ((< (abs (f x)) .01) x) ;;If the result is close enough to zero, return the value of the input
((< (f x) 0) (Half-Interval-Method f x b))
((> (f x) 0) (Half-Interval-Method f a b))
)))

(Half-Interval-Method sin 2.0 4.0)

>>
>>60022785
>OOP gives us much more bloat: Polymorphism, inheritance.

These are literally the only two reasons to use OOP.

Without oop you would have something like
struct dragon { (stuff in here) }
and constructors like
dragon* dragon_new() { return calloc(1, sizeof(dragon)); }
and methods like
void dragon_breathe_fire(dragon* d, int direction, int intensity)
.

The reason to move that to actual classes and methods was so that you could have classes that extend dragon without changing existing code.

How can you call polymorphism and inheretance bloat and the rest of OOP good, when it's the exact inverse
>>
>>60023369
I mean a program which type-checks and definitely terminates, but the totality checker can't tell. Basically limited expressiveness compared to a language which is already total.
>>
>>60023408
>Polymorphism
>These are literally the only two reasons to use OOP.
What were you going to have meant by this?
>>
>>60023435
Did you even read the post?
>>
File: theOGscriptkiddies.jpg (129KB, 401x1317px) Image search: [Google]
theOGscriptkiddies.jpg
129KB, 401x1317px
As the harbor is welcome to the sailor, so is the last typo to the programmer.
>>
>>60023372
Looking at it quickly, you're doing comparisons on which subtree to go down by looking at ROOTS value, not the temp_root we are currently at. In the second else-if, you check if ROOTS right subtree is null, not temp_roots.
>>
>>60023443
I did. Why do you think that polymorphism somehow has anything to do with OOP?
>>
>>60023372
WTF is the difference between Node and BSTNode?

Why do you check if num is less than root->num instead of temp_root->num? The comment says "Current Position in Tree" but the code says "Root of the tree"

Why do you check if (a > b) then "else if (b >= a)" instead of just else? It would make sense if you wanted to replace elements with the same key, but you don't have code that does that

>>60023474
Nice I almost thought you were serious
>>
>>60023372
Should be ok, might wanna refactor out some of the duplication in your if/ elses.
The innermost if/ elses are essentially the same, either call a function or use another level of pointer indirection
>>
>>60023485
`>` not `>=`, my bad
>>
>>60023485
>Nice I almost thought you were serious
I don't think I've ever seen someone try to dodge such a simple question this hard.
>>
>>60023506
You didn't ask a question. Polymorphism has everything to do with OOP. Something that takes a
person*
can't take a
employee*
if person and employee aren't classes and employee extends person. It's the only way to do it without casting an employee struct to a person struct before calling the function and hoping they define the same properties in the same order
>>
File: 1490761562480.png (372KB, 954x768px) Image search: [Google]
1490761562480.png
372KB, 954x768px
>looks at a trap's reddit submissions
>randomly a post about his unix setup
>>
>>60023539
>You didn't ask a question.
Reread my posts then. I definitely asked one.
>Polymorphism has everything to do with OOP
Were you dropped on your head as an infant?
>>
>>60023485
>>60023503
>>60023496

forgot the naming of some of my declarations. As for if else's, I'll fix em up, just like to do that cause it's easier to follow. Ty all.
>>
@60023551
>looks at reddit
I don't want reddit stink nearby. Fuck off.
>>
>>60023408
No, constructors are essentially syntactic sugar, they have nothing to do with polymorpism and inheritance.
WRT extending, the general consensus now is to use composition, so your WaterDragon constructor takes a Dragon object, and will also implement the BreathesFire interface.
If you are finding that you are doing this and having a bunch of passthrough methods in your WaterDragon, then you are probably not breaking things up properly. The idea is that you shouldn't need a dragon to breath fire, you just need a BreathesFire implementer
>>
>>60023399
Check the 2nd recursive call to Half-Interval-Method.
>>
>>60023539
>What is an interface?
>>
Do schools seriously still teach OOP? Is it a sunk-cost thing with the faculty not wanting to admit they've spent so much time and energy on something that's gone the way of punch cards, or what?
>>
Losing my mind working with swing's HTMLDocument and Element classes, because getParent() will just skip some tags. I haven't tried every possible HTML tag, but it looks like it picks up all the block-level tags just fine, like ul and p, but not the inline tags like b.
>>
>>60023369
>>60023409
A program that definitely doesn't terminate is also turing incomplete
>>
File: pic.jpg (6KB, 220x127px) Image search: [Google]
pic.jpg
6KB, 220x127px
How would I implement the PIC, or something similar in a VM?
>>
>>60023681
java's still on top and it's OOP. glad to see it seems it's going down though
>>
>>60023702
program's aren't turing complete, LANGUAGES are
>>
Guys give me a cool project that I can put on my resume so that I can get a job at a compnay that pays well.

Please no trollling
>>
>>60023706
SimAVR might give a good example of how you could write a simulator, which is what I assume you are asking
>>
>>60023702
>A program that definitely doesn't terminate is also turing incomplete
No. You can write a provably terminating C program which adds two ints. That doesn't somehow make C non-Turing complete.
>>
>>60023726
>>60023752

I mean a turing incomplete language can feature a non-terminating program
>>
>>60023699
parent != typed above another tag

<div>
<b>XDDD</b>
<p>xd</p>
</div>

The paragraph tag's parent is the div
>>
>>60023738
write an app that allows you to stream audio from one device to another over web shit.
>>
>>60023760
A total language can't possibly feature one since every program has to terminate.
>>
>>60023770
but I don't own two devices.
>>
>>60023746
The PIC is a specific part of of the whole x86 platform that makes interrupts easier to handle.
I've already written a large part of my VM.
>>
>>60022935
Glhf with natural language recognition.
And depending on how far ya wanna take it, it'll take you decades.
There's a reason the ones built by huge corps with next to limitless resources and manpower are shit...
>>
>>60023738
A game like metroid and zelda but with crafting and also MMO
>>
>>60023785
take a theory of automata course
>>
>>60023796
>Over web shit
Stream it from your device to your PC
>>
>electron desktop app
>>
>>60023798
Sorry buddy, I thought you meant PIC Microcontroller
>>
>>60023808
I'm not sure I completely understand

>>60023819
but the only device I have is my PC.

Give me a COOL project.
>>
I think i'm having a retard moment.
How can the address space of a 32-bit system be 4 gigabyte? Shouldn't it be 512 megabyte?
>>
>>60023821
I don't like it either but the competition (Java) is somehow worse.
>>
>>60023844
You can address 2^32 bytes (each byte being 8 bits)
>>
>>60023814
It's simply impossible to write a non-terminating program in a language with strong normalization.
>>
>>60023844
2^32 is ~4 billion.
>>
>>60023785
A total language maybe, but not all turing incomplete languages
>>
>>60023860
i thought you were saying that a turing complete language can't feature a nonterminating program which is the opposite of true, not about total functional programming. carry on
>>
>>60023852
who needs portability anyway
linux desktop is a meme, mac users don't need software

winforms are all around superior
>>
>>60023632
Okay, I fixed that part, but it still seems to be running indefinitely:
;;Finds the roots of a function, f
;;Given that f(a) < 0, and f(b) > 0
(define (Half-Interval-Method f a b)
(let ((x (average a b)))
(cond ((< (abs (f x)) .01) x) ;;If the result is close enough to zero, return the value of the input
((< (f x) 0) (Half-Interval-Method f x b))
((> (f x) 0) (Half-Interval-Method f a x))
)))


Side-note: Is there some way I can format output? When I do
  (format t "A = ~D\n\t F(A) = ~D"
a (f a))


I get the following error:
format: unbound identifier in module in: format
>>
>>60023856
>>60023863
Oh! Right.
I was 2^32 dividing by 8 to convert from bits to bytes. But we're not addressing individual bit, are we.
>>
>>60023874
>maybe
It being total would already guarantee that.
>but not all turing incomplete languages
I never said anything about that. Obviously a language with just a looping operation wouldn't be Turing complete.

>>60023885
>i thought you were saying that a turing complete language can't feature a nonterminating program
I wasn't.
>>
>>60023888
First, discredit Apple in the eyes of developers and graphic artists so they'll stop using it. Then we'll talk.
>>
>>60023892
Why are you trying to use a common-lisp format in what appears to be scheme?
>>
>>60023911
>I wasn't.
ok.
>>
>>60023906
Exactly. Easy mistake
>>
>>60023906
This might explain some things:
https://www.youtube.com/watch?v=uYXwCBo40iA
>>
guys give me a project to do

I'll do literally whatever you tell me to.
>>
>>60023948
Haskell compiler in ARM assembly.
>>
>>60023768
Yes, I know this.

Doing some more digging, it seems that rather than creating a BranchElement labeled "b" when there's a bold tag (like it does for block-level elements), it instead creates a generic "content" element with bold as one of the style attributes. I guess I can work with that.
>>
>>60023948
Bresenham in ARM assembly.
>>
>>60023948
>>60023961
ARM assembler in Haskell
>>
>>60023984
Too easy.
>>
>>60023961
>>60023980
>>60023984
be serious...
>>
>>60023948
https://better-dpt-roll.github.io/
Alternatively, just make a compiler/basic os/look into AI...
>>
>>60023706
http://wiki.osdev.org/8259_PIC
>>
>>60023984
https://hackage.haskell.org/package/HARM
>>
>>60023998
I was serious
Bresenham in asm is a bretty neat exercise
>>
>>60023892
In your sin example, you're contradicting your assumption in your 2nd line. Try swapping 2.0 and 4.0.
>>
>>60023998
I was serious
A haskell compiler in asm is a bretty neat exercise
>>
>>60024019
is there any incredible software you'd recommend for writing ASM programs?
>>
>>60024054
use free monads


hard mode:
use indexed monads to provide certain guarantees
>>
>>60023998
Develop your own IDE/Not-IDE TE for your favorite language.
>>
>>60024054
>>60024065
well I appreciate the idea, and will do it, but it might be beneficial for me to program for a bit in Haskell beforehand, right?
>>
>>60023948
Make a webpage with funny pictures
and an about you section
and tables
and blinking marquee tags
and a webring
>>
>>60023948
Haskell compiler in lambda calculus.
Bonus points if it's on paper.
>>
lol, aren't monads just a way for FP to have "objects"? pretty fucking hilarious if you ask me
>>
>>60024079
Well, you are gonna be programming in Haskell for the next few years, so might aswel just learn by jumping right in
>>
>>60024103
You won't fool me twice.
>>
>>60024108
why am I going to be programming in Haskell for the next few years?
>>
OK I think I've figured it out.

You guys aren't really being serious. Why do you have to be mean to strangers on the internet? I'm just trying to do a quick project so I can make 150k/yr working at Google.

Is that so much to ask for?
>>
>>60024141
He's got a gun and he knows where you live
>>
>>60023652
A property of OOP
>>
>>60024157
Make a Freecell game in Swing
>>
File: 1491951981595.jpg (150KB, 672x1000px) Image search: [Google]
1491951981595.jpg
150KB, 672x1000px
>>60024157
the best way to get project ideas is to learn a lot of stuff about different things related to technology. in the process of learning you'll finds things you want to do differently!
>>
>>60024174
what does freecell mean?
>>
>>60024157
Win code jam
>>
>>60024157
Write a physics engine in CSS
>>
>>60024187
how do I do that?

what kind of stuff about technology should I learn?

I'm from India btw
>>
>>60024141
Whoops, mixed that one up... My bad.
>>
>>60024049
This worked! Thanks anon!

Last question. To make this less error-prone, I want to make the following change:
If the arguments passed in to Half-Interval (HI) violate the assumption that f(a) < 0 and f(b) > 0,  
such that f(a) > 0 and f(b) < 0,
Then switch the order of the parameters to (HI)


I did this by doing the following:
  (cond ((and (< (f b) 0) (> (f a) 0)))
(Half-Interval-Method f b a))

But it doesn't seem to be working... Is there a totally dumb error I'm missing?
>>
File: freecell.png (133KB, 1280x720px) Image search: [Google]
freecell.png
133KB, 1280x720px
>>60024189
It's that solitaire game.
>>
>>60024209
Learn to shit in the loo first Pajeet
>>
File: freecell.png (2KB, 336x336px) Image search: [Google]
freecell.png
2KB, 336x336px
>>60024223
>>
>>60024243
t. insecure American
we are coming for you jobs btw
better stop shitposting and start gitting gud
>>
>>60024257
https://www.bloomberg.com/news/articles/2017-04-03/new-h-1b-guidelines-crack-down-on-computer-programmer-jobs
>>
>>60024257
>Butthurt Pajeet
Try harder buddy, not even American.
The whole world laughs at you guys, not just Ameriburgers
>>
@60024257
If you were actually a pajeet, youd know H1b's are plummeting here. The leaves will take you though
>>
Are there any modern wikipedia engines, /dpt/?

Based on modern technologies, with clean design? Backend/API first?
>>
>>60024345
Do you have any particular grievances with MediaWiki?
>>
File: spurious.png (16KB, 520x72px) Image search: [Google]
spurious.png
16KB, 520x72px
Someone think of a pun involving a word and "PIC".
>>
>>60024361
Crappy and messy layout, for one. Dated as hell when it comes to the backend.
>>
>>60021982
Yes
>>
>>60021993
multitasking kernel competing with Linux.
>>
>>60024382
PICSE -> Pixie -> PXE
SE = Something else
>>
>>60024218
Yeah, there's an extra end-parenthesis on your 1st line.

You should align your code a bit more, like

(cond ((and (< (f b) 0)
(> (f a) 0))
(Half-Interval-Method f b a)))


And make sure to use an editor that at least highlights parenthesis pairs for you. That makes Lisp a lot easier to write.
>>
> webscraper
I need to extract data from a website about smartwatches and wearables to a local database. It would be fine, but the website is really shitty. I ended up with using goquery (jquery for golang)

some of the code:
    connectivity = make(map[string][]string)
doc.Find(".full-split-right.full-split-col").Each(func(i int, s *goquery.Selection) {
if s.Find(".data-block-header").Text() == "Additional Information" {
s.Find(".dtf-row.field-component").Each(func(ic int, sc *goquery.Selection) {
var heading string
var content []string
sc.Find(".dtf-label.dtf-col").Each(func(arg1 int, arg2 *goquery.Selection) {
heading = arg2.Text()
})
sc.Find(".dtf-value.dtf-col").Each(func(arg1 int, arg2 *goquery.Selection) {
if len(arg2.Find(".list_scroll").Nodes) == 0 {
// Single value
content = append(content, arg2.Text())
} else {
// mulitiple values
arg2.Find("td").Each(func(arg11 int, arg21 *goquery.Selection) {
content = append(content, arg21.Text())
})
}
})
connectivity[heading] = content
})
>>
>>60022509
>wanting a rat's panties
What is wrong with you?
>>
I forgot, why do we despise webdev?
Are we jealous of their moneys?
>>
>>60024442
Or just use paredit.
>>
>>60024479
Probably because there is no sane programming language born out of webdev.
>>
>>60024479
>webdev
back end webdev's aren't too bad. front end webdev's don't program, is what you need to understand. programming involves creating some type of logic. front end's more like making things pretty, choosing what font you want, etc. it's not programming
>>
>>60022785
>Polymorphism
>Bloat
I see you have little programming experience.
>>
>>60024513
>js is not programming
>react is not programming
yeah, ok
>>
>>60024479
>>60024487
Because we dont have a fresh and sane standard. Webdev is just hack over hack over hack.

JS will be 22 this year.
It needs retired but no one wants to do the work on its successor. And then when we get it, it will take another decade for it to be adopted.
>>
>>60022965
Rust.
>>
>>60024537
Did you mean to reply to that guy?
>>
File: Untitled.png (52KB, 325x396px) Image search: [Google]
Untitled.png
52KB, 325x396px
>>60024382
>>60024409
They are doing construction right outside my apartment, and I can't think straight, have some OC
>>
File: 1491599606850.jpg (226KB, 1200x900px) Image search: [Google]
1491599606850.jpg
226KB, 1200x900px
>>60024537
are you implying front end is programming? because it's not and i don't know anyone who seriously says it is. there's a reason all the "gurls can kode" shit is littered with <'s and >'s
>>60024576
you tell him, shitposter-kun
>>
>>60024580
qt
>>
File: 1492704472420.gif (3MB, 400x224px) Image search: [Google]
1492704472420.gif
3MB, 400x224px
making a clone of arkanoid, a breakout arcade games from the 80s, on python using pygame

im still a noob but its going quite well and it looks quite nice because i found a sprite sheet to get graphics from

it seems like the more programming you do the more satisfying it gets, does it carry on like this?

if it does this seems like a really good career to get into, even though youd be programming pretty boring stuff most of the time, it just feels like you have a lot of freedom to in the way you can approach problems which seems rare in a lot of jobs
>>
File: oh-my.png (113KB, 253x237px) Image search: [Google]
oh-my.png
113KB, 253x237px
>>60022965
>pick any language with objects
>don't use inheritance
>>
>>60022840
Lambda calculus can't be implemented in hardware. Turing machines can.
>>
>>60024645
Where's my infinite memory machine?
>>
>>60024657
Up your ass.
>>
>>60024645
>Lambda calculus can't be implemented in hardware
You're full of shit
>>
what does /dpt/ think of OCaml?
>>
>>60024687
Show me a lambda calculus machine.
>>
>>60024645
They cannot you stupid shit nigger.
>>
This makes no sense to me

#include <iostream>
using namespace std;

#include <boost/smart_ptr/shared_ptr.hpp>

struct Square
{
int width, height, x, y;
};

Square* gPtr;

void a_function()
{
boost::shared_ptr<Square> ptr(new Square());
gPtr = ptr.get();
cout << "Leaving a_function() -> ptr.use_count() = " << ptr.use_count() << endl;
}

int main()
{
cout << "Calling a_function()" << endl;
a_function();
cout << "Deleting gPtr" << endl;
delete gPtr;
cout << "Shit was deleted without crashing the program. You failed me shared_ptr?" << endl;
return 0;
}


Output:
    Success    time: 0 memory: 15240 signal:0

Calling a_function()
Leaving a_function() -> ptr.use_count() = 1
Deleting gPtr
Shit was deleted without crashing the program. You failed me shared_ptr?
>>
>>60024708
>what is lisp
>>
>>60024709
At least partially.
Literally the only way to run lambda calculus on hardware is to compile it down to turing machine instructions, lol.
>>
>>60024698
I've heard some cool things about it but I'm not informed enough to know. One of my buddies said it's big in France and can do cool stuff
>>
>>60024712
>
  boost::
>>
>>60024708
You can do it with a stack
>>
Actually, there's no reason i should be compiling for x86, is there.
>>
>>60024719
An interpreted/compiled language, which compiles down to (turing) machine code, or is interpreted.

You fags can't run your lambda calculus without the help of a superior turing machine.
>>
>>60024732
>>60024753

I could say something equally stupid like "turing machines can only be compiled by boiling them down to lambda calculus expressions - sequencing is an operation", but I don't need to resort to such idiocy.

After all, even ASM gives instructions parameters.
>>
>>60024764
>I could say something equally stupid like "turing machines can only be compiled by boiling them down to lambda calculus expressions - sequencing is an operation"
That's because that simply isn't true.
>>
>>60024753
Why would I translate my lambda calculus into Turing machine code when I can evaluate it by hand?
>>
>>60024442
>
(cond ((and (< (f b) 0)
(> (f a) 0))
(Half-Interval-Method f b a)))


Okay, I'm extremely close to getting this.

The code to "switch" the arguments works, but for some reason, there's an unending recursive loop (see pic related)
>>
>>60024778
Really? You're telling me you never use the ; operator?
>>
>>60024753
what turing machine? it compiles down to C/assembly.
>>
>>60024779
Have fun I guess.
Meanwhile the big boys will be computing our shit on actual hardware and getting real work done.

>>60024787
Are you actually trying to claim that turing machines are lambda calculus?
Then why are you so against them?

>>60024798
>C/assembly
Turing complete, and it runs on hardware that is turing based.
No lambda calculus influence, because it's fucking useless.
>>
>>60024740
Boost sucks?

That doesn't really answer why a scoped_ptr deletes my object when it exits the function, whereas a shared_ptr doesn't.
>>
>>60021954
Anyone got good resources for starting out with C? I learned python for about a month, this last few days I've been learning c++, but after reading about C, I really want to give it a try. I think it will give me a strong understanding of the fundamentals to build off of before I go to college. I talked to a guy in the comp sci program there, apparently they start with Java, which I figure will be a walk in the park if I can get a decent foundation built before the semester starts.
>>
>>60024858
>Are you actually trying to claim that turing machines are lambda calculus?
>Then why are you so against them?
I'm saying it's ridiculous to say lambda calculus is compiled to turing
>>
>>60024708
you didn't answer his question
>>
>>60024869
>scoped_ptr
>deletes my object when it exits the function
Well, duh! I've never even heard of a scoped pointer, but that behaviour is obvious from the name alone.
>>
>>60024881
K&R
>>
>>60024786
Where in SICP are you? You can use
(newline)
to output a newline.

S-expressions in the function body are evaluated in order, so you're recursing into Half-Interval-Method and still evaluating everything below, which was the code that was causing the loop in the first place.

It's exactly the same thing with your 2 display calls. The 1st is evaluated, then the next.

You should put the `and' condition inside the bottom cond, or better yet define an inner function and do something like:

(define (Half-Interval-Method f a b)
(define (inner f a b)
...)
(if (and (< (f b) 0)
(> (f a) 0))
(inner f b a)
(inner f a b)))


Though this still isn't robust, as you're still missing the cases where both f(a) and f(b) are negative/positive.
>>
>>60024858
>Are you actually trying to claim that turing machines are lambda calculus?
https://en.wikipedia.org/wiki/Church%E2%80%93Turing_thesis
>>
>>60024882
>I'm saying it's ridiculous to say lambda calculus is compiled to turing
So it all you want, but it's what happens today and is what has always happened because you can't implement a lambda calculus evaluator in hardware without the help of turing machines.

Yes, you can evaluate by hand, but that's fucking useless.
To actually run it on hardware you have to compile to superior turing machine code.

>>60024890
He didn't have a question.
>>
>>60024896
Yes. Shared pointers are supposed to do the same when the reference count reaches 0, which would be when my local pointer is destroyed upon returning to main().
>>
File: magic.jpg (40KB, 845x960px) Image search: [Google]
magic.jpg
40KB, 845x960px
What are some things you guys use Common Lisp for? Once I was versed enough in it I was going to try writing a wrapper for one of the API's I use at work.
>>
>>60024932
this guy's question
>>60024657
>>
>>60024932
Yet again you have made up assertions out of nowhere.

Not that it matters.
Enjoy not having any functions, types, etc.
>>
>>60024932
>you can't implement a lambda calculus evaluator in hardware
I'm assuming you have a formal proof of this?
>>
File: 1467519275306.gif (1MB, 320x213px) Image search: [Google]
1467519275306.gif
1MB, 320x213px
explodeBy ch xs = let (ys, zs) = break (==ch) xs in ys ++ explodeBy ch zs


Why does this infini-loop? Did I forget to write an edge loop?
I was drunk when writing this, still am btw
>>
>>60024932
>Yes, you can evaluate by hand, but that's fucking useless.
>To actually run it on hardware you have to compile to superior turing machine code.

srsly, are you mentally challenged ?
>>
>>60024954
Oh, then I know the answer: it doesn't exist.

>>60024960
I have functions and types, it just has to all be compiled down to turing machine code because that's the only way to run it.

>>60024965
Burden of proof is on your shoulders to prove that you can.
>>
>>60024712
You're after the effect of calling delete twice on the same pointer, right? But is that really guaranteed to cause a problem?
>>
>>60024997
>it just has to be compiled down
It has to be compiled down to beams of light and currents of electrons, because turing machines can't actually be implemented in hardware
>>
>>60024989
Are you?
Please, show me a physical lambda calculus machine that DOESN'T get help from a turing machine.
>>
>>60024997
>Burden of proof is on your shoulders to prove that you can.
It's not, I didn't claim anything. You claimed that compiling lambda calculus to hardware would lead to a contradiction. Now show me a formal proof of this.
>>
>>60024997
>Burden of proof is on your shoulders to prove that you can.
Actually it is not. You made the proposition that the lambda calculus is useless and you based that on the assumption that it cannot be implemented in hardware. Therefore you need to provide a proof to the later assumption.
>>
File: lisp machine keyboard.jpg (189KB, 2003x813px) Image search: [Google]
lisp machine keyboard.jpg
189KB, 2003x813px
brb programming on my lisp machine
>>
>>60024939
I use it for any new home projects. Mostly AI stuff at the moment with CLML.
>>
>>60024938
Not the OP, I too would like an answer to this (also shared pointers were added in C++11). From what I've read so far on the internet, this is undefined behavior.
>>
>>60024988
Edge case, not edge loop.
drunk haskell is still fun btw
>>
>>60025014
any fucking functional program there is. there is no such thing as a turing machine in the real world and the fact that you are thinking that there is, shows your retardation.
>>
>>60025002
On Ideone.com it does.
http://ideone.com/dWEgic
>>
>>60024988
There is no condition that will cause explode by to not be called. You could try pattern match for an empty list.
>>
>>60024988
I'm not certain what language this is, but I'm going to assume it's because you're not checking the base case for xs being an empty list.
>>
File: 1472177133982.png (270KB, 960x458px) Image search: [Google]
1472177133982.png
270KB, 960x458px
>>60025003
You're retarded, and you don't seem to understand what "implemented in hardware" actually means.

Pic related, turing machine implemented in hardware. Now show me your lambda calculus machine implemented in hardware.

>>60025021
>You claimed that compiling lambda calculus to hardware would lead to a contradiction
No.
It's not feasible or nearly as simple to implement a lambda calculus machine in hardware, simply because lambda calculus does not translate well at all to hardware.
You can't do it without the help of turing machines.

>>60025028
I don't have a proof.
But if you're saying that it's possible, then I'd love if you showed me a lambda calculus machine in hardware. I'm waiting.

We have countless turing machines in hardware, and zero lambda calculus machines in hardware. Really says something about lambda calculus machines huh?
>>
>>60025105
I'm not seeing a turing machine
>>
>>60024297
WTF I love Trump now.
>>
>>60025105
> I'd love if you showed me a lambda calculus machine in hardware. I'm waiting.
see >>60025043
>>
>>60025070
It does on my machine too.
But isn't it possible that doing so *might* not corrupt the heap, if you're very lucky.
I don't know. I don't actually know how the system handles memory allocation under the hood.
>>
>>60025105
>No.
You said "you can't implement a lambda calculus evaluator in hardware".
>You can't do it without the help of turing machines.
Do you have a formal proof of this?
>>
>>60025105
>I don't have a proof.
>>
>>60025105
You really don't seem to understand what a turning machine actually is, and how it works. That may be equivalent to a turning machine in what it can computer, but it's certainly not a turing machine in itself.
>>
>>60024712
Try adding a destructor to Square and see what happens.

struct Square
{
int width, height, x, y;
~Square(){ std::cout << "Don't be square!" << std::endl; }
};
>>
>>60024988
When you call break, I think you're getting stuck in an infinite loop the first time it finds the character you want to break on, so you basically get stuck in an infinite loop:
break (=='a') "bcdabcdef" => ("bcd", abcdef")
break (=='a') "abcdef" => ("", "abcdef")
break (=='a') "abcdef" => ("", "abcdef")
// ect

You need to remove the character you're breaking on from the return, so that you don't continuously break on the same first character.
>>
>>60025069
>any fucking functional program there is
Wait, can I run Haskell code directly on my CPU with no translation whatsoever?
I don't think so. What the fuck do you think GHC does? a fucking no-op? It compiles down to machine code eventually you retard, and run on turing based machines.

I never said real turing machines exist. When I say turing machines I mean machines based on real turing machines.

>>60025127
>It's still turing machine based
Ok

>>60025135
I don't have a proof. However my claim will remain true until proven false, and I have a feeling that it will remain true for a very long time.
Lisp machines aren't lambda calculus machines. They are turing machines optimized for running Lisp code.


Nice try lambda calc fags, but your dream will never ever come true.
Turing machines will forever remain the best, and your useless lambda calc will forever remain useless.
>>
>>60025161
Not him.
On my humble understanding, is not manchine code like instructions of a turing machine (the CPU being the turing machine)? If that's so to make lambda calculus into hardware you should design a new kind of CPU, wich may prove to be hard if not impossible.
>>
>>60024913
I'm near 1.3.3

Oh, so this is just a matter of normal vs applicative order evaluation?

Either way, this definitely helped! Thanks man!
>>
>>60025216
it seems there are two false assumptions

1) that modern computers are based on turing machines and not lambda calculus
2) that if 1) were true, the lambda calculus would therefore be useless

the simplest way to disprove (1 & 2) is to point out that you use functions
therefore the lambda calculus is not useless
as 2 is false, therefore 1 & 2 is false
>>
>>60025216
>However my claim will remain true until proven false
I think you might actually be retarded.
What you said is highly unlikely, considering they are equivalent. Meaning that any property of a Turing machine is also a property of lambda calculus.
Unless you can formally prove that it's impossible, your posts are entirely worthless.
>>
>>60025249
>as 2 is false, therefore 1 & 2 is false
It doesn't work like that.
That doesn't somehow prove that modern CPU's are based on lambda calculus.
>>
>>60025234
turing machines need an infinite tape, and so cannot exist in reality
>>
>>60025249
It a one way implication, this
> as 2 is false, therefore 1 & 2 is false
is logically false.

So going back to actual machine code, aka hardware, how are op codes (wich doesn't use functions, use jumps) lambada calculus.
>>
>>60025309
>>60025325
No, I am saying that because one of the two conditions is false, the conjuction of that condition and another is false, i.e. false is a zero of the operation
>>
>>60025320
I don't see why would you need an infinite tape, just don't make jumps outside your tape no?
>>
>>60025043
I like the YouTube shortcut keys.
>>
>>60025325
>A & B, not A, therefore not (A & B)
>is logically false.
Are you old enough to visit this site?
>>
>>60025342
Ok. that was stupid.
>>
>>60025342
I see, (1&2) are false becouse 2) is false, but I remind you that what you wanted to prove was 1)==False, and at is still uncertain.
>>
>>60025325
>>60025398

You could, as an alternative, suggest that one should consider each individual register value as a distinct instruction - i.e. moving to AL and moving to BL are completely distinct, and not parametrised.

This leaves you with the standard machine having 18446744073709551616 instructions.
>>
>>60025361
because a turing machine has an infinite tape, it can, for example, add 2 arbitrarily large integers. real machine can't do that
>>
>>60025180
Not him, but someone curious, the desctructor gets called twice
#include <iostream>
#include <memory>
using namespace std;
struct Square {
int width, height, x, y;
~Square() {cout << "Deleting square!" << endl;};
};
Square * gPtr;
void aFunc() {
shared_ptr<Square> ptr(new Square());
gPtr = ptr.get();
cout << "Shared ptr count: " << ptr.use_count() << endl;
}
int main(void) {
aFunc();
cout << "Deleting gPtr" << endl;
delete gPtr;
cout << "Deleted!" << endl;
return 0;
}
>>
>>60025247
>Oh, so this is just a matter of normal vs applicative order evaluation?
No. Even with normal order evaluation, there would still be an infinite loop in your previous procedure.

In your previous code, you had a cond that called
(Half-Interval-Method f b a)
. This does indeed terminate, but the problem is that after it terminates, the interpreter then goes and evaluates your
(display a)
, and everything after that.

So everything below still gets evaluated, applicative-order or otherwise, and you have the same infinite loop as you had before you switched the order of the arguments.
>>
>>60025427
>real machine can't do that
Why not? You could just keep adding memory.
>>
>>60025450
>what is infinity
>>
This might be a silly question, but what is called the structure etiquette of writing code? like having the tabs aligned, etc. I'm new to this and I don't know if I'm having trouble reading my code from last week desu.
>>
>>60025475
Keep adding memory indefinitely. What's the problem?
>>
>>60025477
Write all your code in one line.
>>
New thread:

>>60025489
>>60025489
>>60025489
>>
>>60025491
are u retarded? the universe will collapse in some point in time
>>
>>60025427
That depends on how you interpret what you said. Certainly you can't make a machine that adds integers of a size bigger that the machine is capable of, but you can build a machine that is capable of any given size if you have the resources. Hence is not a limitation of the design, but a limitation of the actual resources to build such machine. So, machines that are limited to a given size should still be considered turing machines (becouse the limitation is not of design)
>>
>>60025491
>>60025450
For any physical machine, there exists 2 sufficiently large numbers that it cannot add. If you add more memory, you are creating a new machine with its own memory limitations, and it will also have 2 sufficiently large numbers that it can not add.
>>
File: 50913967_p0.png (821KB, 1000x750px) Image search: [Google]
50913967_p0.png
821KB, 1000x750px
>>60025325
these opcodes can be converted/compiled into lisp which is based on lambda calculus. therefore, it's possible to do the opposite and convert this lambda code into opcodes and the opcodes are now lambda calculus. qed
>>
>>60025428
And the the program crashes. At least it does for me.
>>
>>60025517
So?
>>60025532
>and it will also have 2 sufficiently large numbers that it can not add.
At which point you add more memory.
>>
>>60025556
At which point there are still 2 numbers that you can't add. You will never be able to add all numbers on a physical machine.
>>
>>60025583
Then you add more memory, repeat indefinitely.
>>
>>60025535
I hope you're joking, you pass the op codes to the cpu, end of story. If you decompile op codes to compile them again you still have op codes, wich are for a turing machine (if we accept a CPU is a turing machine).
>>
>>60025556
>So?
You can't build a physically existing machine like this.
>>
>>60025615
these opcodes have a strong lambda calculus basis, because I got them from lambda calculus schematics. they are literal lambda calculus that merely happens to be "disguised" as opcodes.
>>
>>60025705
Exactly. The point is that you have to compile lambda calculus down to turing machine instructions in order to run them on bare hardware.
>>
>>60025705
op codes are not functions. But whatever op codes are, that's irelevant, you still pass them to a CPU aka turing machine, making them the data (or tape) of the machine. If you had a lambda based CPU, you would not use op codes on it, you would probably use strings.
>>
>>60025692
Why not? I could keep adding memory infinitely.
>>
>>60025760
but how can you say that they are "turing instructions" when they are clearly lambda calculus?
>>60025768
all of which is lambda calculus, as I proved above.
>tape
what tape?
>>
>>60025856
Wikipedia: A Turing machine is an abstract machine[1] that manipulates symbols on a strip of tape according to a table of rules.

I don't think you know what you're talking about.
>>
File: chess-dogs.jpg (75KB, 1280x720px) Image search: [Google]
chess-dogs.jpg
75KB, 1280x720px
>>60025874
there is no strip of paper in a cpu, therefore none of that is a turing machine. your turn
>>
>>60025856
Is C code compiled down to assembly still C code? no.
Just because the instructions were compiled from lambda calc doesn't mean the instructions are lambda calc. They are still turing machine instructions.

You're an idiot if you think the resulting instructions aren't turing machine instructions.
You can't run your shitty lambda calc without first translating it to turing machine instructions.
>>
>>60025895
The memory is your strip of paper. We just don't use paper becouse well, the alternative is better.
>>
File: checkmated again.jpg (133KB, 1280x720px) Image search: [Google]
checkmated again.jpg
133KB, 1280x720px
>>60025908
They are equivalent and do the same shit.
>>60025913
So you admit it's not even a turing machine since you are doing stuff that is better instead. You may try to claim this stuff is somehow equivalent to a turing machine but then I can similarly claim that the stuff is equivalent to the lambda calculus. In other words, you are checkmated.
>>
File: lorna.jpg (232KB, 660x720px) Image search: [Google]
lorna.jpg
232KB, 660x720px
>>60024157
You aren't really being serious either. Get back to work and stop asking about shit you can find out on your own or on stackoverflow.
>>
>>60026069
> You may try to claim this stuff is somehow equivalent to a turing machine but then I can similarly claim that the stuff is equivalent to the lambda calculus.

This is bullshit of unimaginable proprtions.
A=a does not mean B=c. Two things being equivalent doesn't mean any thing is equivalent to any thing.

Changing paper with nowadays memory is just a technological improvment, it works the same, the design is the same, so it's still a turing machine. A turing machine is by itself an abstract thing, anything that works like it is also a turing machine.

To further dumb it down, a diesel car and a petrol car use diferent technologies but everybody agrees that both are still cars.
>>
>>60026069
>They are equivalent and do the same shit.
The difference is that the only representation that can actually be run on hardware is the turing machine form.

>lambdafags can't even run their own code without getting help from the superior turing machine
kek
>>
Is it worth learning Rust at this point? Are they still breaking syntax or have they settled down? Also anyone have the git themed expanding your mind pic?
>>
File: not a robot.jpg (152KB, 1280x720px) Image search: [Google]
not a robot.jpg
152KB, 1280x720px
>>60026191
>A turing machine is by itself an abstract thing, anything that works like it is also a turing machine.
The same applies to the lambda calculus: it is abstract and so if it works like the lambda calculus it is lambda calculus.
The cpu works like the lambda calculus. Why? The lambda calculus says there are functions. Some of the opcode shit corresponds to a function in lambda calculus, other parts correspond to the variables, etc. For this reason, the cpu running is literally the lambda calculus at work.
>>
>>60026696
Since the v1.x got released, Rust has been retaining backwards compatibility
>>
>>60026767
>The same applies to the lambda calculus
Do you realize that by accepting your argument without first refuting mine, your basically saying that lambda calculus and turing machines are the same thing?
>>
>>60026767
>if it works like the lambda calculus
It doesn't.
>>
>>60026842
They might be. I wouldn't be surprised, last I heard types were equal to propositions according to some theorem.
>>60027946
It does, as I explained,
>Some of the opcode shit corresponds to a function in lambda calculus, other parts correspond to the variables, etc.
Thread posts: 350
Thread images: 36


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