Hi Rob,
(I to myself:) RTFM.
jallib/compiler/jalv2.pdf, page 21: "Note that it is not possible to include
the same file multiple times. Once a file is included, it will not be included
again."
So, we could have another pragma to allow muliple includes for requesting
libraries... or we just live with it that way.
It was right the very project which made me touch the large_array lib, that
also let me fall into my own trap just minutes after your first reply. I have
byte*3 variables to store there, doing so using more than one large_array...
But if you (and everyone else interested...) are ok with breaking compatibility
here, I'd go for it and change the comments as to only include the lib once. I
can also save a few lines which should have been checking not to re-define
anything.
The broken compatibility is easy to find, as there's a warning which tells you
where to look. And it is easy to fix, just comment all but the last includes of
large_array and place all the alias' behind that include.
And then... There is yet another solution... but I have no idea if it's
portable enough. On Windows, it's at least unusual:
We could symlink large_array.jal to large_array_1.jal, large_array_2.jal..., so
the compiler would simply not know that it includes the same file again. It
works that way on linux, I have just tested it. Can github work with symlinks?
Or zip-files..?
Greets,Kiste
Am Sonntag, 20. Dezember 2020, 12:41:28 MEZ hat Rob CJ <[email protected]>
Folgendes geschrieben:
Hi Kiste,
I assume (always dangerous) that not many people would include more large_array
libraries so I am OK changing the sample files so that it only includes the
library once.
I think one file is always better than 28 so I prefer your solution and include
only the large_array.jal library and not the numbered ones.
If your tests do not reveal any problems I am OK changing all sample files so
that we also do not get the deprecated warning.
Then I could upload the large_array.jal and the 4 generated libraries - for
backwards compatibility - including your python program.
If nobody disagrees then I will do that next week or so.
Enjoy the upcoming holidays!
Kind regards,
Rob
Van: 'Oliver Seitz' via jallib <[email protected]>
Verzonden: zondag 20 december 2020 10:06
Aan: 'Oliver Seitz' via jallib <[email protected]>
Onderwerp: Re: [jallib] Large_array update Or, the idea of having the lib in a
simple file must be given up.
Still, 4 files are better than 28 files. Is this the way to go then?
Greets,Kiste
Am Sonntag, 20. Dezember 2020, 09:59:57 MEZ hat 'Oliver Seitz' via jallib
<[email protected]> Folgendes geschrieben:
Hi Rob,
Does the compiler deny to include the same lib multiple times? If so, I can't
help :-(
It says:
including 'large_array_1.jal'
including '/home/kiste/Pic-LBC/jallib/include/jal/large_array_1.jal'
including 'large_array.jal'
including '/home/kiste/Pic-LBC/jallib/include/jal/large_array.jal'
including 'large_array_2.jal'
including '/home/kiste/Pic-LBC/jallib/include/jal/large_array_2.jal'
including 'large_array.jal'
including '/home/kiste/Pic-LBC/jallib/include/jal/large_array.jal'
blocking source: /home/kiste/Pic-LBC/jallib/include/jal/large_array.jal
Greets,Kiste
Am Sonntag, 20. Dezember 2020, 09:30:42 MEZ hat 'Oliver Seitz' via jallib
<[email protected]> Folgendes geschrieben:
Hi Rob,
thanks for having a look. It's a problem of the
"include-more-than-once"-mechanism. I changed the sample like this, now it
compiles:
-- Setup a large byte array.
const dword LARGE_ARRAY_1_SIZE = 120 -- choose number of array variables
const dword LARGE_ARRAY_1_VARIABLE_SIZE = 1 -- choose size of variables
(byte*1)
--include large_array_1 -- include the array library
-- Setup a large word array.
const dword LARGE_ARRAY_2_SIZE = 120 -- choose number of array variables
const dword LARGE_ARRAY_2_VARIABLE_SIZE = 2 -- choose size of variables
(byte*1)
--include large_array_2 -- include the array library
-- Setup a large dword array.
const dword LARGE_ARRAY_3_SIZE = 120 -- choose number of array variables
const dword LARGE_ARRAY_3_VARIABLE_SIZE = 4 -- choose size of variables
(byte*1)
--include large_array_3 -- include the array library
-- Setup another large byte array.
const dword LARGE_ARRAY_4_SIZE = 120 -- choose number of array variables
const dword LARGE_ARRAY_4_VARIABLE_SIZE = 1 -- choose size of variables
(byte*1)
include large_array_4 -- include the array library
alias byte_array is large_array_1 -- rename/alias the array to
byte_array
alias word_array is large_array_2 -- rename/alias the array to
word_array
alias dword_array is large_array_3 -- rename/alias the array to
dword_array
alias another_byte_array is large_array_4 -- rename/alias the array to
byte_array
That's not a solution, it's a part of the debugging process. I feel a bit
unclear about how my "if defined("-statements work, think I'll have to take a
close look at the compiler options to see what's going on ;-)
Greets,Kiste
Am Sonntag, 20. Dezember 2020, 09:01:48 MEZ hat Rob CJ <[email protected]>
Folgendes geschrieben:
Hi Olivers,
Great work! Wow, it generates a JAL source file of almost 100.000 lines of code
but compiles fast.
Can you have a look at sample 16f1825_large_array.jal? It does not yet compile
with this library and I can't see why. This is - I think - the only sample file
that uses 4 large arrays. The error message is as follows:
d:\PIC\Projects\2020\New_Large_Array\16f1825_large_array.jal:81:
"large_array_2" not
definedd:\PIC\Projects\2020\New_Large_Array\16f1825_large_array.jal:81: '='
expected (got
'const')d:\PIC\Projects\2020\New_Large_Array\16f1825_large_array.jal:87:
"large_array_3" not
definedd:\PIC\Projects\2020\New_Large_Array\16f1825_large_array.jal:87: '='
expected (got
'const')d:\PIC\Projects\2020\New_Large_Array\16f1825_large_array.jal:93:
"large_array_4" not
definedd:\PIC\Projects\2020\New_Large_Array\16f1825_large_array.jal:93: '='
expected (got
'var')d:\PIC\Projects\2020\New_Large_Array\16f1825_large_array.jal:104:
"word_array" not
definedd:\PIC\Projects\2020\New_Large_Array\16f1825_large_array.jal:104: 'end'
expected (got
'word_array')d:\PIC\Projects\2020\New_Large_Array\16f1825_large_array.jal:104:
{FOR starts at
d:\PIC\Projects\2020\New_Large_Array\16f1825_large_array.jal:103}d:\PIC\Projects\2020\New_Large_Array\16f1825_large_array.jal:104:
"word_array" not
definedd:\PIC\Projects\2020\New_Large_Array\16f1825_large_array.jal:104: 'end'
expected (got
'word_array')d:\PIC\Projects\2020\New_Large_Array\16f1825_large_array.jal:104:
{FOREVER starts at
d:\PIC\Projects\2020\New_Large_Array\16f1825_large_array.jal:98}d:\PIC\Projects\2020\New_Large_Array\16f1825_large_array.jal:104:
"word_array" not
definedd:\PIC\Projects\2020\New_Large_Array\16f1825_large_array.jal:104:
unexpected token: word_array14 errors, 0 warnings
Thanks
Kind regards,
Rob
Van: 'Oliver Seitz' via jallib <[email protected]>
Verzonden: zaterdag 19 december 2020 19:52
Aan: 'Oliver Seitz' via jallib <[email protected]>
Onderwerp: Re: [jallib] Large_array update Hi all!
Python was a very good recommendation, thank you Rob Hammerling :-)
I dropped the idea of the array with no index, that would have been a difficult
and nearly useless addition.
Other bad news: The PIC14/byte*2 version needs one byte GPR more than the old
lib, PIC16/byte*4 even four bytes more.
But that is it, all other versions need the same or less GPR. Execution time
and code size are now even 12-25% smaller than with my last version, now my
test program in the best cases needs little more than half the time compared to
the original lib, code is between 300 and 1000 words smaller.
I did some tests, but only with one array at a time.
Greets,Kiste
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email
[email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jallib/2049291384.2558336.1608403923944%40mail.yahoo.com.
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email
[email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jallib/AM0PR07MB62418A0BC3DFC89B67D54327E6C10%40AM0PR07MB6241.eurprd07.prod.outlook.com.
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email
[email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jallib/154029870.2690100.1608452964991%40mail.yahoo.com.
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email
[email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jallib/1127284085.2702819.1608454790521%40mail.yahoo.com.
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email
[email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jallib/391441570.2691887.1608455165435%40mail.yahoo.com.
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jallib/AM0PR07MB6241E877A1E47C1DEAFCD25BE6C10%40AM0PR07MB6241.eurprd07.prod.outlook.com.
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jallib/1060171553.2688557.1608468811211%40mail.yahoo.com.