7 ms·
An HTML file is not a program.
by sfoley 6y ago
An HTML file is not a program.
- peterwwillis 6y agoIt can receive input and create output. The browser is the interpreter for scripted HTML programs.
- smt88 6y agoHTML by itself can't receive input or create output. It is input/output. It can't run or be executed. It doesn't transform state or even have state. It's not Turing complete. HTML with either CSS3 or JavaScript is definitely a program, though.
- morganvachon 6y ago"HTML by itself can't receive input or create output." So GET and POST are figments of my imagination then?
- chillingeffect 6y agoThose are HTTP I believe.
- Jarwain 6y agoHttp verbs which can be sent from html
- smt88 6y agoExcept that you can "run" (display) an HTML document without ever sending any HTTP requests. The HTML has no power to send one. It just tells you what happens if a user clicks a UI element. Saying that HTML can send HTTP messages is like saying that HATEOAS API responses[1] can send HTTP messages. They can't without a separate program (written in a non-HTML language) to interpret the HTML and send the message. 1. https://restfulapi.net/hateoas/ https://restfulapi.net/hateoas/
- tzs 6y ago> HTML with either CSS3 or JavaScript is definitely a program, though Then so is something in HTML that doesn’t use CSS3 or JavaScript, for the same reason that a C program that contains no loops is still a program.
- smt88 6y ago> for the same reason that a C program that contains no loops is still a program HTML is not "C without loops". It is, by definition, a subset of the string type. All HTML is a string, but not all strings are HTML. The following is valid C, but I would absolutely argue that it isn't a program: char str[] = "Geeks"; It's a declaration, just like HTML is. It is a string that is being declared and stored. Still, that C example is more of a program than any HTML is because it contains an instruction. It manipulates memory. HTML is literally just a file format. It is not any more of a program than a PNG file is.
- echlebek 6y ago> HTML by itself can't receive input or create output. Neither can an ELF binary. It needs a loader to execute it. > It can't run or be executed. Yes it can, with a runtime that understands HTML. > It doesn't transform state or even have state. It's not Turing complete. That's not a requirement for a program.
- smt88 6y agoSo what is your definition of a program? It sounds like you're using a definition that's so broad, it would include image files, MP3s, and .gitignore.
- username90 6y agoYou can write an entire game like super mario in an html file. Is a super mario game not a program? And no, this is not an archaic way to use html files, it is pretty common to share smaller games as html files. You play them by loading them into your browser. Remember that html files are not just html. The way we use them today they are fully functional programs.
- smt88 6y agoYou are arguing against a statement I didn't make. Look back at the last sentence of my original comment[1] where I distinguished HTML from HTML+CSS3+JS. It seems we agree that HTML (a language, not a file that also includes other languages) cannot create a game like Mario or even Pong. 1. https://news.ycombinator.com/item?id=24826670 https://news.ycombinator.com/item?id=24826670
- deleted 6y ago[deleted]
- parenthesis 6y agoWhy not?
- jolux 6y agoWrong.
- deleted 6y ago[deleted]
- gen_greyface 6y agowhy not? a html file is a set of instructions for the browsers render engine. That is enough for it to qualify as a program
- thomk 6y agohttps://stackoverflow.com/questions/30719221/is-html-turing-complete https://stackoverflow.com/questions/30719221/is-html-turing-...
- gen_greyface 6y agodoes every program needs to be turing complete?
- jolux 6y agoOnly if you define programs as instructions for manipulating Turing machines.
- nxrabl 6y agoTo be pedantic, we can define a non-Turing-complete subset of a Turing machine's instruction set, and pass combinations of these instructions to the machine, and that could still be called a program.
- dangerbird2 6y agoNot really, since programmable machines predate real-world turing-complete computers by at least a century. https://en.wikipedia.org/wiki/Jacquard_machine https://en.wikipedia.org/wiki/Jacquard_machine
- lkbm 6y agoThis is HTML+CSS. CSS3 is Turing Complete.
- optimuspaul 6y agoOf course it is, it is a collection of instructions that can be executed by a computer to perform a specific task. In this case the task is to display some data on a screen in a specific way. We need to stop arguing that HTML is not a programming language, it's silly and serves no purpose.
- s_dev 6y agoIt's not programming language because it's a markup langauge. It's not turing complete. There are limits to the types of computation that can be performed with it. It's not silly -- it's a meaningful distinction.
- chias 6y agoIf you define a "program" as "a series of instructions to perform a task, where the instruction set is Turing Complete", then your statement is tautologically correct based on your definition. A much more general definition is simply "a series of instructions to perform a task". Do you feel that the former definition of the word "program" is the only one worth using? As an example: if you use a Game Maker application to construct a video game where your inputs are the graphics, the level design, and some basic scripting to connect them up, is the resulting output "not a program" because the input scheme that you used in order to define its behavior was not Turing Complete? You could make an argument that, in the context of Quines, this isn't relevant because the Program is not outputting its own source code but only the top-most layer of its definition, but then again that's true at some level for any Quine not written in machine code (and even then it'd probably be missing much of the OS / display drivers / etc.). Edit: removed an example about "programmable TV remotes" because it wasn't a very good example, and added a note about Quines.
- s_dev 6y ago>"a series of instructions to perform a task" Limitations of those instructions is the key aspect. You couldn't use any English or natural language expression for example. It might seem obvious but complexity of those instructions is what makes the language abstract. Having complicated instructions isn't always desireable though e.g. the CISC vs RISC debate.