« first day (352 days earlier)      last day (2142 days later) » 

01:15
@MDXF Both Cubically and Commentator fail their Hello World tests after the update.
@Adnan Syncing.
01:31
@Dennis That's intentional for Commentator, but I'll look into Cubically.
Cubically's Hello World doesn't even use anything I changed
Have you tried appending a newline
@Dennis Fixed. I completely forgot to finish what I was working on lol.
01:54
@Dennis Can you pull Charcoal>
@MDXF @ASCII-only Syncing.
@ASCII-only Just one key to the right and you got it
@MDXF ok *>>
@ASCII-only .i)i
figure out what that means :P
@MDXF That's unfortunate. I'll hold for a new Hello World then.
02:39
@Dennis is there any way to add a language that requires its compiler to be recompiled every time?
I want to make Cubically be able to have multiple cube sizes, but the interpreter would have to be recompiled every time, unless I wanted to hardcode hundreds of cube sizes, which would eat RAM so bad.
02:54
@MDXF s/compiler/interpreter
03:11
@MDXF Sure, that's possible.
I don't think it's necessary though. A dynamic cube size would certainly be possible without any kind of hardcoding.
@Dennis Really? In C?
Via int ***cube and dynamic memory allocation?
That sounds painful. A single malloc should do.
malloc(6 * CUBESIZE * CUBESIZE);?
You need a n×n×n array and want to index it as cube[i][j][k], yes?
Yep. cube[face][line][cubelet]
03:16
Ah, just the surface. So 6×n×n.
So cube[0][0][0] would be the top-left cubelet of the top face, cube[0][2][2] would be the bottom-right cubelet of the top face
Yep.
Well, cube[i][j][k] is just flatcube[i*n*n + j*n + k].
Where flatcube is int *flatcube = malloc(6 * CUBESIZE * CUBESIZE);?
Yes.
Well, almost.
03:22
You have to account for each int taking up multiple bytes, so it's int *flatcube = malloc(6 * CUBESIZE * CUBESIZE * sizeof(int));.
Oh, true.
Ok I'll work that in when I've finished extending the code for multiple cubes
 
1 hour later…
04:25
@Dennis I have about 100 instances of cube[x][y][z], and flatcube would have issues with array rotation. Can I just do the runtime recompile?
Or is there a way to declare an external array of variable size?
It's your interpreter; you can do whatever you want. That said, the occurrences of cube[x][y][z] could be replaced with a regex, and rotations (of the cube, I assume) could be achieved with a temporary buffer and 6 to 7 calls to memcpy.
@MDXF Looks like C99 makes this possible. tio.run/##S9ZNT07@r5yZl5xTmpKqYFNckpKTmaSXYfc/…
 
4 hours later…
09:00
@Dennis Thank you! :)
09:52
@Dennis can you pull Braingolf when you have a sec?
 
2 hours later…
11:57
I don't know if the cube can be large or not in Cubically, but if you use a stack array it can crash if the array gets longer than 1M or so.
12:53
@Dennis Can you pull Gaia please?
 
1 hour later…
13:56
@Mayube @BusinessCat Syncing.
 
2 hours later…
15:52
@Dennis Problem is, I need to be able to access it from different functions in different files
Different functions wouldn't be a problem. You'd have to make it a global anyway to prevent the issue feersum mentioned.
@Dennis Issue is, extern int cube[][][] throws an error
VLAs can only be used as locals.
Right, forgot about that.
In this type of situation I usually use a single heap alloc and a macro for indexing it.
15:57
Well, it's either malloc or recompilation. I'd personally go with malloc.
Is there a way to cast flatcube to an int[][], and vice versa?
@MDXF Is that even a real type?
@feersum Which one?
With dynamic dimensions? I don't think so.
int[][]
16:09
Hmm, this is gonna be a pain
Why?
I'll try to modify my array rotation code to work with flatcube
@feersum Because I rotate the array, also access it via cube[x][y][z] at least 100 times
Converting the array rotation program to work with flatcube, and changing all instances of cube[x][y][z] to cube_idx(x,y,z)
#define CUBE(I,J,K) flatcube[a*(b*I+J)+K] isn't hard
13 hours ago, by Dennis
Well, cube[i][j][k] is just flatcube[i*n*n + j*n + k].
Now I'm confused, which do I use
They're both the same thing.
16:11
What exactly is this rotation?
I don't see how the flat array makes any difference here?
The int rotated and memcpy? Wouldn't those be annoying to modify to work with a flat array?
No.
If you make the face the first dimension, then each face is still contiguous.
@Dennis Could you pull Lost?
16:20
@WheatWizard Syncing.
Wow that was fast. Thanks a bunch
Unless your program works like an actual Rubik's cube? Where rotating one face affects the edges of adjacent ones?
@feersum Yes that's exactly what it does, just not in the same function
Either way, a flat array wouldn't make it more difficult.
I don't think it's more difficult in theory, just difficult to actually do the modification of the code.
16:25
cube[i][j][k] and within-face memcpyare both trivial to convert. So what's the hard part?
Am I going to have any memory problems calling a swap function on &CUBE(a,b,c) and &CUBE(x,y,z)?
*sighs in relief*
Ok. How would I call rotate_array_clockwise(int n, int arr[][]); with flatcube?
You would have int* arr and passe in &CUBE(face,0,0), if I get what you're going for.
Ah, so I can just completely remove the int arr[][] and just directly access &CUBE(face,foo,bar) in the function.
16:35
That's not what I said, but you can do it however you want.
No, I know, but if I was going to change int arr[][] to int *arr, then I might as well just access it directly.
17:10
@Dennis Question: Why do the /srv/wrappers scripts use "$@" < .input.tio instead of <<<.input.tio?
That would pass the string .input.tio to STDIN, not the file's contents.
Oh, that's true
The string .input.tio should be enough input for anyone!
17:26
All right!! @Dennis can you pull Cubically?
Oh, and for Commentator, this should work with the new version.
17:42
@MDXF You're missing an import.
lang.c:31:25: warning: implicit declaration of function ‘atoi’; did you mean ‘atan’? [-Wimplicit-function-declaration]
             CUBESIZE = -atoi(argv[i]);
                         ^~~~
                         atan
Syncing anyway as it won't affect functionality. I'll take care of Commentator later.
Fixed.
Thanks!
 
1 hour later…
19:12
@MDXF That works indeed. Thanks! I'm syncing Commentator now. Also rebuilt Cubically, just in case.
Btw rather than a TIO macro, you could detect dynamically if STDERR is a TTY or not, and only print color codes if it is.
19:25
@Dennis That's a good idea, I'll check that.
Problem is, if I use POSIX stuff to determine if the output is a TTY, the interpreter won't work on Windows
19:38
No clue. I don't do Windows. I'm almost certain there's such a function for Windows as well though. You could pick the proper one at compile time.
20:15
That would probably work.
@Dennis Could you add Swap? A simple Hello World is "!dlroW ,olleH"oooooooooooox
@Dennis How would I go about writing my own SBCS? Do I actually have to write something that transforms Unicode into single-byte characters, or can I write something like in Charcoal's wiki, Lang-here uses a custom code page. This means that its commands can be considered to take one byte apiece, even though many of them are Unicode characters.?
(I can't recall if I've already asked this)
@MDXF you have
there has to be a file somewhere with your byte count that when fed to your interpreter works
Can the interpreter also just directly accept the Unicode?
@MDXF it can do both
@MDXF but not just the Unicode
20:19
Yeah that's what I expected
at least not for SBCS
@BusinessCat maybe it would be more on-topic at talk.tryitonline.
@MDXF if you know Python, this is how Dennis does both: github.com/DennisMitchell/jelly/blob/master/jelly
@Mr.Xcoder this is talk.tryitonline.net
Do I have to write a transformer, that converts Unicode to SBCS, even if it's unnecessary?
What >_> I though it was TNB, sorry everyone, I have no idea how I got here
20:20
@MDXF no, you just have to be able to read a file with your bytes and do what you want
the rest is extras
Ok cool
Jelly can do either binary based on the codepage or UTF-8
So if Unicode U+2080 does the same thing as My-SBCS 0x01, it counts as one byte?
@MDXF if you do SBCS and you cover 00-FF with your codepage, how do you read Unicode?
> there must be an actual file with the claimed byte count that, when fed to your interpreter, runs the intended program
Dennis has a flag that toggles reading as UTF-8 and reading as SBCS for Jelly
This whole thing is confusing. Say My-SBCS 0x01 is the same character as U+2080. Can my interpreter say if (char_read == 0x01 || char_read == '\u2080') { ... } ?
20:25
@MDXF no, because if you are reading SBCS, you by definition can't read unicode chars
How do I tell my interpreter to read SBCS?
@MDXF it reads binary bytes
and bases off of those
Ok this sorta makes more sense now
@MDXF flags
you have flags for what encoding it should read
@MDXF because of how Unicode works, if you use up all 256 bytes, you can't do unicode
So I could do if ((charset == UTF_8 && char_read == '\u2080') || (charset == SBCS && char_read == 0x01)) { ... } ?
Where charset is set via interpreter flag?
20:28
well... you'd have to read before that
do you know Python?
Ish
can you understand what this is doing? github.com/DennisMitchell/jelly/blob/master/jelly#L49
Dennis reads the file as binary numbers or unicode, depending on a flag
if the unicode flag is not set, he translates the binary numbers to unicode, and then feeds that to his interpreter instead
 
2 hours later…
22:11
@MDXF Way too complicated. Stick to one charset for the internal stuff, and perform translation first if the other one is being used. It's not just built-ins; you can't use one charset for commands and the other for literals, unless you want to make things really complicated.
@BusinessCat I'll take a look tonight.
22:56
Your Hello World was missing an o btw.
23:35
@Dennis Ah, my bad. Thanks for adding it
23:58
@Dennis Do you think it would be interesting to add Scipy to TIO's Python? I'm learning a bit of Python and I have missed Scipy a couple of times. Not sure how much space all the submodules would take, though

« first day (352 days earlier)      last day (2142 days later) »