« first day (2579 days earlier)      last day (1201 days later) » 

12:00 AM
But the console is really an interesting thing now. The main.c driver just calls in a loop a function that returns either a BLOCK! or a GROUP! each time. If it returns a BLOCK! that is considered code to run in "kernel mode" and a GROUP! is "user mode". But all kernel mode really means is that any hooking of the evaluator the user mode has done is not applied.
 
@HostileFork wow! Sort of literate programming ;-)
 
@giuliolunati To understand the flexibility of the main.c loop that just keeps calling the HOST-CONSOLE with the last result (and the last code that was run) look at how it does the countdown when you get an error during a command line script or a --do: countdown response
What happened was, that the BLOCK! that was returned to ask to run the command line script (or command line --do "...") is that it put #countdown-if-error at the front of the block that contained the DO for that code.
So the next iteration of HOST-CONSOLE gets the error, and it also gets the BLOCK! that caused the error when executed. It can look and say "oh, that was a kernel instruction because it was BLOCK! and not GROUP!". Then it looks at the head of the block and notices it was annotated. Then it responds to the annotation...
And decides to react by giving a cute countdown, also returned as a kernel mode instruction which has #console-if-halt. The kernel executes a wait and prints out 5...4...3...2...1. If it finishes without interruption, it quits. If it gets interrupted, the HOST-CONSOLE notices the #console-if-halt and responds appropriately.
Anyway, I think if people understand how versatile this is, they will realize it will be very easy to make the console behave well.
But back to my earlier point, the cleaner separated all this is the better for emscripten. The last instance of Put_Str was removed from main.c... all I/O is now usermode for the R3 console.
@giuliolunati I would like Travis-CI to build emscripten, and for there to be a page people can visit that runs it in a JavaScript/HTML5 terminal to use the latest version from that build. That is a good goal. I want to figure out how to solve the INPUT problem for that, too.
 
12:26 AM
@HostileFork maybe we'll be forced to use emterpreter
 
@giuliolunati Maybe. Or, build Rebol as a Windows 3.1 app! blog.archive.org/2016/02/11/…
Every now and again I think about what it would take to do continuations in a reasonable way.
With FRAME!, all usermode functions (code written in Rebol as a block) wouldn't be a problem to continue. It's the native code, when you don't have a VM "under the C" to freeze state on. But I might not have looked at every angle of it yet.
There are, after all, a finite number of natives...and only some of those natives call out to usermode that might request a continuation...and not all of those natives would need to offer continuability to get started with partial support. Basic ones like WHILE would have to account for a request for continuation in the body, but maybe a lot of other things could skip it until later. even in that case, maybe continuations from the condition could be punted on.
"What's the list of native functions one would have to reasonably support in a backtrace up to the console that might call INPUT (or PRINT and need to see it synchronously)". But even Red's Win32 console, where they control everything, doesn't output prints until you're done. Synchronous I/O is nontrivial in single-threaded programs that take responsibility for implementing their I/O from scratch.
 
 
17 hours later…
5:46 PM
posted on November 22, 2017 by Steven White

I want to count the leading spaces in a string.  I can sort of do it, as shown in the sample below, but the core of the problem seems to be finding the first non-blank character.  It seems like there must be a better way than specifying a list of 127 printable characters and then finding any one of them.  I don't want to find "something," but rather "

 

« first day (2579 days earlier)      last day (1201 days later) »