« first day (529 days earlier)      last day (920 days later) » 

12:00 AM
Gotcha.
 
Both are equally efficient, since they notate the same thing in machine code
 
No I mean like the difference between this:
MLZ -1 B<address 1> <address 2> versus MLZ -1 A<address 1> <address 2>; MLZ -1 A<address 2> <address 3>
 
Oh, the first one is definitely more efficient, since it uses only one instruction
In general, with this computer, the fewer instructions you can use, the better
 
12:26 AM
So far I don't think we've even used the C mode, maybe for 2D arrays.
 
 
1 hour later…
1:38 AM
@El'endiaStarman Can you make it possible for us to permalink our code in your QFTASM interpreter, similar to how we can permalink our circuits in Varlife?
 
@KZhang Yeah, I can do that. It'll take a bit of time.
 
2:07 AM
@PhiNotPi @KZhang I can't believe I forgot to ask: what's the endianness of the computer?
 
@quartata TBH I'm not entirely certain because I think it depends on how you measure it. Most of the time, data is transmitted serially with the little end first.
 
I'm not sure why this asks for it.
Let me find out.
I'll just put little endian
 
It just converts to the human-readable assembly, right, and not machine code?
 
Yep. That's why I don't know why it cares.
 
@quartata I think big-endian is probably the correct thing to put, actually, since the SL (shift left) makes the number larger.
 
 
7 hours later…
8:52 AM
@PhiNotPi I'm expecting arrays might use the C mode
 
what is the syntax for arrays?
 
9:12 AM
@muddyfish
 
9:32 AM
@Cowsquack int x[3] = [1, 2, a] though that's subject to change and they're not actually implemented yet; I just got them to go through the grammar
 
 
5 hours later…
2:13 PM
@muddyfish Are there ways to hand-optimize some of the operators?
Like, to be able to specify what the resulting assembly will be? Can I just use the double-underscore commands to do that?
Does that support hand-optimized loops and jumps?
 
2:30 PM
@PhiNotPi You can do assembly stuff and double-underscore commands though it's limited in that it only allows literals and not addresses. Whilst loop support is theoretically possible, I'm doubting it would work at all because you'd have to know the exact jump location before it's compiled and labels and stuff aren't there
I might add stared expressions at the same time to allow for manual pointers and stuff though it's not high up on my list of things to do
I moved away from hand optimising because it led to me not understanding what I'd written after the fact
 
3:08 PM
unsafe operator not(int a) -> bool
    bool rtn = 1
    rtn = __MNZ__(a, 0)
    return rtn
@muddyfish what makes this operator unsafe?
Actually, I'm still confused on what makes any of those operators unsafe, because I don't see any assignments to the arguments in any of them.
 
@PhiNotPi Because if you have the input the same as the output, it doesn't work
is vaguely remembering why I made choices like that
 
operator bool(int a) -> bool
    bool rtn = 0
    rtn = __MNZ__(a, 1)
    return rtn
^ this one looks really similar but isn't marked unsafe
 
If you have a = not a, then if it weren't unsafe, it would always return 0
It might be that it should be marked as unsafe
Hey @ctaglia
We're working on writing a language that compiles to QFTASM, which in turn can be compiled down to Conway's Game of Life
 
Hi @muddyfish
 
Doesn't rtn act as a kind of scratch address? So after the end of the operator the rtn is copied into the true destination address? Or is that not how it works?
 
3:18 PM
When unsafe, it copies the arguments and return to scratch values but otherwise it doesn't bother
rtn is changed to the actual return variable when it's inlined if not unsafe
That behavior is the same for any arguments
 
Is rtn a special name then?
 
no
the variable attached to the return statement is special
 
unsafe operator (int a % int b) -> int
    int rtn = 0
    while (rtn <= a) do
        rtn += b
    rtn -= a
    return b-rtn
^ how does this work then? it's unsafe, so is nothing treated special?
 
a = a % 3 wouldn't work if unsafe
as it is, it creates permanent scratch variables and copies the passed variables into them whenever % is used
(I'm pretty sure that's how it all works and it makes sense in my head though I haven't tested this sort of thing in a while)
+ is safe because when it performs the assignment, neither of the inputs are used further
You should mark a operator as unsafe if it would break if either of the inputs/outputs were the same physical location
So yes, I think bool should be marked as unsafe
Note that for >= and <, the input and output can't be in the same physical location because they're of different types
 
3:37 PM
So, while rereading the actual challenge, I noticed that we only need the tetris grid. No score necessary.
That means that we should be able to just fit the 10 by 22 tetris grid into 22 RAM adresses, and so we do not need to create a bigger display for our project.
Although, if we do want to create a nice big display for the heck of it, I guess we would need to do a RAM port idea.
 
J F
Just noticed this:
A Bitmap Display has been created before. Anybody who gives this a attempt might want to use it. — copy Jun 18 '13 at 14:16
 
@muddyfish Will your language have global variables?
So that, if you call some subroutine, the global variables are not pushed onto the stack.
 
4:03 PM
Static storage?
 
Basically. Like right now if the main method calls something, all of the main method's local variables are pushed onto the stack. But let's say that we want to call rotatePiece() and we're okay with that subroutine just operating on the global variable of piece location - no need to push the local vars to the stack, pass the piece data as arguments, and then copy the data back over once it's returned.
 
4:16 PM
Will it be possible to return an array from a subroutine?
 
@PhiNotPi The syntax for that is all in place as well as the flag though it's not actually implemented yet
@PhiNotPi Hopefully as well as passing one in though I haven't put any work into deciding how that would work
 
If you have global variables then it shouldn't be too hard to add subroutines inside of other subroutines... when one subroutine calls another, any variables that are outside both of them are treated like globals and aren't pushed to the stack.
 
@PhiNotPi what do you mean by subroutines inside of other subroutines?
 
Closures
 
Ehh I actually don't think that qualifies as closures... for closures/objects I think we need more dynamic memory management.
 
 
1 hour later…
5:27 PM
@KZhang Now that reading from the PC returns the current PC value instead of PC+1, how are you doing the incrementing? The PC doesn't increment when I write to it, does it?
 
What's the address of the PC? It's in RAM, right?
 
RAM address 0
 
I guess I should know that for jumps right :P
ah all right
 
PC increments only when I want it to increment
Do you see the adder at the top of the RAM?
 
Okay I think I got it figured out.
@quartata Have you made progress on LLVM?
 
5:38 PM
Kinda. Trying to follow the SPARC backend (which seems to be the simplest) and recreate it
I do think I'll have to dedicate parts of RAM as registers though.
 
6:29 PM
@El'endiaStarman So far I haven't been able to fix the QFTASM interpreter myself.
Because certain functions, when I modify them in console, do not appear to get "updated" with the changes.
 
what's wrong with the QFTASM interpreter?
 
@PhiNotPi I don't really know how to update JS from the console/debugger either.
 
@Cowsquack It doesn't handle reading from the PC correctly.
 
@PhiNotPi I'm currently at work, but please, list the specific changes you need. I'll get them in by tonight, hopefully.
 
I can probably JS Fiddle it, I'll try that first.
 
6:34 PM
@PhiNotPi I can update JS from the console by hitting Cmd+S (must be something similar in other operating systems) after editing my changes
 
6:51 PM
@PhiNotPi I assume you are in the Sources tab - right click on the tab you are in (it should have a * next to the name) and click Save.
 
@StepHen Yeah, certain functions update properly and certain functions don't.
 
Hm, that's weird.
 
7:08 PM
@El'endiaStarman pull request created
I was able to use CodePen to fix it
 
Oh nice. Looking it over now.
 
7:26 PM
@wizzwizz4 hello
 
@PhiNotPi Hello. How far have you got?
I see that COGOL is coming along nicely.
I'm interested to know how the display would work.
As RAM is visible, you could just use a RAM buffer.
 
@wizzwizz4 We're not even really using Cogol anymore, but have moved on to a new language by Muddyfish.
 
@PhiNotPi QFT?
I wondered why you weren't just writing an LLVM compiler, but after research it turns out that that is hard.
 
@wizzwizz4 Quartata is doing that.
 
@El'endiaStarman Oh? I can't find a link on the GitHub organisation.
 
7:31 PM
@wizzwizz4 The computer itself is pretty much complete. There probably won't be a special display unit, the RAM is "solid state" and arranged in a grid already, it's very difficult to see the "pixels" but they are there.
@wizzwizz4 He hasn't uploaded anything yet.
 
@wizzwizz4 I don't think he's got it in a working state yet.
 
also I'm not in the organization anyways
 
@quartata invitation sent
 
@quartata Could you ping me when it's on GitHub?
 
sure
 
7:41 PM
CodePen with fixed interpreter, for use while the main one hasn't been updated: codepen.io/anon/pen/pryPBO?editors=0010 (it was a minor fix that only involved reading from the program counter)
@Poke hello!
There might actually be another bug... I'll have to work it out on paper to see.
 
@PhiNotPi I've made some comments on your PR.
 
@El'endiaStarman commented back
@PhiNotPi It's not another bug
 
8:05 PM
@muddyfish I added comments back for easier debugging
 
8:22 PM
@PhiNotPi Hi. Just popping in to see what all is happening in here
oh neat, el'endia is here
hi there
Would have been neat to work on this with you folks but at this point I'd need to spin up on everything and I don't have prior experience manipulating the gol to this extent
so i'll be satisfied watching from over here
 
. MLZ -1 -47 1; first argument
. MLZ -1 3 2; second argument
. MLZ 0 0 0;
. MLZ -1 A1 3;
. SRL A1 15 4;
. SUB 2 A4 4;
. MLZ -1 A0 0;
. ADD A0 A4 0;
. ANT -1 A3 3;
. SRL A3 A2 3;
. ANT -1 A3 3;
^ possible SRA code
@Poke yeah we're pretty far down the rabbit hole
 
@PhiNotPi Web interpreter has been updated.
 
8:37 PM
@El'endiaStarman cool thanks
. MLZ -1 -47 1; first argument
. MLZ -1 3 2; second argument
. MLZ 0 0 0;
. MLZ -1 A1 3; move arg to result
. XOR A3 -32768 4; flip sign and store in scratch
. MLZ A4 A0 0; if scratch is negative (arg was positive), do next line twice
. XOR A3 -1 3; invert result
. SRL A3 A2 3; perform shift
. MLZ A4 A0 0; if scratch is negative (arg was positive), do next line twice
. XOR A3 -1 3; invert result
The first option is 8 lines and takes 7 steps for positive numbers, 9 steps for negative numbers. The second is 7 lines and takes 9 steps for positive numbers, 7 steps for negative numbers.
 
9:24 PM
Both take advantage of PC-read-write behavior.
 
9:41 PM
. MLZ -1 47 1; first argument
. MLZ -1 3 2; second argument
. MLZ 0 0 0;
. MLZ -1 A1 3; move arg to result
. SRL A3 15 4; extract sign and store in scratch
. ADD A4 A0 0; if scratch is zero (arg was positive), do next line twice
. XOR A3 -1 3; invert result
. SRL A3 A2 3; perform shift
. ADD A4 A0 0; if scratch is zero (arg was positive), do next line twice
. XOR A3 -1 3; invert result
Basically the same as option 2, but I think more straightforward in understanding.
 
10:03 PM
. MLZ -1 47 1; argument
. MLZ 0 0 0;
. MLZ -1 A1 3; move arg to result
. MLZ A3 A0 0; if arg was negative, do next line twice
. SUB 0 A3 3; invert result
. SUB 0 A3 3; invert result
^ Safe absolute value operation, 4 lines, 4 steps if positive input and 5 steps if negative input
 

« first day (529 days earlier)      last day (920 days later) »