« first day (3702 days earlier)      last day (78 days later) » 

12:21 AM
PORT! does seem to be a valid datatype in Ren Garden, however trying to initiate one via a URL! bombs:
^^^ Trying something else
‌>> decode-url: get in sys/*parse-url 'decode-url  ; not included in 'lib

    sys/make-scheme [
        Title: "Null Scheme"
        Purpose: "Always returns Null"
        Name: 'null

        Actor: [
            copy: func [port [port!]] [
                "Null (copied)"
            ]
        ]
    ]

    probe copy make port! decode-url null://
    probe copy make port! null://
"Null (copied)"
‌(i) Info: use WHY for error information
‌** Script Error: append does not allow #[datatype! blank!] for its series argument
 
12:53 AM
@rgchris READ doesn't have much of a basis for working in any way it would work on a desktop. So one has to be written to call JavaScript functions. Source is here: github.com/hostilefork/replpad-js/blob/master/replpad.reb
@rgchris What in particular are you aiming to do?
 
@HostileForksaysdonttrustSE I don't see why it wouldn't. It's the schemes that wouldn't correlate to the desktop
 
@rgchris You could access the normal lib/read if it wasn't overwritten.
 
It is overwritten
@HostileForksaysdonttrustSE Trying to utilize schemes:
sys/make-scheme [
    Title: "Null Scheme"
    Name: 'null

    Actor: [
        read: func [port [port!]] [
            "Null (read)"
        ]
    ]
]

probe read null://
The way HTTP(S) is currently READ, you could just replace the desktop scheme with:
sys/make-scheme [
    Title: "In-Browser HTTPS Scheme"
    Name: 'https

    Actor: [
        read: func [port [port!]] [
            ; missing the GitLab handling
            whatever/read-url-helper unspaced ["https://" port/spec/host port/spec/path]
        ]
    ]
]
 
1:12 AM
@rgchris If you make a local copy of the replpad you can hack on it, but taking some of those overrides out will break the console. READ may be one of them. You could put the lib read aside as LIB-READ or find some way to fall through to it under conditions you check.
READ may not be required for any part of the load at this point... load-r3.js uses fetch() directly to get the .reb files and uses normal web mechanics to get the CSS
Or you can hook the new READ and give it a tunneling hook to whatever behavior you want, bypassing schemes.
 
1:35 AM
It's more the opposite—it's the bypassing behaviour that is the problem
 
 
1 hour later…
2:56 AM
I don't know if it's related to the discussion here, but when I QUERY on an http port, I haven't been able to get a data object back of the server response.
This is something that used to work, but it's been a long time since I tried it on a port.
 
r3-alpha>> x: open example.com

r3-alpha>> query x
== make object! [
    name: none
    size: none
    date: none
    type: 'file
    response-line: none
    response-parsed: none
    headers: none
]
 
I mention this because it's one aspect of the video meeting demo tomorrow, so I probably will stick to showing filesystem queries.
Yes, that's what I get... an object yes, but full o' nuthin'
 
There's not really determinism in HTTP requests. If you open one request and are interacting with it and it's sending you a size, nothing says that asking again of the same URL would give you the same size.
 
There's so much goodness to show with files, that I'll maybe just touch on URL! and/or show what can be done with a straight READ-- which is a lot more useful imo than anything you get from headers and such.
 
> "...you may not always see a Content-Length. Typically you might not see it for any content which is dynamically generated, since that might be too expensive to service an exploratory HEAD request. For example, a HEAD request to Apache for a static file will have a Content-Length, but a request for a PHP script may not."
I guess it could have saved the length if it was given one up front, but I don't think it always is. Anyway, point being, this would need some design.
 
3:03 AM
@HostileForksaysdonttrustSE I'm not concerned about the variability of some of the fields. Just might be useful to get the data for cookies and other stuff one might expect from something modeled off of the current rationale of QUERY.
It's not lost on me that I'm brining this up the night before the meeting. :) I am just mentioning because of the other issue. I have lots to show tomorrow.
 
3:59 AM
Here's a little scheme that sits over the HTML5 Storage API. The aforementioned PORT/READ limits make it a little cumbersome, but still works:
3
import gist.githubusercontent.com/rgchris/…
p: make port! [scheme: 'storage host: "Foo"]
insert p "Bar"
probe copy p
Ideally the interface would be just READ/WRITE: write storage:foo "This" and read storage:foo
Note that this is persistent—so long as you are using the same browser, you can read what you've stored after a refresh
(in theory) And so long as you're not using a private window
 
4:22 AM
@rgchris Neat. Well, if you can make a scheme for http/https that uses fetch() that would be fine. Though as my remarks on this issue show, the scheme concept isn't put together very well.
Running a copy of the replpad locally to hack on it shouldn't be hard, it's just static files.
 
4:39 AM
The main complexities in schemes as I see it are related to ports—specifically the ways async, TCP and I guess FILE/DIR ports work.
The scheme setup itself works reasonably well, but for protocols built atop async/TCP, you need to understand some the circular calls and spawned ports work. Little synchronous schemes like this storage one are not so challenging.
 
5:10 AM
@HostileForksaysdonttrustSE Doesn't initiate—I cloned from hostilefork/replpad-js. After the preamble, the page goes white.
 
@rgchris Was one commit out of date, try this: github.com/hostilefork/replpad-js/commit/…
 
That worked.
 
Debugging before the console trapping is set up can be difficult, but some more information with the "tracing_on" switch: http://hostilefork.com/media/shared/replpad-js/?tracing_on
 
5:32 AM
@rgchris @HostileForksaysdonttrustSE As I suspected, this works when READ is commented out. Only issue remaining is this error when I go to make a port from a URL:
** Script Error: append does not allow #[datatype! blank!] for its series argument
‌** Where: switch _ make read case switch load-module applique import main
‌** Near: [*** append decode-url spec ** compose [ref: (spec)]
‌    nam...
‌** File: tmp-boot.r
‌** Line: 4925
 
@rgchris DECODE-URL is set to blank and seems to get set to sys/*parse-url/decode-url by some code not run in the web build. You'd have to do that set manually.
 
I did, I still get this error.
 
That error seems to clearly suggest the notion of decode-url worked with by that code is blank. So maybe you didn't set lib/decode-url
 
Though whichever module holds this code may use LIB before it runs my update
 
The init-schemes function is where the assignment was done, and INIT-SCHEMES is something run by the main() code which the web build doesn't have, so adding init-schemes somewhere in the startup is something you'd need to do if you wanted to use them.
Perhaps in main.reb, call sys/init-schemes github.com/hostilefork/replpad-js/blob/master/main.reb
 
5:53 AM
Ok, it works by putting sys/decode-url: lib/decode-url: :sys/*parse-url/decode-url immediately before the sys/make-scheme call, but in replpad.reb to be in the same context as the READ helpers
 
6:42 AM
Here's a patched replpad.reb with an HTTP and HTTPS scheme (and the storage scheme with that READ/WRITE interface). Will work on creating a pull request. It has the same restrictions (I believe) in terms of which URLs it can access.
Storage: can use write storage:key "Thing" then read storage:key
Can think about how that might work with a little more nuance, but seems fairly intuitive.
 
 
4 hours later…
10:51 AM
posted on December 19, 2020 by iArnold

Another idea I came up with that can become very useful for system administrators. To use some applications sometimes you need to establish some connections or a certain setup before they can be started or used. So for instance to connect to a database a ssh tunnel must be initiated and the program perhaps must be started from a shell script. Another program will work inside a v

 
 
7 hours later…
6:14 PM
Next Re-Meet Video meeting is due to commence in 3.75 hours
@rgchris maybe you can take us through what your patches to replpad do?
 
 
1 hour later…
7:27 PM
@GrahamChiu Not much to speak of, but have a fun wee experiment at hand
CLEAN-PATH seems awry:
‌>> clean-path %foo
== hostilefork.com/media/shared/replpad-js/foo
‌
‌>> clean-path %foo
== oof/sj-daplper/derahs/aidem/moc.krofelitsoh//:ptthfoo
‌>> change-dir %/foo/
== %/foo/

‌>> clean-path %bar
== %/foo/bar

‌>> clean-path %bar
== %rab/oof/bar

‌>> clean-path %bar
== %rab/foo/barbar

‌>> change-dir %baz/
== %baz/

‌>> clean-path %bar
== %baz/bar

‌>> clean-path %bar
== %rab/zabbar

>> what-dir
== %rabbaz/bar
 
8:07 PM
Hm, I try and replace CHANGE-DIR from %replpad.reb and it doesn't seem to stick. It must be getting overwritten from somewhere else.
Ah—forcing the issue (user/change-dir: :new-def) seems to break something.
 
8:36 PM
@rgchris You're on for a few minutes at your time 17:45 cheers
 
 
2 hours later…
10:08 PM
Any link to the talks?
 
 
1 hour later…
11:12 PM
Still ongoing.
Here's a link to what I presented docs.google.com/presentation/d/…
 
11:50 PM
Thanks for the demos! I'll reiterate my hopes that all projects that are of interest to people have tests, and that these tests be kept working through some form of continuous integration. As I've demonstrated, that can apply to web projects too...we can poke keypresses into websites and check for patterns in output with headless web browsers.
 

« first day (3702 days earlier)      last day (78 days later) »