mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-04-26 23:23:55 +00:00
add install instructions
This commit is contained in:
parent
b510eb9a10
commit
d95333b179
18
niva.md
18
niva.md
@ -7,12 +7,20 @@ 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.
|
|
||||||
|
|
||||||
|
For example, everything except the declaration is sending messages to objects.
|
||||||
|
`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:
|
On an imaginary graph of complexity, I would put it here:
|
||||||
Go < Niva < Java < Kotlin < Scala
|
Go < Niva < Java < Kotlin < Scala
|
||||||
|
|
||||||
@ -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