non-declarative markup language - markup

Wikipedia states:
Many markup languages such as HTML, MXML, XAML, XSLT or other
user-interface markup languages are often declarative. HTML, for
example, only describes what should appear on a webpage - it does not
specify the possible interactions with that webpage.
Which implies that there are markup languages which are non-declarative (use of the word often). I suspect this is not the case - Are there any non-declarative markup languages?

CFML (Coldfusion Markup Language) and o:XML(object-oriented XML) are two non-declarative markup languages:
CFML tags are essentially much more powerful versions of Java Tag Libraries, and with CFML's ECMAScript-like syntax you'll feel right at home.
o:XML is a complete object oriented programming language, with features including polymorphism, function overloading, exception handling, threads and more. The syntax is fully compliant XML. With o:XML, object-oriented paradigms can be leveraged to the maximum, while data and code remains in a standard format. With o:XML there is no 'impedance mismatch' when developing XML web-applications, tools and systems.
References
o:XML - object-oriented XML
Schema for Object-Oriented XML
Introducing o:XML
Why CFML? - Open CFML Foundation
Object Oriented Programming And ColdFusion - What's The Point?

Related

Is there a standard for defining mappings/transformations?

Are there any standards for defining data transformations in a tool and format agnostic manner?
There are some obvious candidates like XPath transformations but they're specific to XML. There are hundreds of ETL tools on the market, but they're proprietary syntaxes and often rely on low-code/no-code wysiwyg formats.
Has there been any attempts to define an agnostic data transformation standard/format?

XML parser interface to different languags

I'm working on writing a parser for a specific XML based document, which has a lot of rules and complicated interface.
I was going to write the parser in Ruby to parse it to JSON. Then realized, a lot of other people who use different languages like to use it. So I'm thinking of somehow creating a central rule system, where each language can wrap it and create it's own parser.
Any idea how to go about it?
It's unlikely to be productive for you to write your own XML parser from scratch.
As you anticipated, there has indeed been a need for parsing XML in every major language. You can likely find libraries that implement multiple parsing models in any language you need. Be aware of tree-based models such as DOM, stream-based models such as SAX, and pull-based models such as StAX. Also consider XML processing models above the parsing level: Declarative transformations (eg XSLT) and databinding (eg JAXB).
The "central rule system" you envision has also already been realized in schemas (eg, XSD, RelaxNG, Schematron, ...).

Lazarus coding style guide

Style Guide?
Other than http://wiki.freepascal.org/Coding_style is there a style guide that represents the style followed by a notable and large body of work in Lazarus ( and/or FPC and/or Delphi) or some sort of widespread concensus.
Example
I'm looking for things that say something such as
Names of literal constants should be in all uppercase.
Names of variables should use camelCase with initial lowercase
Indent a begin on the line after an if
The above is just an example. I'm aware of well-supported conventions in languages like Java and Perl but not of a predominant convention for programs written using Lazarus or Delphi.
Purpose
My intent is
Try to adopt a common style for all the code I write
Have this style not be too much of a surprise for the majority of programmers who might one day read it.
I'm not working in a business that has established standards.
As a good detailed style guide I'm considering the Object Pascal Style Guide by Charles Calvert. It's for Object Pascal which the Free Pascal is a child of. In fact, most of the FPC units respect the rules mentioned there.
This article documents a standard style for formatting Delphi code. It is based on the conventions developed by the Delphi team.
You will probably yield the most info on this subject with the search term "delphi coding conventions" or something. These are very loose standards that are not enforced but can be very helpful to keep your code readable. Delphi and Lazarus are very interchangeable. Same would apply with Delphi as Lazarus in this regard. Much more info on Delphi.Old Delphi books are a great resource even.

What languages support "dynamic" metaprogramming?

In Metaprogramming Ruby, the author states that only a few languages, including Ruby, can manipulate themselves at runtime. What other languages besides Ruby can support this type of metaprogramming?
The specific quote I'm referring to is in the introduction on page xix:
In this book, I'll stick to a different meaning of metaprogramming,
focusing on code that manipulates itself at runtime. Only a few
languages can do that effectively, and Ruby is one of them. You can
think of this as dynamic metaprogramming to distinguish it from the
static metaprogramming of code generators and compilers.
Most languages now days are moving towards providing that kind of functionality, but it's generally not as "clean" as it's in ruby.
All these languages have a lot of those capabilities (reference):
ActionScript
BASIC
BeanShell[3]
Clojure
ColdFusion
Common Lisp and most other Lisps
Groovy[4]
E programming language
JavaScript
VBScript
MATLAB / Octave
Lua
Objective-C
Perl
PHP
Powershell
Python
Ruby
Smalltalk
Tcl
Other languages such as Java and C# (reference) have ways of inspecting and creating code at run time, but it's not so "natural" as in those languages, and it feels a lot like a hack.

Are semantics and syntax the same?

What is the difference in meaning between 'semantics' and 'syntax'? What are they?
Also, what's the difference between things like "semantic website vs. normal website", "semantic social networking vs. normal social networking" etc.
Syntax is the grammar. It describes the way to construct a correct sentence. For example, this water is triangular is syntactically correct.
Semantics relates to the meaning. this water is triangular does not mean anything, though the grammar is ok.
Talking about the semantic web has become trendy recently. The idea is to enhance the markup (structural with HTML) with additional data so computer could make sense of the web pages more easily.
Syntax is the grammar of a language - the rules by which to form sentences or expressions.
Semantics is the meaning you are trying to express with your code.
A program that is syntactically correct will compile and run.
A program that is semantically correct will actually do what you as the programmer intended it to do. i.e. it doesn't have any bugs in it.
Two programs written to perform the same task in different languages will use different syntaxes, but they would be the same semantically.
If you are talking about web (rather than programming languages):
The syntax of the language is whatever the browser (or processing program) can legally recognize and handle, and render to you. For example, your browser can render HTML, while your API can parse XML trees.
Semantics involve what is actually being represented. There's a lot of buzz now about semantic webs and all that stuff, but it essentially means that each entity is also associated with some human-readable information or metadata, so that a certain tag would have a supposed meaning and refer you to it.
Social networks are the same story. You put knowledge in the links
"An ant ate an aunt." has a correct syntax, but will not make sense semantically. A syntax is a set of rules that can be combined to produce infinite number of gramatically valid sentences, but few, very few of which has a semantics.
Syntax is the word order of a sentence. In English it would be the subject-verb-object form.
Semantic is the meaning behind words. E.g: she ate a saw. The word saw doesn't match according to the meaning of the sentence. but it is grammatically correct. so its syntax is correct. =)
Specifically, semantic social networking means embedding the actual social relationships within the page markup. The standard format for doing this as defined by microformats is XFN, XHTML Friends Network. In regards to the semantic web in general, microformats should be the go-to guide for defining embedded semantic content.
Semantic web sites use the concept of the semantic web, which aims to bring meaning to web content by using special annotations to identify certain concepts in a page. This makes possible the automatic (by a computer, not a human) reasoning about the content, which improves its aggregation, extraction, indexing and searching.
Explanations above are vague on the semantics side, semantics could mean the different elements at disposition to build arguments of value(these being comprehensible, to end-user man and digestible to the machine).
Of course this puts semantics and the programmer-editor-writer-communicator in the middle: he decides on the semantics that should be ideally defined to his public, comprehended by his public, general convention by his public and digestible to the machine-computer. Semantics should be agreed upon, are conceptual, must be implementable to both sides.
Say footnotes, inline and block-quotes, titles and on and on to end up into a well-defined and finite list. Mediawiki, wikitext as an example fails in that perspective, defining syntax for elements of semantic meaning left undefined, no finite list agreed upon. "meaning by form" as additional of what a title as an example again carries as textual content. Example "This is a title" becomes only semantics integrated by the supposition within agreed upon semantics, and there can be more then one set of say "This is important and will be detailed"
Asciidoc and pandoc markup is quite different in it's semantics, regardless of how each translates this by convention of syntax to output formats.
Programming, output formats as html, pdf, epub can have consequentially meaning by form, by semantics, the syntax having disappeared as a temporary tool of translation, and as one more consequence thus the output can be scanned robotically for meaning, the champ of algorithms of 'grep': Google. Looking for the meaning of "what" in "What is it that is looked for" based upon whether a title or a footnote, or a link is considered.
Semantics, and there can be more then one layer, even the textual message carries (Chomsky) semantics thus could be translated as meaning by form, creating functional differences to anything else in the output chain, including a human being, the reader.
As a conclusion, programmers and academics should be integrated, no academic should be without knowledge of his tools, as any bread and butter carpenter. Programmers should be academics in the sense that the other end of the bridging they accomplish is the end user, the bridge... much so: semantics.
m.

Resources