DrSensor / DrSensor/nusa

Runtime nominal types

Open
#31 0 comments 0 reactions 0 assignees View on GitHub
decorator enhancement priority: low
Dominant language
JavaScript
Stars
4
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Sized types

### Traits
- can be used as decorator which either **c**lamp or bitshift the value when the accessor is set/assigned
- can be used as TypedArray specifier for `@allocate` decorator
> **💡 Tip**: see AssemblyScript [portable](https://www.assemblyscript.org/compiler.html#portable-overflows) standard [library](https://github.com/AssemblyScript/assemblyscript/blob/main/std/portable/index.js#L21-L105)

### Types
- `u8` `u8c` `i8` `i8c`
- `u16` `u16c` `i16` `i16c`
- `u32` `u32c` `i32` `i32c` `f32` `f32c`
- `u64` `i64` `f64`
> **Note** `@spawn(number, u8c)` will use [Uint8ClampedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) as the backed array

## Time types

### Traits
> exactly similar to Go
- can be used as multiplier
- assume the target multiplier is in millisecond

### Types
- `us` `ns` `ms` `s` `m` `h` `d` `w` `mo` `yr`
- `GHz` `MHz` `kHz` [`fps`|`Hz`] `mHz` `uHz` `nHz` `pHz`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.