I want to compile a Scala distribution with a large limit for the number of tuple arguments - for example, 50 instead of 22. (and also the extension of the function class / case / etc)
I assumed those are TupleN, FunctionN, etc. generated at compile time. But in the sources directory I found all those Tuple1 for Tuple22 with comments that they were generated.
In addition, I found the src / build / genprod.scala file, which seems to be a necessary file. But how to run it right?
I changed MAX_ARITY in genprod and changed MaxFunctionArity in Definitions.scala , what else do I need to change to make it work?
And is it possible to use Scala's resulting distribution with sbt? Or are there some fundamental issues with this?
NOTE: I fully understand that trying to get around tuple problems this way is not very good, but in this case it is more of an educational project.
EDIT: Well, this is getting interesting. Since the Scala compiler loads, I cannot compile it with large tuples, since the old compiler uses 22 limits. Therefore, it seems to me that first I need to create a compiler with this limit, and only after that compile it into several tuples. How can i do this?
EDIT2: Now I have a problem - I tried to increase MaxFunctionArity and run ant replacestarr-opt , but then it does not work with scala.Function23 not found . If I try to add scala.Function23 and the like, it will not compile at all. Is there any way to fix this?
EDIT3: I tried to execute the commands in the following order:
ant build
It seems that ant replacelocker not working because the starr compiler is used and it still does not allow more than 22 arguments.
I tried replacing starr:
ant build
but this failed with scala.Function23 not found . It seems to be a dead end - I need to change this to MaxFunctionArity and generate classes, but I cannot do it at the same time, and if I try to separate these actions, I get a failure.
Is there any way to resolve this?
EDIT4: I forgot to mention that in this experiment I am trying Scala 2.9.2, as this is the latest stable version.
EDIT5: Since I was able to build a quick compiler with large tuples using the locker compiler, I expected a problem with the starr layer.
So, I tried to do the following (without changing anything):
ant build ant replacelocker ant replacestarr
And the last command failed with
Unable to find jar:file:/home/platon/Input/sources/scala-tupled/lib/scala-compiler.jar!/scala/tools/ant/sabbus/antlib.xml
Now, what is strange, why can't he build himself?