WasmEdge LFX Mentorship Pre-test

This is a WasmEdge LFX mentorship pre-test for Module instance dependency tree in WASM store (https://github.com/WasmEdge/WasmEdge/issues/4514)

Submission Requirements

Mentee will submit two materials on the mentorship system:

  1. RESUME
  2. COVER LETTER

Cover Letter Format

The COVER LETTER should follow the given format listed below:


The Original Cover Letter

No format limit, you can put anything you want

Check List

Pre-test 1

Please show the answer about the following code snippet:

def alphabetToNum(c):
    if c >= 'a' and c <= 'z':
        return (ord(c) - ord('a') + 1) * 100
    elif c >= 'A' and c <= 'Z':
        return (ord(c) - ord('A') + 1) * 1000
    elif c >= '0' and c <= '9':
        return int(c)
    else:
        return 10000

result = 0
for a in "111BBBccc!@#$^*":
    result += alphabetToNum(a)
print(result)

Pre-test 2

To proof you have the basic understand about the C/C++ skills and WasmEdge C API:

  1. Refer to the following WASM files.
  2. ;; lib.wasm
    (module
      (func (export "add") (param i64 i64) (result i64)
        (i64.add (local.get 0) (local.get 1))
      )
      (func (export "mul") (param i64 i64) (result i64)
        (i64.mul (local.get 0) (local.get 1))
      )
    )
    ;; calc.wasm
    (module
        (type $type0 (func (param i64 i64)(result i64)))
        (import "lib" "add" (func $lib-add (type $type0)))
        (import "lib" "mul" (func $lib-mul (type $type0)))
        (func (export "add_and_square") (param i64 i64) (result i64)
            ;; Function to add 2 numbers and square it ((a + b)^2).
            ;; Exported as "add_and_square".
            (call $lib-mul
                (call $lib-add (local.get 0) (local.get 1))
                (call $lib-add (local.get 0) (local.get 1))
            )
        )
    )
  3. Use the WasmEdge C API to write the C/C++ code of executing the WASM function. You can decide the arguments you want.
  4. Both the image of the execution result and the soure code (.cpp format) should be attached here.

Your Proposal

We would like to know what's your planing to finish this mentorship inside the mentorship timeline. You should disclosure if there is a event (such as mid-term or final exam) and the progress may be less than other week.