« first day (3306 days earlier)      last day (474 days later) » 

12:48 AM
-2
Q: Does red sometimes hang on macOS?

aMikeI might be going crazy here. The recent red releases can sometimes stall for several seconds before a console prompt. This is on macOS 10.12.6. It seems to happen after a command has given an error. Something simple as ? xyz or more involved like checksum %qwe 'asd (yes, where all those words an...

 
 
7 hours later…
8:17 AM
0
Q: Analyzing a connection trace

Jesus P. Magallon NavarroI have two PCs connected in a network on a WoW Legion server. From the other I try to connect but it gives me an error. I installed the Microsoft Network Monitor 3.4 program to monitor the network but I don't understand where the problem is. I show you the report to see if someone managed to see...

 
 
7 hours later…
2:56 PM
@HostileFork, try Object.defineProperty((function() {return this})(), "x", {get() {console.log("boo!")}}); x; x;. As for Wasm: even there the stack use of a single function depends on architecture, implementation, and optimisations. And if you compile some other language to it, then on all the compiler's internals, too. — Andreas Rossberg 24 hours ago
^-- That is bad news. I was going to say--for instance--that while C has a problem of being abstract w.r.t. architecture, if you were able to make a C compiler that knew it went to Wasm it could build a cost model for functions in terms of stack use, and then have some way of forcing a stack overflow before running the function if it knew it could not do it.
He seems to be saying even if your program is all Wasm there's nothing you can ask about to get that information reliably. So even if you had some kind of "recursion probe" lets say (a dummy operation to consume stack equal to the operation you're about to run) you can't know the engine would cost it the same, so your probe might succeed and then the operation still fail.
The moral of the story is: Don't write your car engine or braking control systems in Wasm (at least until they harden the spec...a lot)
I think I need to draw a line here...between my engineering interests and the goals of the project...and say we move to a CPython-like user-configurable depth limit that is just a dumb old integer. If your recursions are more deep than that integer, the system generates a "safe"/"catchable" stack overflow error (but not a stack overflow error, a "recursion limit reached" error, because you can't catch stack overflows--we need to educate people about that)
You can set that limit to infinity and that means your program will maximize its use of stack--never artificially constraining you. but it will crash if it ever exhausts the space. And we can give you tools to help you get a rough idea of about how deep you can usually recurse, though it will vary widely based on what code is running (especially when running non-Rebol stacks, like calling into ODBC or whatever).
 
4:10 PM
But first...I'll look at the Stackless Python implementation that predates PyPy and see if they know anything I don't.
 
From the WASM paper: "A call instruction may also trap due to stack overflow, but this is not semantically observable from within WebAssembly itself because it aborts." Argh.
So the best you can do is have two identical running instances, one lagging behind the other by one CALL instruction. Then when the leader dies, don't issue the CALL on the trailer.
It's not as bad as it sounds, leader and trailer can swap each time so it's not a 100% performance penalty.
 
"The C stack limits recursion depth. The C stack has a fixed size, and therefore the stack cannot grow infinitely. The frame stack is not limited. I think it is good to keep recursion depth limited, but not as a matter of an implementation detail. This should be a user option. The C stack should be reserved for C modules that really need it." (from Stackless Python)
"PERL has already no longer a C stack. They will have some good reasons for this. Python has no reason to be limited and stay behind." Now this applies to us too...we kind of don't want to be lagging on it and looking technically inferior. Add in the stack overflow error problems and it sounds like we have to do it. Ren-C frame stack may make this not too hard.
@MarkI Interesting idea, though I doubt there'd even be a guarantee of this working. Nothing in the browser says it has to give all workers equal resources.
@AndreasRossberg That is unfortunate to hear, e.g. that Wasm isn't aiming for any kind of "quality of service" contracts/guarantees? That's a weakness compared to even small embedded boards; this would be needed for Real-Time OS applications--and I'm always wary of slippery slopes ("if I can't trust this for a car braking system, why should I trust it for [X,Y,Z]"). Alas. And looks like there's a lot of confusion surrounding stack overflow handling in general... — HostileFork 51 mins ago
 
4:34 PM
So they're not really saying anything I don't know in the stackless tech document, it's just a matter of me accepting that doing this is worthwhile. One aspect is it means the REBFRM structs representing interpreter state need to be in pooled memory instead of on the C stack. All the work to allow this is done, that's why it's in a struct.
The harder aspect is to avoid recursive calls into the interpreter, by having the return result be "run a continuation". We already have return signals besides "throw" and "final result", so a lot of that is done. And CHAIN essentially does a continuation that does not consume more C stack. So that's done too.
But CHAIN does not leave a persistent entity on the stack, each sub-function disappears after it runs. What we want is something that leaves something so it appears still on the Rebol stack (e.g. a Rebol recursion) with no corresponding C recursion. So this is a new "weird result".
It isn't an all-or-nothing, I guess you just decide if you feel like doing things with continuations or not. If plain old invocation doesn't add C stack levels, e.g. foo (bar (baz)) is one level instead of 3 when you're inside baz, and IF doesn't add C stack levels, maybe it's not so bad if switch/case/any do add levels. It can be an ongoing process to update functions to continuation style.
But the cool fast pseudo-threading-generator tricks won't be able to work on anything you haven't converted to this style, e.g. the g: generator [x] [yield x + 1 loop 3 [yield x + 2]]
All right. I think this is the right way to approach our stack woes ("everybody else is doing it"). And @giuliolunati wanted continuations anyway. :-) I will muck around and see what I can do.
2
 
 
3 hours later…
7:56 PM
@HostileFork But WASM does explicitly know how much resources it has. It doesn't know how much are used by the stack (sadly) but it knows how much is available for it in total (because it has to ask for it by size initially) and that's all we have to have both workers duplicate.
 
 
2 hours later…
 
1 hour later…
11:20 PM
posted on November 19, 2019 by noreply

The original commentary was posted in Red's Gitter channel, here, by Gregg Irwin, one of our core team members, in response to various requests for the ability to create new datatypes in Red. As a writer, Red has always appealed to me because of its flexibility; but, of course, "the [lexicon] devil is in the details," as the idiom goes (okay, I edited that idiom a little, but it was too cool a

 

« first day (3306 days earlier)      last day (474 days later) »