\Et"y*mon\, n.; pl. E. Etymons, Gr. Etyma.
[L., fr. Gr. 'e`tymon the true literal sense of a word according to its derivation, an etymon]
Tuesday, July 20, 2004
Watch this space.
Saturday, July 17, 2004
Objects and Relational Databases
For OO, Actor theory and the Pi-Calculus: Robin Milner, Communicating and Mobile Systems: the Pi-Calculus and Robin Milner, The Polyadic pi-Calculus: a Tutorial (1991)
For Relational Theory: Chris Date, Introduction to Database Systems, Eighth Edition and Chris Date, The Third Manifesto (1995).
Update on XQuery - RDF
Two weeks ago I wrote a new rdf-query language - it took me about half a day. The parser was trivial, and the semantics a subset of iTql (Tucana's rdf query language implemented in Kowari). At the end of the day, syntax isn't as important as semantics.
Friday, July 16, 2004
MIML
Somehow I've managed to come across this acronymn twice today from independent sources. I still find it a beautifully accurate description of both C's greatest strength, and it's greatest weakness.
Still, somehow regardless of how many new languages I learn, I still seem to have a soft spot for C --- it is a remarkably elegant MIML.
Jumping the gun.
Therefore, NI proposes that a new requirement be considered by this group: "The query language shall have an XQuery compatible concrete language syntax."
I don't think you could make a more premature proposal. The DAWG is trying to avoid syntax issues, preferring to get the semantics right first --- a good idea. To be proposing concrete syntax requirements at this stage is surely jumping the gun. I am even more surprised to see a proposal to mandate as poor a prima-facie case as XQuery.
XML has a document centric, single-rooted, hierachial view of its data; and XQuery reflects that. RDF on the other hand is a open-world, non-rooted, cyclic directional graph-based view. It is not immediately obvious how to reconcile these two approaches; neither is it apparent that a syntax designed to query the former, will be appropriate for the latter. This becomes particularly apparent when you look at the block-and-layer diagram in Jeff's proposal pdf. The only link between the XQ Data Model, and the RDF Triples is that both are sometimes serialised as XML --- ok XML tends to be serialised as XML, but lets not quibble, RDF often isn't.
On the other hand, XQuery is itself quite a nice solution to its problem. Particularly nice is its definition of two isomorphic concrete grammars sharing a common semantic model. I would have absolutely not problem with discovering that XQuery can be married with the semantics required by an RDF query language, in fact that would be great. Still I would like to see the DAWG finalise the required semantics first.
I would be concerned if XQuery was even considered desirable at this stage, let alone a requirement.
Wednesday, July 14, 2004
When is an infinite loop not an infinite loop?
This of course was aggrivated by the fact that everytime I identified precisely when the transaction was marked for rollback, it was iterating over a Tuples. This isn't surprising given we spend alot of our time iterating over Tuples. Not that that occurred to me until after I found the bug. Hence I spent all of yesterday looking inside the TuplesOperations and half a dozen Tuples subclasses.
Yesterday was definately the most fustrating days I've had in some time.
Tuesday, July 13, 2004
UML Editors
Why mention this? Because I have finally found a UML program that is probably close-enough that I can live with it's short-comings; and shows sufficient promise that I might even be convinced it's worth contributing to.
So I would like to recommend that the next time you want to throw together a quick UML diagram, you check out Violet.
Monday, July 12, 2004
Continuations.
Continuation Passing Style in Java
Continuation Passing Style in C
One of these days I'll actually get around to setting up my own wiki :).
Worthwhile languages.
C - Some people describe this as portable assembly. They are right. C feels remarkably close to the ideal minimal abstraction from the concerns of computer architecture. I can't think of a good programmer who dosn't know C well, there is a good reason for this.
Python - Possibly the most pleasant language I know. Also by far the easiest language I know of to teach to absolute beginners. Python has the advantage of supporting both imperative, functional, and object-oriented paradigms. However it's best feature is its truely remarkable community. I am unaware of any community that has such a healthy focus on usability, readability, and statistics-driven optimisation. I don't do much python programming anymore, but I still enjoy reading the community.
Scheme - Take one very powerful language; add very simple syntax; mixin safe syntactic closure and you get scheme. Hence it is widely used in the language research community, where people are understandably more interested in the power and facilities of their language than popularity.
Languages I know, want to use, and admire:
Erlang - One of the nicest languages I've come across. Scalable, safe concurrency, with pattern matching, and a whole gamult of features supporting fault-tolerant computing all the way down to low-level wire-protocol work.
Haskell - This is a language for thinking outside the box. Lazy, pure-functional, static-strong typing, advanced HM type inferencing, monads, arrows, the list goes on. If you have only ever done imperative procedual or object-oriented code (read java, C, C++, smalltalk, python, perl, etc) learn the exceptions to most of the rules you have osmosed.
SML/OCaml; Clean, elegant, safe, and fast! What's not to like about ML? Yes you can pick a single metric on which your language of choice wins against ML, but you'll be hard pressed to find two.
Yes, I recognise the distinct lack of logic and constraint languages in this list so I'll just point at two I have been recommended but haven't found time to investigate sufficiently to add to the list above: Mercury, Mozart, and one that looks very promising Paul Reppy's Moby.
An impressive rant.
C++ is philosophically and cognitively unsound as it forces a violation of all known epistemological processes on the programmer. as a language, it requires you to specify in great detail what you do not know in order to obtain the experience necessary to learn it. C++ has taken premature optimization to the level of divine edict since it _cannot_ be vague in the way the state of the system necessarily is.
C++ is a language strongly optimized for liars and people who go by guesswork and ignorance.
C++ turns otherwise good people into paranoid, insecure prostitutes, and it comes from creating such horrible living environments for themselves and compounded by trying to explain to themselves that "it's OK, really".
Friday, July 09, 2004
Database Abstraction Layers.
- Persistence
- Integrity
- Closure
Database Abstraction Layers and Programming Languages
Mnemosyne, the best persistence/query/language integration attempt I am personally aware of.
Wednesday, July 07, 2004
A very cute use for egrep.
tr "[:print:]" "[x*]" < FILE | egrep -vno '^(..+)\1+$'[H-CHAT] What's your top three shell tricks?
The thread explains what it does, and I would probably replace the .'s in the egrep pattern with x's; still very cute.
It can also provide a good example of when cs theory can occasionally be useful: Given the provided solution uses a gnu-extensions to regex(7), can this be done with a pure POSIX regular expression?
Wednesday, June 30, 2004
Programming Language Pragmatics
I recently finished reading this and thought I should provide a review as it is a truely remarkable book. Fundamentally the book is an informal survey of the various fields of computer science and engineering that impact the design and implementation of programming languages, their interpreters, and compilers --- and it succeeds admirably. Specifically the chapters include:
- Introduction
- Programming Language Syntax. (FA/PDA's; regular expressions; context-free grammars; LL/LR parsers, including one of the clearest descriptions of LR parsing I have come across.)
- Names, Scopes, and Bindings. (Value lifetime; garbage collection; different scoping rules; different implementation approaches to scoping.)
- Semantic Analysis. (Attribute grammars; attribute flow. While well written, I personally found this one of the weaker chapters.)
- Assembly-Level Computer Architecture. (Effectively a one chapter synopsis of Hennersey and Patterson.)
- Control Flow. (Selection; Iteration; Recursion; and Non-determinisim)
- Data Types. (Static and Dynamic checking; discussion of implementation; A short discussion of HM-style type inference; as well as discussions on the particular issues associated with Records, Arrays, Pointers, Lists, and IO.)
- Subroutines and Control Abstraction. (Calling sequences and conventions; call-stack/tree management; exceptions - including continuations; coroutines.)
- Building a running program. (Compiler backends; intermediate code; register allocation; linking - including dynamic linking and pic.)
- Data Abstraction and Object Orientation. (OOP, including semantics and implementation concerns of encapsulation; inheritance; finalisation; polymorphism. All discusses with reference to a multitude of different languages and approaches to OOP).
- Nonimperative Programming Models: Functional and Logic Languages. (Split into two sections, one on functional and one on logic programming. Of particular interest are introductions to both the lambda and first-order predicate calculi; and discussions on the advantages these mathmatical groundings provide programmers).
- Concurrency. (Background; Theory; Shared-memory; and Message-Passing. A very impressive introduction to concurrency.)
- Code Improvement. (By necessity of space, a very limited introduction to code optimisation. Still it manages to cover a reasonable amount of ground, although I would have liked more discussion on cache optimisation techniques. Peephole Optimisation; Global Redundancy; Data Flow Analysis; Loop Invariants and Unrolling; Instruction Scheduling; Register Allocation).
In conclusion, I would highly recommend this to any programmer who has experience in only one or two languages; any undergraduate wanting to broaden their understanding of programming; any professional wanting to learn more about compiler/interpreter/parser theory and implementation and wants context for the more focuses works in this field.
5-stars.
Tuesday, June 29, 2004
Domain Specific Languages
1. My son and I recently read a book on Leonardo da Vinci (great link), in particular looking at the way Leonardo’s work contained a great body of work from very rough sketches to beautiful and complete works of art. Explaining how artists start with rough pencil sketches, refining the lines, the perspective and then move onto oil to complete was a particularly interesting discussion. 2. I know there are many analogies that we in computer science draw between our world and that of construction – here’s another. Look at how buildings are really constructed, the architect does not build blue prints, they draw or make a model of the envisioned building (some of these drawings have become as well known as the actual buildings themselves). For example, Frank Lloyd Wright’s Fallingwater started with a truly beautiful drawing that sold the client. Then followed floor plans and blueprints. Only then did wiring diagrams, plumbing details and specific engineering drawings for features such as the cantilevered balconies complete the story.Simon then goes on to state his position:
My position is that the creation of domain specific languages that do not seamlessly support the ability to transform information along the refinement scale are not helpful to us. So, for example, a component designer that is a stand alone tool unconnected to the class designer that provides the next logical level of refinement (classes being used to construct components) is a pot hole in the road from concept to actual implementation. Now, this is not as I have said to indicate that domain specific languages are bad, just that many of us in this industry love to create new languages be they graphical, textual or conceptual. We have to beware of the tendency to build these disjoint languages that force the user to keep stopping and jumping across another gap.I couldn't read this and not immediately be struck by Paul Graham's reflections on creating what became Yahoo Store, specifically his comments regarding lisp. Writing this it also occurred to me that RMS's comment in Why you should not use Tcl is also appropriate:
The principal lesson of Emacs is that a language for extensions should not be a mere "extension language". It should be a real programming language, designed for writing and maintaining substantial programs. Because people will want to do that! Extensions are often large, complex programs in their own right, and the people who write them deserve the same facilities that other programmers rely on....which can only apply doubly for
It also brings to mind the miriad of embedded dsl's spawned by the Haskell community though their wholesale adoption and exploitation of monads (and more recently arrows).
It only reinforces my increasing belief that the biggest gap in many popular modern languages is the lack of syntactic closure; the ability to introduce new syntatic support for a feature that becomes a first-class citizen of your programming environment.
Monday, June 28, 2004
...but at least it's done.
The problem is that calculating an accurate row count becomes a potentially expensive operation; you can generally only afford an upper-bound instead. So unfortunately while the semantics changed, the name stayed the same, to the general confusion of all.
Subsequentely I have spent the past 2.5 days reverting the semantics, and introducing new methods to access the upper-bound (and cardinality). Tedious work, but at least it's done.
Now on to getting resolvers to play nicely with transactions.
"So, what do you do for a living?"
My last job was with a company called Braintree, who make world class communication gateways --- mainly for the eftpos and financial industry. So I could always answer "I help design boxes to connect old EFTPOS machines to the bank using new technologies". It glosses over a lot, is largely incomplete, but remains something most people could comprehend. The worst job I've had to try and explain was my first. "I am writing the user-interface to an Electron Paramagnetic Resonance simulation"? I've seen geeks eyes glaze over on that one :).
So far for my current job I've had to revert to the classic "I'm a programmer in an IT company", which is sufficiently devoid of information to be mutually unsatisfying. So what am I currently working on? I am employed by Tucana Technologies to work on an open-source RDF database Kowari. Kowari is used by Tucana as the base on which we build our enterprise rdf-datastore TKS. OTOH, if having difficuty explaining my job is the price to pay for having this much fun I suppose it's worth it. Tucana is a great company to work for, and Kowari is really fun engineering. Still, if anyone can think of a one or two sentence description that isn't quite as insipid I would appreciate it.
Friday, June 25, 2004
Once more with feeling...
Let us start with my morning reading:
- Lambda The Ultimate - Probably the premiere blog on the topic of computer languages; their design, semantics, and implementation.
- Squawks of the Parrot - The blog of Dan Suglaski, the lead developer on parrot --- the new perl-6 vm.
- About Kim - Another blog. Kim's posts invariably betray a striking intelligence; are always thought provoking; and periodically on programming language topics.
- Groklaw - Because even geeks need soap-opera sometimes.
- Irregular Web Comic - There are other web comics I enjoy, but this has rapidly become my favourate.