Possible Unclear while implement

Go down

Possible Unclear while implement Empty Possible Unclear while implement

Post  zerohasthehope on Fri Nov 25, 2011 11:18 pm

I'm new to this language.
There seems some unclear point for me:
I will give choices to user, but what's the default value? I mean what is your default implementation while making your interpreters?
1. How about alpha channel? For example: 0x7f00ff00 in ARGB, should we consider it as 0xff00ff00 or 0xff000000 or 0xffffffff
2. How to handle colors not in the color table? as black or white?
3. Stack Element: any limitation of size? What is each number in stack? (signed int 32? Or big integer of possibly unlimited length?)
4. Stack Character: When the data is out of Unicode range, when displaying as character, converting to Unicode, just wrap by doing mod operation? Or just treat as "not-correct operation" and ignore?
5. Handling white blocks. What is your default way? (Make turnings in white or not? Do you all follow the "Clarification of white block behaviour" from "dangermouse"?)
6. Any OP that will increase stack. For example push. If the stack is full, what will happen? (Ignore op or fatal error?) or Just infinite stack size until main system's limit?
7. Roll: stack: (top)1 2 3 4 5(base), so time_of_roll=1,depth=2, right? What is the expected result?
8. In: how to handle in char? Just read in 1 char, and leave anything remaining unaffected? How about CRLF? npiet seems to replace all CR with LF, and do you all do it in that way?
How to handle in integer? How to know the end of input? npiet seems handle like this: read until CRLF, and read CRLF, and discard the just got CRLF. Do you all do it in that way? How about non-integer character got? Any range limitation? If has limitation, what will happen if the input is out of range?
9. Out: directly output? Or any processing? npiet seems to totally ignore CR and output LF. Do you all do it in that way?
I'm planning to write a program, using piet, so: user uploads an image, some text (like happy birthday), and my program change only a minor pixels in that image, so when the output image is executed by the interpreter with all default settings, the interpreter will output the text from the author. With this planning, I met the above unclear points. Please help me.


Posts : 1
Join date : 2011-11-25

View user profile

Back to top Go down

Possible Unclear while implement Empty Re: Possible Unclear while implement

Post  DIN99 on Sun Apr 19, 2015 7:16 am

1. I would ignore alpha for one simple reason: Color metrics wise it changes the actual lightness, hue and saturation of the color dependent on the background, and it could lead to visual confusion of colors. You can make the interpreter accept RGBA images, but ignore A for processing.
2. See the “program execution”, “black blocks and edges” and “white blocks” sections on the Dangermouse website.
3a. Ideally the stack size is unlimited. An (theoretically) unlimited stack length makes Piet Turing-complete. Dangermouse: “If a finite stack overflows, it should be treated as a runtime error, and handling this will be implementation dependent.”
3b. According to dangermouse data values exist only as integers. I guess the byte length of the integer is up to the implementation. The PietDev implementation seems to allow for float values as computation result, though.
4. Both sound like reasonable ideas
5. I would follow the clarification
6. Stack overflow should be treated as runtime error, see 3a.
7. [ROL 12345] should result in [435]. See my very detailed explanation of the roll operation here: http://piet.forumotion.com/t7-roll-implementation#56
8. no answer yet
9. no answer yet

Posts : 4
Join date : 2015-04-17
Location : Germany

View user profile

Back to top Go down

Back to top

Permissions in this forum:
You cannot reply to topics in this forum