If a programming language is turning complete...

If a programming language is turning complete, does that mean it can do EVERYTHING any other turning complete language can do? Like for example could I somehow implement an entire clone of Windows 7 in PHP code?

Attached: index.png (306x165, 6K)

Other urls found in this thread:

youtube.com/watch?v=nyHzfVnI4J8
twitter.com/AnonBabble

>turning complete
Why am I not surprised that OP mentioned PHP in his question?
>the absolute state of this board

Turing complete means it can do everything that Turing machine can. Now let's rephrase your question to "can I make OS in language X?" This has nothing to do with Turing-completeness per se, other than that language has to be Turing complete. If you wish to make OS you need a way to to talk with underlying hardware, so you need machine code. Assember, C, C++, C#, Rust are compiled languages meaning they are turned to machine code that you can run directly on metal. PHp, Python, scripting languages on the other hand are interpreted languages which means you never get machine code out of them, rather they use precompiled binary that reads input script/file line by line and executes it. While you couldn't write kernel in PHP (kernel is responsible for talking with hardware, running programs, managing resources etc.) you could create kernel in other language with built in PHP interpreter and for example build all your applications and GUI in PHP. It would be slow, resource-heavy, restricting and dumb but doable. Most of the OSes I know are mainly coded in mix of Assembler, C and C++.

Educate yourself, read about Linux kernel, ToaruOS, Ghost kernel and check out os-dev wiki.

tl;dr: despite this being summerfag thread it's oddly higher quality/more on topic than many threads here

Being Turing complete means that the language is able to perform all the same computations as other Turing complete languages. However, an operating system is not a computational problem/domain, but an engineering one.

You can do anything you set your mind to OP. With enough extreme effort you could probably manipulate the PHP interpreter in such a way as to perform all the low-level operations necessary for an OS without using any other code besides PHP.

No real language is actually Touring Complete becuase they all run on finite memory machines

And where's your mod_php gonna sit lmao

This

idk much about PHP, maybe you use html? And a browser? and essentially write a virtual machine and an OS in PHP
Is that possible?

Dude, if youwrite the whole operation system inside php, and then the internet itself, how do you access it from outside, like, how when your computer is inside the php

>While you couldn't write kernel in PHP
There are translator from vk for translating from php to c++ so theoretically you can write kernel in php.

>like, how when your computer is inside the php

Attached: matrix-red-pill.gif (640x480, 1.26M)

meant for

>like, how when your computer is inside the php

Attached: 15391760-7191903-image-m-11_1561752263138.jpg (306x425, 19K)

>how do you access it from outside, like, how when your computer is inside the php

Attached: wat-a.gif (390x220, 1.6M)

let me think about that

First of all for a language to be turing complete, according to alan turing who discovered the concept, that language or machine has to have infinite ram.

So no modern coding environment we use today is turing complete. They are actually pseudo-turing-complete. This means if we had enough ram then we could do more but we don't so we do as much as we can do.

But lets assume for example PHP and c (((are))) turing complete.

That means that since they are both turing complete, they can both solve the same range of math problems presented to them. There isn't a math problem c can solve that PHP can not solve.

HOWEVER

There is no guarantee as to how quickly a turing system complete will solve a problem. There is no guarantee on how fast it will be. There is no guarantee on how easy a turing complete system will be to operate and program, some languages are harder than others.

There is also no guarantee about the underlying hardware of the machine. So php is usually run in the web browser and so the underlying machinery, the web browser, is a sandbox that limits what php can do intentionally. So php run on the server as an application can do more than php run in the browser even though they are the same language. They can still both solve the same math problems though.

>conflating turing completeness with turing machines
Yikes

>php is usually run in the web browser
No, it isn't.

>php is usually run in the web browser
no it isn't you fucking idiot

Nice

This. Interacting with hardware is not a computational problem.

The characteristic *Turing complete* is a statement about the possible computations a system or programming language can perform. So the questions "can a operating system like Windows 7 be implemented in a Turing complete language like PHP" might be built on wrong assumptions. What we usually call a computer is much more than a Turing machine. Above of the actually computing parts, the *arithmetic logic unit* (ALU) together with the memory, a computer does have systems that allow communication with the outside: input and output (IO). This IO systems allows the user to give the computer commands via keyboard, mouse, scanner or other input devices; allow the computer to provide information to the user via monitors, speakers, printers and other peripherals; enable the storage of data on storage devices and communication to other computers via the network.
The purpose of the operating system is to organize all of this resources so the applications can easily access them. Doing this the operating system does not have to do much computation at all. This means that writing an operating system is not so much a question of Turing completeness and computability but more of access of the basic systems of a computer and performance. Performance is of course not a question of functionality but obviously it is desirable that the basic functionality of a system wastes only a minimum of the available resources.
Since high level programming languages like PHP need a running operating system and a interpreter on top of it to run they are not able to implement a native operating system simply because they can not access the computer hardware directly. But of course it would be possible to simulate a computer, within the IO boundaries given to PHP, and write a operating system on top of that. The performance and sense of such a enterprise would be questionable although.

He went full circle

No computer is technically Turing-complete because you'd need an infinite amount of memory for that. Also you can do useful stuff with languages that aren't Turing-complete, like proving the program will eventually finish.

You can write x86 emulator in PHP and simply execute that Windows 7 task.

That's illegal

really makes you think

hold up guys i'll figure this one out

Attached: monkeyspeak.png (489x247, 185K)

Factorio is a Turing complete video game.
youtube.com/watch?v=nyHzfVnI4J8
So is minecraft I think.

Attached: ipvNqCY.jpg (4042x3974, 3.45M)

Any language can be compiled. It's not an intrinsic property of the language itself.

Attached: wat.jpg (650x866, 112K)

that's like saying "i'm going to make OS from Papyrus script or Mount&Blade script"

I'm getting violation error in my head reading this post

underrated post

>minecraft
If you have just NAND and some flip-flop you are Turing complete, so yes.

Even game of Life is Turing complete.

Which CSI episode is this line from?

>how do you access it from outside, like, how when your computer is inside the php

Attached: lol-wut.jpg (533x594, 45K)

Quality post

Attached: WP_20190614_003.jpg (3264x1840, 2.12M)

this is reason Jow Forums exists

All languages get turned into machine code to run on a machjne. and any operating system can be written in any turning complete language. It might not be fast and you might but you can make a copy of windows 7 in Python or JavaScript or whatever the fuck you want.

wtf am I reading

Attached: wtf-a.gif (202x360, 1.84M)