mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-04-26 15:13:56 +00:00
add install instructions
This commit is contained in:
parent
b510eb9a10
commit
d95333b179
24
niva.md
24
niva.md
@ -6,16 +6,24 @@ contributors:
|
|||||||
---
|
---
|
||||||
|
|
||||||
## Intro
|
## Intro
|
||||||
Niva is a simple language that takes a lot of inspiration from Smalltalk.
|
Niva is a simple language that takes a lot of inspiration from Smalltalk.
|
||||||
But leaning towards the functional side.
|
But leaning towards the functional side and static typed.
|
||||||
Everything is still an object, but instead of classes, interfaces, and abstract classes, we have tagged unions,
|
Everything is still an object, but instead of classes, interfaces, inheritance, and abstract classes,
|
||||||
which is the only way to achieve polymorphism.
|
we have tagged unions, which is the only way to achieve polymorphism.
|
||||||
|
|
||||||
So basically niva is types, unions, and methods for them. There are no functions.
|
|
||||||
|
|
||||||
On an imaginary graph of complexity, I would put it here:
|
For example, everything except the declaration is sending messages to objects.
|
||||||
Go < Niva < Java < Kotlin < Scala
|
`1 + 2` is not a + operator, but a `... + Int` message for `Int` object.
|
||||||
|
(ofc there are no extra costs for that)
|
||||||
|
|
||||||
|
C-like: `1.inc()`
|
||||||
|
Niva: `1 inc`
|
||||||
|
|
||||||
|
So basically niva is types, unions, and methods for them.
|
||||||
|
There are no functions.
|
||||||
|
On an imaginary graph of complexity, I would put it here:
|
||||||
|
Go < Niva < Java < Kotlin < Scala
|
||||||
|
|
||||||
Links:
|
Links:
|
||||||
- [Site](https://gavr123456789.github.io/niva-site/reference.html)
|
- [Site](https://gavr123456789.github.io/niva-site/reference.html)
|
||||||
- [GitHub](https://github.com/gavr123456789/Niva)
|
- [GitHub](https://github.com/gavr123456789/Niva)
|
||||||
@ -34,7 +42,7 @@ cd Niva
|
|||||||
|
|
||||||
#### Variable
|
#### Variable
|
||||||
Variables are immutable by default.
|
Variables are immutable by default.
|
||||||
There is no keyword for declaring a variable.
|
There is no special keyword for declaring a variable.
|
||||||
|
|
||||||
```Scala
|
```Scala
|
||||||
// this is a comment
|
// this is a comment
|
||||||
|
Loading…
Reference in New Issue
Block a user