4 ms·
I never meant "free of computation", I actually mentioned a lot that forget computers and softwares, and focus on languages. <script> is Javascript, not html (
by spamtarget 4y ago
I never meant "free of computation", I actually mentioned a lot that forget computers and softwares, and focus on languages.
<script> is Javascript, not html (I mean what's inside), they just smashed together.
>specifies an specific output
That specific output definition is really different.
Consider this:
-task: give me even numbers
-imperative approach:
for i=1 to 100
result += i * 2
next
-functional approach
return [1,2,3,...].select(x=x * 2)
-declarative approach (not possible, but for the sake of example)
EVEN NUMBERS = NUMBERS LIKE 2,4,6 AND CARRY ON <-this requires a framework, which understand every word i wrote there.
What i wanna ask you to re-explain these examples with your understanding of classification, but using the same task.
>Reality is that declarative languages would be little more than file formats without access to computation.
That what HTML is. A declarative language and a file which requires a framework.
> Your earlier example of SELECT (1+3); is something that can be done in HTML (many different ways), too.
No, not with strictly sticking to the standard and not use any trickery. HTML was not designed to do any kind of calculation. That's why javascript came later.
- indymike 4y ago> No, not with strictly sticking to the standard and not use any trickery. HTML was not designed to do any kind of calculation. That's why javascript came later. I thought you would go here, and I understand where you are coming from: Declarative language != file format and declarative is not a paradigm like functional, procedural, object-oriented. Every useful declarative language allows for some level of computation. Take a template language - YAML + some template tags. Aside allowing variable substitution, every time, the language grows a way to make those substitutions more useful, so you get things like: {{ variable_containing_a_date + interval(days=1) }} Back to functional, oo, procedural: some declarative languages import a paradigm. Back to the script tag: Even though it was added after the original spec, <script> is part of the standard for HTML and is one of the reasons it pushed many other formats to the side and the web won. I would submit that HTML+JavaScript is the platform, not just HMTL. One can write declarative code in an imperative language, and the reverse is true. I do really appreciate you thinking on this, but I think we're best to use the existing definition and example of declarative languages, and not just banish declarative to static file formats.