Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using sample function Richard.js #209

Open
louisvangeldrop opened this issue Nov 12, 2024 · 7 comments
Open

Error using sample function Richard.js #209

louisvangeldrop opened this issue Nov 12, 2024 · 7 comments

Comments

@louisvangeldrop
Copy link

I try to compile the richard.js sample under windows to native using: porf native richard.js richard.exe --compiler=clang-cl

The result is: 1513/1514 optimizing...TypeError: Cannot read properties of undefined (reading 'push')

@Rob23oba
Copy link
Contributor

Could you try -d? That will hopefully give a better error message.

@louisvangeldrop
Copy link
Author

1513/1514 optimizing...TypeError: Cannot read properties of undefined (reading 'push')
at z (file:///C:/Users/louis/AppData/Roaming/npm/node_modules/porffor/compiler/pgo.js:95:34)
at js.#main (wasm://wasm/js-0031a292:wasm-function[9]:0x14bb)
at exports. [as main] (file:///C:/Users/louis/AppData/Roaming/npm/node_modules/porffor/compiler/wrap.js:506:26)
at Module.run (file:///C:/Users/louis/AppData/Roaming/npm/node_modules/porffor/compiler/pgo.js:116:13)
at default (file:///C:/Users/louis/AppData/Roaming/npm/node_modules/porffor/compiler/index.js:122:11)
at default (file:///C:/Users/louis/AppData/Roaming/npm/node_modules/porffor/compiler/wrap.js:346:102)
at file:///C:/Users/louis/AppData/Roaming/npm/node_modules/porffor/runner/index.js:149:15

@Rob23oba
Copy link
Contributor

Hmm, maybe try the option --no-pgo, that seems to be causing the issue.

@louisvangeldrop
Copy link
Author

I can compile richards.js without any problem. However when I run richard.exe I do not get the result printed

@Rob23oba
Copy link
Contributor

Yeah, there are still some issues to be fixed in the 2c compiler and in Porffor general.

@louisvangeldrop
Copy link
Author

Will compileing to wasm help. And if so which wasm-engine to use?

@Rob23oba
Copy link
Contributor

I'm pretty sure porffor just doesn't support some of the things that are used in there. You can try to compile to wasm but there are some details about importing that are a bit difficult, otherwise any wasm engine supporting exception handling should suffice. If you just want to run it, doing porf richard.js should do the trick but I'm going to assume that similar issues will arise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants