« first day (2034 days earlier)      last day (1746 days later) » 

4:47 AM
posted on May 26, 2016 by hostilefork

This commit contains the two userspace files from an abandoned attempt to write the Rebol-REPL-in-REPL. The REPL did work, but the main problem with such a choice had to do with its impacts on the debugger. This is because Rebol does not offer something like V8's "isolates" (where even though V8 is single threaded it can still maintain independence of multiple executing interpreters). W

 
 
7 hours later…
12:02 PM
@rgchris Ok, I may have the compromise to please all parties, which allows PRINT and FORM to be defined as I suggest above, but offers PRINT+ and FORM+... with PRINT+ aliased as PRIN for those so inclined to use it...
PRINT+ and FORM+ will use something that variadics offer as a semi-hidden feature, which is the ability to "sniff" a non-quoted argument's first value...and then choose to evaluate it or not. Based on this "sniff" they will distinguish a literal block, e.g. print+ [blah] from a word resulting from a non-block expression, e.g. print+ reverse [blah].
It will then follow the rule that literal blocks will be handled as a dialect, following the rules of PRINT as per R3-Alpha more or less (adjusted slightly), including a line feed. While any non-literal will be processed without a line-feed.
Hence, to get PRINT+ to throw in a line feed, you just take whatever your expression is and put it in a block... a rule that was bandied about before. If you don't see a block as the immediate argument to PRINT+ you know it's not going to be printing a line feed or doing it as a "dialect"...
This would make PRIN a drop-in replacement for all current PRINT that take blocks, and all PRINs that don't take blocks would continue to work as they currently do. So an easy search... if you had a PRIN before that took a block, change that to PRIN FORM. All PRINTs that don't take blocks, turn into PRIN that takes that same content in a block.
To print a literal block (not a function call result) literally with no newline, prin ([the block])...the parentheses are enough to convince it you didn't mean a dialect.
Or prin quote [the block] if you prefer. Hmmm...then maybe parentheses should be used as the way to slip a dialected block in! prin (reverse ["Hello" print]) thus being dialected and newline'd?
 
 
1 hour later…
1:33 PM
@cv007 I bumped a post by you to get you to 21 points, so once that propagates to the chat servers, you should be able to chat and put a word in edgewise. :-)
 
2:26 PM
@Edoc ^-- I think the above is a pretty good compromise. What would you think of x: 10 | prin ["Hello" x] being auto-spaced and giving back Hello x... while prin quote ["Hello" x] would output the block as [Hello x], as would b: ["Hello" x] | prin b? In other words, PRIN dialects (and includes a newline) only if you pass a block directly at the callsite that it can "see", not if it comes from a word or expression.
 
2:53 PM
@HostileFork why not print as it is now and prin without linefeed and without space
 
@sqlab PRINT as it is now has many problems as an orthogonal component. It is too risky for people to type print value and then it works fine for a while, when value is just strings, but then one day value comes along as a block and that runs code. It is very risky to use, and the things I'm proposing doing to PRIN above make it a bit "beastly" from the standpoint of behaviors in APPLY and such...but useful and safe if just writing it in source.
I also would argue that the "conveniences" of today's PRINT quickly decay into inconveniences in all but the most trivial cases.
Which leads to a lot of PRINT REJOINing, and I think I have better and more orthogonal ideas.
But this is why we invent compromises to get the best of all worlds. I just think the PRINT name and FORM name need to be the most solid, safe, and rigorous base.
 
If you use prin without spaces, you can print without rejoining, but keep print as it is now.
I seldom used prin, so changing that, does not harm me very much.
 
Well, one of the advantages of Rebol's design, assuming the modules are done properly, is that your legacy does not need to be an issue...because PRINT is not a "keyword". If you have code that now--or indefinitely--you wish to behave differently, you may define it differently.
And you may pass your print, bound how it is, into functions that define PRINT differently...and they can run the code and get your meaning when your print is referenced, and their meaning when their print is referenced.
If it weren't for this ability, do <r3-legacy> would have been doomed from the start.
 
Of course you can redefine all words at your own risk. But I think, it is a not so good idea to redefine the most used words.
 
@sqlab <shrug> goodluckwiththat. You're talking to the wrong guy. I guess you can ask Carl about Rebol 4. Or you can read up and learn about all the cool as hell stuff Ren-C does.
 
3:06 PM
replacing unset! by void! ?
 
@sqlab No, UNSET! just went away. Once it went away, it seems a lot better to make UNSET? the kind of thing you ask about a variable than anything else. For now UNSET? has no meaning though. You say NOT SET? 'X to test for if x is not set. Or you can say VOID? :X
In the future, some day, when you ask if a WORD! or PATH! contains no value at all then unset? 'x can be a shorthand for that.
 
3:20 PM
@sqlab Some reading: 252, 253, 254
 
4:09 PM
@sqlab I will point out that Ren-C has been striving for at bare minimum compatibility with R3-Alpha with do <r3-legacy> up until this point. Were people to use it and find bugs, I would deal with them. And in fact, I'd even work on an "unset in blocks" compatibility feature, where if people were using it and had stayed engaged and had a good reason for it. Because it's bend-over-backward compatible everywhere else.
 
4:20 PM
In any case, it would have been quite possible for one to be a customer of the fixes and features in the system that one liked while ignoring everything else. That window of opportunity is closing with Ren-C, because it's going to get "frozen" shortly in terms of its R3.EXE "hosting" and move on to its mission to be a library. And Ren Garden will be "the console" from my perspective, so it will be in Atronix's court to take care of the use of the library from within the r3.exe host.
 
4:58 PM
yesterday, by MarkI
Also, if we do end up being able to work together, well, then anything, say like a good Rebol, MUST be possible!
@MarkI ^-- Well, we have worked together, and pursuant to the above comment about <r3-legacy> I really have been trying to make sure that all needs are met. I go out of my way for users I don't have :-) But this is why I ask for real cases. It is true that the first time I thought of not allowing UNSET! in blocks is when you brought it up, before it showed up in the tests with set [a b] reduce [10 ()], so it was advance warning...
And I was pushing for the idea of maybe doing self/x style analogues for "member functions" vs trying to find a way to link up bare words in functions to living in inherited objects, and you said "no, that's not what Rebol's about", and so that kind of thing comes back to mind when a door opens like specific binding...to adapt the mechanism used to solve closure's binding identity problems on recursion to solve the binding identity problems on derivation by "imaging" blocks with new bindings.
Some days I wonder if this isn't the world's easiest programming language, dot com after all. :-/
 
 
3 hours later…
7:59 PM
I'm curious. Why do people think Rebol is even easy at all? Is it because there are some edge cases where it looks like you can do somethings very easily?
 
@GrahamChiu Notation and attempt to avoid "symbol soup" giving it a gloss of comprehensibility, though I personally am surprised people so freely use gibberish like REJOIN and MOLD. I was thinking of titling my post on the new design for PRINT/FORM/PRINT+/FORM+ "A portrait of REFORM" :-)
 
Well, sentences without punctuation make for hard reading
 
I hope people are warming up to |, and it seems so. It's great.
And being a dialectable type is part of what makes it great.
 
I've heard JS is the world's most popular language, and it has a fair bit of symbol soup
 
C++ wound up wandering deep, deep into symbol soup. Haskell, by comparison for the same patterns as C++, is downright fluent. But still, intimidating.
 
8:07 PM
we need a | for non bracketed code
just as some sugar
 
@GrahamChiu I told you to read this Haskell in pictures thing. You really shouldn't be afraid of it. I have come to sympathize with those who wonder how it is that people can be so afraid of a few basic pieces of maybe-not-the-best terminology, and yet seem able to absorb an infinite amount of artificial complexity in its place...
@GrahamChiu You don't need brackets to use |.
 
@HostileFork but I didn't sign up to learn math
 
I told you to model it like |: does [], except, that it won't pass as an argument to a function that takes optional parameters... you can't quote | which you could do if it was just |: does []
It's a specific type with evaluator behavior to stop you from doing quote | (among other reasons), but that also means it's efficient to process.
 
Got some concrete examples
 
@GrahamChiu Is that a question? It's useful any time you want the semantics of (a b c) (d e f) (g h i) but think a b c | d e f | g h i is more readable and also "cheap". Breaking arrays into subarrays has cost, while the BAR!s are light
And I've mentioned that I think, with the right syntax highlighting, it becomes even nicer. [ a b c | d e f | g h i ].
@GrahamChiu You don't have to program in Haskell every day, but compared to mucking with a closed source Forth, I'd argue that for Value of Time Spent you'd get more out of working some of the 99 problems or just pretending to work them and then cheating and looking at the solutions.
I personally just consider it inspiration to keep bringing the quality of the level of thinking to a different space.
 
8:57 PM
@DarekNędza Still doing any...Reboly things? Feedback on New Stuff would be useful, even if just LIKE or DISLIKE I guess.
 
9:21 PM
@HostileFork is there some kind of change log?
 
@DarekNędza There's a commit log... though I have taken a while off and am rebasing out some old things. I guess if you want to talk about "things on the floor right now" then it depends on your area of interest, but above I mention:
6 hours ago, by HostileFork
@sqlab Some reading: 252, 253, 254
@DarekNędza I dunno if you've read the UTF-8 everywhere Manifesto but I'm starting to buy it, e.g. string processing should be basically done on UTF8 instead of trying to turn things into some uniform codepoint width to manipulate it and back.
 
@HostileFork Ok, that would be "to read" for tomorrow.
 
@DarekNędza There was a pretty good reception to the Rebol vs. Lisp Macros article, and I haven't published the followup yet
Honestly, I didn't write it expecting Lisp people to read it.
 
@HostileFork there is "lisp" in the tittle, so..
 
@DarekNędza Yes, but I didn't expect them to read it.
So now in the follow up I sort of feel pressured to not just write what I was originally going to write, but to answer the comments.
 
9:30 PM
@HostileFork but how would you deal with string like "abc<some chinese character>e"? Does "<some chinese character" is 1 character (string of length 1)?
 
@DarekNędza Are you asking me how it works to use a UTF-8 character encoding as an internal representation in general?
It makes your string-skipping and other operations more complex, you don't assume your "loaded" characters are a fixed size.
It makes some things less efficient, but, I think that I agree with the argument that the perceived inefficiency is less consequential than the cost of conversion in general. I don't have any arguments better than the authors of the manifesto, just a bit of corroborating evidence that "it kind of sucks to not just leave the strings UTF-8 and have them that way most of the time, because you only really need to convert them to send them to Windows, and screw Windows"
 
@HostileFork I don't like this. Python or Julia has (or had) something like this. It was harder to manipulate string that way.
 
@DarekNędza Hm? I thought Python had variadic width expansions, and Red was thinking of following suit
e.g. if your string only uses chars that fit in 8 bits per character, you get a byte string, but the first non-8-bit character you insert updates the size, but who knows when it collapses later (if it does)... and oh, maybe it will expand to 4 bytes per character
If you as a programmer just talk about codepoints, you shouldn't care about the internal representation, and I think especially with modern locality concerns you really shouldn't fret too much about the variadic measurements. I won't rewrite the manifesto, but, I will say, there's tons of cool stuff that would happen if the internal representation were UTF8
 
Right, it was Julia. I will show example soon.
 
In particular, I want to make PARSE the interface to TRANSCODE, so parse "x: 10" [set-word! integer!] => true, and the short path to that is if the source loader and parse can operate on the same format of data, e.g. UTF8
From a user level you would notice no difference, other than, a lot of things that didn't work before would :-) But that predicates all the dots and lines being done right internally.
 
9:39 PM
```
julia> s = "\u2200 x \u2203 y"
"∀ x ∃ y"
s[1] // ok
s[2] // error
```
 
@DarekNędza You will have to translate that to me. How's Julia doing these days BTW?
@DarekNędza e.g. I don't see what the error is. If Julia is 1-based (don't know it, beyond that it exists)... then what would be wrong with getting [2]? Wouldn't it be a space?
 
@HostileFork ok, wait a minute
here is full example, I will explain it soon:
julia> s = "\u2200 x \u2203 y"
"∀ x ∃ y"
julia> s[1]
'∀'

julia> s[2]
ERROR: UnicodeError: invalid character index
in next at ./unicode/utf8.jl:65
in getindex at strings/basic.jl:37

julia> s[3]
ERROR: UnicodeError: invalid character index
in next at ./unicode/utf8.jl:65
in getindex at strings/basic.jl:37

julia> s[4]
' '
 
Well, I don't know, but the concept would be that if you indexed into a string it would be no different than today.
e.g. the internal choice to expand UTF-8 is "theoretically" irrelevant from series positions and codepoints returned.
The user just sees a string as a series of codepoints, and traverses it as today.
It means you can't do simple math to skip N characters, because the skip depends on the bytes. So instead of a simple addition, you wind up needing to "sort of decode" to skip that distance.
But, the fact that skipping is easy-ish is an asset of UTF-8. And @DarekNędza, I submit this, which while you might not be a C++ programmer I thought it interesting: blog.hostilefork.com/locality-locality-locality
 
@HostileFork oh, so it's like Julia's
 
@DarekNędza Well, I don't understand Julia's problem above. Because it seems to have a problem with what I wouldn't imagine a problem being necessary for.
Rebol doesn't have that problem today if you use escaping (but it's limited to 16-bit codepoints)... but the proposed change to UTF-8 internals wouldn't change the user-experience.
I just think that a better investment than trying to manage a 1-byte to 2-byte expansion (which may or may not collapse later) that may become a 4-byte expansion is just to say screw that, and use UTF-8 internally.
Essentially, the mixture of formats internally for how a string can be causes more harm than good, and if you UTF-8 everywhere then it's a bit more complex, but the precise design factors of UTF-8 were to make navigating and skimming easier, so that makes it nice.
 
9:57 PM
@HostileFork "the problem" is when given string s like "∀ x ∃ y" when user want 3rd character he/she want "x" not some number.
 
>> third "∀ x ∃ y"
 
; Brought to you by: try.rebol.nl
== #"x"
 
@DarekNędza I'm not proposing changing that...
 
@HostileFork oh, then I misunderstood.
 
@DarekNędza I meant that often, systems consider "encodings" to be inefficient, and compacted... and to make those encodings easier to work with, they try to canonize them so that each codepoint is the same size. So you can add and subtract by the width of the character(s) to move around. But it may be--over the long run--that to get that "efficiency" you aren't gaining so much, and spend more time encoding and decoding than anything.
So in your case "\u2200 x \u2203 y" , that's "7 codepoints". But it's "9 bytes".
So the question would be, although you can represent spaces and x and y in a single byte...should you do an intermediate decoding so that everything is at the "lowest common denominator" for convenience
e.g. "∀" won't fit in a byte, so nothing in that string should... so you can have every character the same size and do convenient character math with the confidence you don't have variable size characters.
UTF-8 everywhere challenges the question of "just how valuable is it to do this decoding, vs. internally doing all your work on strings with variable bytes per character". I am leaning to agreeing.
(for the kind of space of problems that Rebol/Red-like things attack)
 
10:08 PM
Well, I guess we had to test it... like in your link with C++ example
 
@DarekNędza Well, the Rebols and the Forths of the world want to fight abstraction and stay close to the metal, but the metal is plastic these days :-)
 
@HostileFork World is changing so much those days.
 
@DarekNędza So an interesting point from Mr. RMS about why he decided to become a freak of nature slash prophet, was because he had been around when computer culture existed before corporations. Then corporations came in and people's attitudes changed, about sharing and excitement and such, and it became secrets and business. He didn't like that change.
He thought it might be the case, that people who had never thought you should just share software and solutions but everything was business and copyright, that people would perhaps not even know what a world of sharing and problem solving was like...and the window of what he saw was closing, unless he spoke up.
I'd say that, as the aging programmers are aging and maybe losing so much interest in programming, it may mean that there are people growing up who don't know what it's like to have functioning systems that work in a small footprint with few dependencies.
If everything you see is tacitly accepted as a 1GB download for the most minor of software updates, it's not just about the inefficiency...it's about the illegibility. Who knows what that carries.
@DarekNędza I have a lot of gripes of Carl's coding practices, but I endorse his grumpy old man blogs 100%: rebol.com/article/0497.html
We have to ask: when did we lose our senses, or our desire to sense?
 
Well, lot's of "things" are big, so 1gb is not something big.
 
@DarekNędza Well, you probably don't flinch at being given a 30 page contract to sign with a cell carrier, in which that contract outlines 30 pages of what they don't guarantee you.
 
10:20 PM
@HostileFork hell no! I hate every "legal" texts (like licenses) that is bigger than, let say, 1 page.
 
Courts are obligated to the businesses, so you can't actually win that kind of thing.
 
@HostileFork nice
 
When I am king, this will all be different.
(got a surface book, it has a pen)
 
@HostileFork where is the fork?
 
@DarekNędza The Fork is everywhere. Even in the Rhino.
@DarekNędza It's a game. You have 10 minutes to draw in MS paint (basically) something... you get a phrase to draw, then you draw it, then someone describes it, then someone else draws it, etc. etc.
 
10:27 PM
@HostileFork that's... I don't know.
 
@DarekNędza Well, you don't have to play if you don't want to. I don't like having to draw in MS paint.
But, it's a thought experiment, kind of like programming in Rebol.
 
@HostileFork Thought experiment - well that's little interesting.
 
@DarekNędza Well, I guess the thing is, if you aren't "afraid" (I use the word loosely) of a stream of downloads and patches, knowing you can't read them, or gigabytes of "update", then it may be an example of what Richard Stallman was talking about...how we culturally adapt to things. Some "updates" take away features, due to copyright enforcement etc, they're not "improvements" from your POV.
 
@HostileFork I heard about GTA from Steam - it deleted some music.
 
@DarekNędza You don't have to get tinfoil hat about it (though you're not necessarily wrong if you do, as the Snowden/etc. leaks show...why were they stockpiling Solaris vulnerabilities and not telling anyone? Who in Al Qaeda runs Solaris?) You can just basically say "oh, I see, I am interacting with you and you are transacting me in a way that is not for my benefit. why are we friends again?"
Open source is one angle, but what good is open source if it's a pile of updates you can't read and never will?
> There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult. -C.A.R. Hoare
 
10:37 PM
@HostileFork It can be a few kB that may destroy your pc. That few kB you may not understand.
@HostileFork Ok, but can you put every game/program into, let's say 100 MB?
 
@DarekNędza I have gotten a couple of pull requests to my whitespace collection, weird ones even. Anyway, whitespace is a language that only reads spaces and tabs and newlines, the rest of the input is comment. See also Polyglot, and why I want to secure against it.
@DarekNędza "I have a map of the United States... Actual size. It says, 'Scale: 1 mile = 1 mile.' I spent last summer folding it. I hardly ever unroll it. People ask me where I live, and I say, 'E6." --Steven Wright
@DarekNędza I actually want to crush out all accidental information from programs entirely, I am displeased with ASCII, so I have another codec that Ren-C shall support: USCII. ASCII is unreliable and arbitrary...
 
@HostileFork I've watched youtube movie about security - it's constant war, people will find a way to destroy something.
Well, time for sleep. Good night and thank you for talk.
 
@DarekNędza Well if you are writing Rebol, please come and ramble about it here, people would rather read you talk than me saying what's on my mind that minute. You'd have instant fans.
 
@HostileFork Sure.
 
 
1 hour later…
11:46 PM
@HostileFork I have been reading all the void unset stuff and it is very interesting.
As far as I can see it makes good sense. The rejoin and compose examples you have are compelling common use cases
 
@johnk Well, we know the limits, as @MarkI has said... and you make those limits worse the more you allow functions to treat "absence of parameter" as a value, even if it isn't.
So, as it seems to be an issue if I do not explicitly give kudos to @MarkI, as it is when people do not for me, we have to be sensitive to if you cross those purposes and say a function can only have certain effects by assigning meanings to void".
e.g., such a change must be accompanied by at minimum, a set of guidelines, and these guidelines may suggest conclusions e.g. that FUNCTION offer definitional LEAVE.
 
(let me go back and read @MarkI's comments ...)
 
@johnk I know you may not have a ton of time, but if we can keep at least a bit of things running that means a lot to me... and I do try to post rebol-issues when it's fitting to honor your work. It would be easier if at least, you gave me tagging rights to say "Ren-C/dismissed" or "Ren-C/open". The thing is, that I wanted to not fragment efforts, and instead of being thanked for it people still treat me on occasion like this divisive figure... maybe it's the icon :-P
 

« first day (2034 days earlier)      last day (1746 days later) »