@RikedyP I am using Chrome. And I just checked and it still doesn't work
Also, "Ctrl + Shift + Backspace" also removes the expected indentation
I know you can just edit the line above, but most command line REPLs (Python, Haskell, etc) have a command to get the previous line (usually just up arrow) and then you can edit it
So I typically do the same thin in APL (aka use Ctrl + Shift + Backspace)
Note on the old tryapl.org, up arrow worked - and my recommendation is to just leave it that way
No beginner is going to know the Ctrl + Shift + Backspace is what you need to type to get the prev line
@code_report Very fair point - that is a shame - just carried away cos we're so used to it / the text editor / xiki shell thing is cool in my opinion - do you think we can get away with just saying telling people how it works on the intro tab? Also by this point, you don't just use the actual interpreter? The goal of TryAPL for us is to get people to an interpreter
@Adám Well I'd like to know what @brgal's experience with his recent workshop was
@Adám But yeah I guess that wouldn't hurt - it's just pretty lame in my opinion, but I'm definitely biased :P
@dzaima Yeah I'll add that (both why not)
@code_report Can you try a )clear for me - I'm using Chrome and it works for me - or if not try clearing cookies and also localStorage.clear() just for good measure
@code_report although AFAIK we don't currently save your input history to localStorage (Adam said we should and maybe we will soon)
@RikedyP I'm used to RIDEs behavior for up/down, but the ctrl+shift+backspace is still imo way too complicated for something that's used maybe 0.7x as often as enter
@RikedyP yeah, not by default, but I didn't even think about binding it. (though i guess ctrl+d is typeable with one hand whereas ctrl+up/down takes 2 (there is right ctrl, but i never use it))
@dzaima @code_report Okay fixed now + you can use alt+up/down for recall - we are considering having a one-line input/ separate output mode like before but that won't happen soon cos busy. Thank you so much for your feedback invaluable as always
⎕ is 1) take input from user; 2) output to stdout; 3) anything that doesn't deserve a single-character builtin but is still useful enough to be in the language
Yeah, I don't think it is worth it either. The idea was that ⎕ML≥2 people could replace all their ⊃s with ⊇s and all their ↑s with ⍏s and then set ⎕ML←1.
sad that this doesn't work, probably because no ¯0 :/ https://tio.run/##rVXLctMwFN37K7IrjJGtpyXxAZ1hxTfYlpw4ceJMndLpMOwYZoCGYcNkxZI1Cx47NuRP/CPlSpZLKZShpdno6L7OuZZ0k68bZE7zpp2e92/ePXrcv3iLo377fjLbbNbdwzQ17fE0b5p5ctIemfWR7bqkbJcpxRSnWKQEp0W9Oak7i8p29cQedXW7Qm2FIK9obIeOu3o1Re2qOUVV0@Ybt1u39WqDlsfNpl43dQlGyMlXBuXG1G6Tnh@CkKf5pICFZP2rD/3Zt3778h5oNA8U0f3ZV4D5/X77iU5Uv/3cb79ELlgngmWSM5JxnFFhv3/Ecr8r@tfPK/AinHAdfkoxobgETwmeKnYxU0BcYCa0zqhkEnMtExxCpnEJyLoy18bYuIwMrAUqgwUnGGOuFFWEiv3OmQvPN6KpZ174ZIcaQCVaAJoDogmlAkumhIKFYsKhJYZVqD6PG4cQQAdqpx9a5JRRxSQRQmrLsPSfph7YXRrxggvP5DjzwIQ5z6AfYGSEARHJ9rsc/LPh2…
@rak1507 Hm, now I want an integrated APLcart feature in the IDE: Hit a keyboard combo, get pop-up, type query, select result, result is pasted at cursor position.
@dzaima I've been looking at destructuring compound functions in BQN, which is needed for nice function formatting and useful for the tacit function expander I mentioned. It turns out I can tag compound functions in the Javascript VM with only about 5% overhead, so it's not a technical problem. But I wanted to decide on a format that we might use for a system function. Here's my current model:
not compound ¯1,x
2-train 0, g,h
3-train 1,f,g,h
1-mod 2,𝕗,𝕣
2-mod 3,𝕗,𝕣,𝕘
left partial 4,𝕗,𝕣
right partial 5, 𝕣,𝕘
So the result is a list between 2 and 4 items long, with a "type" and then elements. It only expands one level at a time.
With this model, a 3-train with · on the left would have to be represented as a 2-train, but maybe we'd like to add extra information to distinguish them.
@Marshall I think with that function there are four "reflection"-ish queries you might want to do: get type; convert primitive to character; destruture compound function; and get source code (location?) for blocks. Somewhere in there there needs to be a way to tell a primitive apart from a block, though.
And the programmer might want to inspect values in the scope, but they're not allowed to.
@rak1507 That's what it says, but I don't know the reporting tool. How big is data?
@Marshall My compiler doesn't distinguish between (·F G) and (F G) in object code output. We probably shouldn't require implementations to keep track of the difference.
@Marshall and dzaima/BQN just implements (·F G) as (F G)
@Marshall (it's a good model for a single function giving the info, but i think it might be worth it to get a more general form of querying arbitrary data)
@dzaima I'm fairly sure I prefer using functions for all these queries. The reason for the ToE bullet in Dyalog would be that there are values that aren't first class.
For blocks in particular it might be reasonable to have a function that returns a metadata namespace.
@RikedyP Alt + up / down works :) thanks for adding that. I have Dyalog 17 on 18 on my Windows laptop, but when I tried downloading Dyalog for linux my keyboard setting broke for half a day so I uninstalled it. I personally think Dyalog should be heavily investing in tryapl.org. In C++ land, godbolt.org has become the primary place I write C++ code examples and prototype. Software development (and everything) is headed to the browser/cloud, not to desktops.
@code_report linux dyalog breaking the keyboard layout is an expected problem. My solution is still to just clear /opt/mdyalog/18.0/64/unicode/aplkeys.sh
arguably, C++ did too for many decades (getting a C++ compiler up and running on your workstation was no small feat). With godbolt.org, the "time to first line" is the time it takes to type the URL in. TryAPL.org can serve the same purpose.
@dzaima For the compound function expander, the things I'm still wondering about are whether it should rearrange arguments in some way to make them more regular (pad missing left inputs, or put the "main" function/modifier first), and whether it should indicate data/primitive/block instead of lumping them all together as ¯1.
@code_report Yeah, one thing we will be looking into is creating a lightweight but secure container to run APL in. We could spin up a few to have them ready at a moments notice, and then as they get corrupted or busy, we spin up new ones.
@code_report We have a serious problem in our duality of trying to remain constant for our existing customers (the ones paying all of our salaries) and making the product attractive to the modern audience.
@Marshall I'd guess there's no good solution to the ordering issue. I'd have another 2 types for primitive and block, and only non-function/non-modifier for ¯1 (erroring on non-fn/mod is probably not worth it)
@dzaima I guess they should be 0 (primitive) and 1 (block), and shift everything else up? That makes 2- and 3-train numbers work nicely, by complete coincidence.
@Adám I can appreciate that. That being said, I think growth of APL and discovery of new customers and a growing community all starts with low barrier to entry, and TryAPL.org provides that. My love for APL started on TryAPL.org after I googled the language having listened to a couple episode on APL on the FunctionalGeekery podcast. If it weren't for TryAPL.org, I am not sure how far I would have gotten.
For terminal I/O, J allows numeric codes in file functions to indicate stdin/stdout/stderr. That might be a good approach to take (although for stdin we'd need a way to handle streams).
@Marshall will get to implementing. Having 3 separate file functions for different types makes a lot of sense (as opposed to an argument of the type, or not having any options other than lines..)
@dzaima Putting the BQN-side type in an argument would be good except there's no argument to put it in. And eventually we probably want to allow the file argument to say what encoding the file has, but it's pretty unlikely anyone will want anything but UTF-8 for a long time.
@Marshall short read thru, and my first thoughts would be that it might be helpful to wrap open(2) and write(2) as close as possible
you could still use convenient wrapper functions for everyday usage, but there are times you want to write to a file descriptor not a path, as well as write byte slices (not a whole file)
@cannadayr I've been assuming whatever Dyalog's portable file functions do is reasonable. I haven't thought much about anything that holds files open as I almost always just read or write the entire file (I knew BQN would need them eventually though).
I read about magic functions the other day, and was wondering, is there some core subset of APL that is all in C and a lot of the rest is done in APL? It seemed like magic functions might only be used for special cases though
@rak1507 Right, almost everything is in C, and magic functions are for a select few primitives. We're getting rid of magic operators, as they cause problems.
@rak1507 There's no clean separation. There are some places where magic functions can't be used, but otherwise they can just be put anywhere, usually to handle a particular case.
Right yeah I was wondering, idk how anything works but if there's some sort of function that does the stuff, if you can call that in C rather than in APL
First time using link, sorry if this is a silly question. Does it not support something like foo←2∘{⍺×⍵} ? It returns DOMAIN ERROR: Invalid text array *** Fix: Unable to write "foo" to file.
@Marshall what do the file writing functions return?
(only just noticed that •FBytes actually returns a character array, not a number array of 0-255. I'd imagine anything dealing with bytes wouldn't want to touch characters)
@Marshall well, that depends on who's implementing the optimizations. Signed bytes are definitely more annoying to use, and the only case when I'd expect a character •FBytes to not be immediately followed by @-˜ is when abusing it for faster loading of ASCII files
@dzaima If you're handling a binary format that someone else designed, I think it's reasonably likely for it to use some signed bytes, or a mix of signed and unsigned. It's weird to say it like this but to me characters feel less like the data is already interpreted and more like you can make your own choice.
Although converting from usigned int to signed int is still easier than character to signed int.
@dzaima I guess that's why. They reflect that the bytes in a file are useless and don't mean anything until you do a conversion—and you might choose to convert in various ways.
@Marshall are there any actual usages of signed bytes in any file format? Bytes being given as signed doesn't help at all afaict in parsing 2- or 4-byte signed ints
@Marshall so unsigning separate bytes vs adding a sign in post-processing
@Marshall the only "conversion" you can do is subtract @+something, and that "something" is zero for unsigned conversion, and zero for the best signed conversion i've found. (not that this refutes your point, but it's still intentional boilerplate to usage)
@dzaima Well, (¯128×0⊸≤)⊸(+-¯128-⊣) converts between offset unsigned bytes and signed bytes without going out of signed byte range (example), but it's not exactly pleasant.
@Marshall oh right. The user doesn't have access to anything representing a non-relative •Import. I guess it could be another •Decompose case, giving the path and string version of the function
@dzaima They're ignored, except the first and last. But if you write the import deriver thing without the double underscores then you're really in deep trouble.