mirror of
https://github.com/hi-language/hi-language.github.io.git
synced 2026-01-14 00:28:05 +00:00
Update index.html
This commit is contained in:
14
index.html
14
index.html
@@ -82,7 +82,7 @@
|
||||
const markdownContent = `
|
||||
# A corely symbolic language
|
||||
|
||||
**Hi** is a programming language inspired by JavaScript, designed with a symbolic core to be more universal, AI-friendly, and conducive to code golfing. The syntax prioritizes symbols over keywords.
|
||||
**Hi** is a programming language inspired by JavaScript, designed with a symbolic core to be more universal, AI-friendly, and conducive to code golfing, for the whole world. We prioritize symbols over keywords.
|
||||
|
||||
The underscore \`_\` is the global output function.
|
||||
|
||||
@@ -111,7 +111,7 @@ A Block with only executable code is a function.
|
||||
|
||||
\`\`\`javascript
|
||||
sayHi: {
|
||||
_("Hi")
|
||||
_("Hiiii")
|
||||
}
|
||||
sayHi() // Invokes the block
|
||||
\`\`\`
|
||||
@@ -121,7 +121,7 @@ A Block with named properties is an object. A \`#\` prefix denotes a private pro
|
||||
|
||||
\`\`\`javascript
|
||||
player: {
|
||||
name: "Orion", // Public property
|
||||
name: "Orion" // Public property
|
||||
#hp: 100 // Private property
|
||||
}
|
||||
_(player.name) // "Orion"
|
||||
@@ -136,7 +136,7 @@ counter: {
|
||||
|
||||
inc: {
|
||||
value = value + 1 // Mutates parent's private state
|
||||
},
|
||||
}
|
||||
|
||||
get: {
|
||||
value // The last expression is returned
|
||||
@@ -153,7 +153,7 @@ _(counter.get()) // Prints 1
|
||||
greet: (name) {
|
||||
_("Hi, " + name)
|
||||
}
|
||||
greet("Master")
|
||||
greet("World")
|
||||
\`\`\`
|
||||
|
||||
## Booleans and Equality
|
||||
@@ -164,7 +164,7 @@ Hi dispenses with boolean keywords in favor of canonical numeric values.
|
||||
- \`!0\` is **true**.
|
||||
- \`-0\` represents null/undefined values.
|
||||
- All other numbers, and any non-empty string, block, or array are "truthy".
|
||||
- \`==\` performs strict equality comparison (equivalent to JS \`===\`).
|
||||
- \`==\` performs a strict equality comparison, similar to JavaScript's \`===\` operator.
|
||||
|
||||
## Conditional Expressions
|
||||
|
||||
@@ -203,7 +203,7 @@ _(primes) // [1, 3, 5, 7]
|
||||
Loops are initiated with the \`*\` operator following a standard three-part condition or a simple boolean expression.
|
||||
|
||||
- \`>>\` is used for **continue**.
|
||||
- \`^\` is used for **break**.
|
||||
- \`^\` is used for **break** (to exit a loop) or **return** (to exit a block).
|
||||
|
||||
\`\`\`javascript
|
||||
// for-style loop
|
||||
|
||||
Reference in New Issue
Block a user