From d2772d77ce3b0908495bb298a0597a02bf300d1d Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Tue, 5 Oct 2021 14:04:29 -0400 Subject: [Docs] FIP additions --- libtnsl/README.md | 2 +- libtnsl/src/alg/alg.tnsl | 20 --------------- libtnsl/src/alg/math/math.tnsl | 20 --------------- libtnsl/src/algo/algo.tnsl | 26 ++++++++++++++++++++ libtnsl/src/algo/math/math.tnsl | 26 ++++++++++++++++++++ libtnsl/src/libtnsl.tnsl | 10 ++++++-- libtnsl/src/reflect/type.tnsl | 54 +++++++++++++++++++++++++++++++++++------ 7 files changed, 107 insertions(+), 51 deletions(-) delete mode 100644 libtnsl/src/alg/alg.tnsl delete mode 100644 libtnsl/src/alg/math/math.tnsl create mode 100644 libtnsl/src/algo/algo.tnsl create mode 100644 libtnsl/src/algo/math/math.tnsl (limited to 'libtnsl') diff --git a/libtnsl/README.md b/libtnsl/README.md index 7fb8922..4206136 100644 --- a/libtnsl/README.md +++ b/libtnsl/README.md @@ -16,7 +16,7 @@ More information on these features can be found in the specification under libts ## Provided Sub-modules libtnsl provides the tnsl base module and the following sub-modules to address each feature: -* alg +* algo * Algorithms. Also contains the math sub-module for basic math operations. * box * Data containers (vector, map, etc.) diff --git a/libtnsl/src/alg/alg.tnsl b/libtnsl/src/alg/alg.tnsl deleted file mode 100644 index d346464..0000000 --- a/libtnsl/src/alg/alg.tnsl +++ /dev/null @@ -1,20 +0,0 @@ -/## - Copyright 2021 Kyle Gunger - - Dual licensed under the CDDL 1.0 and BSD 3-Clause licenses. - - This file may only be used in accordance with one of the two - licenses. You should have received a copy of each license with - the source code. In the event that you did not recieve a copy - of the licenses, they may be found at the following URLs: - - CDDL 1.0: - https://opensource.org/licenses/CDDL-1.0 - - BSD 3-Clause: - https://opensource.org/licenses/BSD-3-Clause - - THIS SOFTWARE/SOURCE CODE IS PROVIDED "AS IS" WITH NO - WARRANTY, GUARANTEE, OR CLAIM OF FITNESS FOR ANY PURPOSE - EXPRESS OR IMPLIED -#/ \ No newline at end of file diff --git a/libtnsl/src/alg/math/math.tnsl b/libtnsl/src/alg/math/math.tnsl deleted file mode 100644 index d346464..0000000 --- a/libtnsl/src/alg/math/math.tnsl +++ /dev/null @@ -1,20 +0,0 @@ -/## - Copyright 2021 Kyle Gunger - - Dual licensed under the CDDL 1.0 and BSD 3-Clause licenses. - - This file may only be used in accordance with one of the two - licenses. You should have received a copy of each license with - the source code. In the event that you did not recieve a copy - of the licenses, they may be found at the following URLs: - - CDDL 1.0: - https://opensource.org/licenses/CDDL-1.0 - - BSD 3-Clause: - https://opensource.org/licenses/BSD-3-Clause - - THIS SOFTWARE/SOURCE CODE IS PROVIDED "AS IS" WITH NO - WARRANTY, GUARANTEE, OR CLAIM OF FITNESS FOR ANY PURPOSE - EXPRESS OR IMPLIED -#/ \ No newline at end of file diff --git a/libtnsl/src/algo/algo.tnsl b/libtnsl/src/algo/algo.tnsl new file mode 100644 index 0000000..7ddd677 --- /dev/null +++ b/libtnsl/src/algo/algo.tnsl @@ -0,0 +1,26 @@ +/## + Copyright 2021 Kyle Gunger + + Dual licensed under the CDDL 1.0 and BSD 3-Clause licenses. + + This file may only be used in accordance with one of the two + licenses. You should have received a copy of each license with + the source code. In the event that you did not recieve a copy + of the licenses, they may be found at the following URLs: + + CDDL 1.0: + https://opensource.org/licenses/CDDL-1.0 + + BSD 3-Clause: + https://opensource.org/licenses/BSD-3-Clause + + THIS SOFTWARE/SOURCE CODE IS PROVIDED "AS IS" WITH NO + WARRANTY, GUARANTEE, OR CLAIM OF FITNESS FOR ANY PURPOSE + EXPRESS OR IMPLIED +#/ + +/; export module algo + /: include + "math" + :/ +;/ \ No newline at end of file diff --git a/libtnsl/src/algo/math/math.tnsl b/libtnsl/src/algo/math/math.tnsl new file mode 100644 index 0000000..5676d09 --- /dev/null +++ b/libtnsl/src/algo/math/math.tnsl @@ -0,0 +1,26 @@ +/## + Copyright 2021 Kyle Gunger + + Dual licensed under the CDDL 1.0 and BSD 3-Clause licenses. + + This file may only be used in accordance with one of the two + licenses. You should have received a copy of each license with + the source code. In the event that you did not recieve a copy + of the licenses, they may be found at the following URLs: + + CDDL 1.0: + https://opensource.org/licenses/CDDL-1.0 + + BSD 3-Clause: + https://opensource.org/licenses/BSD-3-Clause + + THIS SOFTWARE/SOURCE CODE IS PROVIDED "AS IS" WITH NO + WARRANTY, GUARANTEE, OR CLAIM OF FITNESS FOR ANY PURPOSE + EXPRESS OR IMPLIED +#/ + +/; export module math + /; include + + ;/ +;/ \ No newline at end of file diff --git a/libtnsl/src/libtnsl.tnsl b/libtnsl/src/libtnsl.tnsl index 266c1fa..434e7a4 100644 --- a/libtnsl/src/libtnsl.tnsl +++ b/libtnsl/src/libtnsl.tnsl @@ -20,5 +20,11 @@ #/ /;export module tnsl - -;/ + /: import + "algo" + "box" + "io" + "reflect" + "time" + :/ +;/ \ No newline at end of file diff --git a/libtnsl/src/reflect/type.tnsl b/libtnsl/src/reflect/type.tnsl index 2ed0016..b36dfc5 100644 --- a/libtnsl/src/reflect/type.tnsl +++ b/libtnsl/src/reflect/type.tnsl @@ -19,25 +19,63 @@ EXPRESS OR IMPLIED #/ -; raw struct _type_header { - uint +/## tnsl.reflect._type + Header data which prefixes all non-raw structs. + Upper limits for classes and libs defined here: + - Max 2^32 libraries + - Max 2^16 classes per library + - Max 2^8 Generics per class +#/ +; raw struct _type(uint8 N) { + uint32 _lib_index, + uint16 _type_index, - ~{}_type_header + {N}_type _generic_list } -; raw struct _method { +/## tnsl.reflect._method + Metadata for methods (can be decoded from library + symbol tables). Limits for methods defined here: + - Max 2^8 inputs + - Max 2^8 outputs +#/ +; raw struct _method(uint8 I, O) { + ~{}charp + name, + + {I}_type + inputs, + {O}_type + outputs, + ~void address } -; raw struct _type { - ~{}int - _offsets, +/## tnsl.reflect._member + Metadata about struct members +#/ +; raw struct _member { + ~{}charp + name, + + uint + offset, + + _type + _member_type +} +/## tnsl.reflect._type_addresses + Metadata about where things are stored + in a class +#/ +; raw struct _type_addresses { ~{}uint + _offsets, _super_offsets, ~{}_type @@ -47,7 +85,7 @@ _methods } -/; method _type_header +/; method _type /; _is (_type_header base) ;/ -- cgit v1.2.3