New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build binary compatible hello.red in R2 and R3 for Elf #421

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
1 participant
@hostilefork

hostilefork commented Mar 4, 2013

This is incomplete work but my original goal was not to get all the regression tests running, but just get a byte-for-byte compatible hello.red executable. Now, as per Kaj's suggestion it's not necessary to hold it up when there are people who are in a good (and likely better) position to help. It should not be actually pulled into master until the test regressions are fixed. But pushing it seemed like the right thing to do at this point.

One important thing is that there is an esoteric bug in R3 which I isolated, and which BrianH is working on a "real fix" for. I just poked in a workaround temporarily. Here is the modification I made to c-word.c around line 238... I just wrapped the while loop in an IF:

if (LEN_BYTES(VAL_SYM_NAME(words+h)) == len) {
    while ((n = Compare_UTF8(VAL_SYM_NAME(words+h), str, len)) >= 0) {
    ...
}

You'll need that or the real fix for Compare_UTF8, for binary compatibility of the R2/R3 build of hello.red.

Performance-wise it suffers because I did not try to tackle a map! rewrite, since defining hash! as block! was easier. That's something that wouldn't be too hard to do, but more prudent to get the test suite passing again.

I threw most of my miscellaneous routines for R2/R3 support into the r2-forward.r file just because it was included already and I didn't want to add new files if I could avoid it. But what we actually want is going to be a mixture of R2/Forward enhancements and the creation of R3/Backward.

These StackOverflow questions pertain to the documentation of issues of R2/R3 compatibility, sorted in rough order of importance:

http://stackoverflow.com/questions/15077974/how-to-use-unicode-codepoints-above-uffff-in-rebol-3-strings-like-in-rebol-2

http://stackoverflow.com/questions/14203426/can-parse-on-binary-in-rebol-2-capture-a-binary-instead-of-a-string-like-in

http://stackoverflow.com/questions/14525958/into-behavior-difference-in-rebol-2-parsing-vs-rebol-3

http://stackoverflow.com/questions/14532596/why-doesnt-rebol-3-honor-quoted-function-parameters-that-are-parenthesized

http://stackoverflow.com/questions/14405471/how-can-i-work-with-a-single-byte-and-binary-byte-arrays-in-rebol-3

http://stackoverflow.com/questions/14368508/weird-behavior-with-select-and-the-and-operators-returns-junk-or-none

http://stackoverflow.com/questions/14352264/difference-between-rebol-2-and-rebol-3-when-mixing-some-in-parse-with-change

http://stackoverflow.com/questions/14352039/expand-the-full-path-of-a-file-in-rebol-without-get-modes

http://stackoverflow.com/questions/14330738/what-does-positional-pick-on-an-object-do-in-rebol-2-and-whats-the-equivalent

http://stackoverflow.com/questions/14319411/how-to-convert-a-binary-to-a-char-in-rebol-2

http://stackoverflow.com/questions/14208269/common-way-of-testing-for-membership-in-a-map-working-in-both-rebol-2-and-3

If possible I'd like to have discussions/feedback about those questions and techniques on StackOverflow, at least as much of the discussion as we can.

Viva la Redolution...! :-)

@hostilefork

This comment has been minimized.

hostilefork commented Sep 7, 2013

I'm going to close this pull request and assume no one is doing derivative work on it. Hence if this is important, then rebasing the changes against a current master would be the best strategy.

In my opinion this was important. It gave me a fairly broad view of Red and how it works, the thinking behind it, and assisted in forming my opinions of the direction of the Rebol and Red projects.

It also formed the basis of what an "R3/Backward" would need to look like, found a couple of mean bugs in Rebol, and was my first "real" Rebol programming project.

However, we basically cannot move forward on this without getting the indexing compromise finished. With that and R3/Backward, Red should "just work" on Rebol3 with only minor changes at most.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment