

That’s it. I’ve about had it. I’ve been working with C# now for a long time, and there are many things I like about it. But the structure for structure’s sake, lack of easy to implement multiple dispatch, and other such nonsense is starting to eat me for breakfast.
It’s time for a change, or at least some more education and investigation. So… in the weeks of past I’ve been feverishly investigating new and exciting frontiers. I’ll admit this is more than just looking for a language to use, it’s and investigation of techniques and methodology as much as it is a search for the golden fleece of utilitarian bliss.
I’ve made a few stops of late, and I’m now going to describe what I’ve found. Before I delve right in, I want to make you aware of my initial biases: I’m not looking for something to interface with Relational Databases. I write code for Relavance knowledge bases now, and I don’t intend to crush my thoughts back into flat tabular form anytime soon. So I have a few avenues that are already open for me to get data to and from Relavance. One is a .NET API written by my friend and collegue Dylan Currier, of Levitronics in Canada called AbstractThought. Another is a COM interface to a set of VB6 DLL’s written by the Inventors and Masters of Relavance technology (we’ll call them RE and PT for now) and company. These are temporary limitations, but I’m working within them at the very… My ideal scenario is to implement another multi-user server head as a TCP/IP front for a virtual machine, using lock-free I/O completion ports to simulate prioritized multitasking. The Virtual machine is based on a stack machine design, so the nodes therein are to be of the dynamic variety. I will either implement some kind of Tagged Union structure to represent a stack node as a Variant of sorts, or do some fancy conversion algorithms to get things hopping with multiple types of nodes. The parser, well that’s the easy part, I’m going to write the grammar for Gold Parser Builder, and have the parser emit instructions for my VM. I plan to use either the Calitha Engine or the Morozov engine as the parser implementation. My old implementation of this language actually hard compiled the code to MSIL assemblies, but I want to be able to run it in lower security environments, (read Commercial Hosting,) as well as avail TCP/IP raw (instead of .NET remoting as it stands at the moment.) And lets face it, a query language should not have to build DLLS for every operation
That’s just silly.
First Stop: Ruby. I can’t get too much into the details here because I’m saving my material for an expose on Ruby for C# developers that I’m publishing for DevX.com. I’ll post a link when it comes up. Suffice it to say that Ruby has many nifty features such as dynamism and continuations as well as a simplified syntax, but COM interop is at best difficult, and at worst, slower than molases. And it’s not quite .NET ready yet because Mr. John Lam is a VERY busy employee of Microsoft now, and understandably doesn’t get as much time to pump this sucker out at the moment as he once did.
Second Stop: Forth. Forth is very nice for implementing a stack machine because, well, it is a stack machine, and it’s syntax is stack oriented. The only problem I have with it is that I’d have to implement my own embeddable version of it in .NET to allow for my extensions, so I just decided to keep looking for the moment. I haven’t ruled it out, but I can’t say I’m leaning toward it. Simple translation at the parser layer would be efficient in that step, but a stack over a stack over a stack machine seems to be pushing the envelope a little in the terms of runtime efficiency. I do admit that I haven’t actually run a performance test to justify my thinking on this one.
The third stop: Well this is sort of more than a stop, it’s a miniature journey of it’s own… Functional Languages. I’ve taken the time to learn the basics of LISP and SML (thanks LtU!) and even had a small crack at Scheme. These languages are beautiful to be sure, and elegant beyond words, but being so, they are difficult to make an imperative run on top of, at least with my current level of experience with them. I have to say that I have very much respect for the folks who make these their bread and butter, and indeed I can learn a lot from their examples. Unfortunately I am an aging unix hacker turned .NET coder, and my quickly aging C (not ++) rooted skills aren’t sharp enough to absorb all that I need to in this realm in time to put together something useful, not to mention efficient in a Functional language. I will say that with the combination of SML.net and LSharp, there are two very good embeddable options for interoperating with the .NET API AbstractThought.
So, then, what about languages LIKE c#?
Stop 4 was a very close call, and I almost stopped here for good: Nemerle. It’s a META-programming extension to C#, and apart from some slick built-in shortcuts and macros (compile-time macros are one of the key features of the language!) it pretty much is C# masked by a few nicer syntacticly sweet constructs. Still a tiny bit rigid for what I want, as in want to be able to use yesterday.
So then I found it… The damned near holy grail for a frustrated C# coder such as myself… Boo. No, I’m not trying to scare you (Yeah, see how funny I am? That was hilarious.) it’s the name of the language. It’s a very nice hybrid of C# and Python (what?) It’s much like C# in syntax, if you could take out 80% of the non-code jibberish that you have to write in C#, but it’s also SO much more. It has closures (which don’t have to be confusing like anonymous methods in Whidbey) and the real kickers: Optional Duck Typing and Native support for Multiple Dispatch. I can’t say for certain that I’ll be here forever, or even a very long time, but the wonderful syntactic terseness that’s inspired by Python, and the type conventions of C# rolled into an easy to read language make this sucker a promising candidate. The language is an allstar cast of my favorite features of Python (short syntax for classes, optionally based on whitespace-as-blocks) the ability to declare Modules (a common feature of modern languages of late fame to aggregate static utility-ish functions into a structure that make sense on it’s own without having instances.) Free floating functions which can be used as objects (like functors, but even better - Closures), and what appears to the common observer to be LISP-Like List contruction (actually a masked IList structures like an array list, but the native syntactical support and conventions encourage the use in a more sensical and natural way than simply instantiating an ArrayList and casting it to IList). Last, but not least among the spectacular feature set is the very active development and improvement of the language which is quickly bringing it in line with other fully Whidbey-savvy languages through the incorporation of Generics. The list moves several times a day, and the bugfix discovery to resolution rate of late is very good. Possibly best of all, it works on Mono and is natively supported in SharpDevelop, which makes hacking it very user friendly for all of you superior operating systems fans.
So for now… Boo is Best, and I’m working through the conversion of some of my more murky code base to it. I’m testing my chops out by implementing a manual DAL over relavance for object persistence in a particular application, but once I get this off the ground in earnest, I’m going to implement the virtual machine a-here.
On a side note: investigation for a query language is a tough business, there are a lot of things to consider, or at least there were until I found SQLite.org. I of course don’t really want to implement SQL proper becasue it doesn’t lend itself very nicely to associative methodology, but I do like having most of the idioms I’ll be using exemplified, not the least of which being how to use a virtual machine to query a knowledge store.
On an even Sider note: REBOL was recommended to me by one of my unwitting mentors and it has a lot of potential. I will need a little time to get my head around the idea of using a simple syntax language that pretty much does everything under the sun. Of particular note, the guy who invented REBOL also happens to be the genius behind the magical simplicity of yore, the Amiga.




More Options ...

Categories
Tag Cloud
Blog RSS
Comments RSS

Void (Default)
Life
Earth
Wind
Water
Fire
Lightweight
11:46 pm - April 13th, 2007
It seems we are traveling down the same road. I’ve been playing with Gold Parser Builder (see my blog) and I’m keenly interested in your work with Relavance, something I was painfully unaware of and am now just learning about thanks to your latest blog.
10:45 pm - April 28th, 2007
Just a sort of FYI, there is some more info to be released and explicated shortly, and I won’t be so patronizing next article, I promise. I didn’t like the ‘lets pretend’ theme as much as I thought, but I’m not the type to go back and ‘revise’ a blog entry that probably less than 100 people read currently anyway.