Skip to content

Add ability to use files from git#134

Merged
certik merged 1 commit into
lfortran:mainfrom
alanocallaghan:main
May 6, 2026
Merged

Add ability to use files from git#134
certik merged 1 commit into
lfortran:mainfrom
alanocallaghan:main

Conversation

@alanocallaghan

@alanocallaghan alanocallaghan commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Really cool project!

Related to #81 and #114, this enables you to load a fortran file from github. The querystring format is very simple, it's everything that comes after raw.githubusercontent.com basically. So
?github=carpentries-incubator/intro-to-modern-fortran/refs/heads/main/exercises/03-maths/solutions/lennard_jones_potential.f90, for example to open https://github.com/carpentries-incubator/intro-to-modern-fortran/blob/main/exercises/03-maths/solutions/lennard_jones_potential.f90

You could in theory split the query up into user+repo (or have these also separate), path to file within repo, and branch (default to HEAD), but this won't really save any space in the URL (should remain well under any limits) and there are no defaults for all of it except branch.

This would be quite helpful for us (well, not me because I don't know any fortran, but some nice people who I am working with today) to develop accessible lessons for fortran :)

@certik certik merged commit adc9fce into lfortran:main May 6, 2026
1 check passed
@certik

certik commented May 6, 2026

Copy link
Copy Markdown
Contributor

Thanks! I merged it, let's see if it works.

Note that LFortran at this webpage is using its experimental direct WASM backend, which has limitations. Our LLVM backend can now compile almost any Fortran, but doesn't run well in the browser, so we'll have to improve the browser experience. We'll do that after we reach beta quality, hopefully later this year.

@certik

certik commented May 6, 2026

Copy link
Copy Markdown
Contributor

I think it works!

https://dev.lfortran.org/?github=carpentries-incubator/intro-to-modern-fortran/refs/heads/main/exercises/03-maths/solutions/lennard_jones_potential.f90

This loads the code. It doesn't compile due to the WASM prototype backend, but otherwise everything works.

@alanocallaghan

alanocallaghan commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

Great! It should be very useful for introductory courses already. Thanks

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

Successfully merging this pull request may close these issues.

2 participants