Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit 53a77a1

Browse files
authored
feat: big update, Language→Reference (#206)
1 parent 3fb8995 commit 53a77a1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+2512
-1048
lines changed

pages/_meta.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ export default {
1515
title: "Cookbook",
1616
type: 'page',
1717
},
18-
language: {
19-
title: "Language",
18+
ref: {
19+
title: "Reference",
2020
type: 'page',
2121
},
2222
ecosystem: {

pages/book/import.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Callout } from 'nextra-theme-docs'
44

55
Tact allows you to import Tact and [FunC](https://docs.ton.org/develop/func/overview) code — any given `.tact` or `.fc`/`.func` file can be imported into your project using an `import{:tact}` keyword.
66

7-
Additionally, Tact compiler has a versatile set of standard libraries, which come bundled in, but not included right away, see [Language→Libs→Overview](/language/libs/overview).
7+
Additionally, Tact compiler has a versatile set of standard libraries, which come bundled in, but not included right away, see [Standard libraries overview](/ref/standard-libraries).
88

99
<Callout type="warning" emoji="⚠️">
1010
NOTE: All imported code is combined together with yours, so it's important to avoid name collisions and always double-check the sources!
@@ -36,7 +36,7 @@ import "./relative/path/to/the/target/func/file.fc";
3636
import "../subfolder/imported/func/file.fc";
3737
```
3838

39-
But in order to use functions from such file, one has to declare them as `native` functions first. For example, when standard library [@stdlib/dns](/language/libs/dns) uses a `dns.fc` FunC file, it maps FunC functions to Tact ones like so:
39+
But in order to use functions from such file, one has to declare them as `native` functions first. For example, when standard library [@stdlib/dns](/ref/stdlib-dns) uses a `dns.fc` FunC file, it maps FunC functions to Tact ones like so:
4040

4141
```tact
4242
// FunC code located in a file right next to the current Tact one:
@@ -49,4 +49,4 @@ native dnsStringToInternal(str: String): Slice?;
4949

5050
## Standard libraries
5151

52-
See [Language→Libs→Overview](/language/libs/overview).
52+
See [Standard libraries overview](/ref/standard-libraries).

pages/book/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Book Overview
1+
# Book overview
22

33
import { Cards, Steps } from 'nextra/components'
44

55
Welcome to **The Tact Book** section (or just **The Book**), — an introductory book about the Tact language.
66

7-
Here are it's main contents:
7+
Here are its main contents:
88

99
<Steps>
1010

pages/book/integers.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Use underscores (`_`) to improve readability: $\mathrm{0b111\_111\_111}$ is equa
4646

4747
For example, arithmetic with dollars requires two decimal places after the dot — those are used for the cents value. But how would we represent the number \$$1.25$ if we're only able to work with integers? The solution is to work with _cents_ directly. This way, \$$1.25$ becomes $125$ cents. We simply memorize that the two rightmost digits represent the numbers after the decimal point.
4848

49-
Similarly, working with Toncoins requires nine decimal places instead of the two. Therefore, the amount of $1.25$ TON, which can be represented in Tact as [`ton("1.25"){:tact}`](/language/ref/common#ton), is actually the number $1250000000$. We refer to such numbers as _nano-tons_ (or _nanoToncoins_) rather than _cents_.
49+
Similarly, working with Toncoins requires nine decimal places instead of the two. Therefore, the amount of $1.25$ TON, which can be represented in Tact as [`ton("1.25"){:tact}`](/ref/api-comptime#ton), is actually the number $1250000000$. We refer to such numbers as _nano-tons_ (or _nanoToncoins_) rather than _cents_.
5050

5151
## Serialization
5252

pages/book/types.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ Tact doesn't support classical class inheritance, but instead introduces the con
140140

141141
A trait can also let the contract inheriting it to override the behavior of its [functions](/book/functions#virtual-and-abstract-functions) and the value of its [constants](/book/constants#virtual-and-abstract-constants).
142142

143-
Example of a trait [`Ownable`](/language/libs/ownable#ownable) from [`@stdlib/ownable`](/language/libs/ownable):
143+
Example of a trait [`Ownable{:tact}`](/ref/stdlib-ownable#ownable) from [`@stdlib/ownable`](/ref/stdlib-ownable):
144144

145145
```tact
146146
trait Ownable {
@@ -159,7 +159,7 @@ trait Ownable {
159159
}
160160
```
161161

162-
And the [contract](#contracts) that uses trait [`Ownable`](/language/libs/ownable#ownable):
162+
And the [contract](#contracts) that uses trait [`Ownable{:tact}`](/ref/stdlib-ownable#ownable):
163163

164164
```tact
165165
contract Treasure with Ownable {

pages/cookbook/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Cookbook Overview
1+
# Cookbook overview
22

33
import { Callout, Steps, Cards } from 'nextra/components'
44
import { OneIcon, FormulaIcon, DiagramIcon, DropperIcon, BoxIcon, IdCardIcon, WarningIcon, StarsIcon, RowsIcon, GearIcon, LightningIcon } from '@components/icons'

pages/cookbook/misc.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ nativeThrowUnless(39, number == 198);
2626
<Callout>
2727

2828
**Useful links:**\
29-
[`throw(){:tact}` in Language→Reference](/language/ref/advanced#throw)\
29+
[`throw(){:tact}` in Core library](/ref/core-debug#throw)\
3030
[Errors in Tact-By-Example](https://tact-by-example.org/03-errors)
3131

3232
</Callout>

pages/cookbook/random.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ number = random(1, 12);
2020
<Callout>
2121

2222
**Useful links:**\
23-
[`randomInt(){:tact}` in Language→Reference](/language/ref/random#randomInt)\
24-
[`random(){:tact}` in Language→Reference](/language/ref/random#random)
23+
[`randomInt(){:tact}` in Core library](/ref/core-random#randomInt)\
24+
[`random(){:tact}` in Core library](/ref/core-random#random)
2525

2626
</Callout>
2727

pages/cookbook/single-communication.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ send(SendParameters{
9191
["Sending messages" in the Book](/book/send#send-message)\
9292
["Message `mode`" in the Book](/book/message-mode)
9393
[`StringBuilder{:tact}` in the Book](/book/types#primitive-types)\
94-
[`Cell{:tact}` in Language→Reference](/language/ref/cells)
94+
[`Cell{:tact}` in Core library](/ref/core-cells)
9595

9696
</Callout>
9797

pages/cookbook/time.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if (currentTime > 1672080143) {
1919
<Callout>
2020

2121
**Useful links:**\
22-
[`now(){:tact}` in Language→Reference](/language/ref/common#now)\
22+
[`now(){:tact}` in Core library](/ref/core-common#now)\
2323
["Current Time" in Tact-By-Example](https://tact-by-example.org/04-current-time)
2424

2525
</Callout>

pages/cookbook/type-conversion.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ dump(coinsString); // "0.261119911"
6060
<Callout>
6161

6262
**Useful links:**\
63-
[`Int.toString(){:tact}` in Language→Reference](/language/ref/strings#inttostring)\
64-
[`Int.toFloatString(){:tact}` in Language→Reference](/language/ref/strings#inttofloatstring)\
65-
[`Int.toCoinsString(){:tact}` in Language→Reference](/language/ref/strings#inttocoinsstring)
63+
[`Int.toString(){:tact}` in Core library](/ref/core-strings#inttostring)\
64+
[`Int.toFloatString(){:tact}` in Core library](/ref/core-strings#inttofloatstring)\
65+
[`Int.toCoinsString(){:tact}` in Core library](/ref/core-strings#inttocoinsstring)
6666

6767
</Callout>
6868

pages/ecosystem/index.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Overview
1+
# Ecosystem overview
22

33
import { Cards, Steps } from 'nextra/components'
44

55
Welcome to the **Ecosystem** section — a bird-eye overview of Tact ecosystem, tools and ways you can start contributing to those!
66

7-
Here are it's main contents:
7+
Here are its main contents:
88

99
<Steps>
1010

@@ -20,4 +20,4 @@ Here are it's main contents:
2020
/>
2121
</Cards>
2222

23-
</Steps>
23+
</Steps>

pages/index.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ For custom plugins for your favorite editor and other tooling see the [Tools](/e
109109
Alternatively, take a look at the following broader sections:
110110
* [Book](/book) helps you learn the language step-by-step
111111
* [Cookbook](/cookbook) gives you ready-made recipes of Tact code
112-
* [Language](/language) provides a complete reference of the standard library, grammar and evolution process
112+
* [Reference](/ref) provides a complete glossary of the standard library, grammar and evolution process
113113
* Finally, [Ecosystem](/ecosystem) describes "what's out there" in the Tacts' and TONs' ecosystems
114114

115115
<Cards>
@@ -120,13 +120,13 @@ Alternatively, take a look at the following broader sections:
120120
/>
121121
<Cards.Card
122122
icon="🍲 "
123-
title="Examine the Cookbook"
123+
title="Grind the Cookbook"
124124
href="/cookbook"
125125
/>
126126
<Cards.Card
127127
icon="🔬 "
128-
title="Study the Language"
129-
href="/language"
128+
title="Skim the Reference"
129+
href="/ref"
130130
/>
131131
<Cards.Card
132132
icon="🗺️ "

pages/language/_meta.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

pages/language/index.mdx

Lines changed: 0 additions & 59 deletions
This file was deleted.

pages/language/libs/_meta.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

pages/language/libs/overview.mdx

Lines changed: 0 additions & 32 deletions
This file was deleted.

pages/language/ref/_meta.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)