3 ms·
How so? What you're saying amounts to basically an instruction not a relation or declaration in the programming sense of the word.
by notNow 11y ago
How so?
What you're saying amounts to basically an instruction not a relation or declaration in the programming sense of the word.
- crdoconnor 11y agoUsing HTML? It's a declarative language.
- notNow 11y agoHow would you specify the starting time of execution in HTML documents?
- gizmo686 11y agoGiven the current specs, I am not aware of any way to do it, but in theory, you could do something like: <div visible="after:5pm"> hello world </div>
- dragonwriter 11y agoUsing a poshformat (which, if the use case was general enough, might be formalized into a microformat.) [0] Probably leveraging the HTML time element. Of course, that lets you specify the execution time, but unless you have a system consuming the format that is aware of the additional semantics beyond the base HTML semantics, specifying that won't do anything. [0] http://microformats.org/wiki/poshformats http://microformats.org/wiki/poshformats
- gizmo686 11y agoSuppose the langauge has a built-in printf() and sleep() function. You could say main=printf("Hello World"), which declares that your program is equivalent to the action of printing "Hello World". You could also say that main=sleep(1), which declares that your program is equivent to the program sleep(1). You can also say that main=sleep(1) >> printf("Hello World"), which says that your program is equivent to the program that sleeps for a second, then prints "Hello World". You can even create syntactic sugar around the concatenation operator, so it looks like you are programming in an imperative language. If the concatenation operator happens to be over-loadable, you can do a lot of neat stuff with it. Even if it isn't, you can define common control flow operations (such as for loops) at the language level, which means that you can just as easily define new control flow operations that the language designers didn't think of.
- pekk 11y agoPrefixing "main=" to a subroutine definition is no different from any language's syntax for declaring subroutines. If that means every programming language is declarative, then declarative doesn't even mean anything.
- anon4 11y agoOkay, but why the weird syntax and not the standard C style int main() { sleep(1); printf("Hello World"); return 0; } And then you can say "pure functions can be evaluated in any order". Maybe impure functions can be suffixed by a !.
- jerf 11y agoIn the small, all paradigms are the same. print "Hello World" with suitable syntax tweaks, is imperative, functional (that code works in Haskell), declarative, and logical (Prolog has a print). Or, more accurately, is simply too small to be usefully discussed in this context. You have to pick something larger to talk about.
- tel 11y agoIt's nice to have the data/declarative notion of an instruction. It's even nicer to have this notion be exactly the same notion by which you cause effects via your language. This means that all effectual code you encounter can, at least in principle, be analyzed as a declarative data structure.