Frege / frege

Frege is a Haskell for the JVM. It brings purely functional programing to the Java platform.
https://github.com/Frege/frege/wiki/_pages
Other
3.64k stars 145 forks source link

make frege build easier to bootstrap #180

Open thkoch2001 opened 9 years ago

thkoch2001 commented 9 years ago

As mentioned in #170, debian (and other distros) have good reasons to build everything from source. This is difficult (but not impossible) if something depends on itself for being built.

Are there ways how Frege could become easier to build without Frege? Some Ideas:

Ingo60 commented 9 years ago

I am afraid none of your points would really work, AFAICS:

How do other self hosting languages (Haskell, Scala?) do it?

thkoch2001 commented 9 years ago

I've not yet worked on any compiled package in Debian. So I don't want to give false informations on how other debian packages solve this. However I believe that bootstrapping Frege from Java Source files is still beneficial.

Ingo60 commented 9 years ago

In some sense, yes:

I am sorry this all sounds that terrible, It's just that I see no easy way, and don't want to hide the technical difficulties that I see.

I see the value, and appreciate it, in building everything from sources. But it is simply difficult with self-hosting compilers.

seancorfield commented 9 years ago

Also, I would anticipate that at some point Frege's compiler will move from generating Java to generating JVM bytecode, like most other compilers, so any thoughts of blessing the generated Java source code as somehow "official" in any way seems completely wrong-headed to me.

ghost commented 9 years ago

That might open a new issue. Is Frege able to produce reproducible builds? https://wiki.debian.org/ReproducibleBuilds/About

Debian aims to have byte for byte identical builds of its packages independently of the time or machine. Is the bytecode produced by Frege identical in two subsequent builds of the same source code?

Reproducability is not a must have to enter the debian archive but it's a good thing to aim for.

Ingo60 commented 9 years ago

No, it's not.

For one, we have a time stamp of the time of compilation.

And then, as mentioned before, the compiler generates a lot of synthetic symbols (not just local variables) using a unique number generator. The state of that number generator is not deterministic in case of parallel builds. But those builds are the way to go if you want to compile some program like the compiler that consists of many modules, since it figures out the dependency order and thus which modules can be compiled when and which ones can be build concurrently.

To be sure, the generated programs are identical up to renamings of certan variables. But I guess that is not what is looked for.

ForNeVeR commented 9 years ago

It seems that guys from GHC will have to do some changes to implement deterministic builds: https://ghc.haskell.org/trac/ghc/ticket/4012

mat8913 commented 8 years ago

Would it be possible to put a pre-built compiler in the source package? That's what the rustc Debian package does: https://sources.debian.net/src/rustc/1.6.0%2Bdfsg1-2/dl/

Ingo60 commented 8 years ago

You mean the java files? Sure, but this would get fairly big. Surely not less than 100MB.

mat8913 commented 8 years ago

Isn't https://github.com/Frege/frege/releases/download/3.23.288/frege3.23.422-ga05a487.jar all that's needed? It's less than 20MB.

Ingo60 commented 8 years ago
  1. The JAR is binary, but the requirement was to build from source code.
  2. The compiler is still in development and self-hosting, this means there is no guarantee that it will be able to compile the latest sources. Hence, one would have to maintain a JAR and a set of sources from whence step by step and commit by commit the latest can be build. (But even this is sometimes impossible to do automatically.)

Now, option 2 is exactly what we have already: Access to all versions of the sources through git, and a recent enough compiler to compile HEAD in the releases area.