Chris Knott
01/10/2021, 7:08 PMDavid Piepgrass
01/10/2021, 9:59 PMDavid Piepgrass
01/11/2021, 6:52 PMDavid Piepgrass
01/14/2021, 2:38 AMRay Imber
01/14/2021, 10:07 PMDavid Piepgrass
01/15/2021, 4:49 AMRay Imber
01/15/2021, 5:22 AMchange_temporarily
is in fact built up of several lower level macros is it not? And this required you to implement several other fairly complicated bits of infrastructure, including collection_with_change_events
(if that's not boilerplate / ceremony code, idk what is) and your macro macro
to interface with the C# interactive engine. You don't deal with the C# interactive engine directly in your change_temporarily
macro (though you could in theory), instead you have built up to it using a series of lower level macros that you progressively develop.
I don't mean to imply this is a bad thing! I believe what you are doing is fundamental to the nature of macro systems. You inevitably build up infrastructure organically on top of itself like this. What is interesting to me is the shape macros take in an imperative Algol descendent language compared to a lisp ends up being very different (more verbose).
As the resident shill for the fringe language Nim in this community, which has a very similar macro system (at least on the surface), I can tell you that Nim has run into many of the same issues you are running into. This appears to be an interesting case of convergent evolution.David Piepgrass
01/15/2021, 5:45 AMchange_temporarily
is built on the on_finally
macro, that's true, but I don't see how this is any different from Lisp where macros are even more ubiquitous. Can you give an example of something that would end up more verbose in LeMP (or Nim, though I haven't used Nim nor Lisp) than in Lisp?
CollectionWithChangeEvents
isn't used by anything at all (I wrote it and then decided I didn't need it after all). macro
is, of course, a macro, but in a Lisp I understand that one typically also uses a macro to define other macros.
I don't think this is fundamentally a matter of Algol (conventional) languages vs Lisps. The "Loyc tree" way of seeing things is intended to abolish most of the differences between "Lisps" and "Algols", so that the only differences left are the parser, printer and some historical baggage that neither type of language is able to shed.
And by the way, something that might not be obvious is that I'm trying to shift C# from being a "statement-based" language to a "expression-based" language like Lisp is. So Enhanced C# is fundamentally expression-based, e.g. the statement if (c) Foo();
is perfectly equivalent to the expression #if(c, Foo())
.
Admittedly there can be some "ceremony" necessary to bridge this gap, e.g. the case
statement expects an expression argument, so if the user wants to write a statement in its natural form if (c) Foo();
, the user must enclose the statement in braces, and the case
statement must in turn remove the braces before processing the syntax tree. I would say this falls into the category of historical baggage - there is no reason an Algol-style language can't embrace an expression-based nature from the start, like LES does. In addition, since LeMP is a preprocessor it does face substantial difficulties as a result of the fact that it can't add features to C# itself.David Piepgrass
01/15/2021, 6:00 AMDavid Piepgrass
01/15/2021, 6:23 AMRay Imber
01/15/2021, 7:46 AMcase
😛
https://github.com/nim-lang/Nim/issues/12874Doug Moen
04/19/2021, 1:26 PMnow that I think about it, I can't name a single Algol-style language, other than my own LES, that rejected the statement/expression dichotomyAlgol 68 is an expression-oriented language. It doesn't have macros, though. The family of functional languages including ML and Haskell are strongly influenced by Algol, and are also expression oriented. Maybe you meant C-style language?
David Piepgrass
04/28/2021, 4:37 AM