Hi,
GNU APL configures, makes, and installs fine under Windows Subsystem
for Linux. However, when I try to import that little workspace I
wrote a while back to calculate PI to 5000 digits, I get the
following...
==
Asser
Hi Fred,
I believe the windows environment is available under your linux
filesystem as /mnt/c so you should be able to access any Windows
files.
The Linux filesystem is under your Windows AppData\Local.
I installed xming, a minimalist Windows X server, and ran the linux
Firefox. Videos work OK,
Hi,
Has anyone tried building GNU APL under the new Windows Subsystem for
Linux just released as part of the Windows 10 Anniversary Update? I
was wondering if this might be a cleaner solution for GNU APL under
Windows than Cygwin. It might also solve the problem with building
shared libraries un
Hi Jürgen,
When James A. Brown wrote APL2, he based his arrays on Trenchard
More's "Array Theory", an attempt to give nested rectangular arrays an
axiomatic foundation equivalent to that of set theory. The major
implementation of this idea is in the language NIAL, of which Q'NIAL
is a popular inc
Hi Jürgen,
I commented on this enclose issue back on the 14th of September. I
actually liked the way GNU APL did it.
https://lists.gnu.org/archive/html/bug-apl/2015-09/msg00061.html
Regards,
Mike
Hi Jürgen,
I just built SVN 690 on my Raspberry Pi without any problems. I ran the
program I wrote to calculate 1000 digits of Pi to test it, and it took
555.429 seconds, versus around 26 seconds on a PC.
So a blindingly fast floating point engine, the Raspberry Pi is not.
Regards,
Mike
On
Hi Richard,
I run GNU APL under Cygwin in both 32 and 64 bit Windows, and also under 64
bit Ubuntu Server.
To build GNU APL, you first install Cygwin. You'll need to install g++ and
make, and I usually also grab gdb and nano at the same time.
Then the usual ./configure, make, make install, will
Hi Jürgen,
> Interestingly, my *APL2* reports *DOMAIN ERROR* on
*0 +/ 99*
*Odd. You should mention that in the APL2 forum. Perhaps you need a later
service level.*
*There's still one minor inconsistency between APL2 and GNU APL on that
expression. *
*≡ reports a depth of 4 for the result in
Just in case it isn't instantly obvious what's wrong in the prior post, GNU
APL is returning the wrong thing for dyadic reduce with a left argument of
zero and a scalar right argument.
If f is a scalar function, and X is a non-empty vector, or a scalar which
gets treated as a 1-element vector, the
[IBM APL2]
DISPLAY ((+/).×) / A A←3 3⍴4↑1
┌─┐
│ ┌→┐ │
│ ↓ ┌───┐ ┌─┐ ┌─┐ │ │
│ │ │ ┌→──┐ │ │ ┌→┐ │ │ ┌→┐ │ │ │
│ │ │ │0 0│ │ │ │0 0 0│ │ │ │0 0 0│ │ │ │
│ │ │ └~──┘ │ │ └~┘ │ │ └
The attached transfer file contains an implementation of the SHA-256
message digest function, described in FIPS 180-4, as a collection of APL
objects. This is an excellent test of doing large numbers of single-bit
operations in APL.
The function HASH computes the message digest of a character str
The workings of locked functions are supposed to be completely concealed
from the user, and if an error appears in one, it is considered to have
occurred in the line invoking the locked function, as if it were a
primitive.
We can see this in APL2.
∇FOO
[1] BAR⍫
∇BAR
[1] →1∇
Hi,
I notice the maximum rank of an object in GNU APL is 8.
In APL2, it is 63.
The most common APL FFT algorithm reshapes the input into a hypercube with
dimensions of length 2, and makes a pass, operating on successive axes. So
if you want people to be able to do FFTs on vectors longer than 25
Hi,
SVN 675 fixes the things that were preventing PI1000 from running
correctly, so I can now benchmark it in GNU APL.
In order to be as fair as possible, I have built GNU APL on an Amazon
instance running 64 bit Ubuntu Server LTS, to eliminate any overhead due to
Cygwin, and turned off all the p
Here's a nice little floating point intensive benchmark that should run
efficiently under GNU APL.
The function ME uses modular exponentiation to calculate N|16*M for
positive integer M and N even if 16*M is too large to be exactly
representable as a double float.
∇Z←M ME N;⎕IO;I;B;W
⎕IO←I←0
B
[IBM APL2]
(2*32) | ¯1090558516
3204408780
[GNU APL]
(2*32) | ¯1090558516
¯1090558516
Answer should have the same sign as the modulus.
[IBM APL2]
⌊2*32
4294967296
[GNU APL]
⌊2*32
0
???
2015 at 8:26 AM, Mike Duvos wrote:
> I see the problem. You limit *⎕PP to 16, which isn't enough digits. 1E**¯16
> is 1 to 16 places.* I didn't notice this, because you just set it to 16
> if I set it to 18.
>
> You need to allow a larger
>
>
> *⎕PP to exac
I see the problem. You limit *⎕PP to 16, which isn't enough digits. 1E**¯16
is 1 to 16 places.* I didn't notice this, because you just set it to 16 if
I set it to 18.
You need to allow a larger
*⎕PP to exactly reproduce floating data written out and read back in.*
t
> and complex numbers
> with their maximum precision. So this merely shows that *1D45* to the
> *8th* power
> slightly differs from its theoretical value *1.0* (due to rounding erros
> when parsing
> *1D45* and when computing the *8th* power).
>
> /// Jürgen
>
>
>
)CLEAR
CLEAR WS
ALMOST_ONE←1D45*8
⎕CT←0
⎕PP←18
ALMOST_ONE
1
1=ALMOST_ONE
0
2 ⎕TF 'ALMOST_ONE'
ALMOST_ONE←1J¯2.449293598294707E¯16
When I set ⎕PP←18, I would expect the exact values of numbers to be printed.
APL2 prints the number exactly.
know.
> But once I have the file, I can add and test it.
>
> /// Jürgen
>
>
> On 08/31/2015 05:25 AM, Mike Duvos wrote:
>
> [IBM APL2]
>
>)CLEAR
> CLEAR WS
> ⎕IO←0
> M←¯12+⍳25
> )OUT OUT
>
> [GNU APL]
>
> )IN OUT
7.642854597E¯1J¯9.989374566E¯1
Then I get a result, which agrees with APL2 to a few decimal places in most
places.
On Sun, Aug 30, 2015 at 11:24 PM, Mike Duvos wrote:
> Hi,
>
> I looked into the ¯4○ thing a bit more and have identified the discrepancy
> between APL2 and GNU APL, whic
imited in what APL functions
> it allows. Unfortunately there exist no specification as to which APL
> functions can be used in *2 ⎕TF*
>
> The pattern below (*'M←¯12-⎕IO-⍳25'*) has not occurred before, so the
> parser didn't know.
> But once I have the file, I can
rtunately there exist no specification as to which APL
> functions can be used in *2 ⎕TF*
>
> The pattern below (*'M←¯12-⎕IO-⍳25'*) has not occurred before, so the
> parser didn't know.
> But once I have the file, I can add and test it.
>
> /// Jürgen
>
>
>
quot;wrong" remains to be seen, but it's a case where APL2 and
GNU APL do things differently.
On Sun, Aug 30, 2015 at 9:37 PM, Mike Duvos wrote:
> Dropped an iota in the prior post.
>
> X←1D1*⍳360
> +/¯4○X
> ¯3.814090113E¯8J3.814086508E¯8
>
> That cha
Dropped an iota in the prior post.
X←1D1*⍳360
+/¯4○X
¯3.814090113E¯8J3.814086508E¯8
That changes the IBM result slightly, but the GNU APL one is still off by a
large amount.
On Sun, Aug 30, 2015 at 9:13 PM, Mike Duvos wrote:
> )CLEAR
> CLEAR WS
> ⎕IO←0
)CLEAR
CLEAR WS
⎕IO←0
X←1D1*360
+/(¯1+X×X)*0.5
5.393937829E¯8J¯5.393937829E¯8
[IBM APL2]
+/¯4○X
5.393937829E¯8J¯5.393937829E¯8
[GNU APL]
+/¯4○X
122.0040743J2.828427087
I think this is wrong.
[IBM APL2]
)CLEAR
CLEAR WS
⎕IO←0
M←¯12+⍳25
)OUT OUT
[GNU APL]
)IN OUT
ERROR: inverse 2 ⎕TF failed for 'M←¯12-⎕IO-⍳25
I'm assuming the error here is on the GNU APL side of the transaction, as
APL2 has been around for a while, and people would have complained.
> Elias
>
> On 29 August 2015 at 11:42, Elias Mårtenson wrote:
>
>> I never analysed the Sieve benchmark. I'll take a look at it tonight.
>>
>> Regards,
>> Elias
>> On 29 Aug 2015 06:51, "Mike Duvos" wrote:
>>
>>> Hi
eigel wrote:
> Juergen
>
> I just built 664 -- the performance of the factorial 300 that Mike Duvos
> posted has indeed improved enormously - now running 8 seconds instead of
> 20 on my reference platform.
>
> In line with expectations from Elias' profiling results.
>
> Very well done!
>
> FredW
>
>
>
>
Hi Nick,
Yes, pasting from an xterm to mail drops some relational operators on my
machine.
There's an .atf file of the workspace attached to one of the other posts in
this thread.
Regards,
Mike
On Fri, Aug 28, 2015 at 10:38 AM, Nick Lobachevsky
wrote:
> Something is missing here, most prob
Hi Nick,
APL historically has required consecutive numbers to be separated by at
least one character that can't be part of a number.
This differs from the lex approach of matching the longest legal thing, and
not caring about the next thing beginning immediately thereafter.
Since doing it differ
nfortunately my copy-on-write algorithm didn't actually work
> properly so it needed to be rolled back. The potential is there, however.
>
> Regards, Elias
> On 28 Aug 2015 20:46, "Mike Duvos" wrote:
>
>> Hi Elias,
>>
>> That's very interesting.
>
half of processing time, 47.24% was spent doing
> 6210421621 calls to Cell::init(). This was mostly caused by 105552 calls to
> Value::clone(), creating what I believe is mostly unnecessary copies of the
> an array with an average of 6210421621/105552≈59000 elements.
>
> Regards,
> Elias
&
erally, I just edit my APL files as plain .apl files. Makes the Emacs
> navigate-to-definition easy to use too.
>
> Regards,
> Elias
>
> On 28 August 2015 at 10:42, Mike Duvos wrote:
>
>> Hi Elias,
>>
>> I am apparently still having problems with pasting Unico
ng this error when
> testing it:
>
> * TIME 'PRIMES←SIEVE 10'*
> DOMAIN ERROR
> SIEVE[3] →((⍴B)P←B⍳1)/L2
>^ ^
>
> Regards,
> Elias
>
> On 28 August 2015 at 10:30, Mike Duvos wrote:
>
>> Here is a function that f
Here is a function that finds all the Primes less than N, by clearing bits
in a boolean vector.
)CLEAR
CLEAR WS
⎕IO←0
∇
[0] Z←SIEVE N;B;K;P
[1] Z←B←0 0,(¯2+N)⍴0=K←0
[2] L1:→((⍴B)P←B⍳1)/L2
[3] B←B∧(⍴B)⍴∼P↑1
[4] Z[K]←P◊K←K+1
[5] →L1
[6] L2:Z←K↑Z
∇
And our timing fun
⍴⍴10?¯1+2*25
1
⍴⍴10?¯1+2*26
1
⍴⍴10?¯1+2*27
1
⍴⍴10?¯1+2*28
⍴⍴10?¯1+2*29
⍴⍴10?¯1+2*30
⍴⍴10?¯1+2*31
⍴⍴10?¯1+2*32
DOMAIN ERROR
⍴⍴10?¯1+2⋆32
^ ^
There seem to be some numbers in the domain of Deal, for which it neither
gives an answer, nor a
Here's a simple little recursive function to compute matrix permanents.
∇
[0] Z←PERM X;⎕IO;N
[1] Z←1 ⋄ ⎕IO←0
[2] →(0=⍴N←⍳↑⍴X)/0
[3] Z←+/X[0;]×PERM¨N {⍵[N~0;N~⍺]}¨⊂X
∇
⎕←A←10 10⍴11↑1
1 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0
0 0 0 0 1 0
GNU APL's domino gives a domain error for matrices that are close to
singular, but aren't.
)clear
CLEAR WS
A←100 100⍴101↑1
A[1;1]←0
[IBM APL2]
10 10 ↑⌹A+⎕CT×100
1.1E11 ¯1 ¯1 ¯1 ¯1 ¯1 ¯1 ¯1 ¯1 ¯1
¯1.0E0 1 0 0 0 0 0 0 0 0
¯1.0E0 0 1
Hi,
GNU APL seems to be a bit too forgiving when processing malformed numbers.
It matches what it can, and then continues merrily onwards, even if it is
interpreting as a numeric vector a block of garbage with no intervening
spaces.
¯5¯6¯7
¯5 ¯6 ¯7
1E6E7
VALUE ERROR
100 E7
PL* says:
>
> * ≡10 NEST 0*
> *1024*
> * ≡17 NEST 0*
> *131072*
>
> In theory one could check or limit the nesting depth of a value in GNU APL,
> but the run-time overhead would be significant.
>
> /// Jürgen
>
>
> On 08/19/2015 11:57 PM, Mike Duvos wrote:
&
APL on the same machine as IBM APL2
> or under a GNU/Linux emulator like *cygwin*?
>
> /// Jürgen
>
>
> On 08/22/2015 06:24 AM, Mike Duvos wrote:
>
> One more little benchmark, this time doing a variety of primitives.
>
> ⎕IO←0
>
> ∇
> [
n: are you running GNU APL on the same machine as IBM APL2
> or under a GNU/Linux emulator like *cygwin*?
>
> /// Jürgen
>
>
> On 08/22/2015 06:24 AM, Mike Duvos wrote:
>
> One more little benchmark, this time doing a variety of primitives.
>
> ⎕IO←0
>
&g
One more little benchmark, this time doing a variety of primitives.
⎕IO←0
∇
[0] TIME X;TS
[1] TS←⎕TS
[2] ⍎X
[3] (⍕(24 60 60 1000⊥¯4↑⎕TS-TS)÷1000),' Seconds.'
∇
∇
[0] Z←SHOW X;I
[1] Z←(I,50)⍴(50×I←⌈(⍴X)÷50)↑X←,X
∇
∇
[0] Z←X TIMES Y;D;I;C
[1] Z←+⌿(-⍳⍴X)⌽
m the mathematical operations.
> I even implemented an optimisation for this which was rolled back because
> it was severely broken. However, when it worked it provided an order of
> magnitude performance improvement or more.
>
> You might want to read up in the mailing list archive
Hi Elias,
It seems that there would be a substantial performance hit using C++ object
management to construct your workspace. I haven't run any benchmarks
before, but perhaps a quick comparison with APL2 would be useful at this
point.
Let's make a little function that does something 100 times.
⍎ (100⍴'{⍺'),' + ',100⍴'⍵}'
==
Assertion failed: body[bend].get_tag() == TOK_R_CURLY
in Function: setup_one_lambda
in file: Executable.cc:541
Call stack:
-- S
∇NEST[⎕]∇
∇
[0] Z←N NEST X;I
[1] Z←X
[2] I←¯1
[3] L1:→((I←I+1)≥N)/0
[4] (∊Z)←⊂,Z
[5] →L1
∇
≡10 NEST 0
1024
≡15 NEST 0
32768
≡16 NEST 0
65536
≡17 NEST 0
Bus error (core dumped)
ubuntu@ip-172-31-35-10:~$
check the source file Workspace.hh).
>
> Setting the value of the "variable" ⎕CT will simply change this value.
>
> Regards,
> Elias
>
> On 20 August 2015 at 10:41, Mike Duvos wrote:
>
>>A∘.=A←100-⎕CT×⍳10
>>
>> 1 1 1 1 1 1 1 1 1 1
>> 1
nsive. Not packing is memory expensive. If I am correct, then
> I have a slight leaning towards the way GNU APL did it. If I am wrong and
> the expense of packing / unpacking over many operations is not expensive,
> then I'd lean towards IBM.
>
> Blake
>
>
> On Thu, Au
A∘.=A←100-⎕CT×⍳10
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
[10 items, all tolerantly equal]
∇BLAH;⎕CT
[1] A∘.=A
[2] ∇
[IBM APL2]
WA←⎕WA ⋄ A←1000 1000⍴1=1 ⋄ WA-⎕WA
125056
[GNU APL]
WA←⎕WA ⋄ A←1000 1000⍴1=1 ⋄ WA-⎕WA
48046080
APL2 obviously packs boolean ravels 8 bits per byte. How does GNU APL
store its booleans?
I use large bitmaps a lot in my code, so having them stored packed in the
workspace is
(3↑⎕PP)←⊂'BAD VALUE'
[Uninteruptable infinite loop of the following...]
immediate_execution() caught APL error 0x50004 (DOMAIN ERROR)
DOMAIN ERROR
immediate_execution() caught APL error 0x50004 (DOMAIN ERROR)
DOMAIN ERROR
immediate_execution() caught APL error 0x50004 (DOMAIN ERROR)
DO
(3↑⎕IO)←10
⎕IO
10
⍳20
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
APL2 returns ⎕IO ERROR
What characters are used for the function and variable arguments in lambda
expressions? When I browse that section of the documentation, the
characters all render as little squares.
Hi Jürgen,
SVN 661 builds on both Cygwins without errors.
Now all that remains to be fixed is the Windows shared library issue.
Regards,
Mike
; then *uname -p* tells the difference, thanks.
>
> I have modified *./configure* according to Elias' comment. If you want
> you can test
> the attached files and let me know if they work.
>
> /// Jürgen
>
>
>
> On 08/16/2015 05:14 PM, Mike Duvos wrote:
>
> Hi
Hi,
My 32-bit Cygwin accepts -rdynamic. 64-bit Cygwin says it's a command line
error.
For 32-bit...
$ uname -a
CYGWIN_NT-6.1 shameless 2.2.0(0.289/5/3) 2015-08-03 12:49 i686 Cygwin
$ uname -s
CYGWIN_NT-6.1
$ uname -o
Cygwin
For 64-bit...
$ uname -a
CYGWIN_NT-6.3 Optiplex 2.0.4(0.287/5/3) 20
Hi Jürgen,
I looked a bit more closely at the shared library issue with Cygwin.
If I type in the command to link the library from the binaries after doing
a make, I get a message which says that Windows DLLs cannot have
unsatisfied external references, and that I need to include -no-undefined
in
Hi Jürgen,
-rdynamic passes -export-dynamic to an ELF linker. Windows isn't ELF, so
the flag is meaningless under Cygwin.
If you just change the makefile to never use -rdynamic if it detects Cygwi
n/Windows, all other things being equal, that should fix it for Cygwin,
without breaking it on any
Hi Jürgen,
Thanks. After removing -rdynamic from configure, GNU APL built without
errors on my laptop.
I still don't understand why g++ accepts -rdynamic everywhere except on
64-bit Cygwin.
Regards,
Mike
While the following doesn't blow up the system, it's hard to argue that it
should be allowed.
∇X ← X (X X X) X;X;X;X;X;X
[1] ∇
100 * X + 200
200
)CLEAR
CLEAR WS
A ← 'ZIPPITY' 'DOO' 'DAH'
∊2⌷A
DOO
(∊2⌷A) ← 0
A
ZIPPITY 0 0 0 DAH
So far, so good. Let's try it again with brackets.
A ← 'ZIPPITY' 'DOO' 'DAH'
∊A[2]
DOO
(∊A[2]) ← 0
A
Z 0 PPITY DOO DAH
Clearly, it's parsing the selectiv
Just tried building GNU APL with 64-bit Cygwin on my Windows 10 Acer laptop.
It did not go well.
$ make|grep error
g++: error: unrecognized command line option '-rdynamic'
make[3]: *** [template_F0.lo] Error 1
make[3]: *** Waiting for unfinished jobs
g++: error: unrecognized command line opt
On the GNU APL web page, it states that GNU APL has a maximum symbol count
of 65536. However, it appears that this isn't enforced, and you can make
as many symbols as you like. If you make a million or so, and type )VARS,
the system will segfault.
This isn't anything a user is likely to encounte
Hi Jürgen,
> Z← R For real numbers, yields the largest integer that does not exceed R
(within the comparison tolerance).
> That is essentially what ISO says and what GNU APL has implemented. The
observed behavior
> of the IBM APL2 implementation seems to be (within R times the comparison
toleranc
Hi Juergen,
You write...
"Summary: For *⌈* and *⌊* GNU APL follows the ISO standard while IBM APL2
does not."
While this may be the case, I would argue that the APL2 approach is much
more numerically robust than the ISO approach.
Within the range of contiguous integers exactly representable as
I just noticed that Make builds .a files for things like FILE_IO under
Cygwin instead of .DLL files.
Under Cygwin, you are running a windows binary with cygwin1.DLL doing an
API translation between linux and windows, with your shared libraries set
up as Windows .DLLs.
It is somewhat less than cle
Hi Juergen,
I know the file was successfully opened, because I print the argument that
is going to be passed to do the read, 2 0 16, and it has successfully
fetched the file size.
The value error is strange, because it branches to the dyadic case only
after using NC to check existence of the left
Now I can't replicate what I put in my prior message, which makes me think
I had index origin set to 1 for the first expression.
So never mind. :/
On Wed, Aug 12, 2015 at 1:15 PM, Mike Duvos wrote:
>
>)CLEAR
>
> CLEAR WS
>
> ⎕IO←0
>
> ⌹/3 3 ⍴
)CLEAR
CLEAR WS
⎕IO←0
⌹/3 3 ⍴⍳9
1.5 4.8 7.875
⍝ This should be the same as...
(0 ⌹ 1 ⌹ 2) , (3 ⌹ 4 ⌹ 5) , (6 ⌹ 7 ⌹ 8)
0 3.75 6.857142857
⍝ Which is the correct answer
> relative, so both your examples should definitely return 5. In
> Extended APL the tolerance is absolute, so both your examples are
> right on the cusp of whether they should return 5 or the next integer
> up/down.
>
> Jay.
>
> On 12 August 2015 at 03:25, Mike Duvos wrote:
>
a/a←⌊/''
SEGMENTATION FAULT
thread: 0x7f93f4eb8780
thread_contexts_count: 1
busy_worker_count: 0
active_core_count: 1
thread # 0: 0x7f93f4eb8780 pool sema: 0 RUN job: 0 no-name
-- S
⌊5-⎕CT
4
⌈5+⎕CT
6
Unless something has drastically changed since I last read the APL spec,
both of these should return 5.
A←'' ⋄ (↑A)←0
-- Stack trace at Cell.cc:129
0x7f0746a36ec5 __libc_start_main
0x443145 main
0x54ee0d Workspace::immediate_execution(bool)
0x483c92Command::process_line()
0x483d1b Command::do_APL_expre
∇RDFILE[⎕]∇
∇
[0] Z←RDFILE X;NILL
[1] NILL←210 SVOPAIR 'C5' 'D5'
[2] C5←'IR,',PATH,X,',D'
[3] NILL←C5
[4] C5←⎕←2 0,D5
[5] NILL←C5
[6] Z←D5
[7] C5←⍳0
[8] NILL←⎕SVR 2 2⍴'C5D5'
∇
[In APL2]
RDFILE 'test'
2 0 16
This is a test.
[In GNU APL]
RDFILE 'test'
2
> Elias
> On 7 Aug 2015 11:04, "Mike Duvos" wrote:
>
>> In Cygwin, I set up GNU APL as a server I could connect to by doing the
>> following.
>>
>> mkfifo /tmp/pipe
>> cat /tmp/pipe |apl --noColor 2>&1 | nc -l 127.0.0.1 > /tmp/pipe
&
I am
redirecting a shell, or some C program that reads and writes stdio. It
only happens when I do it with GNU APL. While I'm not suggesting this is a
bug, I was wondering if anyone could suggest an explanation of this
unexpected behavior. Is there something uncommon about the way GNU APL
re
80 matches
Mail list logo