Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Voyd Rename #49

Merged
merged 5 commits into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
*.void linguist-language=Swift
*.voyd linguist-language=Swift
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ ast.json
*output*.json
*output*.wat
.env
test.void
test.voyd
/playground.*
/playground
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"cSpell.advanced.feature.useReferenceProviderWithRename": true,
"cSpell.advanced.feature.useReferenceProviderRemove": "/^#+\\s/"
},
"[void]": {
"[voyd]": {
"editor.tabSize": 2
},
"vitest.nodeExecutable": ""
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Void
# Voyd

Void is a high performance WebAssembly language with an emphasis on full stack web development.
Voyd is a high performance WebAssembly language with an emphasis on full stack web development.

https://justforfunnoreally.dev/

Expand Down Expand Up @@ -29,7 +29,7 @@ fn app() -> JSX::Element

**Disclaimer**

Void is in it's very early stages of development. Void is not ready for public
Voyd is in it's very early stages of development. Voyd is not ready for public
announcement or use. Some core syntax and semantics are subject to change.
Expect frequent breaking changes. In addition, many documented features are not
yet implemented.
Expand Down Expand Up @@ -60,13 +60,13 @@ yet implemented.
**Install**

```
npm i -g voidc
npm i -g voydc
```

**Usage**

```
voidc path/to/code.void
voydc path/to/code.voyd
```

**Requirements**
Expand Down Expand Up @@ -130,7 +130,7 @@ To call a function, use the function name followed by the arguments in parenthes
add(1, 2)
```

Void also supports uniform function call syntax (UFCS), allowing functions to be called on a type as if they were methods of that type.
Voyd also supports uniform function call syntax (UFCS), allowing functions to be called on a type as if they were methods of that type.

```rust
1.add(2)
Expand Down
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Void Language Maintainer Docs
# Voyd Language Maintainer Docs

Docs intended for maintainers of the void language
Docs intended for maintainers of the voyd language
14 changes: 7 additions & 7 deletions docs/notes/devlog.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ brought to the fact that a function is an effect?

Background, given:
```
// src/throws.void
// src/throws.voyd
effect State<T>
ctl set(val: T) -> T
ctl get() -> T
Expand Down Expand Up @@ -131,7 +131,7 @@ Effect system implementation ideas:

```ts
type Get = () => number;
type Put = (value: number) => void;
type Put = (value: number) => voyd;

const loop = (n: number) => {
if (n === 0) return;
Expand All @@ -148,7 +148,7 @@ const put = (value, state, continuation) =>
const loop2 = (
n: number,
state: { value: number },
continuation: (state: { value: number }) => void
continuation: (state: { value: number }) => voyd
) => {
if (n === 0) return continuation(state, undefined);

Expand Down Expand Up @@ -182,11 +182,11 @@ Ideal features:
- Supports ES Module Syntax natively?
- Handles function overloads cleanly
- Still easily supports WASM and potentially other sources while still providing a good DX
- A `module.void` format for configuration and exports etc
- A `module.voyd` format for configuration and exports etc

Open questions:

- Void supports _both_ named parameters _and_ objects and treats each one differently. How should
- Voyd supports _both_ named parameters _and_ objects and treats each one differently. How should
this be handled? The best I can think of is that named parameters should be treated as objects
- Need to define a standard for tagged data structures.

Expand All @@ -197,7 +197,7 @@ Open questions:
1. (Unchanged) Any line with more than one symbol is wrapped with parenthesis (if it does not
already have them)

```void
```voyd
add 1 2

// Becomes
Expand All @@ -211,7 +211,7 @@ Open questions:
2. The first child is not a named argument
3. The parent is not wrapped in parenthesis

```void
```voyd
add 2
mul 4 x

Expand Down
2 changes: 1 addition & 1 deletion docs/notes/language-benefits.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ export class Parameter extends NamedEntity {
}
```

Void avoids this common error as the constructor / init function
Voyd avoyds this common error as the constructor / init function
is not defined by the user. This problem still exists on overloaded initializers
4 changes: 2 additions & 2 deletions docs/structural-subtyping.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

Context:
```void
```voyd
obj A {
x: i32
}
Expand All @@ -24,7 +24,7 @@ fn main() -> i32
```

Implementation (Psuedo VOID / WASM hybrid):
```void
```voyd
// All objects implicitly extend Object
type Object = {
// All objects that can be used to access a member of an the object.
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "voidc",
"name": "voyd",
"version": "0.6.0",
"description": "",
"module": "dist/index.js",
Expand All @@ -13,8 +13,7 @@
"prepublishOnly": "tsc"
},
"bin": {
"voidc": "./dist/cli/cli.js",
"void": "./dist/cli/cli.js",
"voyd": "./dist/cli/cli.js",
"vt": "./src/cli/cli-dev.ts"
},
"keywords": [],
Expand Down
26 changes: 13 additions & 13 deletions reference/basics.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Comments

```void
```voyd
// This is a single line comment
```
# Identifiers

Identifiers bind names to values, types, and other language constructs. They can
contain letters, numbers, and underscores, and must start with a letter or underscore.

```void
```voyd
hey
hey_there
MyType
Expand All @@ -17,7 +17,7 @@ MyType2

# Variables

```void
```voyd
// Declare an immutable variable
let x = 5

Expand All @@ -27,7 +27,7 @@ var y = 3

# String Literals

```void
```voyd
// Strings are defined with double quotes
let name = "John"

Expand All @@ -42,7 +42,7 @@ let greeting = "Hello, ${name}"

# Numeric Literals

```void
```voyd
// Integers
let x = 5

Expand All @@ -52,14 +52,14 @@ let y = 3.14

# Boolean Literals

```void
```voyd
let x = true
let y = false
```

# Object literals

```void
```voyd
let value = {
a: 5,
b: 4
Expand All @@ -70,7 +70,7 @@ let x = value.a // x will be bound to 5

Field shorthand:

```void
```voyd
let a = 5
let value = { a, b: 4 }

Expand All @@ -80,7 +80,7 @@ let value = { a: a, b: 4 }

# Tuple literals

```void
```voyd
let value = (5, 4)
let x = value.0 // x will be bound to 5

Expand All @@ -90,7 +90,7 @@ let (a, b) = value

# Control Flow

```void
```voyd
// If statements
if x > 5 then:
// Do something
Expand Down Expand Up @@ -130,17 +130,17 @@ let y =

Expressions are statements that return a value. They can be used in a variety of contexts, such as variable assignment, function arguments, and more.

```void
```voyd
// Binary expressions
let x = 5 + 3

// Function calls
let y = add(5, 3)
```

Virtually every statement in Void is an expression, including control flow statements.
Virtually every statement in Voyd is an expression, including control flow statements.

```void
```voyd
let x = if true then: 1 else: 2

// Blocks are also expressions, returning the result of the last statement
Expand Down
4 changes: 2 additions & 2 deletions reference/control-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn match<T extends Object, U>(val: T, bind_identifier: Identifier, body: MatchBl
```

Example:
```void
```voyd
obj Optional

obj None extends Optional
Expand All @@ -37,7 +37,7 @@ fn main(a: i32, b: i32) -> String

The second signature of match is useful when the value being matched against
is not already bound to an identifier (i.e. dot pipelines):
```void
```voyd
fn main(a: i32, b: i32) -> String
a.divide(b)
.match(x) // Here, match binds the result of the previous expression to x
Expand Down
18 changes: 9 additions & 9 deletions reference/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Function Basics

```void
```voyd
fn add(a: i32, b: i32) -> i32
a + b

Expand All @@ -15,14 +15,14 @@ add(1, 2)

With return type inference:

```void
```voyd
// Equal sign is used when the function is written on one line
fn add(a: i32, b: i32) = a + b
```

With effects:

```void
```voyd
fn get_json(address: String): Async -> Dictionary
let json_text = await fetch(address)
parse_json(json_text)
Expand Down Expand Up @@ -86,7 +86,7 @@ move(x: x, y: y, z: z)

Labeled arguments also support concise closure sugar on call sites:

```void
```voyd
fn try({ do: ((): throws -> void), catch: (e: Error) -> void })

try do():
Expand Down Expand Up @@ -218,9 +218,9 @@ See the chapter on [Syntax](./syntax.md) for more information and detailed rules

## Function Overloading

Void functions can be overloaded. Provided that function overload can be unambiguously distinguished via their parameters and return type.
Voyd functions can be overloaded. Provided that function overload can be unambiguously distinguished via their parameters and return type.

```void
```voyd
fn sum(a: i32, b: i32)
print("Def 1")
a + b
Expand All @@ -236,7 +236,7 @@ sum { a: 1, b: 2 } // Def 2
This can be especially useful for overloading operators to support a custom
type:

```void
```voyd
fn '+'(a: Vec3, b: Vec3) -> Vec3
Vec3(a.x + b.x, a.y + b.y, a.z + b.z)

Expand All @@ -247,15 +247,15 @@ A function call is considered to be ambiguous when multiple functions in
the same scope share the same name, and the types of each parameter overlap
in order.

```void
```voyd
fn add(a: i32, b: i32) -> i32
fn add(d: i32, e: i32) -> i32 // Ambiguous collision
fn add(f: i32, c: f32) -> i32 // This is fine, the second parameter does not overlap with previous
```

Object types overlap if one is an extension of the other:

```void
```voyd
obj Animal {}
obj Dog extends Animal {}
obj Cat extends Animal {}
Expand Down
Loading