Re: Scala package

2021-05-22 Thread Shyam Saran
It is helpful for our beloved OS -thanks
it will be helpful for app development.
At present, I do not know any of groovy, scala (will learn.)


On Fri, 21 May 2021 at 01:05, Julien Lepiller  wrote:

> I'll think about that. Note that we already have Groovy, as it's properly
> bootstrapped :)
>
> Le 20 mai 2021 15:09:08 GMT-04:00, Shyam Saran 
> a écrit :
>>
>>
>> Many people want to move all their development work on guix
>>
>> example android sdk app development, yes scala, gradle, kotlin, groovy
>> etc (even blockstack, ethereum) required to be packaged
>> As many of you, and Julien trying this.
>>
>> So more than contributing code, please provide a blog post from which,
>> who all want to help
>> can also get guidance.
>>
>>
>> Thanks
>>
>> syam
>>
>>
>>
>>
>>
>> On Wed, 19 May 2021 at 21:06, Katherine Cox-Buday <
>> cox.katherin...@gmail.com> wrote:
>>
>>> Ludovic Courtès  writes:
>>>
>>> >> I think the best way to bootstrap would be to reimplement Scala in
>>> > another language. I tried that too, but even the parser is crazy.
>>>
>>> Yes, the syntax is complex. Maybe even worse than C++ in terms of
>>> parsing. I abandoned scala awhile ago, but I saw that with its latest
>>> release, maybe some things got simplified. Maybe it's worth another
>>> look?
>>>
>>> > Could you share a link to that so everyone realizes just how far you
>>> > went?  :-)
>>>
>>> Before I outright abandoned the language, I was looking into
>>> bootstrapping this too. I did not go nearly as far, but was strongly
>>> dissuaded by core scala contributers from even trying (to be fair, they
>>> probably don't hold bootstrapping in high regard as we do).
>>>
>>> The only thought I have to contribute is: would it be possible to
>>> bootstrap off of a binary seed, and then do what's possible to grow that
>>> down to prior versions as much as possible? It's a compromise, but it at
>>> least gets Guix into the scala ecosystem and provides scaffolding to
>>> work off of. Of course this might run contrary to Guix's goals/needs.
>>>
>>> --
>>> Katherine
>>>
>>>


Re: Scala package

2021-05-20 Thread Julien Lepiller
I'll think about that. Note that we already have Groovy, as it's properly 
bootstrapped :)

Le 20 mai 2021 15:09:08 GMT-04:00, Shyam Saran  a 
écrit :
>Many people want to move all their development work on guix
>
>example android sdk app development, yes scala, gradle, kotlin, groovy
>etc
>(even blockstack, ethereum) required to be packaged
>As many of you, and Julien trying this.
>
>So more than contributing code, please provide a blog post from which,
>who
>all want to help
>can also get guidance.
>
>
>Thanks
>
>syam
>
>
>
>
>
>On Wed, 19 May 2021 at 21:06, Katherine Cox-Buday
>
>wrote:
>
>> Ludovic Courtès  writes:
>>
>> >> I think the best way to bootstrap would be to reimplement Scala in
>> > another language. I tried that too, but even the parser is crazy.
>>
>> Yes, the syntax is complex. Maybe even worse than C++ in terms of
>> parsing. I abandoned scala awhile ago, but I saw that with its latest
>> release, maybe some things got simplified. Maybe it's worth another
>> look?
>>
>> > Could you share a link to that so everyone realizes just how far
>you
>> > went?  :-)
>>
>> Before I outright abandoned the language, I was looking into
>> bootstrapping this too. I did not go nearly as far, but was strongly
>> dissuaded by core scala contributers from even trying (to be fair,
>they
>> probably don't hold bootstrapping in high regard as we do).
>>
>> The only thought I have to contribute is: would it be possible to
>> bootstrap off of a binary seed, and then do what's possible to grow
>that
>> down to prior versions as much as possible? It's a compromise, but it
>at
>> least gets Guix into the scala ecosystem and provides scaffolding to
>> work off of. Of course this might run contrary to Guix's goals/needs.
>>
>> --
>> Katherine
>>
>>


Re: Scala package

2021-05-20 Thread Shyam Saran
Many people want to move all their development work on guix

example android sdk app development, yes scala, gradle, kotlin, groovy etc
(even blockstack, ethereum) required to be packaged
As many of you, and Julien trying this.

So more than contributing code, please provide a blog post from which, who
all want to help
can also get guidance.


Thanks

syam





On Wed, 19 May 2021 at 21:06, Katherine Cox-Buday 
wrote:

> Ludovic Courtès  writes:
>
> >> I think the best way to bootstrap would be to reimplement Scala in
> > another language. I tried that too, but even the parser is crazy.
>
> Yes, the syntax is complex. Maybe even worse than C++ in terms of
> parsing. I abandoned scala awhile ago, but I saw that with its latest
> release, maybe some things got simplified. Maybe it's worth another
> look?
>
> > Could you share a link to that so everyone realizes just how far you
> > went?  :-)
>
> Before I outright abandoned the language, I was looking into
> bootstrapping this too. I did not go nearly as far, but was strongly
> dissuaded by core scala contributers from even trying (to be fair, they
> probably don't hold bootstrapping in high regard as we do).
>
> The only thought I have to contribute is: would it be possible to
> bootstrap off of a binary seed, and then do what's possible to grow that
> down to prior versions as much as possible? It's a compromise, but it at
> least gets Guix into the scala ecosystem and provides scaffolding to
> work off of. Of course this might run contrary to Guix's goals/needs.
>
> --
> Katherine
>
>


Re: Scala package

2021-05-19 Thread Katherine Cox-Buday
Ludovic Courtès  writes:

>> I think the best way to bootstrap would be to reimplement Scala in
> another language. I tried that too, but even the parser is crazy.

Yes, the syntax is complex. Maybe even worse than C++ in terms of
parsing. I abandoned scala awhile ago, but I saw that with its latest
release, maybe some things got simplified. Maybe it's worth another
look?

> Could you share a link to that so everyone realizes just how far you
> went?  :-)

Before I outright abandoned the language, I was looking into
bootstrapping this too. I did not go nearly as far, but was strongly
dissuaded by core scala contributers from even trying (to be fair, they
probably don't hold bootstrapping in high regard as we do).

The only thought I have to contribute is: would it be possible to
bootstrap off of a binary seed, and then do what's possible to grow that
down to prior versions as much as possible? It's a compromise, but it at
least gets Guix into the scala ecosystem and provides scaffolding to
work off of. Of course this might run contrary to Guix's goals/needs.

-- 
Katherine



Re: Scala package

2021-05-18 Thread Ludovic Courtès
Hi,

Julien Lepiller  skribis:

> I think the best way to bootstrap would be to reimplement Scala in another 
> language. I tried that too, but even the parser is crazy.

Could you share a link to that so everyone realizes just how far you
went?  :-)

That OCaml now has a clean bootstrapping story can hopefully give GHC
and Scala folks an incentive to catch up.

How about writing a blog post?  Ricardo and you could summarize your
heroic efforts, like Ricardo did for GHC (and it’d be a truly
interesting read I’m sure, both for those interested in Scala’s history
and for those interested in compilers).  And in conclusion, you could
say: “Look, a major competitor is doing it right.”  :-)

(And in the meantime, I fully appreciate that when you say it’s maybe
time to give up, it probably *is* time.)

Ludo’.




Re: Scala package

2021-05-18 Thread Daniel Trujillo Viedma

El 18/5/21 a las 11:44, Ricardo Wurmus escribió:


Leo Prikler  writes:


Hi Julien,

Am Dienstag, den 18.05.2021, 01:01 +0200 schrieb Julien Lepiller:

Hi Guix!

I have the attached file that build Scala, although it's not
bootstrapped at all. It contains %binary-scala, a few dependencies of
Scala we haven't packaged yet, and the final scala, built from
%binary-scala, without sbt (which requires Scala too).

Since I've tried and failed to bootstrap Scala for so long, I think
it's time to give up. I can't always create miracles.


Some points relevant to bootstrapping:
- The last version, that ships "scalai" written in Java seems to be   
v1.4.0+4.  Perhaps one can use scalai to bootstrap scalac within it.

- The last version, that does not "require" sbt is 2.11.x,
  though with your workaround we can also build later versions.


We tried building a clean bootstrap chain for Scala for years. Back 
then I went down the rabbit hole and found that early scalac is 
written in Pizza; but it turned out that Pizza is written in Pizza and 
is released under the old Artistic License, which is considered non-free.


   https://logs.guix.gnu.org/guix/2018-04-08.log#230002
   https://logs.guix.gnu.org/guix/2018-04-09.log#073740

I pointed a branch at an old Scala commit that contains the old Socos 
compiler source, which ostensibly are written in Java, but actually 
are not:


   https://github.com/rekado/scala-bootstrap/tree/bootstrap

This is at around version 1.4.0.4, as you wrote above.

Since the old days Scala Native has grown considerably, and perhaps we 
can reuse some of its native libraries.  I’m not too hopeful, because 
the bulk of it is still written in Scala, obviously, but there are 
parts that are written in C / C++, which might come in handy.


   https://github.com/scala-native/scala-native



Hi all! My name is Daniel, I'm from Spain, this is my first contribution 
to Guix (well, to a discussion, actually)



I've seen this thread about Scala, and I would like to know more about 
the progress in bootstrapping in Scala. Scala (2) is my main language 
right now, but I want to try other purest options, Lisp being one of 
them, and also want to transition to Guix and contributing packages, 
eventually. I love what you, people, built.



Probably you know about this, but here is a link to an IRC channel about 
this: https://www.bootstrappable.org/projects/jvm-languages.html



It would be nice to have an exact dependency graph so that we can easily 
see the dead ends, and find the the most cost-effective solution. 
Probably translate old Scala code to a similar, already bootstrapped 
language would be a better option than building a compiler for Scala...



Thank you!

Dani.





Re: Scala package

2021-05-18 Thread Leo Prikler
Am Dienstag, den 18.05.2021, 14:37 +0200 schrieb Julien Lepiller:
> Le Tue, 18 May 2021 13:36:43 +0200,
> Leo Prikler  a écrit :
> 
> > Am Dienstag, den 18.05.2021, 07:15 -0400 schrieb Julien Lepiller:
> > > The old scala is written in a superset of java5, that requires
> > > PiCo
> > > to build, and PiCo was built with JaCo. They were developped at
> > > EPFL, and you can find a binary for it, but no source: 
> > > http://zenger.org/jaco/
> > > 
> > > Apparently, JaCo was later reimplemented in Keris, whose source
> > > code
> > > is available. However, KeCo (the Keris compiler) is written in
> > > Keris.
> > > 
> > > It is not even clear that building an old version of scala is
> > > going
> > > to work, as the language evolved a lot since then.
> > > 
> > > I think the best way to bootstrap would be to reimplement Scala
> > > in
> > > another language. I tried that too, but even the parser is
> > > crazy.  
> > Thanks Julien and Ricardo for the detailed explanation of what goes
> > wrong here.
> > 
> > Would a bootstrap chain from 2.0.x work at least, so that the crazy
> > Scala parser can target a specific (early) version and we get a
> > slightly smaller binary or are the gains from that too
> > minimal?  This
> > is also a concern going forward, can we always hope to "bootstrap"
> > the
> > next Scala version with the one currently packaged in Guix?
> 
> That's not even clear it would be possible. Citing discussion on
> Scala's forum
> (
> https://contributors.scala-lang.org/t/compiling-scala-and-sbt-for-debian-distro/3620/12
> )
> 
> The Scala 2.12 compiler is written in Scala 2.12 and uses the Scala
> 2.12 standard library. Compiling it with 2.11 isn’t an option.
> 
> and later:
> 
> If that was the only hurdle you had to clear, you might be fine. But
> it
> isn’t the only hurdle; the compiler was re-bootstrapped several dozen
> times between 2.11.6 and 2.12.9. (And then a bunch more times after
> that to get to 2.13.0.)
> 
> so we would get an enormous bootstrap chain, and it's not even
> guaranteed that each bootstrap can be replayed nicely.
So in the end we would always be forced to bootstrap Scala 2.x.y from
more or less that exact 2.x.y?  How does anyone find this acceptable?




Re: Scala package

2021-05-18 Thread Julien Lepiller
Le Tue, 18 May 2021 13:36:43 +0200,
Leo Prikler  a écrit :

> Am Dienstag, den 18.05.2021, 07:15 -0400 schrieb Julien Lepiller:
> > The old scala is written in a superset of java5, that requires PiCo
> > to build, and PiCo was built with JaCo. They were developped at
> > EPFL, and you can find a binary for it, but no source: 
> > http://zenger.org/jaco/
> > 
> > Apparently, JaCo was later reimplemented in Keris, whose source code
> > is available. However, KeCo (the Keris compiler) is written in
> > Keris.
> > 
> > It is not even clear that building an old version of scala is going
> > to work, as the language evolved a lot since then.
> > 
> > I think the best way to bootstrap would be to reimplement Scala in
> > another language. I tried that too, but even the parser is crazy.  
> Thanks Julien and Ricardo for the detailed explanation of what goes
> wrong here.
> 
> Would a bootstrap chain from 2.0.x work at least, so that the crazy
> Scala parser can target a specific (early) version and we get a
> slightly smaller binary or are the gains from that too minimal?  This
> is also a concern going forward, can we always hope to "bootstrap" the
> next Scala version with the one currently packaged in Guix?

That's not even clear it would be possible. Citing discussion on
Scala's forum
(https://contributors.scala-lang.org/t/compiling-scala-and-sbt-for-debian-distro/3620/12)

The Scala 2.12 compiler is written in Scala 2.12 and uses the Scala
2.12 standard library. Compiling it with 2.11 isn’t an option.

and later:

If that was the only hurdle you had to clear, you might be fine. But it
isn’t the only hurdle; the compiler was re-bootstrapped several dozen
times between 2.11.6 and 2.12.9. (And then a bunch more times after
that to get to 2.13.0.)

so we would get an enormous bootstrap chain, and it's not even
guaranteed that each bootstrap can be replayed nicely.

> 
> > Le 18 mai 2021 05:44:42 GMT-04:00, Ricardo Wurmus
> >  > > a écrit :
> > > Leo Prikler  writes:
> > >   
> > > >  Hi Julien,
> > > > 
> > > >  Am Dienstag, den 18.05.2021, 01:01 +0200 schrieb Julien 
> > > >  Lepiller:  
> > > > > Hi Guix!
> > > > > 
> > > > > I have the attached file that build Scala, although it's not
> > > > > bootstrapped at all. It contains %binary-scala, a few 
> > > > > dependencies of
> > > > > Scala we haven't packaged yet, and the final scala, built from
> > > > > %binary-scala, without sbt (which requires Scala too).
> > > > > 
> > > > > Since I've tried and failed to bootstrap Scala for so long, I 
> > > > > think
> > > > > it's time to give up. I can't always create miracles.  
> > > > 
> > > >  Some points relevant to bootstrapping:
> > > >  - The last version, that ships "scalai" written in Java seems
> > > > to 
> > > >  be 
> > > >v1.4.0+4.  Perhaps one can use scalai to bootstrap scalac 
> > > >within it.
> > > >  - The last version, that does not "require" sbt is 2.11.x,
> > > >though with your workaround we can also build later
> > > > versions.  
> > > 
> > > We tried building a clean bootstrap chain for Scala for years. 
> > > Back then I went down the rabbit hole and found that early scalac 
> > > is written in Pizza; but it turned out that Pizza is written in 
> > > Pizza and is released under the old Artistic License, which is 
> > > considered non-free.
> > > 
> > > https://logs.guix.gnu.org/guix/2018-04-08.log#230002
> > > https://logs.guix.gnu.org/guix/2018-04-09.log#073740
> > > 
> > > I pointed a branch at an old Scala commit that contains the old 
> > > Socos compiler source, which ostensibly are written in Java, but 
> > > actually are not:
> > > 
> > > https://github.com/rekado/scala-bootstrap/tree/bootstrap
> > > 
> > > This is at around version 1.4.0.4, as you wrote above.
> > > 
> > > Since the old days Scala Native has grown considerably, and 
> > > perhaps we can reuse some of its native libraries.  I’m not too 
> > > hopeful, because the bulk of it is still written in Scala, 
> > > obviously, but there are parts that are written in C / C++, which 
> > > might come in handy.
> > > 
> > > https://github.com/scala-native/scala-native  
> 




Re: Scala package

2021-05-18 Thread Leo Prikler
Am Dienstag, den 18.05.2021, 07:15 -0400 schrieb Julien Lepiller:
> The old scala is written in a superset of java5, that requires PiCo
> to build, and PiCo was built with JaCo. They were developped at EPFL,
> and you can find a binary for it, but no source: 
> http://zenger.org/jaco/
> 
> Apparently, JaCo was later reimplemented in Keris, whose source code
> is available. However, KeCo (the Keris compiler) is written in Keris.
> 
> It is not even clear that building an old version of scala is going
> to work, as the language evolved a lot since then.
> 
> I think the best way to bootstrap would be to reimplement Scala in
> another language. I tried that too, but even the parser is crazy.
Thanks Julien and Ricardo for the detailed explanation of what goes
wrong here.

Would a bootstrap chain from 2.0.x work at least, so that the crazy
Scala parser can target a specific (early) version and we get a
slightly smaller binary or are the gains from that too minimal?  This
is also a concern going forward, can we always hope to "bootstrap" the
next Scala version with the one currently packaged in Guix?

> Le 18 mai 2021 05:44:42 GMT-04:00, Ricardo Wurmus  > a écrit :
> > Leo Prikler  writes:
> > 
> > >  Hi Julien,
> > > 
> > >  Am Dienstag, den 18.05.2021, 01:01 +0200 schrieb Julien 
> > >  Lepiller:
> > > > Hi Guix!
> > > > 
> > > > I have the attached file that build Scala, although it's not
> > > > bootstrapped at all. It contains %binary-scala, a few 
> > > > dependencies of
> > > > Scala we haven't packaged yet, and the final scala, built from
> > > > %binary-scala, without sbt (which requires Scala too).
> > > > 
> > > > Since I've tried and failed to bootstrap Scala for so long, I 
> > > > think
> > > > it's time to give up. I can't always create miracles.
> > > 
> > >  Some points relevant to bootstrapping:
> > >  - The last version, that ships "scalai" written in Java seems
> > > to 
> > >  be 
> > >v1.4.0+4.  Perhaps one can use scalai to bootstrap scalac 
> > >within it.
> > >  - The last version, that does not "require" sbt is 2.11.x,
> > >though with your workaround we can also build later versions.
> > 
> > We tried building a clean bootstrap chain for Scala for years. 
> > Back then I went down the rabbit hole and found that early scalac 
> > is written in Pizza; but it turned out that Pizza is written in 
> > Pizza and is released under the old Artistic License, which is 
> > considered non-free.
> > 
> > https://logs.guix.gnu.org/guix/2018-04-08.log#230002
> > https://logs.guix.gnu.org/guix/2018-04-09.log#073740
> > 
> > I pointed a branch at an old Scala commit that contains the old 
> > Socos compiler source, which ostensibly are written in Java, but 
> > actually are not:
> > 
> > https://github.com/rekado/scala-bootstrap/tree/bootstrap
> > 
> > This is at around version 1.4.0.4, as you wrote above.
> > 
> > Since the old days Scala Native has grown considerably, and 
> > perhaps we can reuse some of its native libraries.  I’m not too 
> > hopeful, because the bulk of it is still written in Scala, 
> > obviously, but there are parts that are written in C / C++, which 
> > might come in handy.
> > 
> > https://github.com/scala-native/scala-native




Re: Scala package

2021-05-18 Thread Julien Lepiller
The old scala is written in a superset of java5, that requires PiCo to build, 
and PiCo was built with JaCo. They were developped at EPFL, and you can find a 
binary for it, but no source: http://zenger.org/jaco/

Apparently, JaCo was later reimplemented in Keris, whose source code is 
available. However, KeCo (the Keris compiler) is written in Keris.

It is not even clear that building an old version of scala is going to work, as 
the language evolved a lot since then.

I think the best way to bootstrap would be to reimplement Scala in another 
language. I tried that too, but even the parser is crazy.

Le 18 mai 2021 05:44:42 GMT-04:00, Ricardo Wurmus  a écrit :
>
>Leo Prikler  writes:
>
>> Hi Julien,
>>
>> Am Dienstag, den 18.05.2021, 01:01 +0200 schrieb Julien 
>> Lepiller:
>>> Hi Guix!
>>> 
>>> I have the attached file that build Scala, although it's not
>>> bootstrapped at all. It contains %binary-scala, a few 
>>> dependencies of
>>> Scala we haven't packaged yet, and the final scala, built from
>>> %binary-scala, without sbt (which requires Scala too).
>>> 
>>> Since I've tried and failed to bootstrap Scala for so long, I 
>>> think
>>> it's time to give up. I can't always create miracles.
>>
>> Some points relevant to bootstrapping:
>> - The last version, that ships "scalai" written in Java seems to 
>> be 
>>   v1.4.0+4.  Perhaps one can use scalai to bootstrap scalac 
>>   within it.
>> - The last version, that does not "require" sbt is 2.11.x,
>>   though with your workaround we can also build later versions.
>
>We tried building a clean bootstrap chain for Scala for years. 
>Back then I went down the rabbit hole and found that early scalac 
>is written in Pizza; but it turned out that Pizza is written in 
>Pizza and is released under the old Artistic License, which is 
>considered non-free.
>
>https://logs.guix.gnu.org/guix/2018-04-08.log#230002
>https://logs.guix.gnu.org/guix/2018-04-09.log#073740
>
>I pointed a branch at an old Scala commit that contains the old 
>Socos compiler source, which ostensibly are written in Java, but 
>actually are not:
>
>https://github.com/rekado/scala-bootstrap/tree/bootstrap
>
>This is at around version 1.4.0.4, as you wrote above.
>
>Since the old days Scala Native has grown considerably, and 
>perhaps we can reuse some of its native libraries.  I’m not too 
>hopeful, because the bulk of it is still written in Scala, 
>obviously, but there are parts that are written in C / C++, which 
>might come in handy.
>
>https://github.com/scala-native/scala-native
>
>-- 
>Ricardo


Re: Scala package

2021-05-18 Thread Ricardo Wurmus



Leo Prikler  writes:


Hi Julien,

Am Dienstag, den 18.05.2021, 01:01 +0200 schrieb Julien 
Lepiller:

Hi Guix!

I have the attached file that build Scala, although it's not
bootstrapped at all. It contains %binary-scala, a few 
dependencies of

Scala we haven't packaged yet, and the final scala, built from
%binary-scala, without sbt (which requires Scala too).

Since I've tried and failed to bootstrap Scala for so long, I 
think

it's time to give up. I can't always create miracles.


Some points relevant to bootstrapping:
- The last version, that ships "scalai" written in Java seems to 
be 
  v1.4.0+4.  Perhaps one can use scalai to bootstrap scalac 
  within it.

- The last version, that does not "require" sbt is 2.11.x,
  though with your workaround we can also build later versions.


We tried building a clean bootstrap chain for Scala for years. 
Back then I went down the rabbit hole and found that early scalac 
is written in Pizza; but it turned out that Pizza is written in 
Pizza and is released under the old Artistic License, which is 
considered non-free.


   https://logs.guix.gnu.org/guix/2018-04-08.log#230002
   https://logs.guix.gnu.org/guix/2018-04-09.log#073740

I pointed a branch at an old Scala commit that contains the old 
Socos compiler source, which ostensibly are written in Java, but 
actually are not:


   https://github.com/rekado/scala-bootstrap/tree/bootstrap

This is at around version 1.4.0.4, as you wrote above.

Since the old days Scala Native has grown considerably, and 
perhaps we can reuse some of its native libraries.  I’m not too 
hopeful, because the bulk of it is still written in Scala, 
obviously, but there are parts that are written in C / C++, which 
might come in handy.


   https://github.com/scala-native/scala-native

--
Ricardo



Re: Scala package

2021-05-18 Thread Leo Prikler
Hi Julien,

Am Dienstag, den 18.05.2021, 01:01 +0200 schrieb Julien Lepiller:
> Hi Guix!
> 
> I have the attached file that build Scala, although it's not
> bootstrapped at all. It contains %binary-scala, a few dependencies of
> Scala we haven't packaged yet, and the final scala, built from
> %binary-scala, without sbt (which requires Scala too).
> 
> Since I've tried and failed to bootstrap Scala for so long, I think
> it's time to give up. I can't always create miracles.

Some points relevant to bootstrapping:
- The last version, that ships "scalai" written in Java seems to be 
  v1.4.0+4.  Perhaps one can use scalai to bootstrap scalac within it.
- The last version, that does not "require" sbt is 2.11.x,
  though with your workaround we can also build later versions.

Would it generally be possible to use scalac 1.4 to compile any 2.x
version?  (We can first assume that we have this scalac as binary, and 
hopefully construct our chain from there similar to Rust.  Then we
"only" need to somehow bootstrap 1.4)

> If this is acceptable, I will send actual patches later, and rework
> the sbt package I had around 2018 (I managed to build it with a Scala
> compiler, without a pre-existing sbt).
IIRC, there are some bootstrap binaries well hidden within Guix source
code, but this obviously does not look nice.

> (license license:bsd-3)))
I think it's actually Apache 2.0




Scala package

2021-05-17 Thread Julien Lepiller
Hi Guix!

I have the attached file that build Scala, although it's not
bootstrapped at all. It contains %binary-scala, a few dependencies of
Scala we haven't packaged yet, and the final scala, built from
%binary-scala, without sbt (which requires Scala too).

Since I've tried and failed to bootstrap Scala for so long, I think
it's time to give up. I can't always create miracles.

If this is acceptable, I will send actual patches later, and rework the
sbt package I had around 2018 (I managed to build it with a Scala
compiler, without a pre-existing sbt).
(use-modules
  (guix build-system ant)
  (guix build-system copy)
  (guix git-download)
  (guix download)
  (guix packages)
  ((guix licenses) #:prefix license:)
  (gnu packages java))

(define %binary-scala
  (package
(name "scala")
(version "2.13.4")
(source (origin
  (method url-fetch)
  (uri (string-append "https://downloads.lightbend.com/scala/;
  version  "/scala-" version ".tgz"))
  (sha256
   (base32
"1alcnzmxga00nsvgy8yky91zw5b4q0xg2697vrrdgjlglpxiqwdw"
(build-system copy-build-system)
(arguments
 `(#:install-plan
   '(("." ""))
   #:phases
   (modify-phases %standard-phases
 (add-before 'install 'set-java-home
   (lambda* (#:key inputs #:allow-other-keys)
 (substitute* (find-files "bin" ".")
   (("^#!.*" shebang)
(string-append shebang "\nJAVA_HOME="
   (assoc-ref inputs "openjdk"))
 (add-before 'set-java-home 'remove-unneeded
   (lambda _
 (for-each delete-file (find-files "bin" "bat$")))
(inputs
 `(("openjdk" ,openjdk14)))
(home-page "https://scala-lang.org/;)
(synopsis "Scala programming language")
(description "Scala combines object-oriented and functional programming in
one concise, high-level language.  Scala's static types help avoid bugs in
complex applications, and its JVM and JavaScript runtimes let you build
high-performance systems with easy access to huge ecosystems of libraries.")
(license license:bsd-3)))

(define scala-asm
  (package
(inherit java-asm)
(version "9.1.0")
(source (origin
  (method git-fetch)
  (uri (git-reference
 (url "https://github.com/scala/scala-asm;)
 (commit "s-9.1")))
  (file-name (git-file-name "scala-asm" version))
  (sha256
   (base32
"1wsrlb6kb0fwxjdqanxqgmq4qcyq9gqn129w3l4bj7gvlspll33l"
(arguments
 `(#:jar-name "java-asm.jar"
   #:source-dir "src/main/java"
   ;; no tests
   #:tests? #f

(define java-jline3-terminal
  (package
(name "java-jline3-terminal")
(version "3.19.0")
(source (origin
  (method git-fetch)
  (uri (git-reference
 (url "https://github.com/jline/jline3;)
 (commit (string-append "jline-parent-" version
  (file-name (git-file-name name version))
  (sha256
   (base32
"16cfbkbj925c92xnwq5sbg7v57yh840g0mh95iyzkkajxirz9qn9"))
  (snippet
   ;; calls maven, and conflicts with ant
   `(delete-file "build"
(build-system ant-build-system)
(arguments
 `(#:jar-name "jline3-terminal.jar"
   #:source-dir "terminal/src/main/java"
   #:test-dir "terminal/src/test"
   #:phases
   (modify-phases %standard-phases
 ;(add-after 'unpack 'make-files-writable
 ;  (lambda _
 ;(for-each make-file-writable (find-files "."))
 ;#t))
 (add-before 'build 'copy-resources
   (lambda _
 (copy-recursively
   "terminal/src/main/resources/"
   "build/classes")
 #t)
(native-inputs
 `(("java-easymock" ,java-easymock)
   ("java-junit" ,java-junit)))
(home-page "")
    (synopsis "")
(description "")
(license #f)))

(define java-jline3-reader
  (package
(inherit java-jline3-terminal)
(name "java-jline3-reader")
(arguments
 `(#:jar-name "jline3-reader.jar"
   #:source-dir "reader/src/main/java"
   #:test-dir "reader/src/test"))
(inputs
 `(("java-jline3-terminal" ,java-jline3-terminal)

(define scala
  (package
(inherit %binary-scala)
(source (origin
  (method