Hey there 🤗, Welcome to my GSoC Journey
This is a series of blogs that I am writing to share my amazing GSoC 22 (Google Summer of Code 2022) Journey with you all.
Adding Print support and Deploying on Live Site
In this week, I-
- added support for printing in the generated wasm binary
- added support for stop and error stop
- built the LCompilers Frontend for
LFortran(compiled towasm) and deployed it toGitHub Pageswith the compiledlfortran wasm binary.
I also worked on my Compiling LFortran to wasm task of Week/Blog 2. The same blog has been updated and can be found here.
During this weeks endeavour, I faced challenges at two places:
-
After upgrading my
nodeversion (as stated here), myemscriptenstopped working. I neededemscriptento compileLFortrantowasm. Things started working when I successfully uninstalled my upgradednodeand reinstalledemscripten. And I was able to buildLFortrantowasmusingemscripten. -
Even though
emscriptenwas fixed andLFortranwas successfully compiling towasm, it did not haveC++ exceptionssupport. As per !1549, we need to add the flag-fexceptionsto enable exception support. Even after including the-fexceptionsflags, exceptions were still not being supported. Withoutexceptionssupport theLCompilers Frontendwas not showing the hints/feedback if there were errors in the source code. I tried different combination ofemscriptenflags and finally found that- the flag
-s STANDALONE_WASMwas somehow not-allowing/disablingexceptionssupport - apart from including
-fexceptionsasemscriptenflags,-fexceptionsis also needed to be included asCXX_DEBUG_FLAGSin thebuild_to_wasm.shscript
- the flag
This phase was mostly/approximately from 18-06-2022 to 24-06-2022.
The MRs during this phase are as follows:
- !1794 WASM: Add print support
- !1795 WASM: parse empty source code
- !1797 WASM: Add support for stop and error stop
Also,
GitHub Repo for Frontend: https://github.com/Shaikh-Ubaid/lcompilers_frontend
Live Site: https://shaikh-ubaid.github.io/lcompilers_frontend/
Upcoming Tasks for next week:
- Building a NodeJS testing infrastructure #712
- Adding support for
if-elsestatements in theWASM Backend#700
That’s all for this blog. Thank you for your time. We continue this series in the next blog.