Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuples longer than 20 wide #103

Open
gbluma opened this issue Sep 15, 2017 · 3 comments
Open

Tuples longer than 20 wide #103

gbluma opened this issue Sep 15, 2017 · 3 comments

Comments

@gbluma
Copy link
Contributor

gbluma commented Sep 15, 2017

There's currently a limitation in place that prevents this from happening.

@skaller
Copy link
Member

skaller commented Sep 15, 2017

Yes, because code for tuples or arrays that has to expand "in place" would get too big if it were allowed to go on forever. There has to be some sort of limit. If you need an actual (heterogenous) tuple larger than 20 there's something wrong with your code. Use a record instead. Arrays can be any size, however some code is limited to 20 again, for example _strr converts datatype to a printable form. If you want to print a big array of 20 million elements you need to think about not using 20 million inline calls to _strr, us a loop instead :-)

@skaller
Copy link
Member

skaller commented Sep 15, 2017

Rough .. the requirement is to stop the compiler going into a long loop which would probably be a recursion that would blow the compiler stack .. or cause the client to throw their computer overboard waiting for it.

@skaller
Copy link
Member

skaller commented Mar 9, 2020

Should this still be open? The limit can be increased to say 50. Arrays can be any size.
Tuples have to have some limit. The limit applies to arrays in the sense that it limits the size
of an expression:

1,2,3,4,5,6,7,8,9,10,......

You can still have an array with millions of elements, you just can't initialise it with a tuple form.
A large tuple expression of elements of the same type requires a very verbose C++ constructor to a struct with a lot or elements which is aliased to an array.

There is another case where tuples could grow forever, namely, using type class based polymorphic recursion. However this has its own recursion limit so isn't an excuse for a limit on tuples.

The limit on tuples is hard coded, possibly to different values in different places. In principle it could be removed, at risk of some recursions getting into infinite loops. Or it could be set to a much larger value.

The question is: why do you want large tuples?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants