Hacker News new | past | comments | ask | show | jobs | submit login

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




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


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


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


You 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


"HTML by itself can't receive input or create output."

So GET and POST are figments of my imagination then?


Those are HTTP I believe.


Http verbs which can be sent from html


Except 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/


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


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




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: