« first day (400 days earlier)      last day (2255 days later) » 

9:50 AM
Officially the first day of meteorological spring - could fool us! Best to contact us via email for the rest of the week
 
 
4 hours later…
2:14 PM
@Feeds That looks pretty cool. rimshot drum roll sounds in the distance
 
 
2 hours later…
ngn
3:59 PM
@Feeds that's on the 21st of March, not the 1st
 
ngn
@cairdcoinheringaahing ah, I see. it's not the first time meteorologists were wrong and physicists were right :)
unrelated: a minor whine about - I can't solve "is my prison secure" elegantly only because stencil doesn't work on matrices smaller than the step
 
ngn
4:22 PM
nvm, found a workaround
 
 
2 hours later…
6:35 PM
So, guys: best way to put an apl project in git? Just do a git init in the project's folder or is there a better way?
 
@J.Sallé uh, just like how you put most stuff in git?
 
@EriktheOutgolfer I was actually wondering if the REPL had a built-in for that (since it's what I do in Eclipse)
 
@J.Sallé built-in for...git? no, I don't think so
 
 
1 hour later…
7:45 PM
@J.Sallé Use ]save item /path/ to save your stuff as a text file.
 
@Adám ah, great! Thanks Adam.
 
 
1 hour later…
9:06 PM
@Adám I found something definitely easier to do in C# than APL: Write simple scripts. csi allows you to run C# as a scripting language, without needing to define a class and Main method. It supports #! and allows easy access to to command line arguments.
On a related note, how do I get the command line arguments in apl?
 
@Pavel I didn't read it through, but perhaps this resource page might help.
 
 
1 hour later…
ngn
10:20 PM
I write APL in hashbang scripts, but it's a bit ugly:
#!/bin/bash
(echo ∇M;tail -n+3 $0;echo -e '∇\nM\n⎕off')|dyalog -script;exit $?
@Pavel I don't think you can access argv in dyalog
 
D:
 
10:38 PM
⎕←2 ⎕NQ # 'GetCommandLineArgs'
 
@Adám
┌───────────────────────────────────┬───────┐
│/opt/mdyalog/16.0/64/unicode/dyalog│-script│
└───────────────────────────────────┴───────┘
 
@Pavel @ngn ^
 
ngn
@Adám huh! i'll try that right away
it sort of works... there's a "ws not found" message on stderr
 
@ngn Well, the argument to dyalog is the workspace name.
 
ngn
@Adám you're not allowed to pass arguments to the apl script itself?
 
10:42 PM
@ngn What APL script?
 
ngn
@Adám yeah, I know but there's been such a project for like 5 years
 
@Adám What's QuadNQ?
 
@ngn I know, but it had stalled because they painted themselves into a corner.
@Pavel eNQueue [tasks for the interpreter to do].
 
ngn
10:48 PM
@Adám "they"? did what... ?
@Adám anyway, my ugly #! solution works now
 
@Pavel Every object can have a queue of things it needs to do. # is special, as it is the "root object" and can handle some unique system tasks. 2 means "do it now.
@ngn Kind of. It just treats the "script" as a tradfn body, which means you can't (easily) define tradfns or objects.
 
Huh. So what happens if I use it in an some instance of a user-defined class? Do I define a custom handler in the class?
 
ngn
@Adám I never needed those.
 
@ngn Can't take input tho
 
ngn
@Pavel no, with "-script" you can't
 
10:53 PM
@Pavel Yes, you can specify handlers for specific event types.
 
ngn
@Adám actually, I think I needed to do something like that once, and I used ⎕fix or similar to load an external file
 
@ngn Have you looked at my TIO wrapper?
 
ngn
@Adám nope
 
@Adám I just cat /srv/wrappers/apl-dyalog or whatever.
 
10:57 PM
⎕←↑⊃⎕NGET '/srv/wrappers/apl-dyalog'
 
@Adám
#!/usr/bin/env bash

export DYALOG=${DYALOG:-$(ls -d /opt/mdyalog/*/64/unicode | tail -1)}
export MAXWS=128M WSPATH=$DYALOG/ws

{
	echo :namespace
	cat .code.tio
	echo
	echo :endnamespace
} > ~/.bin.tio.dyalog

{
	echo "⎕PW←32767"
	echo "'#'⎕NS⎕FIX'file://$HOME/.bin.tio.dyalog'"
	cat .input.tio
	echo
} | $DYALOG/dyalog -script "$@"
 
ngn
@Adám right, that looks better than my tradfn wrapper
 
@ngn Couple of downsides because code runs in an anonymous namespace: Output is silenced by default. Result-less code lines are not handled. You can't use ⎕OFF.
 
ngn
@Adám and I'm not sure if it can be morphed into a #! header at all...
@Adám if the script itself is loaded with ⎕fix, there's no way to ignore the first few lines from it, is there?
 
@ngn You should be able to write a (long) #! header which replaces the first two lines of the currently running file with :namespace and appends :endnamespace, writes that to a temporary file, and then calls dyalog with the command to ⎕fix the temporary file, no?
 
ngn
11:10 PM
@Adám technically yes :)
 
@ngn But then again, our idea is to have a wrapper for dyalog, which can be called with the name of a script file, and basically does all this.
 
ngn
@Adám you can get to the Bramley bakery through Reading ;)
 
@ngn We're also envisioning the wrapper reserving the cmd line args for the script to read through something like ⎕ARGV. Note the difference: args of the script and args of the APL interpreter.
 
ngn
@Adám sounds good, the convention is to use "--" as an optional separator between interpreter args and program args
 
@ngn Yes, we're planning on something like that. I think in fact that that part is already being implemented.
 
ngn
11:15 PM
@Adám btw, i noticed that that ⎕nq expression reorders the args
it might be intentional - it seems the first two are always "dyalog" and "-script"
 
@ngn Yeah, I think the interpreter is agnostic on arg order, but GetCommandLineArgs tries to normalise some things.
 
ngn
@Adám great, good luck with that project
 
@ngn Remember, GetCommandLineArgs was never intended to provide argument to an application. It was intended to let an application know the settings which APL was started with. We'll introduce a clean new system without such legacy.
 
ngn
@Adám and that's why it was named GetCommandLineArgs and not GetAPLSettings :D
@Adám why not just ⍵?
 
@ngn Things were written with a very workspace-in-interpreter centric view. We'll fix that.
 
ngn
11:23 PM
@Adám ⍵ has no meaning at the namespace level, might as well do something useful. in a sense, cmd line args are like function args to the whole program
 
@ngn Because then dfns cannot access the args directly.
 
I wonder if ⎕USING←'System' ⋄ Environment.GetCommandLineArgs would work
 
@Pavel Yes, that works too, but no need for .NET. If you just want the raw command line on Windows, you can use ⎕←2 ⎕NQ # 'GetCommandLine'
 
Right
(For the record, I'm a fan of ⎕ARGV)
 
@Pavel In some ways, it feels like we're developing a new programming language. OK, development of the core language has been going on for over half a century, but now we just have to establish how interaction with the environment will happen, and then we're ready for release. :-D
 
11:36 PM
Dyalog almost is a new language. I'm guessing Iverson never envisioned classes in his notation!
 
11:49 PM
@Adám I noticed (on Wikipedia) that Morten Kromberg and Gitte Christensen recieved the Iverson Awward in 2016. Do you know what specifically that was for?
 
@Pavel This.
 
Thanks
 

« first day (400 days earlier)      last day (2255 days later) »