enarx / codex

Code examples that can be compiled to WebAssembly for use with Enarx
Apache License 2.0
22 stars 14 forks source link

[Feature]: Restructure `examples` directory #63

Open rvolosatovs opened 2 years ago

rvolosatovs commented 2 years ago

Is there an existing issue for this?

Description

This is the current structure:

git ls-files examples
examples/README.md
examples/assemblyscript/README.md
examples/c#/README.md
examples/c++/README.md
examples/c/README.md
examples/go/README.md
examples/grain/README.md
examples/javascript/README.md
examples/ruby/README.md
examples/rust/README.md
examples/rust/mio/echo-tcp/Cargo.lock
examples/rust/mio/echo-tcp/Cargo.toml
examples/rust/mio/echo-tcp/Enarx.toml
examples/rust/mio/echo-tcp/LICENSE
examples/rust/mio/echo-tcp/README.md
examples/rust/mio/echo-tcp/src/main.rs
examples/rust/std/tcp-client/Cargo.lock
examples/rust/std/tcp-client/Cargo.toml
examples/rust/std/tcp-client/Enarx.toml
examples/rust/std/tcp-client/LICENSE
examples/rust/std/tcp-client/README.md
examples/rust/std/tcp-client/src/main.rs
examples/rust/tokio/echo-tcp/.cargo/config
examples/rust/tokio/echo-tcp/Cargo.lock
examples/rust/tokio/echo-tcp/Cargo.toml
examples/rust/tokio/echo-tcp/Enarx.toml
examples/rust/tokio/echo-tcp/README.md
examples/rust/tokio/echo-tcp/src/main.rs
examples/rust/tokio/http/.cargo/config
examples/rust/tokio/http/Cargo.lock
examples/rust/tokio/http/Cargo.toml
examples/rust/tokio/http/Enarx.toml
examples/rust/tokio/http/LICENSE
examples/rust/tokio/http/README.md
examples/rust/tokio/http/src/date.rs
examples/rust/tokio/http/src/enarx-white.svg
examples/rust/tokio/http/src/fireworks.gif
examples/rust/tokio/http/src/index.html
examples/rust/tokio/http/src/main.rs
examples/rust/tokio/http/src/protocol.rs
examples/swift/README.md
examples/typescript/README.md
examples/zig/README.md

(introduced in #55 )

I believe a much more useful structure would look like:

...
examples/http-client/c
examples/http-server/c
examples/http-server/rust/std
examples/http-server/rust/tokio
...

This way developers can immediately look for the exact functionality they want to implement, and, if an example for the language of their choice is missing - look for examples in different languages they're familiar with. Currently, developers are presented with an empty directory for the language of their choice and then either assume that the language is not supported or have to search through the repository.

Acceptance Criteria

No response

Suggestions for a technical implementation

No response

rjzak commented 2 years ago

People are likely coming here with a language in mind.

bstrie commented 2 years ago

We discussed this with Nathaniel in the meeting yesterday and the conclusion was that we should leave the directories in the cookbook section organized by language, but we should have a table in the readme that lists the status of each cookbook example in each language both as a way to achieve the benefits of this issue and also make it easy for people to understand when an example in a given language is missing to encourage contribution.

nickvidal commented 2 years ago

I'm happy to create a table.