google / google/xls

Suggested Documentation Changes to "Tutorial: Basic Logic"

Open
#1,248 2 comments 0 reactions 1 assignee Claimed by @proppy View on GitHub
documentation
Dominant language
C++
Stars
1.9k
Forks
283
Avg merge
2d 10h
Merged PRs (30d)
135

Description

[doc link](https://google.github.io/xls/tutorials/float_to_int/)

* Bootstrapping
* In paragraph 2 "Function parameter declarations!" here are a few dashes that look like they are badly formatted and might be better off as list sub-items. Instead of:
`- u1, u8, and u23 are all shortcuts for the type uN[1], uN[8], and uN[23]. The uN[X] construct declares an X-bit wide unsigned type. There is also sN[X], which declares an X-bit wide signed type. - Other type shortcuts exist such as bitsX, bool (alias for uN[1]), and u[1-64] and s[1-64], being aliases for uN[1] through uN[64] and sN[1] through sN[64].`
How about
* `u1, u8, and u23 are all shortcuts for the type uN[1], uN[8], and uN[23]. The uN[X] construct declares an X-bit wide unsigned type. There is also sN[X], which declares an X-bit wide signed type.`
* `Other type shortcuts exist such as bitsX, bool (alias for uN[1]), and u[1-64] and s[1-64], being aliases for uN[1] through uN[64] and sN[1] through sN[64].`

* Line 4 of the `float_to_int` function does not have a trailing `;` which is crucial to how the block is evaluated. I don't have any experience with Rust-like languages and found out only after a lot of confusing type-related errors when trying to implement the `missing test cases` exercises. You could call this out in the example here, but it would probably be a good idea to include it somewhere in the language reference.

* Simple Logic
* Missing test cases: it might be a good idea to show what the code looks like for these. My initial attempts to get it working resulted in hard-to-understand type errors because I had an extra `;` at the end of the last line of an evaluated else block (see above).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.