git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [GSOC][PATCH] userdiff: add support for Scheme

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Mar 30, 2021, 12:56 UTC
Message-ID
<874kgsn6kb.fsf@evledraar.gmail.com>
In-Reply-To
<59DFC82F-A3EA-4637-94AE-4042697448FF@gmail.com>
On Tue, Mar 30 2021, Atharva Raykar wrote:
Show 49 quoted lines
> On 29-Mar-2021, at 15:38, Phillip Wood <phillip.wood123@gmail.com> wrote:
>> On 28/03/2021 13:40, Atharva Raykar wrote:
>>> On 28-Mar-2021, at 08:46, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
>>>> The "define-?.*" can be simplified to just "define.*", but looking at
>>>> the tests is that the intent? From the tests it looks like "define[- ]"
>>>> is what the author wants, unless this is meant to also match
>>>> "(definements".
>>> Yes, you captured my intent correctly. Will fix it.
>>>> Has this been tested on some real-world scheme code? E.g. I have guile
>>>> installed locally, and it has really large top-level eval-when
>>>> blocks. These rules would jump over those to whatever the function above
>>>> them is.
>>> I do not have a large scheme codebase on my own, I usually use Racket,
>>> which is a much larger language with many more forms. Other Schemes like
>>> Guile also extend the language a lot, like in your example, eval-when is
>>> an extension provided by Guile (and Chicken and Chez), but not a part of
>>> the R6RS document when I searched its index.
>>> So the 'define' forms are the only one that I know would reliably be present
>>> across all schemes. But one can also make a case where some of these non-standard
>>> forms may be common enough that they are worth adding in. In that case which
>>> forms to include? Should we consider everything in the SRFI's[1]? Should the
>>> various module definitions of Racket be included? It's a little tricky to know
>>> where to stop.
>> 
>> If there are some common forms such as eval-when then it would be good to include them, otherwise we end up needing a different rule for each scheme implementation as they all seem to tweak something. Gerbil uses 'def...' e.g def, defsyntax, defstruct, defrules rather than define, define-syntax, define-record etc. I'm not user if we want to accommodate that or not.
>
> Yes, this is the part that is hard for me to figure out. I am going by
> two heuristics: what Scheme communities in other places would generally
> prefer, and what patterns I see happen more often in scheme code.
>
> The former is tricky to do. I posted to a few mailing lists about this,
> but they don't seem active enough to garner any responses.
>
> The latter is a little easier to measure quickly. I did a GitHub search,
> where I filtered results to only consider Scheme files (language:scheme).
>
> Some armchair stats, just for a broad understanding:
>
>   Total number of scheme files: 529,339
>   No. of times a construct is used in those files:
>     define and its variants : 431,090 (81.4%)
>     def and its variants    :  18,466 ( 3.5%)
>     eval-when               :   3,375 ( 0.6%)
>
> There was no way for me to quickly know which of these uses are at the top
> level, but either way of the more structural forms that do show up in Scheme
> code, define and its variants seem like a clear winner. I am not sure if
> it's worth adding more rules to check for def and its variants, given that
> they are not nearly as common.

In those cases we should veer on the side of inclusion. The only problem we'll have is if "eval-when" is a "setq"-like function top-level form in some other scheme dialect, so we'll have a conflict.

Otherwise it's fine, programs that only use "define" won't be bothered by an eval-when rule.

Previous: Atharva RaykarNext: Atharva Raykar
Message 9 of 35 in “userdiff: add support for Scheme”
  1. Atharva RaykarMar 27, 2021
  2. Junio C HamanoMar 27, 2021
  3. Junio C HamanoMar 27, 2021
  4. Ævar Arnfjörð BjarmasonMar 28, 2021
  5. Junio C HamanoMar 28, 2021
  6. Atharva RaykarMar 28, 2021
  7. Phillip WoodMar 29, 2021
  8. Atharva RaykarMar 30, 2021
  9. Ævar Arnfjörð BjarmasonMar 30, 2021
  10. Atharva RaykarMar 30, 2021
  11. Atharva RaykarMar 28, 2021
  12. Atharva RaykarMar 28, 2021
  13. Junio C HamanoMar 28, 2021
  14. Atharva RaykarMar 29, 2021
  15. Junio C HamanoMar 29, 2021
  16. Phillip WoodMar 29, 2021
  17. Johannes SixtMar 27, 2021
  18. Atharva RaykarMar 28, 2021
  19. Phillip WoodMar 29, 2021
  20. Johannes SixtMar 29, 2021
  21. Ævar Arnfjörð BjarmasonMar 29, 2021
  22. Phillip WoodMar 29, 2021
  23. Atharva RaykarMar 30, 2021
  24. Atharva RaykarMar 30, 2021
  25. Phillip WoodApr 5, 2021
  26. Johannes SixtApr 5, 2021
  27. Atharva RaykarApr 6, 2021
  28. Phillip WoodApr 6, 2021
  29. [GSoC][PATCH v2 0/1] userdiff: add support for schemeAtharva Raykar, Apr 3, 2021
  30. [GSoC][PATCH v2 1/1] userdiff: add support for schemeAtharva Raykar, Apr 3, 2021
  31. Phillip WoodApr 5, 2021
  32. Atharva RaykarApr 6, 2021
  33. [GSoC][PATCH v3 0/1] userdiff: add support for schemeAtharva Raykar, Apr 8, 2021
  34. [GSoC][PATCH v3 1/1] userdiff: add support for SchemeAtharva Raykar, Apr 8, 2021
  35. Junio C HamanoApr 12, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.