« first day (532 days earlier)      last day (1446 days later) » 

12:36 AM
@Dennis How do you represent FRACTRAN programs in plaintext?
1 hour later…
1:40 AM
@Dennis Also, when you have time, could you add Locksmith to TIO? HW program is in the repository, hw.lmt
@Pavel Whitespace separated string representations seems to be the most common way. For example, 3/2 2/3.
1 hour later…
2:45 AM
@Dennis Interpreter?
It's a simple find-and-replace loop.
I'll probably just make one myself.
3:45 AM
@ConorO'Brien will the languages ever stop? :P
@Dennis Wolfram MathWorld has a mathematica interpreter: mathworld.wolfram.com/FRACTRAN.html
I can't see one on the page you linked to.
Anyway, since Fractran operates only on a single integer, I'd like an interpreter with some useful forms of I/O.
@Dennis It's the provided Wolfram notebook. I can copy the program to a wolframscript file.
I doubt it has the forms of I/O I have in mind, and I wouldn't know how to add them in Mathematica.
The core is just this:
        while True:
                fraction = next(fraction for fraction in program if not register * fraction % 1)
                register *= fraction
except StopIteration:
Btw I'll try to catch up on the pending language requests tomorrow.
4:04 AM
@Dennis Hmm, how do you output text, that is, Hello, World!
	Invoke with `wolframscript -file FRACTRAN.wls <codefile> <starting_integer> <max_iterations>`

FractranIt[f_List, n_Integer] := Module[{i = 1, l = Length[f]},
  		While[i <= l && ! IntegerQ[n f[[i]]], i++];
  		If[i > l, 0, n f[[i]]]

Fractran[f_List, n0_Integer, nmax_: 100] := Module[{i = 1, l = {n0}},
  		While[l[[-1]] > 0 && i <= nmax,
   			l = Append[l, FractranIt[f, l[[-1]]]]

code = ReadString@$ScriptCommandLine[[2]]

n = ToExpression@$ScriptCommandLine[[3]]
@Pavel To store a list in Fractran, you use prime exponents. For example, [1, 2] becomes 2**1 * 3**2. With an option to output exponents (e.g., -E) and an option to output characters (e.g., -C), you can decode a single (large) integer to a string.
@Dennis I don't know Jelly
But I see your point
ÆE gets the prime exponents, casts ordinals to characters.
Well, the above glob of Mathematica just prints a list of numbers, but I can make it parse flags, too.
If possible, I'd rather not depend on Mathematica for other languages.
4:17 AM
@Dennis Oh, why not? Someone might just write an esolang in Mathematica one day :P
Some people already did.
And I'm guessing none of these are on TIO
Nobody has requested them so far.
What'll you do if someone does?
@Dennis What are they? Definitely not so that I can request them
4:19 AM
@Pavel Add them. That's why I said If possible.
@Pavel Hey, someone already did.
Jan 8 '17 at 23:21, by Pavel
@Dennis can you add Mthmtca
If I had a vague understanding of how Mthmtca works at one point, I no longer do.
@Dennis Mthmtca requires MathKernel to be on the PATH for the makefile to work by the way
The main problem with depending on Mathematica is that Wolfram could revoke the license they gave me at any point. I don't think they're going to do that, but if they do, there's really nothing I can do about it. Breaking all Mathematica permalinks would be bad enough. No need to break other stuff as well.
Mathematica permalinks could be redirected to Mathics and just hope as little as possible breaks.
Aside from that, Mathematica wouldn't be my first choice for writing an interpreter. For starters, an interpreter in Mathematica is only useful to people with access to Mathematica. For TIO, I'd rather avoid the 1-second startup time and the occasional glitches people reported.
Finally, since there's no canonical interpreter to be found, I want to make one with the flags I mentioned, and I don't really know Mathematica.
Mathics should supports $ScriptCommandLine, which would make my Fractran interpreter also work in Mathics, except it's broken.
4:30 AM
Mathics takes 3 seconds to print Hello World, so I wouldn't use it for Fractran anyway.
Also that
It amuses me when a program takes more time to produce a constant output than it does for me to speak the same output.
In that case, let me introduce you to my hilarious friend Kotlin.
That... is amazing. It's like it somehow added together the execution times of every language that its syntax resembles.
Whatever takes so long takes place before even looking at the source code. tio.run/##y84vycnM@w8E/5LTchLTi//rpicWJSWmpwIA
4:41 AM
Now I need to install it and figure out what it's doing. That's fascinating in a bad way.
If I have a string of binary, how can I convert it to UTF-8? xxd is too picky about formatting.
(That should be a mthmtca Hello, World!)
I wish there was an equivalent of -ps for the -b flag
@Dennis Can you change ShortC's wrapper to this please?
Basically the C code should be preprocessed before it's fed to shortC
4:56 AM
Ok, can confirm that that is an invalid mthmtca Hello, World!
@MDXF and after that would you mind pulling it as well @Dennis ? Thanks in advance :)
5:21 AM
@Dennis This python code prevents debug info from being printed. Probably not high priority but it is probably a bug.
Steps to reproduce, hit play, wait a second, hit play again.
Everything works properly when you allow things to time out.
Not useful but here's it golfed
6 hours later…
11:53 AM
@Dennis Is there something wrong here‌​?
(sorry I'm not very good at bash commands)
Looks like some extension.
1 hour later…
1:25 PM
@user202729 The shorthand syntax only works without the +. You have to use tail -n +2 here.
@HeebyJeebyMan That is pretty much by design. When you click play again to quit the process, TIO tries to terminate it gracefully with SIGINT. If that doesn't work / takes longer than a second, everything is unceremoniously nuked with SIGKILL.
Since the timing is done from without the sandbox, the timer is nuked as well, so you won't get any output.
@MDXF That won't break pre-existing shortC answers, will it?
At least the Hello World doesn't work anymore.
Apparently because cpp appends a linefeed, which shortC doesn't like at all. tio.run/##K87ILypJ/v/f0UvJIzUnJ19HITy/KCdFkev/fwA
@HeebyJeebyMan -31 bytes
1:56 PM
@Dennis Actually that is a bad idea. Any particular program can only handle finitely many prime exponents.
@user202729 Why does that make it a bad idea?
Then programs can't allocate new list entries. It's more similar to a tuple, where number of elements are fixed at compile time.
I'm not following. The program 3/2 would convert [2] (4) to [0, 2] (9).
For example, if you use the list of prime exponents as output, you can't have the program "Given the number n, output n ones".
How would you do that without prime exponents?
2:09 PM
You can interpret the exponent of 2 as a base-256 bijective number and convert that to ASCII and output.
Or do the way the shortest Fractran self-interpreter do it - base 11 number encodes base 10 number representing list of numbers separated by a.
But that only means prime exponents shouldn't be the only option, not that it shouldn't be an option at all.
... good point. Prime exponents tend to take less bytes too.
At least for sum these integers, that seems to be the golfiest way.
3:13 PM
@Dennis Why does waiting for it to time out work then?
@HeebyJeebyMan Two reasons: 1. After the timeout is reached, a SIGTERM signal is sent. There's a similar weirdness if you adjust for that in your program. 2. The sandbox calls the used language's wrapper with time timeout <wrapper>. The timeout command finishes as soon as it sends the signal, so time will print timings whether the process has finished or not.
3:46 PM
@Dennis thank you!
@MDXF never ;)
1 hour later…
4:57 PM
@Dennis Do I just add the LICENSE file from the Jelly repo to the Peanut Butter repo? Do I need to modify it in any way?
Q: How to manage a copyright notice in an open source project?

Steve BennettI'm working on, and adding to, a GitHub-hosted project that includes this LICENCE.md (apparently the MIT licence verbatim): Copyright (c) 2012 [Acme Corp] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Softw...

Ok, I've added the LICENSE, is it ok? I have zero experience with legal stuff.
2 hours later…
6:39 PM
@Dennis Oops. Fixed
7:24 PM
@Dennis Could you please pull Locksmith?

« first day (532 days earlier)      last day (1446 days later) »