Skip to content

Commit

Permalink
v1.0.0-pre.0 (draft v13)
Browse files Browse the repository at this point in the history
  • Loading branch information
AldaronLau committed Aug 15, 2024
1 parent 10bd098 commit 6848adb
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 82 deletions.
90 changes: 9 additions & 81 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Daku v1.0.0-pre.0 (draft v11)
# Daku v1.0.0-pre.0 (draft v13)

> Asynchronous host interface abstraction API for WebAssembly plugins, drivers,
> applications, and more!
Expand All @@ -7,26 +7,20 @@ The `daku` crate is designed to be used for applications that run within a host,
such as a plugin in an application, or a driver in an operating system, and even
a program in an operation system (similar to WASI), and more!

Since Daku is currently in the pre-release stage, things may change based on
feedback but large changes are unlikely.

The [daku specification](https://ardaku.org/daku) is currently in draft, so some
remnants of the old spec may remain in this README and other files in the
repository for now.

## Goals

- Simple
- Efficient
- Modular
- Minimal (in API surface, and memory footprint)
- Asynchronous
- Stable base API
- As simple and efficient as possible
- Backwards Compatible
- Reduced context switching
- Security-first
- First-class multimedia portals
- Portals compatible with WASI versions via 2-way abstractions
- First-class multimedia portals (WASI compatible)

## License
Copyright © 2022-2023 The Daku Contributors.
Copyright © 2022-2024 The Daku Contributors.

Licensed under any of
- Apache License, Version 2.0, ([LICENSE\_APACHE] or
Expand All @@ -38,82 +32,16 @@ Licensed under any of
at your option.

### Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
licensed as described above, without any additional terms or conditions.

## Help

If you want help using or contributing to this library or specification, feel
free to send me an email at <[email protected]>.

[LICENSE\_APACHE]: https://github.com/ardaku/daku/blob/v1/LICENSE_APACHE
[LICENSE\_BOOST]: https://github.com/ardaku/daku/blob/v1/LICENSE_BOOST
[LICENSE\_MIT]: https://github.com/ardaku/daku/blob/v1/LICENSE_MIT

## Types

### TimeZone
```rust
#[repr(C, u32)]
enum TimeDesignation {
Utc = 0,
}

#[repr(C, packed)]
struct TimeAdjustment {
/// Time to replace
when: DateTime,
/// New time
new: DateTime,
}

#[repr(C, packed)]
struct LeapSecond {
/// Which year
year: i16,
/// Always the last day of the month
month: u8,
/// Direction: Either -1 or +1
delta: i8,
}

#[repr(C, packed)]
struct TimeZone {
/// Name of TimeZone (abbreviated, null terminated unless size 6)
designation: TimeDesignation,
/// List of adjustments made in this timezone
deltas: List<TimeAdjustment>,
/// Replace UTC jan 1 00:00:00:000 year 0 with Local time adjustments
///
/// This must be equivalent to all of the adjustments in `deltas` plus
/// any daylight savings time modifications.
offset: DateTime,
/// List of leap seconds
leap_seconds: List<LeapSecond>,
/// Sum of leap seconds
leap: i16,
/// Is daylight savings time?
is_dst: bool,
/// Reserved for future use, set to 0
reserved: u8,
}
```

### Lang
```rust
#[repr(C, u32)]
enum Language {
/// English United States
EnUS = u32::from_ne_bytes(*b"enUS"),
/// English Great Britain
EnGB = u32::from_ne_bytes(*b"enGB"),
/// Esperanto
EoXX = u32::from_ne_bytes(*b"eoXX"),
}

#[repr(C, packed)]
struct Lang {
/// List of languages in order of user preference (0 is most preferred)
list: List<Language>,
}
```
4 changes: 4 additions & 0 deletions spec/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
- [Lang 🧪](./lang.md)
- [Region 🧪](./region.md)
- [LangRegion 🧪](./langregion.md)
- [LeapSecond 🧪](./leapsecond.md)
- [TimeDesignation 🧪](./timedesignation.md)
- [TimeAdjustment 🧪](./timeadjustment.md)
- [TimeZone 🧪](./timezone.md)
- [Portals](./portals.md)
- [0x00 - Log](./log.md)
- [0x01 - Prompt](./prompt.md)
Expand Down
2 changes: 1 addition & 1 deletion spec/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Daku is an asynchronous host interface abstraction API for WebAssembly plugins,
drivers, applications, and more! Daku is both an API and a file format. Ardaku
is an engine you can use for running Daku modules on different Wasm runtimes.

## Daku Specification v1.0.0-pre.0 (draft v12)
## Daku Specification v1.0.0-pre.0 (draft v13)

The current version of Daku targets the full WebAssembly 2.0 spec without any
non-standard or experimental features.
Expand Down
3 changes: 3 additions & 0 deletions spec/lang.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ Spoken language
- `identifier: [byte; 2]`

### Language Identifiers

- `en`: English
- `eo`: Esperanto
11 changes: 11 additions & 0 deletions spec/leapsecond.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# LeapSecond

## *Type*: `LeapSecond`

A leap second

### Fields

- `year: half` Which year
- `month: byte` Always the last day of the month (0-11)
- `delta: byte` Direction (either -1 or +1)
3 changes: 3 additions & 0 deletions spec/region.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ Region code
- `identifier: [byte; 2]`

### Region Identifiers

- `US`: United States
- `GB`: Great Britain / UK
10 changes: 10 additions & 0 deletions spec/timeadjustment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# TimeAdjustment

## *Type*: `TimeAdjustment`

A time adjustment like daylight savings time

### Fields

- `old: DateTime` Old time
- `new: DateTime` New time
13 changes: 13 additions & 0 deletions spec/timedesignation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# TimeDesignation

## *Type*: `TimeDesignation`

Name of a timezone

### Fields

- `designation: int`

### Designations

0. UTC
14 changes: 14 additions & 0 deletions spec/timezone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# TimeZone

## *Type*: `TimeZone`

A timezone specification

### Fields

- `designation: TimeDesignation` Name of the timezone
- `extension: opt[_]`: Reserved for timezone specification extensions
- `offset: DateTime` Date and time of this timezone for UTC jan 1 00:00:00:000
year 0
- `adjustments: List[TimeAdjustment]` List of adjustments made in this timezone
- `leap_seconds: List[LeapSecond]`: List of leap seconds

0 comments on commit 6848adb

Please sign in to comment.