XL Compiler Bootstrapped
descubes inputs: "An XL compiler bootstrapped two days ago (that means it compiled itself). Take a look at the project homepage to discover this language, designed around concept programming ideas, which is a sort of cross between C++, Lisp and XML. Much help is now needed to improve this rudimentary first iteration." One thing to note is that the C++ version of the compiler came in at 4500 lines, while the XL equivalent came in at some 2700 lines. This seems to imply that XL may be easier to work in than C/C++. Might XL someday be nudging the old workhouse out of a job in the near future?
That's a huge difference in line count between the two versions. If XL is that good a language, it may be worth learning. Now maybe I can get that 1400-line C++ program I've been working on for a year to be less than 1000 lines!
"When someone says "I want a programming language in which I need only say what I wish done," give him a lollipop."
-- Alan Perils
:)
The web site seems to completely lack examples. It also isn't apparent how they do 'objects' (ie bundles of data and the functions that operate on them). It just looks like a very poor man's version of Python to me.
Whoa...check out that SWEET hacker logo in the upper right corner .. anybody else check it?
That logo means this guy is a hacker (no, not the kind that break into computers illegally, the kind that have scrawny mustaches and like to shoot people with guns. Excuse me, like to shoot guns, not necessarily at people. But keep an eye on them anyway if you're a teacher or parent.)
Wow, anybody kool enough to use the neat-o hacker logo must have like the most AWESOME program evarrrrr!
I did not see support for "iterators" mentioned directly, but if the extension mechanism is strong enough that should be doable.
I'll be taking a careful look at it myself. These are some very powerful features. (Sather had many of these and was (in my experience) the best language I've ever used.) If C# had only put in decent syntax for some of these things I could have been persuaded that Microsoft was not the SAOE (Software Axis Of Evil), but they didn't.
No. Concept-programming focuses on the limits of abstractions, and consequently on the techniques that help building better abstractions. Concept programming is not what people do. I wish, but it just ain't so. This is discussed ad-nauseam on the Mozart web site.
I read the code for the compiler itself, and didn't really see the kind of abstraction I really wanted to see.
This is really interesting to me. What kind of abstraction would you have wanted there? Please note that the bootstrap compiler is very limited, like any bootstrap compiler, so I can't make use of many fancy features of the "theoretical" XL. But I'm relatively proud of the "translate" extension, for instance (http://xlr.sf.net/031105.html). I think this is a good example of higher-level abstraction. And it's what makes the XL version shorter than the C++ one.
While you can go ahead and create domain specific abstractions with syntax, the code to implement a nontrivial abstraction with reasonable semantics and syntax is equally or *more* complex than just using either domain specific tools separately, or using basic functional abstraction in the first place.
That is just not true. One data point: the symbolic derivation in XL (http://mozart-dev.sf.net/derivation.html) is a few hundred lines of code. The corresponding C++ equivalent using template meta-programming is a few thousands lines of code. The derivative expansion in the source code is shorter than the derivative meta-processing code if you use it only once. Just like inlining the code of a function is shorter than adding all these pesky prototypes if you use the function only once.
You can implement every abstraction buzzword ever mentioned with functional decomposition combined with a preprocessing pass. The important part is not the mechanics, since every programming language since lisp has these mechanics.
The objection "it's easy to build, here are the tools" is not a valid one in my opinion. "It's easy to build a kernel, all you need is a C compiler". Yeah, right.
The important part is the interface to the programmer... and that's a tough problem
And that's precisely where XL and Lisp differ the most. I think XL is more accessible to a majority of programmers, and can appeal to some who would not touch Lisp with a ten foot pole. Yet under the hood, it is so much like Lisp that Lisp-enabled programmers who would not touch C with a ten foot pole could like XL.
I believe you have a good background and could add valuable contribution to the project. Why don't you try to take "one more stab" at this kind of mutable language? ;-)
-- Did you try Tao3D? http://tao3d.sourceforge.net
What you *really* need is a better way for libraries, and other code, to expose their functionality.
Unix started down this road with 'everything is a file' but failed to follow through on that promise.
When the Unix creators decided to take what they already knew and start again, 'everything is a file' became a design philosophy.
Consequently, devices can be accessed through the file system
One can draw to a screen via files, or open a internet network connection
The magic for all off this is a unified protocol 9p. All file access is via 9p so if your program can speak 9p it can serve files to anyone. One binds a programs namespace into your own and off you go. The network becomes utterly transparent.
In this way one waves bye bye to bindings and other marshalling techniques, who needs 'em.
If your programming language can open and read and write files, it can do anything.
It is just one of the many benefits that plan9 has brought to us.
Too bad people are letting it slip past them.
There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
It's not in the looks. From http://xlr.sourceforge.net/info/xl.html:
A lot of ideas come from older languages.
Think C/C++... without the syntactic and semantic complexity.
Think Lisp... without the parentheses.
Think XML... with better support for highly structured data such as program.
There are links to explanations on the original page.
-- Did you try Tao3D? http://tao3d.sourceforge.net