FAQ
Login
GNU social JPは日本のGNU socialサーバーです。
Usage
/
ToS
/
admin
/
test
/
Pleroma FE
Public
Public
Network
Groups
Featured
Popular
People
Embed Notice
HTML Code
<blockquote style="position: relative; padding-left: 55px;"><section><a href="https://mk.absturztau.be/notes/9bls9dv6e1">niconiconi (niconiconi@mk.absturztau.be)'s status on Friday, 24-Feb-2023 16:36:00 JST</a><a href="https://mk.absturztau.be/@niconiconi" title="niconiconi@mk.absturztau.be"><img src="https://gnusocial.jp/theme/gnusocialjp/default-avatar-stream.png" width="48" height="48" alt="niconiconi" style="position: absolute; left: 0; top: 0;">niconiconi</a></section><article><p>FORTRAN to WebAssembly cross-compile is a success! I can run FORTRAN code in Firefox now!!!</p></article><footer><a rel="bookmark" href="https://gnusocial.jp/conversation/1240298#notice-2617998">In conversation</a><time datetime="2023-02-24T16:36:00+09:00" title="Friday, 24-Feb-2023 16:36:00 JST">Friday, 24-Feb-2023 16:36:00 JST</time> <span>from <span><a href="https://mk.absturztau.be/notes/9bls9dv6e1" rel="external" title="Sent from mk.absturztau.be via ActivityPub">mk.absturztau.be</a></span></span><a href="https://mk.absturztau.be/notes/9bls9dv6e1">permalink</a><h4>Attachments</h4><ol><li><label><a rel="external" href="https://gnusocial.jp/attachment/750088">[user@openwork fortran]$ cat test.f90 module m_test implicit none integer, parameter :: dp = selected_real_kind(15, 307)contains ! calculate pi using Gregory-Leibniz algorithm ! https://craftofcoding.wordpress.com/2020/04/09/calculating-π-with-gregory-leibniz-ii-fortran/ function pi_leibniz(n) result(x) bind(c, name = 'pi_leibniz') integer, value :: n integer :: i real (kind=dp) :: x x = 1.0_dp do i = 1,n if (mod(i,2) == 1) then x = x - (1.0_dp / ((i*2.0_dp)+1.0_dp)) else x = x + (1.0_dp / ((i*2.0_dp)+1.0_dp)) end if end do x = x * 4.0_dp end function pi_leibnizend module m_test</a></label><br><a href="https://misskey-taube.s3.wasabisys.com/files/44e0f11e-183a-4b89-a8c1-fd5d1c0f940f.png" rel="external">https://misskey-taube.s3.wasabisys.com/files/44e0f11e-183a-4b89-a8c1-fd5d1c0f940f.png</a></li><li><label><a rel="external" href="https://gnusocial.jp/attachment/750089">[user@openwork fortran]$ cat test.html <!DOCTYPE html> <html> <body> <script type="module"> async function init() { const { instance } = await WebAssembly.instantiateStreaming( fetch("./test.wasm") ); var result = instance.exports.pi_leibniz(100000000); document.write(result) } init(); </script></body> </html> [user@openwork fortran]$ make flang-new -O2 --target=i386 -emit-llvm -S test.f90 llc --march=wasm32 -filetype=obj test.ll wasm-ld -L/usr/local/lib/clang/17/lib/wasi/ -l:libclang_rt.builtins-wasm32.a --no-entry --export-all -o test.wasm test.o</a></label><br><a href="https://misskey-taube.s3.wasabisys.com/files/997a8e3c-3fa8-4631-87bb-8de4f427ecf9.png" rel="external">https://misskey-taube.s3.wasabisys.com/files/997a8e3c-3fa8-4631-87bb-8de4f427ecf9.png</a></li><li><label><a rel="external" href="https://gnusocial.jp/attachment/750090">A Firefox browser window URL: https://127.0.0.1:8000/test.htmlWeb page shows: 3.141592663589326</a></label><br><a href="https://misskey-taube.s3.wasabisys.com/files/9039c350-6220-46ec-aee1-f83105251def.png" rel="external">https://misskey-taube.s3.wasabisys.com/files/9039c350-6220-46ec-aee1-f83105251def.png</a></li></ol></footer></blockquote>
Corresponding Notice
Embed this notice
niconiconi (niconiconi@mk.absturztau.be)'s status on Friday, 24-Feb-2023 16:36:00 JST
niconiconi
FORTRAN to WebAssembly cross-compile is a success! I can run FORTRAN code in Firefox now!!!