├── .github ├── FUNDING.yml └── ISSUE_TEMPLATE │ └── enter-the-syntax-parse-bee.md ├── .gitignore ├── ANNOUNCEMENT.md ├── README.md └── img ├── logo-200.png └── logo.svg /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: racket 2 | custom: https://racket-lang.org/sfc.html 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/enter-the-syntax-parse-bee.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Enter the 2021 Syntax Parse bee 3 | about: form to submit entries 4 | title: "[entry - name/description of macro]" 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | Please enter the bee by submitting code (or links to code) for: 11 | 12 | 1. your macro 13 | 2. an example use of your macro 14 | 3. (optional) "before" code that your macro helps to improve 15 | 16 | Thank you for your submission! 17 | 18 | > If your entry is a PR to the [syntax parse examples repository](https://github.com/bennn/syntax-parse-example), please include a link to the PR. 19 | 20 | ## Macro 21 | 22 | > Paste the code for your macro here. 23 | > Please explain the purpose of the macro. 24 | 25 | 26 | ## Example 27 | 28 | > Illustrate one or more ways of using your macro. 29 | > Please show code and briefly describe what it does. 30 | 31 | 32 | ## Before and After 33 | 34 | > If you designed your macro to improve some existing code, please explain the improvements. 35 | > 36 | > Use the following categories if applicable: 37 | > - _Code Cleaning_ : Please share the code that you used to write before creating your macro. Briefly explain how the code works. 38 | > - _Macro Engineering_ : Please share the old macro that you revised. Briefly explain the changes. 39 | 40 | 41 | ## Licence 42 | 43 | > Please confirm that you are submitting this code under the same MIT License that the Racket language uses. 44 | > Please confirm that the associated text is licensed under the Creative Commons Attribution 4.0 International License 45 | 46 | ## Contact 47 | 48 | > To receive prizes and/or provide feedback please complete 49 | > the form at https://forms.gle/Z5CN2xzK13dfkBnF7 (google account not required / email optional). 50 | 51 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | \#* 3 | .\#* 4 | .DS_Store 5 | compiled/ 6 | /doc/ 7 | -------------------------------------------------------------------------------- /ANNOUNCEMENT.md: -------------------------------------------------------------------------------- 1 | # Syntax Parse Bee 2021 2 | 3 | ** the Bee is over ! Thank you all for participating ** 4 | 5 | Hi folks, 6 | 7 | **Write a macro with Racket this summer! Win stickers!** 8 | 9 | The purpose of this event is to grow the [syntax-parse-example](https://docs.racket-lang.org/syntax-parse-example/index.html) [documentation](https://docs.racket-lang.org/syntax-parse-example/index.html) and [repository](https://github.com/bennn/syntax-parse-example) to grow as a resource for the Racket community. (You can also contribute directly to the [syntax parse examples repository](https://github.com/bennn/syntax-parse-example)) 10 | 11 | _It's like a Quilting Bee, but for syntax parse macros!_ 12 | 13 | As we hope to include many new examples derived from the entries in the syntax-parse-example [documentation](https://docs.racket-lang.org/syntax-parse-example/index.html) and [repository](https://github.com/bennn/syntax-parse-example) we ask entrants to licence their code under the same MIT license [1] as used by Racket, and your text under the http://creativecommons.org/licenses/by/4.0/ license. 14 | 15 | Ground Rules: 16 | * you can write any macro as long as it uses [syntax-parse](https://docs.racket-lang.org/syntax/stxparse.html) somehow 17 | * enter as many times as you like 18 | * the first 20 individuals who enter will win exclusive stickers 19 | * open July 1 to September 1 20 | 21 | Submit by opening an issue here: [submit your entry](https://github.com/syntax-objects/Summer2021/issues/new?assignees=&labels=entry&template=enter-the-syntax-parse-bee.md&title=%5Bentry+-+name%2Fdescription+of+macro%5D) 22 | 23 | To help you get started, we suggest two categories of before-and-after macro: 24 | 25 | 1. Code Cleaning : Introduce a macro where there was none before. Look for ways 26 | to make your source code more beautiful and/or less repetitive. 27 | 28 | 2. Macro Engineering : Use the tools in syntax-parse to improve an existing 29 | macro (which may or may not currently use syntax-parse). Try to make the old 30 | macro more maintainable, more robust against errors, and/or more flexible. 31 | 32 | Updates will be via Racket News, Racket-Users, Slack, Discord & Reddit. 33 | 34 | Whatever you decide, we hope that you learn and have fun! 35 | 36 | - Ben + Stephen 37 | 38 | 39 | PS a 'Bee' is a community effort toward a common goal. A quilting bee is for 40 | making a quilt. In this case the quilt is a patchwork of syntax-parse macros. 41 | 42 | 43 | - - - 44 | 45 | ## Resources/notes 46 | 47 | ### Q. Why `syntax/parse` macros? 48 | 49 | A. `syntax/parse` provides functionality for writing macros and specifying syntax that automatically validates macro uses and reports syntax errors. 50 | 51 | 52 | ### Q. I've not written macros before how can I get started? 53 | 54 | A. The following resources are recommended, but if you run into trouble don't hesitate to ask for help on [racket-users](https://lists.racket-lang.org/), [Slack](https://racket-slack.herokuapp.com/), [Discord](https://discord.gg/6Zq8sH5) or [#racket IRC](https://kiwiirc.com/nextclient/irc.libera.chat/#racket). 55 | 56 | The [Fear of Macros tutorial](https://www.greghendershott.com/fear-of-macros/) is a great resource for basic macro engineering (though, not syntax-parse in particular). 57 | 58 | The Racket Guide also provides an introduction to macros, but like Fear of Macros doesn't cover Syntax Parse: 59 | https://docs.racket-lang.org/guide/macros.html 60 | 61 | Mythical Macros tutorial: 62 | https://soegaard.github.io/mythical-macros/ 63 | 64 | Macros and Languages in Racket book draft: 65 | http://rmculpepper.github.io/malr/ 66 | 67 | Syntax parse docs: 68 | https://docs.racket-lang.org/syntax/stxparse.html 69 | 70 | Syntax parse examples: 71 | https://docs.racket-lang.org/syntax-parse-example/ 72 | 73 | Extra syntax classes: 74 | https://docs.racket-lang.org/syntax-classes/ 75 | 76 | Racket includes a macro debugger to make it easier for experienced programmers to debug their macros and for novices to study their behavior. 77 | https://docs.racket-lang.org/macro-debugger/index.html 78 | 79 | Fine print: 80 | * this is an UNOFFICIAL event run by Racket users (@spdegabrielle and @bennn) 81 | * entries must be submitted under the [MIT license [1]](https://github.com/racket/racket/blob/master/racket/src/LICENSE-MIT.txt) for code, and [http://creativecommons.org/licenses/by/4.0/](http://creativecommons.org/licenses/by/4.0/) [3] license for the included text. 82 | * stickers will be mailed via USPS; international entries are allowed 83 | * please abide by the [Racket Friendly Environment Policy [2]](https://racket-lang.org/friendly.html) 84 | 85 | 86 | [1] https://github.com/racket/racket/blob/master/racket/src/LICENSE-MIT.txt 87 | 88 | [2] https://racket-lang.org/friendly.html 89 | 90 | [3] http://creativecommons.org/licenses/by/4.0/ 91 | 92 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Syntax Parse Bee Summer 2021 2 | 3 | [_A community-led Racket event. Click to see others, past & future._](https://docs.google.com/document/d/1OAGSAXk7AfhVLEcjyeihh2IXKX9ZhUM0ZvKnObP6kxk/edit) 4 | 5 | The Syntax Parse Bee is now over for 2021. 6 | 7 | Thank you to the participants!!! 8 | 9 | We received 22 entries from 15 individuals: 10 | 11 | https://github.com/syntax-objects/Summer2021/issues 12 | 13 | The final results of these submissions cover a wide range. Some are macros 14 | that you could use in any Racket project. Others are syntax classes. Still 15 | others are more like starter code for a new DSL. 16 | 17 | The code inside these submissions is very informative. Whether you're 18 | new to macros or a seasoned syntax parser, there is a lot to learn from. 19 | 20 | - Ben + Stephen 21 | -------------------------------------------------------------------------------- /img/logo-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syntax-objects/Summer2021/46c5f0e1897128139afb07205e2d5144b52e063a/img/logo-200.png -------------------------------------------------------------------------------- /img/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 24 | 46 | 48 | 49 | 51 | image/svg+xml 52 | 54 | 55 | 56 | 57 | 58 | 63 | 72 | 78 | 85 | 92 | 98 | 105 | 108 | 114 | 119 | 124 | 129 | 130 | #' 142 | Syntax Bee 2021 153 | 154 | 155 | --------------------------------------------------------------------------------