Update SPECIFICATION.MD
This commit is contained in:
parent
a88ab4cfa6
commit
7f31e86eec
|
@ -1,8 +1,22 @@
|
||||||
# *zwl* (zongors world language) Design parameters, for *zwm* (zongors world machine)
|
# *zwl* (zongors world language) Design parameters
|
||||||
|
|
||||||
## Modern programming languages in the 21st century usually have need for the following requirements
|
## What is *zwl*?
|
||||||
|
|
||||||
### Data
|
*zwl* is an esoteric programming language that is trying way too hard to be a serious programming language.
|
||||||
|
|
||||||
|
It is inspired by both [esoteric programming languages](https://esolangs.org/wiki/Esoteric_programming_language), like [var'aq](https://web.archive.org/web/20091026213516/http://geocities.com/connorbd/varaq/), [uiua](https://www.uiua.org/), and [ZOMBIE](https://web.archive.org/web/20201125123312/https://www.dangermouse.net/esoteric/zombie.html) and serious programming languages like C, Perl, Common Lisp, Lua, Rust, Go, Odin, Zig, Elixir, and Haskell.
|
||||||
|
|
||||||
|
## What are the features in *zwl*?
|
||||||
|
|
||||||
|
In general the paradigms are designed to be: var'aq-like, Interpreted, Distributed, Concurrent, and have an option to be JIT.
|
||||||
|
|
||||||
|
## What is the purpose of this language?
|
||||||
|
|
||||||
|
*zwl* acts as the assembly language for *zwm*. it allows for a user to manipulate the world machine.
|
||||||
|
|
||||||
|
# Modern programming languages in the 21st century usually have need for the following requirements
|
||||||
|
|
||||||
|
## Data
|
||||||
|
|
||||||
- describing data
|
- describing data
|
||||||
- numeric
|
- numeric
|
||||||
|
@ -19,7 +33,7 @@
|
||||||
- measurements
|
- measurements
|
||||||
- tons of these...
|
- tons of these...
|
||||||
|
|
||||||
### Inputing data
|
## Inputing data
|
||||||
|
|
||||||
- stdio
|
- stdio
|
||||||
- program args
|
- program args
|
||||||
|
@ -30,7 +44,7 @@
|
||||||
- forms
|
- forms
|
||||||
- many others
|
- many others
|
||||||
|
|
||||||
### Storing descriptions of data
|
## Storing descriptions of data
|
||||||
|
|
||||||
- internal
|
- internal
|
||||||
- graph
|
- graph
|
||||||
|
@ -50,7 +64,7 @@
|
||||||
- tape
|
- tape
|
||||||
- socket
|
- socket
|
||||||
|
|
||||||
### Manipulating data
|
## Manipulating data
|
||||||
|
|
||||||
- algorithms
|
- algorithms
|
||||||
- sort
|
- sort
|
||||||
|
@ -65,7 +79,7 @@
|
||||||
- constraints
|
- constraints
|
||||||
- formulas
|
- formulas
|
||||||
|
|
||||||
### Displaying data
|
## Displaying data
|
||||||
|
|
||||||
- objects
|
- objects
|
||||||
- 3d models
|
- 3d models
|
||||||
|
@ -76,7 +90,7 @@
|
||||||
- written output
|
- written output
|
||||||
- ai generated text
|
- ai generated text
|
||||||
|
|
||||||
### System/World Objects
|
## System/World Objects
|
||||||
|
|
||||||
- Viewing objects in nth dimensional space
|
- Viewing objects in nth dimensional space
|
||||||
- Animations
|
- Animations
|
||||||
|
@ -85,7 +99,7 @@
|
||||||
- Interaction from user input on objects in space
|
- Interaction from user input on objects in space
|
||||||
- Creating
|
- Creating
|
||||||
|
|
||||||
### Communication
|
## Communication
|
||||||
|
|
||||||
- Sending and receiving data
|
- Sending and receiving data
|
||||||
- protocols
|
- protocols
|
||||||
|
@ -100,13 +114,13 @@
|
||||||
- keys
|
- keys
|
||||||
- more ...
|
- more ...
|
||||||
|
|
||||||
### Meta
|
## Meta
|
||||||
|
|
||||||
- documentation
|
- documentation
|
||||||
- tutorials
|
- tutorials
|
||||||
- generating objects automatically like
|
- generating objects automatically like
|
||||||
|
|
||||||
### Data Description
|
## Data Description
|
||||||
|
|
||||||
- windowing system
|
- windowing system
|
||||||
- window
|
- window
|
||||||
|
@ -130,12 +144,6 @@
|
||||||
- read
|
- read
|
||||||
- update
|
- update
|
||||||
- delete
|
- delete
|
||||||
|
|
||||||
|
|
||||||
# *zwl* at a high level.
|
|
||||||
|
|
||||||
zwl should be thought of as more of a scripting language for virtual machine more than a programming language that is compiled.
|
|
||||||
|
|
||||||
|
|
||||||
# *zwl* Grammar and Specification
|
# *zwl* Grammar and Specification
|
||||||
|
|
||||||
|
@ -147,40 +155,15 @@ zwl should be thought of as more of a scripting language for virtual machine mor
|
||||||
- there are also a list of "substantial forms" which come with the language which are the building blocks for more complex forms. If you are coming from object oriented languages you can think of this as "primitive types"
|
- there are also a list of "substantial forms" which come with the language which are the building blocks for more complex forms. If you are coming from object oriented languages you can think of this as "primitive types"
|
||||||
- all forms derive from the root form or the "parent of all forms"
|
- all forms derive from the root form or the "parent of all forms"
|
||||||
|
|
||||||
All substantial forms are "fat pointers" like in [Cello](https://www.libcello.org/). and have the following structure (here I will use a psudo C as an example):
|
|
||||||
|
|
||||||
```c
|
|
||||||
typedef enum error_e {
|
|
||||||
none, // no error
|
|
||||||
bound, // array out of bounds error
|
|
||||||
…
|
|
||||||
} error;
|
|
||||||
|
|
||||||
typedef enum type_e {
|
|
||||||
u8,
|
|
||||||
u16,
|
|
||||||
…
|
|
||||||
} type;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct type_s {
|
|
||||||
size_t sz; // size/length of the pointer
|
|
||||||
error err; // the error on the form (default is none)
|
|
||||||
void *ptr;
|
|
||||||
} frm;
|
|
||||||
```
|
```
|
||||||
|
~ «form_token» {
|
||||||
So as you can see each type includes some extra information, its type, if it has an error, the length, and the 'real' pointer to the value.
|
«version» ! version number for auto saving to a database or whatnot
|
||||||
|
«migrate» ! this is to migrate from the previous version to new, in case of interface changes, or None
|
||||||
```
|
«dimensions» ! this returns how many dimensions it can exist in, 0th means non drawable, 2 means 2D GUI usually, 3 means 3D object, and >3 is somthing you will have to implement yourself, e.g. miegakure
|
||||||
frm «form_token» impls «this_form», «that_form» {
|
«unit» ! this is for the unit/measures system
|
||||||
version; ! version number for auto saving to a database or whatnot
|
«display» ! some kind of UI form or None
|
||||||
migrate; ! this is to migrate from the previous version to new, in case of interface changes, or None
|
«position» ! a position in space or None
|
||||||
dimensions; ! this returns how many dimensions it can exist in, 0th means non drawable, 2 means 2D GUI usually, 3 means 3D object, and >3 is somthing you will have to implement yourself, e.g. miegakure
|
} frmdef
|
||||||
unit; ! this is for the unit/measures system
|
|
||||||
display; ! some kind of UI form or None
|
|
||||||
position; ! a position in space or None
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
# Substantial Forms
|
# Substantial Forms
|
||||||
|
|
Loading…
Reference in New Issue