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

Modules #383

Merged
merged 6 commits into from
Nov 15, 2023
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
31 changes: 19 additions & 12 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,6 @@
"outFiles": ["${workspaceFolder}/web/out/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
},
// test extension
// {
// "name": "VSCode Extension Tests",
// "type": "extensionHost",
// "request": "launch",
// "args": [
// "--extensionDevelopmentPath=${workspaceFolder}",
// "--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
// ],
// "outFiles": ["${workspaceFolder}/out/test/**/*.js"],
// "preLaunchTask": "${defaultBuildTask}"
// },
// run lsp in debugger
{
"name": "Language server (LSP) ",
Expand All @@ -36,6 +24,25 @@
"cwd": "${workspaceFolder}",
"args": ["-debug"]
},
// === Interpreter ===
{
"name": "Interpreter: do_nothing",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/interpreter",
"cwd": "${workspaceFolder}/examples",
"args": ["do_nothing"],
},
{
"name": "Interpreter: add_numbers",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/interpreter",
"cwd": "${workspaceFolder}/examples",
"args": ["add_numbers/with_error_handling"],
},
// === Other ===
{
"name": "antlr_000_empty.neva",
Expand Down
20 changes: 18 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Issues must only be created for known bugs and understandable architecture issue

## VSCode Extension

Check out [tygo.yaml](./tygo.yaml). It depends on types defined in the `src` and `ts` packages and thus it's dangerous to rename those types. If you gonna do so make sure you don't brake TS types generation.
Check out [tygo.yaml](./tygo.yaml). It depends on types defined in the `src` and `typesystem` packages and thus it's dangerous to rename those types. If you gonna do so make sure you don't brake TS types generation. Check [web/CONTRIBUTING.md](./web/CONTRIBUTING.md).

# Naming conventions

Expand All @@ -49,8 +49,11 @@ Use `_` instead of space in for test-case names because go turns spaces into und

## FBP/DataFlow

- [Flow-Based Programming: A New Approach to Application Development](https://jpaulmorrison.com/fbp/1stedchaps.html)
- [Elements of Dataflow and Reactive Programming Systems](https://youtu.be/iFlT93wakVo?feature=shared)
- [The origins of Flow Based Programming with J Paul Morrison](https://youtu.be/up2yhNTsaDs?feature=shared)
- [Dataflow and Reactive Programming Systems: A Practical Guide](https://www.amazon.com/Dataflow-Reactive-Programming-Systems-Practical/dp/1497422442)
- [Flow-Based Programming: A New Approach to Application Development](https://jpaulmorrison.com/fbp/1stedchaps.html)
- [Samuel Smith - "Flow Based Programming"](https://youtu.be/j3cP8uwf5YM?feature=shared)

## Golang

Expand Down Expand Up @@ -92,6 +95,7 @@ Use `_` instead of space in for test-case names because go turns spaces into und
- [Syntax Highlighter](https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide)
- [LSP Overview](https://microsoft.github.io/language-server-protocol/)
- [Go library for LSP implementation](https://github.com/tliron/glsp)
- [LSP official docs](https://microsoft.github.io/language-server-protocol/)

## Subjective Recommendations

Expand All @@ -102,6 +106,8 @@ Use `_` instead of space in for test-case names because go turns spaces into und
- ["Propositions as Types" by Philip Wadler](https://youtu.be/IOiZatlZtGU?feature=shared)
- ["Outperforming Imperative with Pure Functional Languages" by Richard Feldman](https://youtu.be/vzfy4EKwG_Y?feature=shared)
- ["What Is a Strange Loop and What is it Like To Be One?" by Douglas Hofstadter (2013)](https://youtu.be/UT5CxsyKwxg?feature=shared)
- ["The Economics of Programming Languages" by Evan Czaplicki (Strange Loop 2023)](https://youtu.be/XZ3w_jec1v8?feature=shared)
- [Why Isn't Functional Programming the Norm? – Richard Feldman](https://youtu.be/QyJZzq0v7Z4?feature=shared)

### Books And Articles

Expand All @@ -111,6 +117,16 @@ Use `_` instead of space in for test-case names because go turns spaces into und
- [Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems](https://www.amazon.com/Designing-Data-Intensive-Applications-Reliable-Maintainable/dp/1449373321)
- [Code: The Hidden Language of Computer Hardware and Software](https://www.amazon.com/Code-Language-Computer-Hardware-Software/dp/0735611319)

### Other

- [Go By Example](https://gobyexample.com/)
- Roadmaps:
- [Computer Science](https://roadmap.sh/computer-science)
- [Algorithms](https://neetcode.io/roadmap)
- [System Design](https://roadmap.sh/system-design)
- [Software Design Architecture](https://roadmap.sh/software-design-architecture)
- [Backend](https://roadmap.sh/backend)

# Community

Here you can find help
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

> On shore abandoned, kissed by wave, he stood, of mighty thoughts the slave.

**Neva** is a general purpose [dataflow](https://en.wikipedia.org/wiki/Dataflow_programming) ([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** (Nevalang) is a general purpose [dataflow](https://en.wikipedia.org/wiki/Dataflow_programming) ([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).

Oh, and a [visual programming](https://en.wikipedia.org/wiki/Visual_programming_language) finally done right!

Expand Down
21 changes: 0 additions & 21 deletions api/graphql/gqlgen.yml

This file was deleted.

135 changes: 0 additions & 135 deletions api/graphql/schema/schema.gql

This file was deleted.

14 changes: 9 additions & 5 deletions cmd/interpreter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"os"
"path/filepath"

"github.com/nevalang/neva/internal/builder"
"github.com/nevalang/neva/internal/compiler"
Expand Down Expand Up @@ -49,8 +48,9 @@ func main() {
// compiler
analyzer := analyzer.MustNew(resolver)
irgen := irgen.New()
p := parser.MustNew(false)
comp := compiler.New(
parser.MustNew(false),
p,
analyzer,
irgen,
)
Expand All @@ -60,16 +60,20 @@ func main() {
comp,
proto.NewAdapter(),
runTime,
builder.MustNew("/Users/emil/projects/neva/std"),
builder.MustNew(
"/Users/emil/projects/neva/std",
"/Users/emil/projects/neva/thirdparty",
p,
),
)

path, err := filepath.Abs(os.Args[1])
wd, err := os.Getwd()
if err != nil {
fmt.Println(err)
return
}

code, err := intr.Interpret(context.Background(), path)
code, err := intr.Interpret(context.Background(), wd, os.Args[1])
if err != nil {
fmt.Println(err)
return
Expand Down
8 changes: 4 additions & 4 deletions cmd/lsp/general_messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ func (s Server) Initialize(glspCtx *glsp.Context, params *protocol.InitializePar
return
}

s.prog <- prog
s.problems <- problems
s.mod <- prog
s.problems <- string(problems)
}()

return result, nil
}

func (srv Server) Initialized(glspCtx *glsp.Context, params *protocol.InitializedParams) error {
go func() {
for prog := range srv.prog {
for prog := range srv.mod {
glspCtx.Notify("neva/workdir_indexed", prog)
}
}()
Expand All @@ -56,7 +56,7 @@ func (srv Server) Shutdown(context *glsp.Context) error {
}

func (srv Server) Exit(glspContext *glsp.Context) error {
close(srv.prog)
close(srv.mod)
close(srv.problems)
return nil
}
Expand Down
Loading
Loading