From 6848adbc7b301b64c3b461a51b5bb1f2b3956152 Mon Sep 17 00:00:00 2001 From: Jeron Aldaron Lau Date: Wed, 14 Aug 2024 20:13:07 -0500 Subject: [PATCH] v1.0.0-pre.0 (draft v13) --- README.md | 90 +++++------------------------------------ spec/SUMMARY.md | 4 ++ spec/introduction.md | 2 +- spec/lang.md | 3 ++ spec/leapsecond.md | 11 +++++ spec/region.md | 3 ++ spec/timeadjustment.md | 10 +++++ spec/timedesignation.md | 13 ++++++ spec/timezone.md | 14 +++++++ 9 files changed, 68 insertions(+), 82 deletions(-) create mode 100644 spec/leapsecond.md create mode 100644 spec/timeadjustment.md create mode 100644 spec/timedesignation.md create mode 100644 spec/timezone.md diff --git a/README.md b/README.md index a7e2dfa..6497bf2 100644 --- a/README.md +++ b/README.md @@ -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! @@ -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 @@ -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 . [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, - /// 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, - /// 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, -} -``` diff --git a/spec/SUMMARY.md b/spec/SUMMARY.md index c8a88a9..03999dd 100644 --- a/spec/SUMMARY.md +++ b/spec/SUMMARY.md @@ -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) diff --git a/spec/introduction.md b/spec/introduction.md index 3e1c420..b4e09fe 100644 --- a/spec/introduction.md +++ b/spec/introduction.md @@ -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. diff --git a/spec/lang.md b/spec/lang.md index 480e6bd..22f48f5 100644 --- a/spec/lang.md +++ b/spec/lang.md @@ -9,3 +9,6 @@ Spoken language - `identifier: [byte; 2]` ### Language Identifiers + + - `en`: English + - `eo`: Esperanto diff --git a/spec/leapsecond.md b/spec/leapsecond.md new file mode 100644 index 0000000..bdecde0 --- /dev/null +++ b/spec/leapsecond.md @@ -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) diff --git a/spec/region.md b/spec/region.md index 712e69c..dd2e3af 100644 --- a/spec/region.md +++ b/spec/region.md @@ -9,3 +9,6 @@ Region code - `identifier: [byte; 2]` ### Region Identifiers + + - `US`: United States + - `GB`: Great Britain / UK diff --git a/spec/timeadjustment.md b/spec/timeadjustment.md new file mode 100644 index 0000000..125da61 --- /dev/null +++ b/spec/timeadjustment.md @@ -0,0 +1,10 @@ +# TimeAdjustment + +## *Type*: `TimeAdjustment` + +A time adjustment like daylight savings time + +### Fields + + - `old: DateTime` Old time + - `new: DateTime` New time diff --git a/spec/timedesignation.md b/spec/timedesignation.md new file mode 100644 index 0000000..bfeaf02 --- /dev/null +++ b/spec/timedesignation.md @@ -0,0 +1,13 @@ +# TimeDesignation + +## *Type*: `TimeDesignation` + +Name of a timezone + +### Fields + + - `designation: int` + +### Designations + + 0. UTC diff --git a/spec/timezone.md b/spec/timezone.md new file mode 100644 index 0000000..4c8b525 --- /dev/null +++ b/spec/timezone.md @@ -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