<p>My esolang involves the use of balanced brackets <code>(){}[]&lt;&gt;</code> to denote different scopes. However, unlike practical languages, all pairs of identical brackets denote the <em>same</em> scope:</p>
<pre class="lang-bash prettyprint-override"><code>(a=1,b=2)
&lt;a=10,b=20&gt;
{j=5,k=6}
(c=a+b) # c=3, because in the () scope, a=1 and b=2
</code></pre>
<p>I want to give users more than 4 scopes, through Unicode bracket characters.</p>
<p><strong>What Unicode bracket characters are there that are mirrors of each other, like <code>(){}[]&lt;&gt;</code>?</strong></p>

<syntax><scoping><unicode><esolang><tokens>
What options in Unicode are there for balanced pairs of brackets like `(){}[]<>`?
CC BY-SA 4.0
2023-07-18T11:51:57.917Z
Off-topic: out of curiosity, how do scopes connect? If not, aren't they just different code/functions/programs interwoven?
Pablo H
CC BY-SA 4.0
2023-07-18T13:06:09.007Z
@PabloH The esolang was made as a 5-minute example for this question, but if it were ever implemented there'd probably be some mechanism to interface between scopes.
bigyihsuan
<h1>Triple-brackets for GPU computing with CUDA</h1>
<p>The webpages provided in the <a href="https://langdev.stackexchange.com/a/1391/34">answer by Jon Purdy</a> and in the <a href="https://langdev.stackexchange.com/a/23/34">answer by Adám</a> together provide a huge list of single-character delimiters, but after seeing the <a href="https://langdev.stackexchange.com/a/1346/34">answer by nchistov</a> which gives examples of &quot;two-character delimiters&quot; like <code>&lt;- [...] -&gt;</code> in HTML and <code>{% [...] %}</code> in Jinja, I'll go one step further and give an example of a &quot;three-character delimiter&quot; <em><strong>which is used a lot when programming for GPUs.</strong></em></p>
<p>In CUDA, the &quot;triple angle brackets&quot; are used to make a call from a &quot;host&quot; (such as the main computer) to a &quot;device&quot; (such as one of the computer's GPUs). An example of this can be seen in <strong>line 2</strong> of the following &quot;Hello World&quot; code:</p>
<pre><code>int main( void ) {
    kernel&lt;&lt;&lt; 1, 1 &gt;&gt;&gt;();
    printf( &quot;Hello, World!\n&quot; );
    return 0;
}
</code></pre>
<p>The numbers beween the triple angle brackets are the number of blocks per grid, and the number of threads per block (in that order), so in the above code, since all we were doing was &quot;Hello World&quot;, it was a &quot;single-threaded&quot; operation with 1 thread per block and 1 block per grid, but if we wanted to make full use of the GPU by doing a &quot;multi-threaded&quot; operation, for example if we have the following:</p>
<pre><code>add&lt;&lt;&lt; 256, 1&gt;&gt;&gt;() 
</code></pre>
<p>instead of running the <code>add()</code> function once, on a single-thread, we will have 256 copies of the kernel running in parallel.</p>

CC BY-SA 4.0
2023-11-12T18:28:52.480Z
2023-11-12T18:28:52.480Z
Nike Dattani
<p>Here are a few (not a complete list):</p>
<ul>
<li>Single angled brackets: <code>‹›</code> (U+2039, U+203A)</li>
<li>Double angled brackets: <code>«»</code> (U+00AB, U+00BB)</li>
<li>Superscript parentheses: <code>⁽⁾</code> (U+207D, U+207E)</li>
<li>Subscript parentheses: <code>₍₎</code> (U+208D, U+208E)</li>
<li>Angled bracket: <code>〈〉</code> (U+2329, U+232A)</li>
<li>Bold parentheses: <code>❪❫</code> (U+276A, U+276B)</li>
<li>Bold angled brackets: <code>❮❯</code> (U+276E, U+276F)</li>
<li>Bold curly brackets: <code>❴❵</code> (U+2774, U+2775)</li>
<li>Full width parentheses: <code>（）</code> (U+FF08, U+FF09)</li>
<li>Full width square brackets: <code>［］</code> (U+FF3B, U+FF3D)</li>
<li>Full width curly brackets: <code>｛｝</code> (U+FF5B, U+FF5D)</li>
</ul>
<p>Feel free to edit in more.</p>

CC BY-SA 4.0
2023-05-16T17:26:43.157Z
2023-05-16T17:26:43.157Z
The Thonnu
<p>Matching delimiters in Unicode are defined according to their general category:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>GC</th>
<th>General Category</th>
<th>Number of Code Points</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Ps</strong></td>
<td><a href="https://www.fileformat.info/info/unicode/category/Ps/list.htm" rel="noreferrer">punctuation, open</a></td>
<td>79†</td>
</tr>
<tr>
<td><strong>Pe</strong></td>
<td><a href="https://www.fileformat.info/info/unicode/category/Pe/list.htm" rel="noreferrer">punctuation, close</a></td>
<td>77</td>
</tr>
<tr>
<td><strong>Pi</strong></td>
<td><a href="https://www.fileformat.info/info/unicode/category/Pi/list.htm" rel="noreferrer">punctuation, initial quote</a></td>
<td>12‡</td>
</tr>
<tr>
<td><strong>Pf</strong></td>
<td><a href="https://www.fileformat.info/info/unicode/category/Pf/list.htm" rel="noreferrer">punctuation, final quote</a></td>
<td>10</td>
</tr>
</tbody>
</table>
</div>
<p> † 77 plus low-9 quotation marks ‡ 10 plus high-9 quotation marks</p>
<p>Conveniently, Unicode handles matching brackets explicitly, because the <a href="https://www.unicode.org/reports/tr9/" rel="noreferrer">Unicode Bidirectional Algorithm</a> needs to ensure they work properly in different script orientations. The official listings are in the Unicode database; <a href="https://www.unicode.org/Public/UCD/latest/ucd/BidiBrackets.txt" rel="noreferrer"><code>BidiBrackets.txt</code></a> lists the bracket characters, and <a href="https://www.unicode.org/Public/UCD/latest/ucd/BidiMirroring.txt" rel="noreferrer"><code>BidiMirroring.txt</code></a> gives the mirrored pairs:</p>
<blockquote>
<p>This data file lists characters that have the Bidi_Mirrored=Yes property value, for which there is another Unicode character that typically has a glyph that is the mirror image of the original character's glyph.</p>
</blockquote>
<p>Vertical presentation forms can be cross-referenced in <a href="https://www.unicode.org/Public/UCD/latest/ucd/VerticalOrientation.txt" rel="noreferrer"><code>VerticalOrientation.txt</code></a> if you want to exclude those. The quotation marks (Pi &amp; Pf) are also paired nearly 1:1; in normal text, it depends on locale whether they should be considered opening or closing, although programming languages are usually locale-insensitive.</p>

CC BY-SA 4.0
2023-06-05T00:24:07.973Z
2023-06-05T00:24:07.973Z
Jon Purdy
<p>Also you can use double brackets.</p>
<p>Like this (like HTML/XML comments):</p>
<pre><code>&lt;- ... -&gt;
</code></pre>
<p>Or this (like in Jinja):</p>
<pre><code>{{ ... }}
</code></pre>
<p>Or this (in Jinja too):</p>
<pre><code>{% ... %}
</code></pre>

CC BY-SA 4.0
2023-06-02T06:53:28.513Z
2023-06-09T07:58:26.817Z
2023-06-09T07:58:26.817Z
чистов_n
<p>Xah Lee has <a href="http://xahlee.info/comp/unicode_matching_brackets.html" rel="noreferrer">a comprehensive list</a>:</p>
<blockquote>
<p>Western quotation “ ” ‘ ’ ‹ › « »<br />
Low-9 quotation „ ‚<br />
Full width brackets （ ） ［ ］ ｛ ｝ ｟ ｠<br />
White variants ⦅ ⦆ 〚 〛 ⦃ ⦄<br />
Asian 「 」 〈 〉 《 》 【 】 〔 〕 ⦗ ⦘<br />
Asian white variant 『 』 〖 〗 〘 〙<br />
Half width variant ｢ ｣<br />
Math ⟦ ⟧ ⟨ ⟩ ⟪ ⟫ ⟮ ⟯ ⟬ ⟭ ⌈ ⌉ ⌊ ⌋ ⦇ ⦈ ⦉ ⦊<br />
Decorative ❛ ❜ ❝ ❞ ❨ ❩ ❪ ❫ ❴ ❵ ❬ ❭ ❮ ❯ ❰ ❱ ❲ ❳<br />
Arabic ornate parenthesis. (You need Arabic font) ﴾ ﴿<br />
More angle brackets 〈 〉 ⦑ ⦒ ⧼ ⧽<br />
Small variants ﹙ ﹚ ﹛ ﹜ ﹝ ﹞<br />
superscript, subscript variants ⁽ ⁾ ₍ ₎<br />
Square bracket variants ⦋ ⦌ ⦍ ⦎ ⦏ ⦐ ⁅ ⁆<br />
⸢ ⸣ ⸤ ⸥<br />
Misc brackets ⟅ ⟆ ⦓ ⦔ ⦕ ⦖ ⸦ ⸧ ⸨ ⸩ ⧘ ⧙ ⧚ ⧛<br />
Paraphrase ⸜ ⸝ Omission ⸌ ⸍ Substitution ⸂ ⸃ ⸄ ⸅ Transposition ⸉ ⸊<br />
᚛ ᚜ ༺ ༻ ༼ ༽<br />
Vertical Brackets<br />
Vertical ⏜ ⏝ ⎴ ⎵ ⏞ ⏟ ⏠ ⏡<br />
Vertical representation form ﹁ ﹂ ﹃ ﹄ ︹ ︺ ︻ ︼ ︗ ︘ ︿ ﹀ ︽ ︾ ﹇ ﹈ ︷ ︸</p>
</blockquote>

CC BY-SA 4.0
2023-05-16T17:26:44.040Z
2023-05-16T17:26:44.040Z
Adám
# What options in Unicode are there for balanced pairs of brackets like `(){}[]<>`?
Posted by: username_0 on 2023-05-16
My esolang involves the use of balanced brackets (){}[]<> to denote different scopes. However, unlike practical languages, all pairs of identical brackets denote the same scope:
(a=1,b=2)

{j=5,k=6}
(c=a+b) # c=3, because in the () scope, a=1 and b=2

I want to give users more than 4 scopes, through Unicode bracket characters.
What Unicode bracket characters are there that are mirrors of each other, like (){}[]<>?
**Tags:** syntax scoping unicode esolang tokens
> **Comments:**
> **username_1**: Off-topic: out of curiosity, how do scopes connect? If not, aren't they just different code/functions/programs interwoven?  
> **username_0**: @PabloH The esolang was made as a 5-minute example for this question, but if it were ever implemented there'd probably be some mechanism to interface between scopes.  
---
## 5 answers
### Answer by username_4 on 2023-06-05. Score: 16 | Accepted answer
Matching delimiters in Unicode are defined according to their general category:

| GC | General Category | Number of Code Points |
| --- | --- | --- |
| **Ps** | [punctuation, open](https://www.fileformat.info/info/unicode/category/Ps/list.htm) | 79† |
| **Pe** | [punctuation, close](https://www.fileformat.info/info/unicode/category/Pe/list.htm) | 77 |
| **Pi** | [punctuation, initial quote](https://www.fileformat.info/info/unicode/category/Pi/list.htm) | 12‡ |
| **Pf** | [punctuation, final quote](https://www.fileformat.info/info/unicode/category/Pf/list.htm) | 10 |

 † 77 plus low-9 quotation marks ‡ 10 plus high-9 quotation marks

Conveniently, Unicode handles matching brackets explicitly, because the [Unicode Bidirectional Algorithm](https://www.unicode.org/reports/tr9/) needs to ensure they work properly in different script orientations. The official listings are in the Unicode database; [`BidiBrackets.txt`](https://www.unicode.org/Public/UCD/latest/ucd/BidiBrackets.txt) lists the bracket characters, and [`BidiMirroring.txt`](https://www.unicode.org/Public/UCD/latest/ucd/BidiMirroring.txt) gives the mirrored pairs:

> This data file lists characters that have the Bidi\_Mirrored=Yes property value, for which there is another Unicode character that typically has a glyph that is the mirror image of the original character's glyph.

Vertical presentation forms can be cross-referenced in [`VerticalOrientation.txt`](https://www.unicode.org/Public/UCD/latest/ucd/VerticalOrientation.txt) if you want to exclude those. The quotation marks (Pi & Pf) are also paired nearly 1:1; in normal text, it depends on locale whether they should be considered opening or closing, although programming languages are usually locale-insensitive.
---
### Answer by username_6 on 2023-05-16. Score: 25
Xah Lee has [a comprehensive list](http://xahlee.info/comp/unicode_matching_brackets.html):

> Western quotation “ ” ‘ ’ ‹ › « »  
> Low-9 quotation „ ‚  
> Full width brackets （ ） ［ ］ ｛ ｝ ｟ ｠  
> White variants ⦅ ⦆ 〚 〛 ⦃ ⦄  
> Asian 「 」 〈 〉 《 》 【 】 〔 〕 ⦗ ⦘  
> Asian white variant 『 』 〖 〗 〘 〙  
> Half width variant ｢ ｣  
> Math ⟦ ⟧ ⟨ ⟩ ⟪ ⟫ ⟮ ⟯ ⟬ ⟭ ⌈ ⌉ ⌊ ⌋ ⦇ ⦈ ⦉ ⦊  
> Decorative ❛ ❜ ❝ ❞ ❨ ❩ ❪ ❫ ❴ ❵ ❬ ❭ ❮ ❯ ❰ ❱ ❲ ❳  
> Arabic ornate parenthesis. (You need Arabic font) ﴾ ﴿  
> More angle brackets 〈 〉 ⦑ ⦒ ⧼ ⧽  
> Small variants ﹙ ﹚ ﹛ ﹜ ﹝ ﹞  
> superscript, subscript variants ⁽ ⁾ ₍ ₎  
> Square bracket variants ⦋ ⦌ ⦍ ⦎ ⦏ ⦐ ⁅ ⁆  
> ⸢ ⸣ ⸤ ⸥  
> Misc brackets ⟅ ⟆ ⦓ ⦔ ⦕ ⦖ ⸦ ⸧ ⸨ ⸩ ⧘ ⧙ ⧚ ⧛  
> Paraphrase ⸜ ⸝ Omission ⸌ ⸍ Substitution ⸂ ⸃ ⸄ ⸅ Transposition ⸉ ⸊  
> ᚛ ᚜ ༺ ༻ ༼ ༽  
> Vertical Brackets  
> Vertical ⏜ ⏝ ⎴ ⎵ ⏞ ⏟ ⏠ ⏡  
> Vertical representation form ﹁ ﹂ ﹃ ﹄ ︹ ︺ ︻ ︼ ︗ ︘ ︿ ﹀ ︽ ︾ ﹇ ﹈ ︷ ︸
---
### Answer by username_5 on 2023-06-02. Score: 12
Also you can use double brackets.
Like this (like HTML/XML comments):
<- ... ->

Or this (like in Jinja):
{{ ... }}

Or this (in Jinja too):
{% ... %}
---
### Answer by username_3 on 2023-05-16. Score: 3
Here are a few (not a complete list):

* Single angled brackets: `‹›` (U+2039, U+203A)
* Double angled brackets: `«»` (U+00AB, U+00BB)
* Superscript parentheses: `⁽⁾` (U+207D, U+207E)
* Subscript parentheses: `₍₎` (U+208D, U+208E)
* Angled bracket: `〈〉` (U+2329, U+232A)
* Bold parentheses: `❪❫` (U+276A, U+276B)
* Bold angled brackets: `❮❯` (U+276E, U+276F)
* Bold curly brackets: `❴❵` (U+2774, U+2775)
* Full width parentheses: `（）` (U+FF08, U+FF09)
* Full width square brackets: `［］` (U+FF3B, U+FF3D)
* Full width curly brackets: `｛｝` (U+FF5B, U+FF5D)

Feel free to edit in more.
---
### Answer by username_2 on 2023-11-12. Score: 2
Triple-brackets for GPU computing with CUDA
The webpages provided in the answer by Jon Purdy and in the answer by Adám together provide a huge list of single-character delimiters, but after seeing the answer by nchistov which gives examples of "two-character delimiters" like <- [...] -> in HTML and {% [...] %} in Jinja, I'll go one step further and give an example of a "three-character delimiter" which is used a lot when programming for GPUs.
In CUDA, the "triple angle brackets" are used to make a call from a "host" (such as the main computer) to a "device" (such as one of the computer's GPUs). An example of this can be seen in line 2 of the following "Hello World" code:
int main( void ) {
    kernel<<< 1, 1 >>>();
    printf( "Hello, World!\n" );
    return 0;
}

The numbers beween the triple angle brackets are the number of blocks per grid, and the number of threads per block (in that order), so in the above code, since all we were doing was "Hello World", it was a "single-threaded" operation with 1 thread per block and 1 block per grid, but if we wanted to make full use of the GPU by doing a "multi-threaded" operation, for example if we have the following:
add<<< 256, 1>>>() 

instead of running the add() function once, on a single-thread, we will have 256 copies of the kernel running in parallel.
---
