GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Embed Notice

HTML Code

Corresponding Notice

  1. Embed this notice
    Panicz Maciej Godek (paniczgodek@functional.cafe)'s status on Sunday, 27-Apr-2025 02:34:44 JSTPanicz Maciej GodekPanicz Maciej Godek

    Some 8 years ago for my master thesis I wrote a simple macro expander for Scheme, which implemented a pattern language akin to syntax-rules.

    At that time, I didn't know about Matthew Flatt's "Let's Build a Hygienic Macroexpander" Strangeloop tutorial, the Clinger-Wand HOPL paper about hygienic macros wasn't yet written, and I didn't know anything about Kohlbecker's work .

    So I built a much simpler device - something that operated on s-expressions rather than syntax-objects, and something that doesn't track the scope of identifiers, but instead implements the following rules:
    - if a symbol was quoted, it was inserted verbatim into the substitution
    - if a symbol appears in both a pattern and a template, the form matched by the pattern is rewritten to the output
    - otherwise the expander inserts a gensym'd identifier

    I honestly think that this simple set of rules is better than the hygienic expander from syntax-rules: it is both simpler (no scope tracking) and more powerful (makes it easier to break hygiene, and doesn't require the use of generate-temporaries), but if someone wants to prove me wrong, I recently dug it up from my master thesis, and after a number of fixes, it currently works under Guile, and is available here:

    https://github.com/panicz/jsssssssss/blob/main/expander.scm

    In conversationabout a month ago from functional.cafepermalink

    Attachments


  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.