GaloisInc / HaLVM

The Haskell Lightweight Virtual Machine (HaLVM): GHC running on Xen
BSD 3-Clause "New" or "Revised" License
1.05k stars 88 forks source link

Port HaLVM to GHC 8.0.1 #82

Closed izgzhen closed 7 years ago

izgzhen commented 7 years ago

There are "only" about 160 commits between https://github.com/ghc/ghc/compare/ghc-7.8...GaloisInc:halvm. So I guess it would be possible to redo everything from scratch for https://github.com/ghc/ghc/tree/ghc-8.0.

I did find some attempts in halvm-ghc's branches:

About porting:

  1. The halvm-base should be eliminated. And as I found, the diff between halvm-base and master base is not much.
  2. Should we move XenDevice, HaLVMCore etc. from HaLVM to HaLVM-GHC source tree? I favour this organization more because they will eventually become part of GHC source anyway (thus the developer of HaLVM will consciously know that he is developing GHC boot-libraries).
  3. How hard would it be: if we want to pull in the rump-kernel/Solo5 redesign at the same time?

Anyway, thanks for your hard work all the way along. I hope we can make some progress before the end of this year ;)

acw commented 7 years ago

Hi @izgzhen! The answers to your questions are mostly inter-related, so I'm going to take them out of order.

With regard to question 2, currently we haven't had any plans to move stuff from the main HaLVM tree into halvm-ghc. This is due to some skepticism that the GHC maintainers will ever accept these libraries in the mainline build, but also some amount of laziness.

With regard to question 1, yes, it does. In fact, it has to be starting in GHC 7.10, and so this got reverted. The GHC 8 HaLVM trees (I believe wip-halvm-ghc-8.0 is my live tree) include the base library directly rather than using halvm-base, I believe.

Finally, with regard to question 3, yes. 😃 My plan was for GHC 8 to be a HaLVM 3 feature. Hence the branches you're seeing are tied to my HaLVM3 work. If you want to see where we are with that, I believe wip-halvm3-base is where I've been working. It doesn't do much right at the moment, but that's the right place to watch. One of these days (we have a long weekend coming up in the US, so perhaps then?) I need to write up the plan, with pointers into this tree, for others to help.

izgzhen commented 7 years ago

In the question 2, My point is to utilize git merge to maintain the HaLVMCore in our own source tree. But well, it is not essentially different, so we can ignore this for now :)

izgzhen commented 7 years ago

I am working on https://github.com/izgzhen/halvm-ghc/tree/wip-halvm-ghc-8.0 and https://github.com/izgzhen/HaLVM/tree/wip-ghc8. I tried a bit previously and figured that it might be easier to first port GHC then tackling the libc and xen layer problem ...

izgzhen commented 7 years ago

Looks like my porting to GHC8 worked -- at least for Core/Hello now

izgzhen commented 7 years ago

Okay, so I will first try the examples one by one, and see if changing to musl is a must-to-do now (some functions are not defined in old minlibc) ... here is the progress (in continued updating):

izgzhen commented 7 years ago

I am preparing for PR now. There are several issues to solve:

izgzhen commented 7 years ago

Note: base/GHC/Event/NoIO.hs is not integrated yet, but I have already update the HaLVM's Makefile

izgzhen commented 7 years ago

All relevant PR submitted.

dmjio commented 7 years ago

@izgzhen fantastic work on this

izgzhen commented 7 years ago

@dmjio Thanks, and I actually forgot that this issue is still open :)