Hacker News new | ask | show | jobs
by dentemple 199 days ago
It is a language, just not a turing complete one.

Pidgen is a type of language, too, but you wouldn't be writing Shakespeare in it.

There's nothing to be pedantic about HTML here, and it just seems so absolutely pointless to me that people try to find a way to be.

1 comments

It's not that it's not a language, it's that it's not a programming language. You don't write programs in it.
This topic always tickles the pedantic part of my brain. If I may assume that the reader would agree that JS is a programming language, what makes it a programming language and not HTML? What makes a static .js file a program and a static .html file not a program?
Generally speaking, HTML doesn't have the constructs necessary to actually compute things. There's no way to declare variables, and there are no conditionals, jumping, or mathematical operations. All you can do is specify a fixed set of page elements.

Embedded JS within HTML doesn't count here, as that's essentially no different than a linked script file.

To be fair, there are some exceptions to this; there are some very hacky and convoluted ways you might be able to get some programmatic behavior out of pure HTML (I remember hearing about a weird example in part of Wikipedia's codebase).

HTML literally means hypertext markup language. It's more like TeX or Markdown, in that it's used to store and represent data, not to manipulate it.

> All you can do is specify a fixed set of page elements.

I'm not denying this but rather questioning why this means the document which specifies this is not a program. The previous sentences describe why it's not Turing-complete, which is moot to whether it's a programming language.

> HTML literally means hypertext markup language. It's more like TeX or Markdown, in that it's used to store and represent data, not to manipulate it.

I disagree that HTML is not used to manipulate data. Unless you mean to say that it doesn't manipulate it directly but I think that's also moot. My day job is to use HTML to build forms that are used to accept user input for data manipulations. It seems to me that I'm programming the browser to render the correct form and the language I'm using for the programming is HTML.

Besides, being used only to store and represent data does not seem to necessarily preclude it being a programming language. "Program" is a word that's used to describe a presentation of some kind. A wind ensemble might perform a "program" of pieces on concert night.

What's the definition of a programming language in the tickling part of your brain?
Well, if you'll pardon the tautology, it's a language that's used for precisely expressing programs. Of course, that just shifts the question. What's a program?

It's a set of instructions for a computer to execute. Hopefully that's not controversial. But isn't `<input type="text">` an instruction to render a text input?

It is "controversial" because it's way too vague, which the pedant part should recognize (is a mouse click not an instruction for a computer to execute?), so of course you won't be able to differentiate at this level.
> it's way too vague

If anything, I made it too specific by saying computer.

> is a mouse click not an instruction for a computer to execute?

If an SOP document—another example of a program—says to click a button on the screen, then of course that action is part of the instructions for a program. No computer needed, even; the instruction could be to stick my thumb up my nose, for all it matters.

programming language makes program

markup language makes document

program does things. document presents info.

we use program to render document.

Thanks for your input but your answers still leave me with questions.

> programming language makes program

What makes a static .js file a program, not a document, and a static .html file a document, not a program?

> we use program to render document.

Is this like how node is a program that's used to render JS documents?

you should start with definitions of program and document and you'll have your answer. in a simplified way, as i said:

program does things. document presents info.

> in a simplified way, as i said:

It's overly simplified to the point of being meaningless. A .js file is a document that presents information to me when I open it using a text editor. So is a .html file, for that matter. Something different happens when they're opened in a browser and, for that reason, they both seem to be programs as well.

That's where I'm coming from.
It is just a syntax language, used in programming web pages. that would be a better descriptor
Why is that a better descriptor? I don't understand this desire to demarcate between programming languages and whatever a "syntax" language is. All languages have syntax, even natural languages - it's one of the terms we've borrowed from linguists.

HTML is one of the languages I use when I am programming. In the sense, I really struggle to see the argument that it isn't a programming language, unless someone is using a very precise definition of "programming language" that I'm not privy to. There's a bunch of well-defined stuff it _isn't_ (e.g. Turing-complete), and a bunch of well-defined stuff that it is (e.g. declarative, or a markup language), but as far as I can tell there's no better definition of "programming language" than "language used for programming", and it certainly seems to fit that bill.