Hacker News new | past | comments | ask | show | jobs | submit | certik's comments login

It was a lot of corner cases that we had to get right, it's the most advanced code that LFortran can compile. I think none of the features individually is difficult to support, but there were a lot of them.


Does anyone know how many transistors were on each chip?

The complete system of 28 chips had 74,442 transistors. From that it follows that some chip had at least 74,442 / 28 = 2,659 transistors. But I am guessing some chips had less, and some chips had more. I am curious how many transistors the chips had on this computer, specifically what was the maximum amount per IC.


Beautiful! I would like to see more cursive handwriting fonts. Here is my contribution from 2 years ago:

https://certik.github.io/slabikar-otf/


Yes, I also like The Theoretical Minimum. Ha, I didn't realize there is more than one book! I think I only have the classical mechanics book. Need to buy the other ones.

I tried to organize many physics subjects in a similar manner, with many worked out examples (minimal, but non-trivial/complete):

https://www.theoretical-physics.com/dev/index.html


The author of LFortran here.

The demo at https://dev.lfortran.org uses our direct WASM backend that does not use LLVM. It is currently more limited, and indeed, we currently do not support the cubic power x**3 there, only square power x**2. Our most advanced backend is LLVM, and that of course supports x**3 and a very wide subset of Fortran (such as 60% of all SciPy packages fully compile and all SciPy tests pass). However, LLVM is huge and relatively slow, so we do not use LLVM in the online demo, which runs the compiler itself in the browser.

For offline LLVM based WASM compilation I think LFortran is ready be tried. We'll be happy to help!


I’ll definitely be trying out more of LFortran in the future.

For this post I really wanted to go deeper into the approach we’ve taken with flang, but I can see that LFortran is also a very strong choice here for running Fortran on Wasm.


Thanks. Please report all bugs that you find. I talked to my collaborators, we'll try to get some simple demo of Fortran->LLVM->WASM working soon, we need to figure out the runtime library issue (like you did), hook it into the driver, etc. I was in fact thinking about exactly this just last week, to easily distribute my simple computational codes online via static pages.

I think exactly the approach that you took with Flang should work with LFortran also.


Grats for the amazing work! LFortran is very cool project.


Thank you!


Just curious but what is keeping you from compiling x*3?


Nothing, we can compile x*3. We can't compile x**3, because we do not have a runtime library setup for WASM yet (Flang above had the same issue) and WASM can do x**2, but arbitrary power, such as x**3, requires a runtime power function that we haven't implemented yet. If you want to help, you can fix it probably quite easily right here: https://github.com/lfortran/lfortran/blob/69d488b1d1fd26b163....


How about cube roots of fractions and rational numbers? (TI and Casio fans will get the deep cut)


The LLVM backend just does the usual floating point calculation for those.


Wow, this looks great. Seems like there is a mini-renaissance of Fortran that I've been seeing lately. I see from the main page:

"LLVM makes it possible to run LFortran on diverse hardware and take advantage of native Fortran language constructs (such as do concurrent) on multi-core CPUs and GPUs."

...is LFortran close to using coarrays, etc, and farming it out as appropriate to the GPU cores?


We are progressing. We'll tackle parallel loops very soon, and get some GPU offloading working. Our main focus is still on just compiling Fortran codes via LLVM. Once we can compile most codes, we'll focus on the various other backends, including GPU, running in the browser and Jupyter.


GFortran, Flang and LFortran are all open-source compilers that support modern Fortran.


LFortran error messages style got inspired by Rust, and the Fortran Package Manager got inspired by Cargo. And in return Rust can get inspired by LFortran to do the interactive prompt. :)

In all seriousness though, Rust got many things right and showed how a modern language, compiler and a package manager should behave. I think it genuinely moved the state-of-the-art. And we are trying hard to improve on the state-of-the-art as well. I think a modern compiler should compile fast in Debug mode, and generate high performance code in Release mode. And it should compile to a binary as well as work interactively. Etc.


It can be both. If you know the dimension at compile time, it is compile time, if you don't it will be runtime.


Yes, there are many nice people there and we are doing what we can to moderate the Discourse so that we can all have a nice place to discuss.


Peter, I am sorry that some users drove you away, possibly myself included. I am personally doing what I can to keep the Fortran open source (and commercial) community together, I have done this before (e.g., with SymPy), and the Fortran community can be very tough in some of the responses. I know most of the people in person, and they are all very nice people.

We regularly address unconstructive behavior. If you or anyone has some feedback how we can run things better, please let me know (you can email me at ondrej@certik.us).


Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: