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

Chat #19

Closed
wants to merge 70 commits into from
Closed

Chat #19

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
89f10b2
Update PHILOSOPHY.md
faddat Feb 4, 2021
999f9b7
Update README.md
faddat Feb 10, 2021
b482b2b
Added a basic Makefile
faddat Feb 13, 2021
c5d351b
Finished Makefile, added some comments to goscan.go
faddat Feb 13, 2021
7b27422
Create make.yml
faddat Feb 13, 2021
2907adf
Update make.yml
faddat Feb 13, 2021
8d83784
Update make.yml
faddat Feb 13, 2021
1050ae2
Update Makefile
faddat Feb 13, 2021
7039e2e
Update Makefile
faddat Feb 13, 2021
47a80e7
Merge pull request #1 from nylira/peng/add-install-info
jaekwon Feb 14, 2021
c3b89cb
Merge pull request #2 from faddat/patch-1
jaekwon Feb 14, 2021
b18b652
Merge pull request #7 from faddat/patch-4
jaekwon Feb 14, 2021
7268494
Add logos screenshot
jaekwon Feb 14, 2021
7e7a53f
enable building gnoland
faddat Feb 14, 2021
bdca653
Update README.md
jaekwon Feb 14, 2021
b3e5d64
Update README.md
jaekwon Feb 14, 2021
dc09e9f
Update README.md
jaekwon Feb 14, 2021
9eb7086
Implemented the techknowlogic version of xgo for multiplatofrm builds
faddat Feb 14, 2021
e4b2043
Update make.yml
faddat Feb 14, 2021
16c0eaa
Update Makefile
faddat Feb 14, 2021
50af14f
Update Makefile
faddat Feb 14, 2021
d5d055b
Update Makefile
faddat Feb 14, 2021
ee66474
Update make.yml
faddat Feb 14, 2021
a0ad981
Update Makefile
faddat Feb 14, 2021
8b22b7d
Update make.yml
faddat Feb 14, 2021
4fc50e0
Update make.yml
faddat Feb 14, 2021
022abce
Update and rename make.yml to build.yml
faddat Feb 14, 2021
d19745b
Update README.md
jaekwon Feb 14, 2021
1034ecc
Update Makefile
faddat Feb 14, 2021
fa1c2e1
Updated build process
faddat Feb 14, 2021
b569f92
Added HasBorder to the Border struct so that tests pass
faddat Feb 14, 2021
8fbae43
Update build.yml
faddat Feb 14, 2021
df1023f
Update build.yml
faddat Feb 14, 2021
48e39a4
Update build.yml
faddat Feb 14, 2021
0926ffa
Merge https://github.com/gnolang/gno into gitpod
faddat Feb 14, 2021
fdc8774
Update README.md
faddat Feb 14, 2021
d4f89e6
Update README.md
faddat Feb 14, 2021
f531d89
https://stackoverflow.com/questions/38172661/what-is-the-meaning-of-and
faddat Feb 14, 2021
e8b1b5d
Corrected some issues
faddat Feb 14, 2021
d51cd1c
Added comments
faddat Feb 14, 2021
7e482c1
Update Makefile
faddat Feb 15, 2021
468ef63
Update build.yml
faddat Feb 15, 2021
0eafccb
beginning of chat, moved logos to the common cmd folder
faddat Feb 17, 2021
3c938bb
composite11.go
jaekwon Feb 17, 2021
f55334f
Merge https://github.com/gnolang/gno into chat2
faddat Feb 18, 2021
4ee2749
type and import decls before vars
jaekwon Feb 19, 2021
f3c8aab
fixing tests; const.go
jaekwon Feb 19, 2021
1b1657e
Merge branch 'master' of https://github.com/gnolang/gno into chat2
faddat Feb 19, 2021
e6a6c14
TRANS_SKIP, and layered decl execution
jaekwon Feb 20, 2021
aa9f155
const implicit repetition fix (types repeat too)
jaekwon Feb 20, 2021
77b2eb8
added plain "go test"
faddat Feb 20, 2021
a7012ed
Merge https://github.com/gnolang/gno into gitpod
faddat Feb 20, 2021
f2aa9b7
Added CHANGELOG
faddat Feb 21, 2021
b6b318d
consts don't convert to default var types
jaekwon Feb 22, 2021
1765eff
uxor, unot; more tests pass.
jaekwon Feb 22, 2021
5abaf48
detect circular definition; big binary op fixes
jaekwon Feb 22, 2021
f80d974
for nil cond fix
jaekwon Feb 22, 2021
493b6d8
Merge https://github.com/gnolang/gno into gitpod
faddat Feb 22, 2021
d54a358
Added new phonies for active dev
faddat Feb 22, 2021
3b6ee3f
Merge https://github.com/gnolang/gno into chat2
faddat Feb 22, 2021
3bdaaa5
Merge branch 'gitpod' of https://github.com/faddat/gno into chat2
faddat Feb 22, 2021
97e31ba
handle native interface elem; handle nil interface equality
jaekwon Feb 22, 2021
958b2ac
implement panic; call functions of declared type
jaekwon Feb 23, 2021
9748687
Add copy() shim
jaekwon Feb 23, 2021
161d77b
implement copy method with slice getpointeratindexint2
jaekwon Feb 23, 2021
61f2433
defer and delete
jaekwon Feb 27, 2021
a669e88
fix tests; for3.go
jaekwon Feb 27, 2021
a7213a9
fix for tests; for6.go
jaekwon Feb 27, 2021
9e10f0e
range iter over string w/ runes
jaekwon Feb 27, 2021
5dc8799
Merge https://github.com/gnolang/gno into chat2
faddat Feb 28, 2021
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
50 changes: 50 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: build
on: [push, pull_request]

jobs:
native:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: '^1.15'
- name: build
run: make
- uses: actions/upload-artifact@v2
with:
name: gnoland
path: |
gnoland
goscan
logos



omni:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: '^1.15'
- name: build
run: make omni
- uses: actions/upload-artifact@v2
with:
name: gno
path: github.com/gnolang


test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: '^1.15'
- name: build
run: make test
31 changes: 31 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- First commits
- Logos browser
- Tests from Yagi
- xgo cross compilation support
- Makefile
- Github action
- Expanded Readme with information about the project

### Changed
- Moved Logos

### Removed



## [1.0.0] - 2017-06-20
### Added


### Changed


### Removed
46 changes: 46 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1 +1,47 @@
all: gnoland goscan logos

.PHONY: logos goscan gnoland


# Uses xgo to compile gnoland, gnoscan and logos
# NB: Binaries will output in the folder github.com/gnoland
targets = windows/amd64,windows/arm64,darwin-10.14/arm64,darwin-10.14/amd64,linux/*

omni: xgo
echo "Building all gnoland components for arm64 and amd64"
xgo -v -x --targets=$(targets) ./cmd/gnoland
xgo -v -x --targets=$(targets) ./cmd/goscan
xgo -v -x --targets=$(targets) ./logos/cmd

# The main show
gnoland:
echo "Building gnoland"
go build -o gnoland ./cmd/gnoland

# goscan scans go code to determine its AST
goscan:
echo "Building goscan"
go build -o goscan ./cmd/goscan


# Logos is the interface to Gnoland
logos:
echo "building logos"
go build -o ./logos ./cmd/logos

clean:
rm logos gnoland goscan

test:
echo "Running tests"
go test
go test tests/*.go -v -run="Test/realm.go"

xgo:
echo "installing xgo"
go get src.techknowlogick.com/xgo


# TODO stringer -type=Op
# Unsure what the above refers to. Created a basic Makefile.

2 changes: 1 addition & 1 deletion PHILOSOPHY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The code is meant to become the spec.
The interpreter serves as a spec for how the AST is meant to be interpreted.
The (virual) machine is designed to interpret an immutable AST which matches the language.
The (virtual) machine is designed to interpret an immutable AST which matches the language.
The interpreter is meant to become independent of the host language, Go.
After the Gno interpreter can interpret itself, we will implement bytecode compilation.
149 changes: 143 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# Gno: Language of Resistance.
# Gno

At first, there was Bitcoin, out of entropy soup of the greater All.
Then, there was Ethereum, which was created in the likeness of Bitcoin,
but made Turing complete.

Among these were Tendermint and Cosmos to engineer robust PoS and IBC.
Then came Gno upon Cosmos and there spring forth Gnoland,
simulated by the Gnomes of the Greater Resistance.

## Language Features

* Like interpreted Go, but more ambitious.
* Completely deterministic, for complete accountability.
Expand All @@ -7,13 +17,20 @@

## Status

_Update Feb 14th, 2021: Implemented Logos UI framework, added Makefile._

This is a still a work in a progress, though much of the structure of the interpreter
and AST have taken place. Work is ongoing now to demonstrate the Realm concept before
continuing to make the tests/files/\*.go tests pass.

Try this:
Make sure you have >=[go1.15](https://golang.org/doc/install) installed, and then try this:

```bash
> go test tests/\*.go -v -run="Test/realm.go"
git clone git@github.com:gnolang/gno.git
cd gno
make
cd build
./gnoland
```

## Ownership
Expand Down Expand Up @@ -125,6 +142,89 @@ Any number of package-level values may be declared in a realm; they are
all owned by the package and get merkle-hashed into a single root hash for
the package realm.

The gas cost of transactions that modify state are paid for by whoever
submits the transaction, but the storage rent is paid for by the realm.
Anyone can pay the storage upkeep of a realm to keep it alive.

## Merkle Proofs

Ultimately, there is a single root hash for all the realms.

From hash.go:

```
//----------------------------------------
// ValueHash
//
// The ValueHash of a typed value is a unique deterministic
// accountable fingerprint of that typed value, and can be used
// to prove the value or any part of its value which is
// accessible from the Gno language.
//
// `ValueHash := lh(ValueImage)`
// `ValueImage:`
// `= 0x00` if nil value.
// `= 0x01,varint(.) if fixed-numeric.
// `= 0x02,sz(bytes)` if variable length bytes.
// `= 0x03,sz(TypeID),vi(*ptr)` if non-nil ptr.
// `= 0x04,sz(OwnerID),sz(ElemsHash),mod,ref` if object.
// `= 0x05,vi(base),off,len,max if slice.
// `= 0x06,sz(TypeID)` if type.
//
// `ElemsHash:`
// `= lh(ElemImage)` if object w/ 1 elem.
// `= ih(eh(Left),eh(Right))` if object w/ 2+ elems.
//
// `ElemImage:`
// `= 0x10` if nil interface.
// `= 0x11,sz(ObjectID),sz(TypeID)` if borrowed.
// `= 0x12,sz(ObjectID),sz(TypedValueHash)` if owned.
// `= 0x13,sz(TypeID),sz(ValueHash)` if other.
// - other: prim/ptr/slice/type/typed-nil.
// - ownership passed through for pointers/slices/arrays.
//
// `TypedValueHash := lh(sz(TypeID),sz(ValueHash))`
//
// * eh() are inner ElemsHashs.
// * lh() means leafHash(x) := hash(0x00,x)
// * ih() means innerHash(x,y) := hash(0x01,x,y)
// * pb() means .PrimitiveBytes().
// * sz() means (varint) size-prefixed bytes.
// * vi() means .ValueImage().Bytes().
// * off,len,max and other integers are varint encoded.
// * len(Left) is always 2^x, x=0,1,2,...
// * Right may be zero (if len(Left+Right) not 2^x)
//
// If a pointer value is owned (e.g. field tagged "owned"), the
// pointer's base if present must not already be owned. If a
// pointer value is not owned, but refers to a value that has a
// refcount of 1, it is called "run-time" owned, and the value
// bytes include the hash of the referred value or object as if
// owned; the value bytes also include the object-id of the
// "run-time" owned object as if it were persisted separately
// from its base object, but implementations may choose to
// inline the serialization of "run-time" owned objects anyway.
//
// If an object is owned, the value hash of elements is
// included, otherwise, the value hash of elements is not
// included except for objects with refcount=1. If owned but
// any of the elements are already owned, or if not owned but
// any of the elements have refcount>1, image derivation
// panics.
```

## Logos Browser

[Logos](/logos) is a Gno object browser. The modern browser as well as the
modern javascript ecosystem is from a security point of view, completely fucked.
The entire paradigm of continuously updating browsers with incrementally added
features is a security nightmare.

The Logos browser is based on a new model that is vastly simpler than HTML.
The purpose of Logos is to become a fully expressive web API and implementation
standard that does most of what HTML and the World Wide Web originally intended
to do, but without becoming more complex than necessary.

## Concurrency

Initially, we don't need to implement routines because realm package functions
Expand All @@ -138,7 +238,16 @@ channel message as well as periodic heartbeat messages even with no sends, so
that select/receive operations can behave deterministically even in the
presence of multiple channels to select from.

## Contributing
## Completeness

Software projects that don't become complete are projects that are forever
vulnerable. One of the requisite goals of the Gno language and related
software libraries like Logos is to become finished within a reasonable timeframe.

## How to become a Gnome

First, read the license. The license doesn't take away any of your rights,
but it gives the Gno project rights to your contributions.

Contributions in the form of completed work in a pull request or issue
or comments are welcome and encouraged, especially if you are interested
Expand All @@ -148,9 +257,37 @@ The biggest bottleneck in these sorts of projects is finding the right people
with the right skillset and character; and my highest priority besides coding,
is to find the right contributors. If you can grok the complexities of this
and related projects without hand holding, and you understand the implications
of this project and are aligned with its mission, keep in touch.
of this project and are aligned with its mission, read on.

The Gno Foundation is a non-profit with missions originally stated in the [Virgo Project](https://github.com/virgo-project/virgo).
The Gno Foundation, which owns the IP to the Gno Works, proposes the following:

* The Gno Foundation permits the Gnoland chain the usage of the Gno Works.
* The Gnoland chain's staking token is given equally to three bodies:

- 1/3 of GNOTs to the Gno Foundation.
- 1/3 of GNOTs to the Gno Community.
- 1/3 of GNOTs to an opinionated spoonful of ATOMs.

Spoonful of atoms to be weighted according to voting history, such that those
who voted in favor of good proposals and against bad proposals as judged by the
Gno Foundation, as well as those who were active in voting, are given favor.
The weighting may be such that some ATOM holders receive no GNOTs.
This is not a fork of the Cosmos Hub, but a new chain, so the distribution is
entirely at the Gno Foundation's discretion, and the foundation has strong opinions.

The Gno Community is determined by the creation and finalization of the project,
as determined by the Gno Foundation according to community contributions.

## Reading the code

Gno's code has been written with extensive comments that explain what each
file does. Eventually, each function will be commented in the same manner.

You can learn a great deal from reading Gnocode, and it's recommended that
both users and developers have a look.

## Updates
## Contact

If you can read this, the project is evolving (fast) every day. Check
"github.com/gnolang/gno" and @jaekwon frequently.
Expand Down
9 changes: 8 additions & 1 deletion cmd/goscan/goscan.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@ import (
"github.com/davecgh/go-spew/spew"
)

/*
Goscan:


*/

func main() {
fset := token.NewFileSet() // positions are relative to fset

filename := os.Args[1]
filename := os.Args[1] // Take a filename as an argument.
bz, err := ioutil.ReadFile(filename)
if err != nil {
panic(err)
Expand All @@ -27,6 +33,7 @@ func main() {
}

// Print the imports from the file's AST.
// AST: https://en.wikipedia.org/wiki/Abstract_syntax_tree
spew.Dump(f)

}
Loading