Skip to content

Commit

Permalink
Final push 0.0.1 (#3)
Browse files Browse the repository at this point in the history
* Fix unused variable in if tests

* Potential 0.0.1 release

Co-authored-by: Rishit Chaudhary <rishitc@users.noreply.github.com>

* fix test filename, add formatting

---------

Co-authored-by: Rishit Chaudhary <rishitc@users.noreply.github.com>
  • Loading branch information
jtenner and rishitc authored Sep 4, 2024
1 parent 05975af commit 5b7120c
Show file tree
Hide file tree
Showing 13 changed files with 347 additions and 170 deletions.
73 changes: 73 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at louis at lpil.uk. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let assert Ok(add_module) =
rec_type.func_type([val_type.i32, val_type.i32], [val_type.i32]),
)
// 4. Tell the wasm module that "function 0" has the type of "type 0"
|> module.add_function_type(type_idx_0)
|> module.append_function_type_index(type_idx_0)
// 5. Add the body of the function to the module at function index 0
|> module.add_code(
// 5.a Function parameters and locals must be defined here: [..parameters, ..locals]
Expand Down Expand Up @@ -71,4 +71,11 @@ Some of these goals are personal,
2. Be compatible with JavaScript and Gleam Targets
3. Validate and Host WASM modules in a Spec Compliant way (not necessarily with performance in mind)
4. (Personal) - Conquer the WebAssembly GC specification, validation, execution, and building
5. Make a developer friendly interface for generating abstract WASM modules, manipulating code, and compile them to WASM binaries
5. Make a developer friendly interface for generating abstract WASM modules, manipulating code, and compile them to WASM binaries

## Maintainers

Special Thanks to

Rishit Chaudhary <rishitc@users.noreply.github.com>

2 changes: 1 addition & 1 deletion gleam.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name = "shinecoder"
name = "shine_coder"
version = "0.0.1"

# Fill out these fields if you intend to generate HTML documentation or publish
Expand Down
17 changes: 17 additions & 0 deletions src/builder/instructions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# WASM Instructions

Regarding the WebAssembly specification, it might be difficult to understand the purpose of each opcode. The following sections can help you find the information you are looking for.

## Instructions Structure

- [Numeric Instructions](https://webassembly.github.io/gc/core/syntax/instructions.html#numeric-instructions)
- [Vector (v128) Instructions](https://webassembly.github.io/gc/core/syntax/instructions.html#vector-instructions)
- [Reference Instructions](https://webassembly.github.io/gc/core/syntax/instructions.html)
- [Aggregate Instructions](https://webassembly.github.io/gc/core/syntax/instructions.html#aggregate-instructions)
- [Parametric Instructions](https://webassembly.github.io/gc/core/syntax/instructions.html#parametric-instructions)
- [Variable Instructions](https://webassembly.github.io/gc/core/syntax/instructions.html#variable-instructions)
- [Table Instructions](https://webassembly.github.io/gc/core/syntax/instructions.html#table-instructions)
- [Memory Instructions](https://webassembly.github.io/gc/core/syntax/instructions.html#memory-instructions)
- [Control Instructions](https://webassembly.github.io/gc/core/syntax/instructions.html#control-instructions)

These instructions are constructed while using the `ExpressionBuilder` api, which only help build the binary representation.
1 change: 1 addition & 0 deletions src/builder/instructions/any.gleam
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import builder/expression.{type ExpressionBuilder}
import internal/structure/types.{AnyConvertExtern}

/// Convert an external value to an anyref
pub fn convert_extern(builder: ExpressionBuilder) {
builder
|> expression.push(AnyConvertExtern)
Expand Down
8 changes: 6 additions & 2 deletions src/builder/instructions/array.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ pub fn array_new_default(builder: ExpressionBuilder, idx: TypeIDX) {
|> expression.push(ArrayNewDefault(idx))
}

pub fn array_new_data(builder: ExpressionBuilder, idx: TypeIDX, data: DataIDX) {
pub fn array_new_data(
builder: ExpressionBuilder,
idx: TypeIDX,
data_idx: DataIDX,
) {
builder
|> expression.push(ArrayNewData(idx, data))
|> expression.push(ArrayNewData(idx, data_idx))
}

pub fn array_new_elem(builder: ExpressionBuilder, idx: TypeIDX, elem: ElemIDX) {
Expand Down
Loading

0 comments on commit 5b7120c

Please sign in to comment.