« first day (154 days earlier)      last day (1123 days later) » 

12:00 AM
@Dennis oh
that's a good question
I'm guessing I can just remove it. Give me a bit of time I'll do some research and get back to you
 
I guess I could turn it into a server-side script that returns a different response based on the extension.
 
@Dennis, if it's not too much hassle, I'd do it similar to this. If it is, I'll just remove the first line or first few characters to get the actual json. It's up to you my preference is the former.
 
The issue is that the page relies on that response, and synchronous XMLHttpRequests are problematic. Having a stand-alone language list in JSON would be nice though. I'd rather have two separate versions.
 
12:17 AM
@Dennis And then you'll need to remember to sync them
It's amazing how easily these things can get out of sync
 
Not necessarily. I could make languages.js a script that adds the needed bits and pieces to the JSON file. I would have to move cmp outsides languages, but that's no biggie.
That stuff has no business in the JS file anyway.
 
@Dennis If you mean that you can generate it from a single source, then yes, it's a good solution. The main thing would be never edit the generated stuff manually.
Even when it's tempting ;)
 
 
3 hours later…
2:58 AM
@AndrewSavinykh Alright, tryitonline.net/languages.json contains pure JSON; backend.tryitonline.net/languages.js is a CGI script that surrounds it with var languages = ... ;.
I still have tio.run/languages.js for legacy reasons, but it won't get updated anymore.
@Downgoat ^
 
Ah ok will update thanks for notice
 
@Dennis Thank you I have a look, don't forget to push all these to git when convenient
@Dennis, question, if I want to write a transpiler, should it output the transpiled source to the stderr and the actual result to stdout, or should it not output the actual result at all?
 
@AndrewSavinykh I'd only print the result and add a switch that shows the transpiled code instead. Like gcc does with -S and assembly.
 
Anonymous
3:29 AM
@Dennis Why is "all" empty?
 
It gets populated by JS. That made more sense when everything was in a single file. I guess I should remove it from languages.json.
 
Anonymous
I've updated this to use the new API
 
Nice. :)
 
4:12 AM
@Dennis Can I get a pull for RProgN?
 
4:45 AM
@ATaco RProgN or RProgN 2?
 
RProgN.
 
@ATaco Done.
 
<3
 
5:11 AM
@Dennis Can you push Del|m|t, please? Thanks
 
Pulled...
 
Thanks
 
5:26 AM
I'm sorry for bothering you @Dennis, but could you pull Del|m|t again? Thanks a ton.
 
5:37 AM
@MistahFiggins Done.
 
Thanks
 
 
12 hours later…
5:11 PM
@Dennis, I can't get the rewrite url right for adding .html. I'm sooner or later I will, but since you already have it, I thought may be you could share?
@Dennis also I'd like to know if I may re use your TIO icon from here github.com/TryItOnline here github.com/TryItOnline-Collateral
 
5:28 PM
@Dennis I'd really like to see Dyalog APL on TIO. Any way to achieve that?
 
@AndrewSavinykh There's a blackout in my village, so I can't access the server right now, but I'll get back to you later.
@AndrewSavinykh Sure. That reminds me that I have to change it though. The icon should use #F0F0F0 for the text. The favicons use the correct color.
 
@Adám That would depend pretty much on Dyalog. I doubt I'm allowed to use my student license for a web service.
 
@Dennis You seem to have a terrible power grid I must say
 
The worst. At least in summer, when those who can afford it use their A/C, problems are the rule, bot the exception.
 
5:35 PM
Fun.
 
Anonymous
You should probably enlist a co-conspirator to help manage TIO when you're not able to (like during blackouts)
 
@Dennis You have me on the inside. :-) Just apply for an educational license, or I can get you the necessary permission.
@Dennis Wait! What am I saying? Student ≡ Educational. No, you have the right license. Go ahead.
 
@Adám I think that one technically expired when I ceased to be a student. It's also not for the latest version.
Also, it says The licence is restricted solely to educational purposes, and I don't think TIO fits the bill.
 
@Dennis Clearly, TIO is helping people learn stuff, no? ANyway, do you want me to get you an explicit permission for a 64-bit Unicode 15.0? (16.0 will have 5.5 new primitives!)
 
5:55 PM
@Adám I'd say it is, but if you can get me an official OK, that would be great!
 
@Dennis No problem You should have it by tomorrow (depending on your time zone).
@Dennis Anything else you need? How do you prevent execution of malicious code?
 
@Adám Great! Thank you! I wanted to add Dyalog APL from day one, but I didn't think it it was possible. Do you need an email address or something?
@Adám All user code runs in a severely restricted SELinux context. There's no internet access and it cannot make changes to the filesystem.
To be honest, I have no idea how to execute APL code as a script, but I hope you can help me with that.
 
6:14 PM
@Dennis If you registered with your name (and your name is Dennis Mitchell), then we'll find your license.
@Dennis Well, how about issuing commands to the OS? Closing/Crashing Dyalog? Issuing prompts? Spawning processes?
@Dennis dyalog.exe < input > output
How will you tackle full memory? And what about infinite loops?
 
Anonymous
Processes get killed after 60 seconds
 
Anonymous
And there are memory limits
 
@Mego Obviously you have tools available for this. Just let me know if you need any advice, e.g. as to which built-ins may be dangerous.
 
Anonymous
With how Dennis has the arena set up, it would be hard for any language to do anything destructive or dangerous
 
Anonymous
Like, write-a-thesis hard
 
6:29 PM
@Mego I'll be happy to try.
 
6:39 PM
@Adám Dennis Mitchell is Dennis the Menace. My last name isn't really Mitchell. You can reach me at dennis@tryitonline.net. That's not the address of my Dyalog license though.
 
@Dennis You can send your actual license info to adam@
 
7:03 PM
@Adám Replied to your email.
 
@Dennis Ok, I've sent a request to our customer account manager, and I'll speak with her at the office tomorrow morning.
 
Thanks again. :)
 
7:58 PM
@Dennis could you add Stacked to TIO? It's a "practical" language. You can run code with node stacked.js path/to/file, or node stacked.js -e "program". You can run node stacked.js -t to see if everything works out. You shouldn't get any errors if everything works as it is supposed to. (Another note: there are two stacked.js's; the one you should use is the one not in src/.)
Also, not all programs that work in the online interpreter are guaranteed to work with the offline interpreter.
 
 
2 hours later…
9:44 PM
@Adám But where/how do I provide the code?
 
9:56 PM
Piping the code works, but then I can't take input. I think.
 
@Dennis What do you mean by "input"? ⎕ and ⍞ ?
 
Yes. Say I want to execute ⍞←'Hello, ',⍞ to greet a user by their name. How do I supply the code ⍞←'Hello, ',⍞ to the dyalog executable? If I pass the file name, it says it's not a workspace.
 
@Dennis Store ⍞←'Hello, ',⍞ in a file, and pipe from that file to the exe. However, I'm not sure what where the prompt gets input from. ⍞← goes to STDERR btw, use ⎕← for STDOUT.
Also, implied output goes to STDOUT, like ⎕←.
 
Right, ⍞← is a bad habit from ngn-apl.
 
Because everything goes as in the session, multi-line functions are:
∇fib←{
⍵≤1:⍵
+/∇¨⍵-1 2
}∇
fib¨⍳10
 
10:12 PM
Seems like input also comes from STDIN. Piping echo -e "⎕←'Hello, ',⍞\nDennis" works as intended. It's going to be hard to interleave code and input though...
 
Yeah, ugh,
Well, you would have to find instances of ⍞, and insert the given input lines right after each.
Even worse would be trying to find ⎕
 
Which can be used for oh-so-many purposes...
 
Well, you'd have to regex ⎕\W
var←3 ⋄ ⍞var is valid, but var←3 ⋄ ⎕var is not; only var←3 ⋄ ⎕ var
Here is a different approach:
Add this line before the code: ∇DennisWrap, and add the two lines and DennisWrap after the user's code. All input lines go after that.
User can embed newlines in his {dfns}, and add arguments after the final }.
 
I have no idea what that does, but it works perfectly. :)
 
Do you know about tradfns?
(ngn apl doesn't have them)
 
10:20 PM
You mentioned them once, but I don't quite grasp the concept.
 
They are programs/scripts (not necessarily functions). Typing ∇progname into the session switches to tradfn definition mode. All lines after that are lines in the program/script. Finally, an un-quoted ∇ switches back into regular REPL mode.
Catch: the text after the initial ∇ tells APL explicitly what will follow.
 
So you define a function DennisWrap, then execute the function. Yes?
 
Exactly
However, tradfns may take arguments, and this will prevent such usage. E.g.:
∇result←Fib n
:If n≤1
result←n
:else
result←+/Fib¨n-1 2
 
I routinely forget than APL can actually be readable when you're not golfing. :P
 
hehe.
 
10:27 PM
Before I forget to ask: can I prevent the dyalog executable from saving/restoring the state?
CONTINUE saved Mon Jan 23 19:16:38 2017
 
I should make a thin cover language for APL called AINAGL (APL is not a golfing language)
 
:D
 
use dyalog.exe -script
This changes: no banner
no CONTINUE handling
no EOF interrupt
no clear ws
no echo of input
no six space prompt
no line number prompt in the ∇ editor
(you were probably seeing input echoing on stderr, no?)
Actually, I have been seriously considering a thin cover for APL just to prevent ⍤ ⌸ ⍠ ⍸ ⊆ and ⌺ from inflating 1-byte/char into UTF-8.
 
Yes, I were. Had to step away from the computer. I'll try it in a minute.
 
no rush
 
10:43 PM
Ah yes, that works perfectly.
$ echo -e "∇TIO\n⎕←'Hello, ',⍞\n⎕←'Hello, ',⍞\n∇\nTIO\nDennis\nAdám" | /opt/mdyalog/14.1/64/unicode/dyalog -script
Hello, Dennis
Hello, Adám
 
:-)
 
And as you said, the ⎕← can be cut.
ngn-apl and GNU APL taught me some bad habits.
 
However, I suggest changing the name from TIO to ∆Ⓣ⍙Ⓘ⍙Ⓞ∆
(unlikely to cause naming conflicts)
 
I'd say. Those don't even show up correctly in my browser.
 
What do you see?
 
10:47 PM
The letters with underscores are rectangles.
 
Oh, so much better then. Actually, they are circled letters, but APL385 Unicode paints them like underscored to look like the good old typewriter overstrike days.
 
Ah, OK. I pasted them into ride to see what they were supposed to look like.
 
Actually, here is a better solution: Go ahead and use TIO, but let the initial prepended line be ∇TIO;TIO.
This will shadow the name TIO, thus making it available for the user to assign.
 
Oh, that's neat.
 
There are a few more trick you can put in if you want. YOu have such a thing as settings, right?
ngn apl has ⎕IO, but it is not changeable. When I golf, I sometimes use ⎕IO←0, and sometimes ⎕IO←1. Being that both are common defaults, I can save a couple of bytes. (CG is all about finding loopholes, right?)
 
10:53 PM
At this point, not really.
 
Well, the user can always begin his code with settings, and still not count them on PPCG.SE.
e.g. ⎕IO←0 ⋄ ⎕ML←3
 
You could always put ⎕IO←0 in the header though, so it won't look like part of the code nor contribute to the automatically calculated byte count.
 
Cool.
OK, so we have settings in "Header" and code in "Code (which you wrap).
How are we to feed arguments?
If I put just × in "Code", it won't work.
 
For J/Jelly, I usually define a function in Code, then call it in the Footer.
 
But then you have to name it.
 
10:57 PM
Right, but that's also excluded from the byte count.
 
how?
 
On PPCG, I mean.
 
oh.
 
Is there any way to escape a line break in APL?
 
You mean inside a string?
'Hello',(⎕UCS 10),'World!'
 
10:59 PM
No, in a statement. This is how I deal with byte counts in Python. tio.run/nexus/…
 
no, APL has no line continuation
However, you can prepend-merge the (last) line of the header to the first line of the code.
Header: ⎕IO←0 ⋄ f← Code: {blah blah}
In fact, you could see a trailing as a flag that that line needs to be merged with the COde.
 
@Dennis you could fix the problem for languages without line continuation characters by adding a checkbox saying "newline after header?"
 
Hm, that would require rewriting the backend a bit. The wrapper sees only the glued code file, not the individual parts.
Replacing ←\n would work though.
@ConorO'Brien That's also a good idea.
 
Right, no APL line ever ends with ←
Regarding naming of the wrapper: YOu should probably use the obscure name and shadow it. If, for some reason, I call my function TIO, I won't be able to call it from the footer, as it is shadowed.
Also, you should not wrap if the code begins (and ends) with a , as this indicates that the user supplied his own wrapper.
Valid solution to http://codegolf.stackexchange.com/questions/59299/math-in-manhattan:
`R←X(f M)Y`
`⍎(5|⌊f 2)⊃'X×M⍣(X≠1)⍎⊃b'(b⎕R(Y⍴'&')⊢a)'10⊥X Y'(('(.*)',b←⍕Y)⎕R'\1'⊢a←⍕X)`
But this would fail with the current design. However, if you detect the `∇`, and do not add the wrapper, then it should work:
`∇R←X(f M)Y`
`⍎(5|⌊f 2)⊃'X×M⍣(X≠1)⍎⊃b'(b⎕R(Y⍴'&')⊢a)'10⊥X Y'(('(.*)',b←⍕Y)⎕R'\1'⊢a←⍕X)∇`
 
I see. APL is going to be interesting.
 
11:16 PM
All this strangeness comes from APL having 50 years of backwards compatibility. Most code from '67 can be run on my Dyalog version 16.0 without any modification.
There was no STDIN/STDOUT/STDERR... Only a IBM mainframe listening to a Synchronous Transmit-Receive protocol on a 40 kbit/s half duplex line... Ah, the good old days!
 
I see. That's hard to compare to a modern setup...
 
Part of the Header can also import libraries, I suppose, e.g. codegolf.stackexchange.com/a/103184/43319: Header: ⎕CY'dfns' Code: ⎕{⍺⍵,2↑⊢⌿cal⍺⍵}¨⍳12 Input: 2014
What happens if Code contains an error?
 

« first day (154 days earlier)      last day (1123 days later) »