From bc448b70cb83cce046e65fb4f69a28a84a53ff49 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Sat, 7 Aug 2021 08:04:33 -0400 Subject: Begin filling out spec + Add initial spec markdowns + Update copyright for libtnsl --- spec/1 - language.md | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++ spec/2 - features.md | 17 ++++++++++++ spec/3 - abi.md | 17 ++++++++++++ spec/4 - fip.md | 17 ++++++++++++ spec/README.md | 59 ++++++++++++++++++++++++++++++++++++++++++ spec/index.md | 1 - 6 files changed, 183 insertions(+), 1 deletion(-) create mode 100644 spec/1 - language.md create mode 100644 spec/2 - features.md create mode 100644 spec/3 - abi.md create mode 100644 spec/4 - fip.md create mode 100644 spec/README.md delete mode 100644 spec/index.md (limited to 'spec') diff --git a/spec/1 - language.md b/spec/1 - language.md new file mode 100644 index 0000000..50ccf68 --- /dev/null +++ b/spec/1 - language.md @@ -0,0 +1,73 @@ +# The Language + +## Section 1 - Files + +### Folder Structure + +TNSL project structure has a root source folder with TNSL files contained within the folder and sub-folders. There is no strictly enforced system, but good practice is to place code sub-modules in sub-folders, and name the module entry point file the same name as its enclosing folder. + +The main file to compile is known as the root file, which generally resides in the root source folder. This file will contain either a main method, or the pre-processor statement `rootfile` to denote the root of a library. A main file may contain both. + +### TNSL Files + + + +## Section 2 - Blocks + +### TNSL Block Notation + +### Modules + +### Functions + +### Control Flow Blocks + +### Anonymous Blocks + +## Section 3 - Statements + +### TNSL Statement Notation + +### Variable Declaration + +### Assignment + +### Special Statements + +## Section 4 - Types + +### Built-in Types + +### The Void Type + +### Defining Types + +### Interfaces + +### Type Levels + +## Section 5 - Operators + +### Operator Presedence + +## Section 6 - `raw` and `asm` + +### The `raw` Keyword + +### The `asm` Keyword + +### Credits + + Copyright 2021 Kyle Gunger + + This file is licenced under the CDDL 1.0 (the Licence) + and may only be used in accordance with the Licence. + You should have recieved a copy of the Licence with this + software/source code. If you did not, a copy can be found + at the following URL: + + https://opensource.org/licenses/CDDL-1.0 + + THIS SOFTWARE/SOURCE CODE IS PROVIDED "AS IS" WITH NO + WARRENTY, GUARANTEE, OR CLAIM OF FITNESS FOR ANY PURPOSE + EXPRESS OR IMPLIED \ No newline at end of file diff --git a/spec/2 - features.md b/spec/2 - features.md new file mode 100644 index 0000000..c5432de --- /dev/null +++ b/spec/2 - features.md @@ -0,0 +1,17 @@ +# Related Features + +### Credits + + Copyright 2021 Kyle Gunger + + This file is licenced under the CDDL 1.0 (the Licence) + and may only be used in accordance with the Licence. + You should have recieved a copy of the Licence with this + software/source code. If you did not, a copy can be found + at the following URL: + + https://opensource.org/licenses/CDDL-1.0 + + THIS SOFTWARE/SOURCE CODE IS PROVIDED "AS IS" WITH NO + WARRENTY, GUARANTEE, OR CLAIM OF FITNESS FOR ANY PURPOSE + EXPRESS OR IMPLIED \ No newline at end of file diff --git a/spec/3 - abi.md b/spec/3 - abi.md new file mode 100644 index 0000000..f586464 --- /dev/null +++ b/spec/3 - abi.md @@ -0,0 +1,17 @@ +# The TNSL Calling ABI + +### Credits + + Copyright 2021 Kyle Gunger + + This file is licenced under the CDDL 1.0 (the Licence) + and may only be used in accordance with the Licence. + You should have recieved a copy of the Licence with this + software/source code. If you did not, a copy can be found + at the following URL: + + https://opensource.org/licenses/CDDL-1.0 + + THIS SOFTWARE/SOURCE CODE IS PROVIDED "AS IS" WITH NO + WARRENTY, GUARANTEE, OR CLAIM OF FITNESS FOR ANY PURPOSE + EXPRESS OR IMPLIED \ No newline at end of file diff --git a/spec/4 - fip.md b/spec/4 - fip.md new file mode 100644 index 0000000..c1e9954 --- /dev/null +++ b/spec/4 - fip.md @@ -0,0 +1,17 @@ +# Features in Place + +### Credits + + Copyright 2021 Kyle Gunger + + This file is licenced under the CDDL 1.0 (the Licence) + and may only be used in accordance with the Licence. + You should have recieved a copy of the Licence with this + software/source code. If you did not, a copy can be found + at the following URL: + + https://opensource.org/licenses/CDDL-1.0 + + THIS SOFTWARE/SOURCE CODE IS PROVIDED "AS IS" WITH NO + WARRENTY, GUARANTEE, OR CLAIM OF FITNESS FOR ANY PURPOSE + EXPRESS OR IMPLIED \ No newline at end of file diff --git a/spec/README.md b/spec/README.md new file mode 100644 index 0000000..6b788cc --- /dev/null +++ b/spec/README.md @@ -0,0 +1,59 @@ +Version 0.0.1 +# The TNSL Language Specification + +## Forward + +As of writing this forward, TNSL is not even a language yet. Right now, it's mostly just a stupid idea that I've devoted too much brain-space to, and I'm not confident will ever take off. The hard-core C folk probably will hate it, as well as the new-fangled rust/golangers with all their type safty. + +I'm trying not to think too hard about that. + +Right now, TNSL isn't a language. But it *could* be. And, really, I think it's a cool challenge to try to pack high-level features into a low-level environment. I hope you find it interesting as well. + +-Kyle + +## Chapter Index + +1. The Language + + - Files + - Blocks + - Statements + - Types + - Operators + - `raw` and `asm` + +2. Related features + + - Style guide + - Compiler Options + - The Pre-Processor + - Included Tools + +3. The TNSL Calling ABI + + - Differences from C + - Link tables + - Exporting C-like Functions + - Types and Arrays in Memory + +4. Features in Position + + - Bare Metal + - `libtnsl` as it relates to Types + - Cross Calling to C + +### Credits + + Copyright 2021 Kyle Gunger + + This file is licenced under the CDDL 1.0 (the Licence) + and may only be used in accordance with the Licence. + You should have recieved a copy of the Licence with this + software/source code. If you did not, a copy can be found + at the following URL: + + https://opensource.org/licenses/CDDL-1.0 + + THIS SOFTWARE/SOURCE CODE IS PROVIDED "AS IS" WITH NO + WARRENTY, GUARANTEE, OR CLAIM OF FITNESS FOR ANY PURPOSE + EXPRESS OR IMPLIED \ No newline at end of file diff --git a/spec/index.md b/spec/index.md deleted file mode 100644 index b67bffc..0000000 --- a/spec/index.md +++ /dev/null @@ -1 +0,0 @@ -# tnsl-lang specification -- cgit v1.2.3