Re:FemtoEmacs: Tiny Emacs clone with configuration in FemtoLisp
by soegaard on Wednesday August 24, 2016 @02:57PM
(#12354362)
Just a quick note to inform you that Racket now uses a new model for macro expansion. It is based on sets of scopes rather than the mark model used in syntax-case.
http://www.cs.utah.edu/plt/scope-sets/
The new model has also been used by Tim Disney and others to make macro expander for JavaScript (see the sweet.js project).
Re:FemtoEmacs: Tiny Emacs clone with configuration in FemtoLisp
by qwertyuiop924 on Wednesday August 24, 2016 @04:37PM
(#12355067)
At a glance, that looks a lot like that Syntactic Closures model: Modeling the environment as both mappings between variables and values, and identifiers and variables. However, I fail to see how renaming is problematic in recursive macros, save being unweildy. I'm not sure, but AFAICT, this may be a solution in search of a problem. It is interesting though, and might be an actual better solution. It's hard for me to tell without a long, slow readthrough, which may happen later.
But this is just a concrete instance of my opinion of Racket in a nutshell: Cool ideas, but sometimes overly complex for my liking, interesting systems that don't always mix well, a syntax over the ideas that I find distasteful on occasion, and documentation that is comprehensive, but hard to understand.
It's okay if you like it, and it's a good language for Getting S%#! Done, but it's not really my thing: I prefer Chicken: Simpler, less academic and cutting edge, but still really good at Getting S%#! Done. But that's my problem, not Racket's
>However, it's not "hygienic by default" -- you have to go out of your way to manually and explicitly ensure your er-macros are hygienic. Leave out a ,(rename 'foo) somewhere, and suddenly you've broken hygiene. Same problem with gensym, really, except that rename is a little nicer to use.
Well, I didn't say it was a great system, I just said if was hygenic, for the given value of hygenic.
>It's also a proposed addition for R7RS-large (SRFI-139).
Thanks. That actually does look pretty neat, although a bit odd in some ways.
>It's all in libraries. `#lang racket` is just a "metalibrary" that exports a bunch of smaller libraries. You can always do `#lang racket/base` and include the subset of libraries you need.
Well, there is that... But I'm still not a huge fan of Racket: I dislike where they diverged from Scheme (mcons? really?), syntax-case STILL leaves a bad taste in may mouth (see below), and the system as a whole just feels overly baroque to me.
>Not to talk shit about Alex -- he's a smart guy and Chibi is a very nice system -- but he's both seriously misinformed about syntax-case and hopelessly obstinate about it. Despite his claims that syntax-case is super complicated to implement, it's really not much more complicated than syntax-rules:
...I don't think that was Alex's objection to syntax-rules. It isn't mine. My objections are as follows:
-Breaking the standard macro abstraction by saying that expressions aren't, in fact, sexprs.
-Presenting an overy complex API to the programmer: lots and lots of functions, and a whole new read syntax.
-the (lambda (stx)) wrapper basically breaks every existing macroexpander, which, if it had a defined format in a given Scheme, probably used the format defined by sc. Why define that anyways?