I cannot load a program into the Windows 1.27-58-unstable build running on Windows 10 32-bit. [Version 10.0.17763.593] The console simply quits with no error message. Trying to load the examples\demo.bas also quits.
Last edit: Yet Another Troll 2019-07-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Both XLOAD and XRUN also quit. I once got XRUN to return a file not found error without quitting but can't repeat it. LOAD will quit even when given a nonexistent file name. EDIT also just quits, possibly after creating a temp file. Commands adjacent to but not actually involving file I/O like ? DIR$(0) appear to run correctly. FSFIRST/FSNEXT also appear to work,
> ver
X11-BASIC Version: 1.27 Jun 30 2019 09:30:03
> ? dir$(0)
C:\Program Files\X11-Basic
> ? fsfirst$(".", "*")
- bas.ico
> ? fsnext$()
d contrib
> ? fsnext$()
d doc
> ? fsnext$()
d examples
> ? fsnext$()
- new.bas.~~~
>
That new.bas.~~~ temp file has since disappeared before I thought to navigate to it in Explorer to see if it contained anything. What deleted it?
Last edit: Yet Another Troll 2019-07-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
new.bas.~~~ is generated by an EDIT command. It is just a temporary file.
Concerning this error: I think I have found it. (The crash manifested only on the WINDOWS version, al though the error was also in the linux version). It was a bug in the LOAD mechanism. It was introduced with the dynamic stack handling.
I have released new files for WINDOWS. Thanks for testing.
However, even in the 1.27-58-unstable release I do see an error on WINDOWS:
run the compiler, select demo.bas, select option "1" and during saving the .exe file I get a segmentation fault. I think this is because of some file permissions not set to write on C:/Program Files or so. It should produce a more readable error. Do you get this error as well?
Last edit: Markus Hoffmann 2019-07-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
LOAD is working now. Thank you for your quick response! I'm afraid I haven't worked much with the compiler in Windows, mainly in Android, but I do know that Windows really, really doesn't want the program files directories to be written to by anything except installers and hotfixes since the introduction of NT 3.1 and NTFS twenty five years ago, even though cheating by twiddling directory permissions is common. W10 does set the TMP and TEMP environment variables to reasonable directories for temp files. I'll check 8.1 later.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Why at the PRINT and not at the ADD doing awful, awful things to the string memory? Was that last allocation of 8 bytes by HEX$ or 12/16 by PRINT for a buffer enough to push the house of cards over?
#!/usr/bin/xbasicProgramStringb0rkS$=Chr$(30)DoTemp%=Len(S$)*2PrintTemp%,Hex$(Temp%),FlushStart=Timer' S$ = S$ + S$ ! Space$(Temp%)AddS$,S$PrintRound(Timer-Start,8),FlushPause1!AllowAndroidtocatchupwithitself?VPS%=VarPtr(S$)Mask%=0xFFCount%=0Start=TimerFinish=Start+3WhileTimer<FinishTemp%=Len(S$)' Temp% = VarPtr(S$)' Temp% = LPeek(Temp% - 4)' Temp% = Asc(Mid$(S$, 2, 1)) And 0xFF' Temp% = Peek(VPS% + 2 - 1) And Mask%IncCount%' FlushWendPrintTemp%,Hex$(Temp%),Count%,Timer-StartFlush' Pause 5Temp%=VarPtr(S$)AddTemp%,LPeek(Temp%-4)' For i% = Temp% - 32 To Temp% + 4' Print Hex$(Peek(i%) And 0xFF, 2); " ";' Flush' Next i%' PrintLoopEnd
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Aha, thank you. Another bug. I could not see it, because on my WINDOWS machine (which I rarely use) ther was a permission denied error when saving the .exe. I am not sure on which version this bug showed up. I> fear that it has been there unseen for a long time....
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Looks like the 24bit address space is exaustet (32bit WINDOWS in reallity only 24bit?) I dont know. On Linux the program continues until all 2GBytes RAm plus some SWAP space is eaten up, Then the program was killed by the OS.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm using a cheap Vulcan tablet. 2GB RAM, 32GB system drive, maybe no swap at all.
This reminds me of the time in the early 90s I was trying a Sieve of Eratosthenes to find all primes between 3 and 0xFFFFFFFF on a 25MHz i486 with 16MB RAM in SCO Xenix/386 GT 2.3.4. I had a spare 1GB SCSI drive just lying around I could dedicate to swap, so...
SCO tech support was very interested in the kernel quirks that turned up.
Last edit: Yet Another Troll 2019-07-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
At least compiled programs can allocate integer matrices of at least 14401, 14401 but less than 14501, 14501.
C:\Program Files\X11-Basic>contrib\ansicon xbasic
**********************************************************
* sdlxbasic V.1.27 *
* by Markus Hoffmann 1997-2019 (c) *
*** sdl la gmp snd ***
* version date: Mon Jul 1 15:04:58 CEST 2019 *
* library V.1.27 date: Mon Jul 1 15:04:58 CEST 2019 *
**********************************************************
> load "\users\trollollio\desktop\p.b"
> run
How long? 14400
Allocated 14400 bytes in 0.004999999999995
Corpus$ initialized in 0.096
Sanity checked in 0.096
0x31720204 bytes of monster matrix allocated in 35.986
Row 2333 249.225
What's strange is Task Manager shows the memory use is 320MB and climbing while the program is still in this loop which only works with string expressions in the Print statements,
DimLookup%(N%+1,N%+1)!Thisdoesn't seem too terribly badClrLookup%()Print"0x";Hex$(((N%+1)^2)*4);" bytes of ";Print"monster matrix allocated in ";Timer-Start' FlushClri%,j%,k%,l%,VPC%VPC%=VarPtr(Corpus$)Fori%=1ToN%PrintChr$(13);"Row ";i%;" ";Forj%=1ToN%' k% = Asc(Mid$(Corpus$, i%, 1))' l% = Asc(Mid$(Corpus$, N% - j% + 1, 1))k%=Peek(VPC%+i%-1)l%=Peek(VPC%+N%-j%+1-1)If(NotAlpha%(k%))Or(NotAlpha%(l%))ThenPrint"Bad chars from Corpus$?",k%,l%StopElseIfk%=l%ThenLookup%(i%,j%)=Lookup%(i%-1,j%-1)+1ElseIfLookup%(i%-1,j%)>Lookup%(i%,j%-1)ThenLookup%(i%,j%)=Lookup%(i%-1,j%)ElseLookup%(i%,j%)=Lookup%(i%,j%-1)EndIfNextj%Print" ";Round(Timer-Start,3);" ";Nexti%PrintPrintLookup%(N%,N%);" length of longest palindromic subsequence(s),"Print"Found length in ";Timer-Start
...and we have a BSOD in the recursive backtracking part of the code. Actual recursion depth was about 1260 and memory usage approaching 900MB because of the hash table of unique longest palindromic subsequences.
Last edit: Yet Another Troll 2019-07-03
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm currently trying to get around my cheap 32-bit Windows tablets' address and swap space issues by switching from a (N% + 1) ^ 2 matrix to an array of strings, only a few of which are actually in memory at any time. I was inspired by section 9.6 of the 1972 DEC BASIC PLUS manual, starting on page 131. There are interesting forgotten ideas in ancient software. However, instead of the entire matrix being mapped to one file, each row is currently being quick and dirty BLOADed and BSAVEd to individual files in ENV$("tmp") with an equally quick and dirty LRU algorithm and then mangled using LPEEK and LPOKE.
The crazy begins with with Function Lookup%(),
#!/usr/bin/ybasicProgramPalindromicShowKInput"How long? ",N%HideKStart=TimerAlpha$="GATTACA"' Alpha$ = "non~EXO xenon"' Alpha$ = "Able was I, ere I saw Elba."' Alpha$ = "xxEva, can I see beezies ~~ in a cave???"' Alpha$ = "!!A MAN. A PLAN. A CANAL. PANAMA!"Alpha$=Upper$(Alpha$)LenA%=Len(Alpha$)IfGlob(Alpha$,"*[-{}]*")ThenPrint"Forbidden characters in Alpha$"StopEndIf' Belt, suspenders, drones, crane, cargo helicopter, orbital skyhookDimAlpha%(256)ClrAlpha%()Fori%=1ToLen(Alpha$)' Parallelizable, but would it actually be worth it?Alpha%(Asc(Mid$(Alpha$,i%,1)))=TrueNexti%Corpus$=String$(N%,"-")!NosentinelsthistimePrint"Allocated ";Len(Corpus$);" bytes in ";Timer-StartClri%,j%,k%,VPA%,VPC%' Randomize' Watch out on 64-bitVPA%=VarPtr(Alpha$)VPC%=VarPtr(Corpus$)Fori%=1ToN%If(i%And0xFFF)=0ThenPrint" ";i%;" ";Chr$(13);' FlushEndIf' Parallelizable, I guess' Repeat' RANDOM sometimes b0rks in Winblowsj%=Random(LenA%)' Until (0 = j%) Or (j% < LenA%)' k% = Asc(Mid$(Alpha$, j% + 1, 1))k%=Peek(VPA%+j%+1-1)' Caution, this sanity check adds significant overheadIfNotAlpha%(k%)!InStr(Alpha$,Chr$(k%))=0ThenPrint"Invalid character at 0x";Hex$(VPA%);" + ";j%,k%StopEndIf' Mid$(Corpus$, i%, 1) = Chr$(k%)PokeVPC%+i%-1,k%Nexti%Print"Corpus$ initialized in ";Timer-StartIfN%<=600ThenPrint"'";Corpus$;"'"EndIfIfGlob(Corpus$,"*[!"+Alpha$+"]*")ThenPrint"Invalid characters!"StopEndIfPrint"Sanity checked in ";Timer-Start' Bottom-up algorithm blatantly ripped off from:' https://www.techiedelight.com/longest-palindromic-subsequence-using-dynamic-programming/IfN%<LenA%ThenPrint"'";Alpha$;"'"Corpus$=Upper$(Alpha$)N%=Len(Corpus$)EndIfIfN%<=600ThenPrint"'";Corpus$;"'"EndIf' Dim Lockup%(N% + 1, N% + 1) ! This doesn't seem too terribly bad' Clr Lockup%()DimLookRows$(N%+1)DimLookFlag%(N%+1)DimLookLRUs%(N%+1)ClrLookLRU%,LookLoad%LookTemp$=Env$("tmp")+"/Palindromic-"+Str$(Timer)+"-"PrintChr$(34);LookTemp$;Chr$(34)' Print "0x"; Hex$(((N% + 1) ^ 2) * 4); " bytes of ";Print"stub matrix allocated in ";Timer-Start' FlushClri%,j%,k%,l%,VPC%VPC%=VarPtr(Corpus$)Fori%=1ToN%PrintChr$(13);"Row ";i%;" ";Forj%=1ToN%' k% = Asc(Mid$(Corpus$, i%, 1))' l% = Asc(Mid$(Corpus$, N% - j% + 1, 1))k%=Peek(VPC%+i%-1)l%=Peek(VPC%+N%-j%+1-1)If(NotAlpha%(k%))Or(NotAlpha%(l%))ThenPrint"Bad chars from Corpus$?",k%,l%StopElseIfk%=l%Then@LetLookup%(i%,j%,@Lookup%(i%-1,j%-1)+1)ElseIf@Lookup%(i%-1,j%)>@Lookup%(i%,j%-1)Then@LetLookup%(i%,j%,@Lookup%(i%-1,j%))Else@LetLookup%(i%,j%,@Lookup%(i%,j%-1))EndIfNextj%Print" ";Round(Timer-Start,3);" ";Nexti%PrintPrint@Lookup%(N%,N%);" length of longest palindromic subsequence(s),"Print"Found length in ";Timer-Start' Even more Globals???DimH%(128)!HashtableforS$(),sizemustbeapoweroftwoDimS$(16)!DYNAMIC,DuplicatedstringtableforStringInsanityDimC%(16)!DYNAMIC,OpenhashingchainsforS$()andH%()HMask%=UBound(H%())-1ArrayFillH%(),-1ClrS$(),C%()SCount%=0' Still more Globals, call stack limits are nastyClrR$,PalindromeCount%,MaxCallDepth%,MaxActualCallDepth%GoSubStringInsanity(N%,N%,0,0)PrintPalindromeCount%,SCount%,MaxCallDepth%,MaxActualCallDepth%Print"Found some/all/most? in ";Timer-StartPrint"OK"EndFunctionLookup%(Row%,Col%)' Return Lockup%(Row%, Col%)LFR%=LookFlag%(Row%)If0!(Row%<0)Or(Row%>N%)Or(Col%<0)Or(Col%>N%)Then' Subscript out of range!StopElseIfLFR%And2Then' Row is currently in memory!No-opElseIfLFR%=0Then' No columns in this row have been written toReturn0ElseIf(LFR%And2)=0Then' Row is not currently in memory@DumpRows@LoadRow(Row%)Else!ImpossibleStopEndIfIncLookLRU%LookLRUs%(Row%)=LookLRU%VPRow%=VarPtr(LookRows$(Row%))ReturnLPeek(VPRow%+ShL(Col%,2))EndFunctionProcedureLetLookup%(Row%,Col%,NewValue%)' Let Lockup%(Row%, Col%) = NewValue%LFR%=LookFlag%(Row%)If0!(Row%<0)Or(Row%>N%)Or(Col%<0)Or(Col%>N%)Then' Subscript out of range!StopElseIfLFR%And2Then' Row is currently in memory!No-opElseIf(LFR%And2)=0Then' Row is not currently in memory@DumpRows@LoadRow(Row%)LFR%=LookFlag%(Row%)Else!ImpossibleStopEndIfIncLookLRU%LookLRUs%(Row%)=LookLRU%LookFlag%(Row%)=LFR%Or1VPRow%=VarPtr(LookRows$(Row%))LPokeVPRow%+ShL(Col%,2),NewValue%ReturnProcedureLoadRow(Row%)LFR%=LookFlag%(Row%)IfLFR%And2Then' Row is already in memory!No-opElseIfLFR%And4Then' Load row from diskLookRows$(Row%)=Space$(ShL(N%+1,2))IfSize(LookTemp$+Str$(Row%)+".temp")<>ShL(N%+1,2)ThenStopEndIfVPRow%=VarPtr(LookRows$(Row%))BLoadLookTemp$+Str$(Row%)+".temp",VPRow%LookFlag%(Row%)=LFR%Or2IncLookLoad%ElseIfLFR%=0Then' Brand new rowLookRows$(Row%)=String$(ShL(N%+1,2),Chr$(0))LookFlag%(Row%)=LFR%Or2IncLookLoad%Else!ImpossibleStopEndIfIfLen(LookRows$(Row%))<>ShL(N%+1,2)ThenStopEndIfReturnProcedureDumpRows()LocalLRU%,LRURow%,i%WhileLookLoad%>4LRU%=0x7FFFFFFFLRURow%=LRU%Fori%=0ToN%If(LookFlag%(i%)And2)=0Then' Row not loaded!No-opElseIfLookLRUs%(i%)<LRU%ThenLRU%=LookLRUs%(i%)LRURow%=i%EndIfNexti%IfLRU%=0x7FFFFFFFThenStopElseIfLookFlag%(LRURow%)And1ThenVPRow%=VarPtr(LookRows$(LRURow%))BSaveLookTemp$+Str$(LRURow%)+".temp",VPRow%,Len(LookRows$(LRURow%))LookFlag%(LRURow%)=(LookFlag%(LRURow%)Or4)AndNot1EndIfClrLookRows$(LRURow%)LookFlag%(LRURow%)=LookFlag%(LRURow%)AndNot2DecLookLoad%WendReturn' IN C$, N%, i%, j%, R$, CallDepth%' OUT NIL' IN/OUT PalindromeCount%, MaxCallDepth%, MaxActualCallDepth%' COMMON Alpha%(), Lookup%(), S$(), H%(), C%(), SCount%ProcedureStringInsanity(i%,j%,CallDepth%,ActualCallDepth%)' Local VPC%, VPR%' Local k%, l%, m%' Local KeepGoing%, PalindromeOK%LocalLenR%' Global Alpha%()IncActualCallDepth%IfActualCallDepth%>MaxActualCallDepth%ThenMaxActualCallDepth%=ActualCallDepth%'Print MaxActualCallDepth%, MaxCallDepth%EndIfTailCallElimination:IncCallDepth%IfCallDepth%>MaxCallDepth%ThenMaxCallDepth%=CallDepth%EndIfPrint" ";ActualCallDepth%;" ";CallDepth%;" ";PrintMaxActualCallDepth%;" ";MaxCallDepth%;Print" ";Chr$(13);' FlushVPC%=VarPtr(Corpus$)If(i%=0)Or(j%=0)Then' We should have a palindromic subsequence to print' Have we already seen this one before?Hash%=CRC(R$)AndHashMask%Prev%=0xDEAFBEEF!-1Curr%=H%(Hash%)DoExitIfCurr%<0ExitIfS$(Curr%)=R$Prev%=Curr%Curr%=C%(Curr%)LoopIfCurr%>=0Then' This is a duplicateIfPrev%>=0Then' Move the found duplicate string up to the front' of the hash chain in case of repeated searchesC%(Prev%)=C%(Curr%)C%(Curr%)=H%(Hash%)H%(Hash%)=Curr%EndIfPrint" DUP ";' Print "'"; R$; "' "; Hash%; " "; Prev%; " "; Curr%; " ";' Print Chr$(13);ElseIfCurr%<0Then' Not a duplicate!IfSCount%=UBound(S$())ThenPrint"*";' FlushDimS$(SCount%+ShR(SCount%,2)+4)!REDIMPRESERVEDimC%(SCount%+ShR(SCount%,2)+4)!REDIMPRESERVEPrint"*";' FlushEndIfS$(SCount%)=R$C%(SCount%)=H%(Hash%)H%(Hash%)=SCount%IncSCount%IncPalindromeCount%PrintPalindromeCount%;" '";R$;"' ";Timer-Start' Is it palindromic?k%=1l%=Len(R$)VPR%=VarPtr(R$)KeepGoing%=(l%=@Lookup%(N%,N%))PalindromeOK%=(l%=@Lookup%(N%,N%))WhileKeepGoing%IfNot(k%<l%)ThenPalindromeOK%=TrueKeepGoing%=FalseElseIf(NotAlpha%(Peek(VPR%+k%-1)))Or(NotAlpha%(Peek(VPR%+l%-1)))ThenPrint"Bad character(s) at",k%,l%StopElseIfNot(Peek(VPR%+k%-1)=Peek(VPR%+l%-1))ThenPalindromeOK%=FalseKeepGoing%=FalseElseInck%Decl%EndIfWendIfNotPalindromeOK%ThenPrintPrintPalindromeOK%,Len(R$),k%,l%,"'";R$;"'"StopEndIf' Is it a subsequence of Corpus$ ?Print"{";Corpus$;"}"Clrk%,l%,m%Fork%=1ToLen(R$)m%=InStr(Corpus$,Mid$(R$,k%,1),l%+1)IfNot(l%<m%)ThenStopEndIfIfl%=0ThenWhilel%<m%Print" ";Incl%WendElseIncl%Whilel%<m%Print" ";Incl%WendEndIfPrint"|";l%=m%Nextk%PrintClrk%,l%,m%Fork%=1ToLen(R$)m%=InStr(Corpus$,Mid$(R$,k%,1),l%+1)IfNot(l%<m%)ThenStopEndIfIfl%=0ThenIncl%Whilel%<m%Print" ";Incl%WendPrint"'";ElseIncl%Whilel%<m%Print"-";Incl%WendEndIfPrintMid$(R$,k%,1);l%=m%Nextk%Print"'"Else' Impossible!PrintPrint"DEAD CODE"StopEndIfi%=0x7FFFFFFFj%=0x80000000'Print i%, j%,'FlushElseIfPeek(VPC%+i%-1)=Peek(VPC%+N%-j%+1-1)Then' R$ = R$ + Mid$(C$, i%, 1)AddR$,Chr$(Peek(VPC%+i%-1))k%=@Lookup%(N%,N%)-Len(R$)+1l%=Len(R$)ClrPalindromeOK%IfNot(k%<l%)ThenPalindromeOK%=TrueElseIfMid$(R$,k%,1)=Mid$(R$,l%,1)ThenPalindromeOK%=TrueElsePalindromeOK%=FalseEndIfIfNotPalindromeOK%ThenPrint"'";R$;"' NOT OK",i%,j%StopElseIfk%<l%Then' Print "'"; R$; "' OK"AddR$,Reverse$(Left$(R$,@Lookup%(N%,N%)-Len(R$)))Clri%,j%GoToTailCallEliminationElse' Print "'"; R$; "' ???"' GoSub StringInsanity(C$, N%, i% - 1, j% - 1, R$)Deci%Decj%GoToTailCallEliminationEndIf' FlushElseIf@Lookup%(i%-1,j%)>@Lookup%(i%,j%-1)Then' Should more compilers recognize tail recursion' GoSub StringInsanity(C$, N%, i% - 1, j%, R$)Deci%GoToTailCallEliminationElseIf@Lookup%(i%,j%-1)>@Lookup%(i%-1,j%)Then' and turn it into a GOTO' GoSub StringInsanity(C$, N%, i%, j% - 1, R$)Decj%GoToTailCallEliminationElse' Finally, some non-tail recursion' Print "Actual recursive call", i% - 1, j%' Obvious SPAWN thread candidate is obviousLenR%=Len(R$)If1!ActualCallDepth%<465Then!RECURSIONDEPTHGUARDGoSubStringInsanity(i%-1,j%,CallDepth%,ActualCallDepth%)EndIfIfLenR%<Len(R$)ThenPrint" Trimming R$ back to ";l%;Space$(20);Chr$(13);' FlushR$=Left$(R$,LenR%)ElseIfLenR%>Len(R$)ThenStopEndIf' ...and back to the tail recursion' GoSub StringInsanity(C$, N%, i%, j% - 1, R$)Decj%GoToTailCallEliminationEndIfReturn
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I saw the references to map, mmap, msync, and unmap in chapter 9 of the 1.27 manual, but no documentation for map in chapter 7. They do look very useful for simulating truly giant memory structures.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is it because you're thinking of a DEC BASIC-PLUS-ish DIM# command and huge virtualized matrix support in both row-major and column-major ordering so operations such as MAT * won't completely thrash the swap? See sections 7.6 and 9.6,
No, not really. I was rather thinking of MATLAB like matrix functions and also recusive definitions (matrix of matricies, etc...) X11-Basic is prepared for this in the sense of that the concept and the way it is implemented would more easily allow this. However, the implementation is still stub, because the concept of matrix of anything was not so useful, or at least I have not needed it so far.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I cannot load a program into the Windows 1.27-58-unstable build running on Windows 10 32-bit. [Version 10.0.17763.593] The console simply quits with no error message. Trying to load the examples\demo.bas also quits.
Last edit: Yet Another Troll 2019-07-01
Is it possible to enter commands (like XRUN?)
Ups. I have not noticed this. I have no idea what was wrong. Maybe I should roll out the more stable older versions 1.26-57 (without unstable) first.
Both XLOAD and XRUN also quit. I once got XRUN to return a file not found error without quitting but can't repeat it. LOAD will quit even when given a nonexistent file name. EDIT also just quits, possibly after creating a temp file. Commands adjacent to but not actually involving file I/O like ? DIR$(0) appear to run correctly. FSFIRST/FSNEXT also appear to work,
That new.bas.~~~ temp file has since disappeared before I thought to navigate to it in Explorer to see if it contained anything. What deleted it?
Last edit: Yet Another Troll 2019-07-01
new.bas.~~~ is generated by an EDIT command. It is just a temporary file.
Concerning this error: I think I have found it. (The crash manifested only on the WINDOWS version, al though the error was also in the linux version). It was a bug in the LOAD mechanism. It was introduced with the dynamic stack handling.
I have released new files for WINDOWS. Thanks for testing.
However, even in the 1.27-58-unstable release I do see an error on WINDOWS:
run the compiler, select demo.bas, select option "1" and during saving the .exe file I get a segmentation fault. I think this is because of some file permissions not set to write on C:/Program Files or so. It should produce a more readable error. Do you get this error as well?
Last edit: Markus Hoffmann 2019-07-01
LOAD is working now. Thank you for your quick response! I'm afraid I haven't worked much with the compiler in Windows, mainly in Android, but I do know that Windows really, really doesn't want the program files directories to be written to by anything except installers and hotfixes since the introduction of NT 3.1 and NTFS twenty five years ago, even though cheating by twiddling directory permissions is common. W10 does set the TMP and TEMP environment variables to reasonable directories for temp files. I'll check 8.1 later.
One of my string space stress testers now appears to fail at an interesting line,
Why at the PRINT and not at the ADD doing awful, awful things to the string memory? Was that last allocation of 8 bytes by HEX$ or 12/16 by PRINT for a buffer enough to push the house of cards over?
xbbc works well when used in my user profile directory, but xbc complains about not finding xbvm:
It looks for it in the directory from which xbc was called. That is C:\Users\trollollio
I tried running xbc.exe in the C:\Program Files\X11-Basic directory,
Aha, thank you. Another bug. I could not see it, because on my WINDOWS machine (which I rarely use) ther was a permission denied error when saving the .exe. I am not sure on which version this bug showed up. I> fear that it has been there unseen for a long time....
Looks like the 24bit address space is exaustet (32bit WINDOWS in reallity only 24bit?) I dont know. On Linux the program continues until all 2GBytes RAm plus some SWAP space is eaten up, Then the program was killed by the OS.
I'm using a cheap Vulcan tablet. 2GB RAM, 32GB system drive, maybe no swap at all.
This reminds me of the time in the early 90s I was trying a Sieve of Eratosthenes to find all primes between 3 and 0xFFFFFFFF on a 25MHz i486 with 16MB RAM in SCO Xenix/386 GT 2.3.4. I had a spare 1GB SCSI drive just lying around I could dedicate to swap, so...
SCO tech support was very interested in the kernel quirks that turned up.
Last edit: Yet Another Troll 2019-07-01
At least compiled programs can allocate integer matrices of at least 14401, 14401 but less than 14501, 14501.
What's strange is Task Manager shows the memory use is 320MB and climbing while the program is still in this loop which only works with string expressions in the Print statements,
...and we have a BSOD in the recursive backtracking part of the code. Actual recursion depth was about 1260 and memory usage approaching 900MB because of the hash table of unique longest palindromic subsequences.
Last edit: Yet Another Troll 2019-07-03
I'm currently trying to get around my cheap 32-bit Windows tablets' address and swap space issues by switching from a (N% + 1) ^ 2 matrix to an array of strings, only a few of which are actually in memory at any time. I was inspired by section 9.6 of the 1972 DEC BASIC PLUS manual, starting on page 131. There are interesting forgotten ideas in ancient software. However, instead of the entire matrix being mapped to one file, each row is currently being quick and dirty BLOADed and BSAVEd to individual files in ENV$("tmp") with an equally quick and dirty LRU algorithm and then mangled using LPEEK and LPOKE.
The crazy begins with with Function Lookup%(),
Yea, I had forseen the MMAP function in X11-Basic for this, But I think I have never really used it, so I cannot say, if it is useful or not.
I saw the references to map, mmap, msync, and unmap in chapter 9 of the 1.27 manual, but no documentation for map in chapter 7. They do look very useful for simulating truly giant memory structures.
Yes, UNMAP und MSYNC are already implemented, but MMAP is not. (for some reason I have forgotten).
Is it because you're thinking of a DEC BASIC-PLUS-ish DIM# command and huge virtualized matrix support in both row-major and column-major ordering so operations such as MAT * won't completely thrash the swap? See sections 7.6 and 9.6,
http://bitsavers.informatik.uni-stuttgart.de/pdf/dec/pdp11/rsts/V04/DEC-11-ORBPA-A-D_BASIC-PLUS_LangMan_Oct72.pdf
No, not really. I was rather thinking of MATLAB like matrix functions and also recusive definitions (matrix of matricies, etc...) X11-Basic is prepared for this in the sense of that the concept and the way it is implemented would more easily allow this. However, the implementation is still stub, because the concept of matrix of anything was not so useful, or at least I have not needed it so far.
Are you looking into beating Coppersmith-Winograd?
Multiplying matrices faster than Coppersmith-Winograd, V. Vassilevska Williams STOC 2012 [to come]
https://dl.acm.org/citation.cfm?id=2214056
Is your recursive array definition idea compatible with my bounds checked array sub-range idea for sorting?