An Algoloid that uses macros to define itself

Started by raiph

raiph

Hi plfers,

My focus is Perl 6, which I suspect folk here won't know about or care about. However, I'm also interested in the new (3 year old) experimental language 007. I've asked its creator if he would be comfortable with me posting about his language and he's given me a greenlight. I'm pretty confident that those working on 007 will be interested in anything folk here have to say about their journey. I will invite them here if anyone replies. Thanks for your attention.

In a recent comment, 007's creator Carl Mäsak wrote:

I want to build 007 as a language that explores not just what it means to be an Algoloid with macros, but also what it means to be an Algoloid that uses macros to define itself.

The point, as I understand it, is to build a non-homoiconic language with the power of lisp macros and a metacircular evaluator.

I'm hoping to elicit comments about his summary of what he wants and/or my formulation.

To leave you with a little more context, here are a couple other excerpts from his recent comment:

In October 2014, I implemented a super-tiny Lisp called ipso. The paper The Roots of Lisp was my inspiration, and I realized it was a really powerful thing for a language to be able to implement its own evaluation semantics in half a page of code, like on page 8 of that paper.

But, he continued:

sometime after that I told [someone] that what I'd really like was a bigger metacircular loop, where the language explained how to parse itself, and then to run the result.

Shortly after that … 007 was born. Its distant goal has always been to "close the loop", so to speak, and be able to express a Lisp-like metacircular parser that (a) is as capable as Perl 6's, or can be extended to be as capable, and (b) is "minimal" in the sense that each of its parts is there in service of something the parser itself needs.

ddrone

I haven't understood the goal about "using macros to define itself", though I admit I haven't read linked threads in detail. What exactly would be the difference from usual boostrapping?

raiph

Well, that didn't work out as I imagined it would.

First, quoting Carl:

Bootstrapping can certainly be done without macros. The very small metacircular evaluator in "The Roots of Lisp" is an example. I imagine 007 could also be bootstrapped (including macros) without using macros.

Given that macros are essentially there as a way to extend the parser, though, it makes sense to also use them in the implementing language (if that happens to be 007-with-macros). It's not macros' primary purpose to serve in bootstrapping, they might just occasionally be the right tool.

So I think I misunderstood what he was saying about his project.

And he chose not to come here to say that himself. I can't fault him for that given that I'd framed things incorrectly.

So, consider this thread a failed attempt to open discussion of something akin to a language that lived only briefly in my imagination. Sorry about the noise.

ddrone

So, consider this thread a failed attempt to open discussion of something akin to a language that lived only briefly in my imagination. Sorry about the noise.

No big deal, the forum isn't particularly high-traffic anyway :)

raiph

Thanks for being understanding.

I hope to have another go here at some point with something wildly different that also comes from my imagination, only I put it there a few decades ago and it's been evolving since and I actually understand a couple things about it. At least I think so. This feels like a good place to put a toe in the water of writing something about it.

Thanks again and catch ya later. :)

IvanV

We can't build something out of nothing. To bootstrap a language, we have to have a medium that is consisted of low level language definition. If this low level language is Turing complete, and we have a valid complete term rewriting system, we can bootstrap anything from that. But not without the startup medium.

raiph

Hi Ivan,

I really appreciate you commenting but I must apologize that I suspect I'm just ending up wasting folks' time as explained in my "Well, that didn't work out as I imagined it would." comment above.

Fwiw, 007 is already a fairly well fleshed out 3 year old language. But it's currently written in Perl 6. Perl 6 is itself written in Perl 6, but it has relatively basic vaguely lispy macros. 007 was/is a project to build much more powerful lisp-like macros for Perl 6. As I understand things, Carl now wants to re-imagine 007, and macros in Perl 6, and a future Perl 6 that integrates the ideas from 007, with the concept in mind that I quoted in the title of this post as he elaborats in the quote I've included in my "didn't work out" comment.

If that's all too confusing, I again apologize and encourage you to just ignore this thread and me too for now. :)