-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(parser): compiler errs after antlr g4 fix
- Loading branch information
Showing
24 changed files
with
1,448 additions
and
1,830 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,33 @@ | ||
# Neva | ||
# Neva Programming Language | ||
|
||
 | ||
**Neva** is a general purpose [flow-based](https://en.wikipedia.org/wiki/Flow-based_programming) programming language with static [structural](https://en.wikipedia.org/wiki/Structural_type_system) typing and [implicit parallelism](https://en.wikipedia.org/wiki/Implicit_parallelism) that compiles to machine code. Designed with [visual programming](https://en.wikipedia.org/wiki/Visual_programming_language) in mind. For the era of effortless concurrency. | ||
|
||
> On shore abandoned, kissed by wave, he stood, of mighty thoughts the slave. | ||
> WARNING: This project is under heavy development and not production ready yet. | ||
**Neva** (Nevalang) is a general purpose ([flow-based](https://en.wikipedia.org/wiki/Flow-based_programming)) compiled programming language with static [structural](https://en.wikipedia.org/wiki/Structural_type_system) typing and [implicit parallelism](https://en.wikipedia.org/wiki/Implicit_parallelism). | ||
```neva | ||
const { | ||
greeting string 'Hello, World!' | ||
} | ||
Oh, and a [visual programming](https://en.wikipedia.org/wiki/Visual_programming_language) finally done right! | ||
components { | ||
Main(enter any) (exit any) { | ||
nodes { printer Printer<string> } | ||
net { | ||
in:enter -> ($greeting -> printer:msg) | ||
printer:msg -> out:exit | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Contributing | ||
|
||
See [CONTRIBUTING.md](./CONTRIBUTING.md) | ||
|
||
## Architecture | ||
|
||
See [ARCHITECTURE.md](./ARCHITECTURE.md) | ||
|
||
## FAQ | ||
|
||
See [FAQ](./docs/faq.md) | ||
See [FAQ.md](./docs/faq.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# Compiler Directives | ||
|
||
Compiler directives are special instructions for compiler. They are not intended to be used on a daily basis by regular user but good nevalang programmer must understand how they work because they are base for how many language features operate. | ||
|
||
- `#runtime_func` - directive for _component_ that tells the compiler that given component does not have implementation in source code and instead a runtime function call must be created. | ||
- `#runtime_func_msg` - Directive for _node_ that tells the compiler to insert given message to corresponding runtime function call. Can only be used with nodes that are instantiated with components with `runtime_func` directive. | ||
- `#struct_inports` - tells the compiler that inports for this component are not defined in nevalang source code but instead must be derived from it's type-argument which is the structure. Inports will correspond to structure fields. |
16 changes: 11 additions & 5 deletions
16
docs/design_principles.md → docs/contributing/design_principles.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,33 @@ | ||
# Design Principles | ||
|
||
## Program fails at startup or never | ||
Nevalang is built on a set of principles. They were rather naturally derived from the development process rather artificially created beforehand. | ||
|
||
**This is one of the final goals of the language. Please note that we are not there yet.** | ||
> WARNING: Language is under heavy development and these principles are not guarantees we can give you at the moment, but rather guiding stars for us to keep moving in the right direction | ||
## Program must fail at startup or never | ||
|
||
The idea is that most of the errors must be caught by compiler at compile time. And the rest of them, that are hard to catch (without sacrificing compiler's simplicity) are checked in runtime at startup. | ||
|
||
If no errors were caught at compile time and startup - then the program is correct and must run successfully. Any (non-logical) error that occurred after startup must be threated like compiler bug. | ||
|
||
## Runtime fast, flexible and unsafe | ||
## Runtime must be fast, flexible and unsafe | ||
|
||
Runtime won't do any checks after startup. The program that runtime consumes must be correct. Program's correctness must be ensured by compiler. If there's a bug in compiler and runtime consumed invalid program - bad things can happen: deadlocks, memory leaks, freezes and crashes. | ||
|
||
## Compiler directives are not for users | ||
## Compiler directives must not be required | ||
|
||
Language must allow to implement everything without using of compiler directives. | ||
|
||
**Compiler directives are not always unsafe** (analyzer won't always validate their usage - that will make implementation more complicated) and thus must be used by language/stdlib developers or at _for users that know what they are doing_. | ||
|
||
It's good for user to understand what compiler directives are and how syntax sugar use them under the hood though. | ||
|
||
## There is developer mode (interpreter) | ||
## There is interpreter (backend can be slow) | ||
|
||
Compiler must be fast to the point where it generates IR. After that we have generating of target code (e.g. generating Go and then generating machine code with Go compiler) - that part ("backend") doesn't have to be fast. It's more important to keep it simple. | ||
|
||
The reason for that is that we have an interpreter that is internally uses compiler (it's impossible to generate IR from invalid program due to lack of type information), but not the whole thing. Just to the point where it generates IR. That's the part of the compiler that is used for development/debugging purposes. That's where we need to be fast. | ||
|
||
## There is visual programming | ||
|
||
Once we build the good enough tool for visual programming we will switch from text based approach. Text will become supporting tool. To achieve this we must always keep in mind that what we do with the language must be easy to visualize in graph environment. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Questions and Answers | ||
|
||
Please note that this is not [FAQ](../faq.md). | ||
|
||
This is knowledge base that should help find out why sertain decisions were maid. This is more for questions like "_why_ X works this way?" assuming you already understand what "X" is. | ||
|
||
- [Design](./design.md) - why language works the way it is | ||
- [Internal](./internal.md) - why the language internally implemented this way |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.