learnforpractice
learnforpractice
> maybe io.ReadFull should fix this? rand.Read calls io.ReadFull inside, so replace rand.Read with io.ReadFull can't fix this issue. See the source code in the following link: https://golang.org/src/crypto/rand/rand.go?s=809:847#L13
The following code works as expected: ``` class B: def __bool__(self) -> bool: raise AttributeError("don't do that!") b = B() try: if b: pass except AttributeError: print("HI") ```
It's important to keep in mind that Codon is a static Python compiler and may have compatibility issues with CPython. In particular, Codon may not support some dynamic language features....
It seems that a codon class can be compared to a Python class that utilizes the @dataclass decorator.
I got lucky. Here is how I do it: hello.codon ```python @export def add(a: int, b: int) -> int: return a + b ``` ``` codon build -o hello.ll hello.codon...
Not sure what version of clang you are using, but I'm using clang and wasm-ld from wasi-sdk. https://github.com/WebAssembly/wasi-sdk Using clang and wasm-ld from LLVM 15 is also fine I think.
I am currently working on porting the codon runtime to WebAssembly. It does take some time, but I am happy to say that I have now successfully run a "hello,...
Making a running demo may be easy, but creating a finished product can be difficult. From my experience, I have learned that it's important to be prepared to handle unexpected...
> There you go. https://github.com/learnforpractice/codon Happy Debugging! @arshajii Maybe create a wasm branch for better issue tracking?
@ctzurcanu check the command in CMakeLists.txt here: https://github.com/learnforpractice/codon/blob/2d967d487f95eec195493957952b243632353d7e/targets/wasm/demo/CMakeLists.txt#L16