You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiling a Python script that uses the time.sleep() function to WebAssembly using py2wasm, the execution of the WebAssembly module stops when using the Wasmer Runtime. Other runtimes, it works, so I believe it's a wasmer specific issue.
I succesfully compiled this Python script using py2wasm.
import time
def fibonacci(n):
fib_sequence = []
a, b = 0, 1
while len(fib_sequence) < n:
fib_sequence.append(a)
a, b = b, a + b
return fib_sequence
def print_fibonacci(n):
for num in fibonacci(n):
print(num)
time.sleep(2)
# Change the value of 'terms' to adjust the number of Fibonacci numbers printed
terms = 15
print_fibonacci(terms)
However, when i run this ('wasmer run Fibonacci.wasm'), the output it 0 and it stops. When i comment "time.sleep(2)", it prints the result correctly.
Expected behavior
The application should not stop after calling time.sleep.
The text was updated successfully, but these errors were encountered:
Describe the bug
When compiling a Python script that uses the time.sleep() function to WebAssembly using py2wasm, the execution of the WebAssembly module stops when using the Wasmer Runtime. Other runtimes, it works, so I believe it's a wasmer specific issue.
This problem was already discussed in a Discord thread in the official Wasmer server, (https://discord.com/channels/1110300506942881873/1235299336401850518)
Steps to reproduce
I succesfully compiled this Python script using py2wasm.
However, when i run this ('wasmer run Fibonacci.wasm'), the output it 0 and it stops. When i comment "time.sleep(2)", it prints the result correctly.
Expected behavior
The application should not stop after calling time.sleep.
The text was updated successfully, but these errors were encountered: