If you want it to be usable then it would be handy to have subroutines. And if rather than being macros they execute "instantaneously" (i.e. one tick at the calling level corresponds to however long it takes to propagate through the subroutine) they could be quite powerful.
@Calvin'sHobbies Yeah, there might be enough ASCII characters to do that, but it would be painful to understand.
This reminds me of a circuit-building kid I had in elementary school: there were various circuit elements (wires, lights, batteries, switches, resistors, etc.) that could snap to a grid.
@PeterTaylor I like that idea, but how to represent it? There could be multiple grids in a file separated by empty lines, the top one being the main program and the others subroutines. I guess we'd need special tiles to denote input and output in subroutines?
Huh. I suppose I shouldn't be surprised people commenting on a primarily computer science forum played with electronics as youngsters. @Calvin'sHobbies is it feasible to reserve two or three values (F,f,etc) as functions that could be defined as separate blocks?
@PhiNotPi For the rotation thing we could use ^v<> to specify input and output (ans maybe space for neither). Then the behavior of each tile would be dependent on how the arrows are arranged around it.
e.g.
v
>+>
v
would move things down and right, but
^
<+<
^
would move them up and left (though then everything is 3x3...)
How about allowing the two-input/two-output "normal" tiles to operate in the opposite direction simultaneously? For example, the AND gate would have B=R=T&L but also T=L=B&R?
@BrainSteel Yes, though I think if there were functions, they would be automatically numbered so there could be arbitrarily many. e.g. "the F tile calls the function number L if R is non-zero and the output goes to both V" (just an impromptu example)
Ok, though your idea is curious. The issue I see with the arrows is that any possible number of inputs/outputs would need to be handled. It might not be that bad, just something to consider.
@cirpis Actually, if we do use the arrows, I'd prefer that there are no preset directions. This seems to make things more symmetrical.
@Calvin'sHobbies much like apl has the same character represent different functions depending on wheter the function is called as a monadic and diadic. This way we could have "-" with only one input represent negation, while "-" with two would be standard substraction
I dont think the arrows should be obligatory though
Just to emphasize, I'm not bent on keeping the tiles "doudyadic" (two outputs, two functions). I'm fine with having multiple inputs/outputs going in any directions.
What if you define an arrow ^v>< to be a block that, upon receiving input from any direction, sends it in the arrow pointed to by the arrow? That would allow constructions like >v to move data right once, and then downward.
I think I mentioned in the Nineteenth Byte, but if you really wanted to this could be our second ever language design competition, preferably with a few restrictions :P
@PhiNotPi I'd prefer to keep the syntax well structured One option I thought would be cool is to make it kinda like piet. Each tile would be an intuitive 8x8 pixel image that could be rotated in 4 ways. (These could map to ASCII chars for a cryptic text version if necessary.)
Bitwise operations, like AND, OR, NOT, NOR, NAND, XOR, and XNOR, although a few might not need a unique tile and could be created just as combinations of the others.
Ok, sure. I think we should consider all of them as functions with 4 potential inputs that are unordered, and 4 potential outputs that have some sort of symmetry.
@Sp3000 Haha, nothing serious, but most languages I'm familiar with require the if be a 1 to do the first thing, else do the second thing. You had an if (thing == 0) {} else{} thing going on.
Like: Q outputs 0 to all of its outputs, and ends the program if any input is ever non-zero. (The exact number of inputs/outputs depends on the arrows.)
Heh. "This reminds me of a circuit-building kid I had in elementary school" ... "I'm pretty sure I know what you're talking about and I have one in my basement right now."
My suggestion in the 19th byte was that you do this actually much more simply than the pattern matching challenge. Just require the language to be Turing complete (can be shown by implementing something simple like Rule 110) and support at least integer types... and maybe some specification which constrains languages to this type of 2D logic based thing... and that's pretty much it.
You keep it narrow by saying that the language must be grid based where each cell represents a "function" (in some sense), which takes and passes data from and to its 4 orthogonal neighbours in some participant-defined way. It must also support input and output. Languages may support any data types but must at least support 32 bit integers.
@PhiNotPi hm yeah, Marbelous is indeed fairly similar
Perhaps a definition like.... A program consists of a grid of tiles. Each tile has a constant type (identical types = identical function) and a variable state (a number). Each tick of time, the state of each tile is simultaneously updated, aka assigned a new state, with the new state being a function of the tile's type and the previous states of the four adjacent tiles.
I think it might be possible, however, to re-implement Marbelous so that it is very similar to this definition of tiles.
If you make a language design challenge, isn't anyone who writes up an existing language automatically disqualified? Sure, you might get things like Marbelous, but is that a massive issue?
@Calvin'sHobbies Yes, reusing newlines makes it almost free to define subroutines. For the subroutine I/O, I was thinking that a subroutine may only have one tile touching each edge, and then we can infer the I/O without special tiles.
@PeterTaylor That sounds really elegant. Quite expensive for golfing purposes though (but then again, requiring rectangular code is usually a bit wasteful anyway).
If golfing is the goal then the values that are passed around should be variable-length arrays of big integers, and we probably need some input from APL/J/K programmers on what the operators should be.
Obvious inputs and outputs are obvious, and then tiles which have either all their inputs or all their outputs accounted for allow propagation of information, but if you have loops...