-
Notifications
You must be signed in to change notification settings - Fork 156
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
Setup online lpython #2328
Setup online lpython #2328
Conversation
Add info about the new flags
This would ensure that it does not break in future
5538e84
to
bd4f333
Compare
|
||
# Notes: | ||
# STANDALONE_WASM is disabling support for exceptions, so it is currently omitted | ||
# In build_to_wasm.sh, we need CMAKE_CXX_FLAGS_DEBUG="-Wall -Wextra -fexceptions" flags for exception support | ||
set(WASM_COMPILE_FLAGS "-g0 -fexceptions") | ||
set(WASM_COMPILE_FLAGS "-g0 -fexceptions -fsanitize=undefined") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LPython's parser segfaults in many cases when LPython is build to wasm. It seems LPython uses a different parser as compared to LFortran. I think LPython uses LR(1) parser where as LFortran uses GLR parser.
The above -fsanitize
flag is actually a debugging flag, but it seems to make LPython's parser to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, LPython uses LALR(1), which should be an easier parser.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a previous version of emscripten, the LPython parser would abort with error in the lines of "large memory ~3.5Gbs requested which is more than the available ~2.4Gbs". With the latest version of emscripten, it says "aborted, runtime error". (I updated my installed emscripten
to be sure the errors are not due to some old version. )
Also do not emit warnings for C Intrinsic funcs
bd4f333
to
1b52a44
Compare
@@ -164,6 +168,7 @@ abi -- External ABI | |||
| GFortranModule -- Yes GFortran | |||
| BindC -- Yes C | |||
| BindPython -- Yes Python | |||
| BindJS -- Yes Javascript |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a new decorator for calls to Javascript functions. We previously used the (BindC + implementation=interface) for recognizing the functions to be imported. But it seems some functions from the numpy intrinsic module use these exact parameters (BindC + interface) and thus we are unable to distinguish between these numpy intrinsic functions and the functions that call into Javascript.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's fine. The same should be done in LFortran.
--> tests/../integration_tests/elemental_01.py:10:24 | ||
| | ||
10 | assert abs(sin(sin(array[i])) - result[i]) <= eps | ||
| ^^^^^^^^^^^^^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These few files got removed. I think these were left over from some previous PR.
After we merge this, we need to update the commit version at https://dev.lpython.org/ (and also the browser window tab name). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this is fine, thanks!
Demo: https://dev.lpython.org/