« first day (885 days earlier)      last day (2895 days later) » 

12:34 AM
0
A: Rebol, extensions and function naming

BrianHThat's a pretty standard naming convention for Rebol exports. However, if you want to avoid global namespace pollution, declare your extension module with the options: [private] header. That will make it so the exports of your module are only imported by modules or scripts that request them expl...

 
 
2 hours later…
2:30 AM
@BenjaminGruenbaum how's that parse in Javascript project going? Still being considered?
 
3:13 AM
@Respectech Well, all attachments are are binaries that are base64 encoded. It works apparently, but when it fails, you increase the buffer size as the amount to send in one go. Which really doesn't sound like a math issue.
 
3:33 AM
@GrahamChiu Still being considered, the bureaucracy is taking far too long :(
 
@BenjaminGruenbaum good job they're enthusiastic!
@Respectech I'm just looking at the differences, and I see in line github.com/gchiu/Rebol3/blob/master/protocols/prot-smtp.r#L284 it just writes the data to the port for the first buffer amount, but after that it writes from this line github.com/gchiu/Rebol3/blob/master/protocols/prot-smtp.r#L312 where there is a superfluous to-binary present. Perhaps try removing that?
I have no idea of what this graphic is about, but there is also a security REcon event in Montreal See recon.cx
 
3:56 AM
Who is @TomBon?
And hey, I was not drunk at noon. Jeez.
@mmcghan Rebol is encoding a few basic standards which, if you went through a time warp, might seem like old-fashioned dinosaur ideas. Like having a parser data type for currency. And everyone knows how much I despise money. Anyway, network schemes and the URL! may seem similarly archaic "in the distant future" but they fit into the way people use computers today.
Rebol had a motto for a while which was "driven by theory, informed by practice" or something like that.
 
@HostileFork He's a long time Reboler .. on Altme
 
If you're going to ask big questions and look for "the root of it all", SpaceChem is a better bet than Rebol, but if you want a more boring variant try Lambda Calculus
 
@HostileFork Only movie stars can do that
 
@GrahamChiu Uncle Larry has never starred in a major motion picture, and he seems to accomplish it with ease.
 
@HostileFork err .. I think i meant it's only news worthy when people of renown are like that
Looks like he was responsible for a number of things we have due to bounties he sponsored rebol.org/aga-display-posts.r?post=r3wp756x1
I'd forgotten he helped sponsor the 0MQ and cURL interfaces
 
4:15 AM
@GrahamChiu Whoa. People offer money for Rebol tasks? :-P
 
@HostileFork Only when they get done :)
Just reading that thread again, looks like a simplified library interface was high on people's wishes. Like the Rebol2 one. But it proved to be somewhat elusive.
 
 
1 hour later…
5:27 AM
@BrianH, can you confirm that that it's a bug that a module loaded using import doesn't export any words listed in the Exports: header? When I load the same module using Needs:, its exported words are visible as expected.
 
6:20 AM
@Adrian when you import into something, the question is what are you importing into? If you use Needs: then the imports are processed before the module starts, and the target of the import is known. In contrast, the import function is run at runtime, after the module is created, and can't know what the context of the module is unless you pass it as a parameter (this is a general constraint of all Rebol-like languages, not of import in particular).
By request from Carl, import imports into the user context system/contexts/user by default, to make it easier to run from scripts (which run in that shared context). It's a safe guess, and done for user convenience. But importing to a module context without having at least a pseudo-global reference to it is impossible. It's not a bug, it's a hard limitation.
 
@BrianH "unless you pass it as a parameter" - how do you do this?
 
However, import returns a reference to the module so you can get stuff for yourself. You can even get stuff that wasn't exported, as long as it's not hidden. Be sure to use import/no-lib/no-user for that kind of thing though. The import function is made for script use by default, so you have to disable a couple things to make it usable to modules.
@Adrian that was a comment about what is at all possible with a Rebol function, not about import in particular. To keep the import function simpler, Carl decided that non-script import would be done primarily by Needs:, with the ability to do special tricks with the import using the /no-* options to break the rules.
 
to clarify - when you say non-script, you mean scripts that are modules?
 
I mean modules that aren't scripts, which you indicate by setting the type: header. Scripts are modules too, they're just special modules.
Unless you need to do the special tricks, you don't need to use import in modules. For that matter, you mostly don't need to import stuff into modules at all. Regular modules export to the runtime library lib, and all modules and scripts import from lib as well. Most apps only need one import call at the top level of the app, and the rest just import stuff automatically. You only need to explicitly import private modules.
 
I got that regular scripts are still modules, from the docs, so that's not the confusion. I'm just trying to clarify that when you say "non-script import would be done by Needs:", you're talking about modules (declared with Type:) specifying their dependencies.
OK, I'm being very dense here. "Regular modules" - you mean scripts not using Type:?
 
6:36 AM
Most of the time you use Needs: in scripts too, if you import at all. It's just that with modules, there are architectural constraints to Rebol's binding model that make it more necessary to use Needs: with modules than it is with scripts.
 
I don't follow this either - "Most apps only need one import call at the top level of the app, and the rest just import stuff automatically. You only need to explicitly import private modules". What I'd like to do here is make the bot script import command modules from a directory. These command modules would be declared with Type:.
 
You read the SO article I wrote on this? I want to know how much I need to explain.
 
posted on April 03, 2013 by rebolek

[Comment] Of course I can implement dialect on top of the scheme, it's just that WRITE url! DATA fits the key/value storage model perfectly, so it feels natural to use. I can add custom REDIS-WRITE that will do what I want, I just don't understand why when it can be solved in WRITE directly.

 
I guess you mean this?
http://stackoverflow.com/questions/14420942/how-are-words-bound-within-a-rebol-module
I haven't - only read the rebol.com docs on modules.
Let me read that - don't need to repeat.
 
@rebolek, these are questions that I was asking rhetorically, so that we can get feedback on the model. The reason that you can't is because write has a different model than what you are requesting. There are serious downsides to changing the model, so it needs to be thoroughly argued before we make any changes.
@Adrian thanks. That article is the best docs on the module system. The rebol.com docs predate a change in the module system API, and were incomplete and wrong before then.
@Adrian, that article doesn't explain why import has its limitations, and barely mentions import at all, but it does provide some background that I'd rather not retype :)
 
6:50 AM
@BrianH It would be nice to have write model described somewhere. Being able to write redis://server/key "value"seems to me superior (and more high-level too) to key: open redis://server/key change key "value" close key. Of course there may be some downsides that I'm not aware of so to have this explained somewhere will really help me and others who want to write a scheme.
 
@rebolek that is one thing that we don't really have: explanations of the R3 port model. It's a weird situation. The new low-level port model is the most thoroughly designed part of R3 (except maybe the module system), but that design hasn't been explained very well. Carl put a lot of thought into it. One thing that you can assume is that every capability or limitation it has is really intentional, but in many cases we have to discover the reasons ourselves. Frustrating.
On the other hand, the high-level port and scheme definition model isn't that well thought through yet. Again, frustrating.
 
@BrianH I agree that it's frustrating. As I said before, using write here feels natural to me and while I'm perfect fine to limit functionality of write and move it somewhere else, I need to know why.
 
@Adrian bot script with command modules, right. OK, first of all, give your command modules names, and import them by word, so it won't reload them until they need upgrading. Second, set your directory in the module lookup list, so it will know where to look. Third, if your bot has a Type: header, use the combination of import options that meets your needs. I should write another article.
@rebolek the low-level port model was thoroughly thought through, but by Carl, not me, so I can't explain it yet. It's been on my todo list to make a thorough study of the current model in order to determine the reasoning behind it. There may be weaknesses in the model, but until we know for sure what the model is we can't know what would be a weakness and what would be a strength.
 
@BrianH Another idea I had is to have some standard port action (send for example) that will accept any-type! and can be used not only to what I want to achieve but also to similar needs in other schemes/ports (also the terminology here is bit confusing to me and I'm not sure where the boundary lies).
 
All I've been able to determine so far is the string/binary/dialect-block behavior of WRITE was intentional. I haven't written enough R3 schemes yet to know for certain what its strengths are.
@rebolek one thing that I know (because it has been documented) is that ports are supposed to be async underneath, with the port-related url operations being sync wrappers for async operations. However, you can have other sync operations that work on open ports too.
Redis is a key-value store, right? Have you considered having your port scheme act like a fake map or object (without binding)?
It seems to me that mimicing object-like behavior for the port actions might work here. So instead of using READ and WRITE, use SELECT, PICK and POKE.
Does redis accept commands? Maybe it would be better to have the dialect block contain such commands (Rebolized of course).
 
7:17 AM
@BrianH Yes, redis accepts commands. There almost no need to rebolize them, it's very Rebol-like (storing value in a key is done with SET key value, retrieving value with GET value etc.).
 
I thought so. I remembered there being a dialected key-value store, but I didn't remember the name.
 
Using POKE instead of WRITE is also an option. I will look into it.
 
The downside is that you have to open the port first.
The upside is that you can use the low-level POKE port action to implement a high-level dialect command that does the same thing, along with other commands, that you could in theory pass to a redis:// url in a batch. That is what write dialect blocks are for.
BBL, must sleep now.
 
@BrianH So I will pass dialect block to write that will call port actions like poke that will call write again with raw data? That's bit strange. And if I can pass dialect block, why not passing object directly as I requested in the beginning? Sorry, but that design makes not much sense to me.
 
7:56 AM
@HostileFork URL! aren't "archaic" at all, but, unfortunately, their implemenation is misdesigned as my CC tickets show
 
8:47 AM
@Mahesh Welcome to the Rebol and Red room. See our FAQ
 
Oh you have a bot? Shiny!
 
@RebolBot do print "Hello @Mahesh"
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> print "Hello @Mahesh"
Hello @Mahesh
 
9:25 AM
now that is awesome.
@RebolBot code=[1+2]; do code
 
@Mahesh What do you mean?
 
I hope thats valid rebol. :P
oh. looks like nope. :(
need to look at rebol once again. its been months since I was last here.
GTG. BBL.
 
@Mahesh help will get you far
 
@RebolBot do code: [1 + 2] do code
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> code: [1 + 2] do code
== 3
 
9:29 AM
@Mahesh In rebol we have set-words, and "=" is an equality test
@rebolek I don't really understand the limitations on 'write either.
Yes, clearly lib/write can't take an object! as a parameter, but actor/write shouldn't have such restrictions as it's not a low level write.
So, when we are using a actor/write, it's a high level write, but when we write directly to the tcp-port, it's a low level write-io
 
@GrahamChiu That's exactly my thought. It just seems easiest and most natural way to me. Of course I can add dialect on top of write, but why am I forced to do it when writewith richer datatype support covers most of use cases?
 
When you're acting with the redis:// scheme, do you perform more than one action at a time?
Anyway, if you're dealing with an object database, it seems attractive to be able to write objects to the scheme port and let the actor handle all the lower level activity.
 
9:47 AM
Mostly yes, with write I need to get redis datatype of key to perform right action.
 
The other thing is that you can just put your object! into a block, and that would be acceptable.
It just seems an arbitrary limitation ... or the reasoning has not been clearly explained.
 
@rebolek when you connect to redis via tcp and performance is at least somewhat important, you don't want to re-open the tcp connection for each command. so in this case, an OPEN + PICK/POKE + CLOSE interaction model seems more favourable anyway.
of course, for quick throw-away scripts where performance doesn't matter, the plain simplicity of a single WRITE is nice.
 
@earl I agree that for performance OPEN/series operation/CLOSE or some dialect is better approach, but as you said, having WRITE to do some quick stuff is really nice. I just don't understand the reasoning for WRITE limitations. If it's intended as low-level function, why can I pass dialect block! to it? And when I can pass block! and not only binary!, why not other types also?
 
Presumably you could also put multiple commands inside the block that you write to the port
 
10:04 AM
If write supported more dtypes, I could do write redis://server/key map [name: "Tony" age: 50 quota: 100] and it will create redis hash for me. Of course I can do something like write redis://server/key reduce [map [name: "Tony" age: 50 quota: 100]]but I don't understand why.
If there's good reason for this limitation I want to know it and understand it, that's all :)
 
10:40 AM
@AmithKK Welcome to the Rebol and Red room. See our FAQ
 
Hello @RebolBot.
Interesting.
 
@RebolBot do print "Helo @Amithkk! I'm a bot."
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> print "Helo @Amithkk! I'm a bot."
Helo @Amithkk! I'm a bot.
 
see, they have an interactive bot which responds to rebol code.
 
@RebolBot do code:[1+2] do code
 
10:42 AM
oops, wrong room. :P
 
@AmithKK What do you mean?
 
@RebolBot do code:[1+2] do code
 
@AmithKK Please continue.
 
@RebolBot do code: [1 + 2] do code
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> code: [1 + 2] do code
== 3
 
10:43 AM
Ah. Nice!
@RebolBot Show me your source code please :P
 
@AmithKK Please continue.
 
@RebolBot show me your youtube videos
 
11:11 AM
@GrahamChiu Thanks. I'm experimenting with rebol now.
 
 
3 hours later…
2:09 PM
@TomBon Welcome to the Rebol and Red room. See our FAQ
 
 
1 hour later…
3:15 PM
@rebolbot bot-source for amithkk
 
@GrahamChiu RebolBot Source @amithkk
 
3:37 PM
@GrahamChiu I'll give that a try.
@GrahamChiu Thanks for pointing that out. We're considering new names now. Too bad, I liked ReCon.
 
 
2 hours later…
5:14 PM
@BrianH Looks like the extension used to form filenames from module names when loading, is .reb unless you modify system/options/default-suffix. I would think this should be .r, instead.
 
5:44 PM
@Adrian I use .r3 for R3-compatible files, .r2 for R2-compatible, and only use .r for files that are written to work in both, often with explicit conditional code. But I don't use .r that often for projects to be published somewhere like Github because it is usually interpreted as being R language syntax, or resource files on OSX.
Still, system/options/default-suffix is set to .reb as a reminder that you probably want to change that setting. If it was set to something that people actually used, that would end up becoming a defacto default file extension.
@rebolek actually, port actions like poke would do the raw data setting directly. Unless you meant a write to some underlying TCP port, something you'd still have to do if you used write for the redis port action. Does Redis even support writing raw data to a database without specifying a key?
It makes sense to support write for bulk operations, but since it doesn't have a key parameter it doesn't make sense to have it do the individual setting, except as a URL shortcut action. Remember, low-level operations work on an open port, not a URL. The URL operations are the high-level ones, relatively speaking.
 
6:01 PM
@BrianH I'm bit confused. So URL operations are high-level ones, but URL operation WRITE is low-level?
 
The whole port model is relatively low-level, but the port model itself has two levels within it. The high level is the URL operations, the low level is the port operations. When you call write to a URL, it's a different function (effectively) than when you call write on a open port. The high-level URL ops open a port internally and then call or schedule a series of low-level ops, then wait for the low-level ops to finish before the high-level ops return.
The port model is a high-level synchronous model built on a low-level asynchronous model.
 
Ok, so back to my initial wish - why can't high level write support more types than block!, string! and binary! ?
 
Because that's not the model. Now, the model could and maybe should be changed, but until you understand why it works the way it does then we can't answer the question of whether it should be changed. Until then, your ticket is a placeholder for that question, when we can have an answer to it.
There is a way to understand the reasons for the model though: Use the model as-is and see how it shapes the behavior of your schemes. Work with it, not against it. Then you can understand it well enough to be able to ask the right questions.
Keep in mind that I haven't done this yet, and frankly, neither has anyone else except Carl. The HTTP scheme is not a good example of the model (since Gabriele quit before the model was explained to him and it became apparent later).
When I first heard about Redis, I used it as a thought project when trying to understand the R3 port model. I can only help as far as I've thought it through already. I can't actually do a Redis scheme myself because I can only allocate time to work on things that I can actually use, which means SQL for now.
So, now that you've reminded me that Redis is what you are working on (I forgot the name), I am glad to help with what I figured out already.
So, dialect operations, you are probably right that set and get would be appropriate here. Both of those functions in the DO dialect have implied context (the word's binding) so you can use the same number of parameters. Set-words could be used to set Rebol words to be used outside the dialect (maybe set-paths too). Maybe get-words would be used to get Rebol values and parens for DO expressions.
The pick, poke and select functions would be good port operations, and probably append for bulk inserts of objects, maps or blocks of key-value pairs, just like they are used for objects and maps. The read and write operations could be higher-level, read as a URL action only, but maybe write could be used to do bulk operations on an open port too, similar to what it does as a URL action bur without opening and closing the port.
 
6:30 PM
Unless you write to the tcp port, writes go thru your port actor and so are high level writes. The difference using a URL is that write should then open the port first.
 
Right. What @GrahamChiu said :)
 
err I'm disagreeing with you!
 
The problem with this "high-level" vs "low-level" distinction is that it is mostly meaningless in scheme writing practice.
 
@GrahamChiu not with what I said earlier. We are talking about a theoretical Redis scheme, not TCP. It makes no sense to support read from an open Redis port since you don't specify the key, and it makes no sense to support anything other than a dialect block for open-port write because you don't specify the key.
 
the port actor translates your write into a low level write. So it should be able to accept other data types than those restricted to the low level write
 
6:35 PM
You can only provide the port's write actor, you have no influence of what WRITE url! does (it creates a port from the URL and invokes the write actor).
 
not just redis
 
@earl that is actually a problem with the design of make-scheme, which was not as well thought through as the port model itself. I would like to replace make-scheme completely if I get the time to figure out what to replace it with.
 
so @earl which side are you taking?
 
@GrahamChiu More flexible WRITE.
 
thanks:)
 
6:38 PM
@BrianH That's not only part of MAKE-SCHEME, it would also require a rewrite of most of the other user-level observable dispatching code ("the port model").
 
those of us with practical experience writing schemes and not just thought experiments, prefer a flexible write
2
there is no need to rewrite anything, just remove the data type restrictions
 
@earl personally I am neutral on whether the write model should be changed. I believe strongly that we really don't know enough to make that decision yet because all non-native R3 schemes are fighting against the model rather than working with it. I am only advocating the model because someone has to in order to have a real discussion about it, which is needed.
 
and let scheme authors get on with it
 
@GrahamChiu we can't know that yet.
 
@BrianH Yet in your argumentation you also discount the years of experience some of us already have with writing schemes.
 
6:42 PM
@earl for R2, which had a completely different model. How many years have you written R3-style schemes? I am not aware of any non-native R3-style schemes.
 
@BrianH Graham and I started doing this in 2010, if I'm not mistaken.
 
correct
 
@earl well, that means that when we have the discussion, your input would be necessary.
 
we are having that discussion now
 
We have been having that discussion for years.
You haven't been watching at all, then. We have SMTP, FTP, POP3, IMAP, S3, DNS, Time, Fax, and probably more. At various states of completion/experimentation.
SL4A!
 
6:46 PM
Redis
 
Well, I haven't. Would you be so kind as to explain to me exactly why read and write work the way they do, and why it would be a really bad idea for them to be changed? Because without those counter-arguments we won't be able to deal with the side effects of making the change. I haven't heard a strong advocacy of the current model, so the impression given is that the schemes have been fighting against it.
 
Have to ask Carl for the "why".
 
the only side effect is that you remove type checking on write
 
And we haven't come up with any reason for why it would be a really bad idea to slightly relax read/write. Seems more like a simple oversight.
 
@earl No, we don't. All we have to do is write some schemes within the model, not fighting against it, and then see what the advantages of doing so are. That way if we make changes, we will know what we will lose and then make sure that the new model can do something better.
 
6:51 PM
@BrianH We have been doing this for years.
 
there is no loss as you put it
 
@earl if you haven't come up with any reason, then you haven't taken full advantage of the model.
 
@BrianH Huh?
The current model is simply rather constrained to one particular use-case.
Even if you take full advantage of this for this single use-case, you can never cater for other uses.
If you have to press every stateless interaction into a stateful model, you'll see mismatches.
Orthogonally extending a model does not necessarily incur any losses. That's why you claim is simply illogical.
 
This isn't like make-scheme, these limits were put in there on purpose, to encourage a particular style of operations. Have you really seen the style of code that fully embracing the model encourages? What are the advantages to the limits? If you can't answer that, then you can't figure out how to get those same advantages with a different model. Or if you have, noone has explained the advantages, so I keep being compelled to look for them myself.
What are the downsides? There would be downsides. I want to make up for those downsides, but not knowing them I can't make up for them.
 
If those limits where put in on purpose, then only to completely discourage use of schemes for some interaction models.
So the "downside" would be, that people write a scheme for something they should rather not write a scheme for.
 
6:57 PM
Well, what would be the benefits of discouraging those interaction models?
 
Less schemes, less artificial attempts to shoehorn things into schemes.
More proper APIs, instead.
We know, that this really is one of Carl's original design intents.
 
@BrianH The scheme is not theoretical and you can make key part of url so it makes sense to read Redis port.
 
OK, I had noticed that benefit. That was made clear by Steeve's half-attempt to make a virtual block scheme, which wasn't blocklike enough.
@rebolek that is what I was talking about for the URL action. You can't specify a key for write in open port mode, which is why I was saying that write should only take a dialect block (or Redis syntax string?) when used in open port mode.
 
@BrianH Ok, you meant write on open port. But with open port you can use poke instead. With closed port, write should be more flexible.
 
Just a question for my todo list: Has anyone made reference examples of schemes that implement different semantic classes? Like a reference series-like scheme, a command processor, an object-like scheme? They don't have to (and shouldn't) implement a particular real-world protocol or use, they should just be best-practice example code.
@rebolek for the purposes of this discussion, I would prefer to consider the Redis scheme to be theoretical. I don't want to be unduly influenced by the design choices you've made already when making new design choices. I'm considering your existing scheme as the thing which gave you the domain knowledge that I don't have. We will likely end up with something that is only minorlydifferent from what you have so far.
@rebolek yup, that is what I was saying. I think that a Redis scheme should have fairly flexible read and write URL actions. The main trick is to make sure that if you are doing URL actions, that you do as much as possible in them, because they have port opening and closing overhead. So we want to make sure that you don't do a bunch of individual key gets and sets using URL actions rather than open ports, unless you have connection pooling.
One advantage of the read and write limits is that you don't have to implement connection pooling in your schemes as often because you are encouraged to use open ports instead. But that doesn't mean that we wouldn't want to have connection pooling for advanced schemes that implement flexible URL actions, like HTTP for instance.
 
7:22 PM
@GOD Welcome to the Rebol and Red room. See our FAQ
 
GOD
@RebolBot k
 
@GOD That's very interesting.
 
GOD
@RebolBot bot lol
 
Another advantage of the current write model limits is that you can do a much better job of implementing an object-like scheme if you implement the operations that work on objects in the way that they work on objects, and you can't do that on URLs, you have to do that on open ports.
 
7:34 PM
I can't see that having artificial limitations to enforce a particular style of writing is good.
 
It is if not writing things in that style has negative performance impact.
BBL, have to do a meeting.
 
Or, it could result in positive performance
 
7:58 PM
@SomeKittens Welcome to the Rebol and Red room. See our FAQ
 
@RebolBot ohai
 
@SomeKittens That's very interesting.
 
Nice new feature
 
8:52 PM
Here is list of PORT actions and SERIES actions. But I don't understand the difference. Why is for example length? port action and not series action?
It's really hard to guess what is the right way of writing schemes when there's no documentation and no examples. And no Carl to ask.
 
 
1 hour later…
10:19 PM
I sort of clarified it here r3gui.com/docs/network/…
@rebolek what do you mean by series action ?
 
insert, append, change, etc.
That's what is written on the wiki.
It's not clear what's the difference between them.
 
it just means that you can write these as port actors, but they take the port! as an argument and these series actors can't take the url! as argument.
the ones that take a url! can do atomic actions.
not that it makes sense for that except only some schemes
 
10:36 PM
@GrahamChiu I thought so, but the why is length? in port! actions? length? url! doesn't open port but returns length of url string.
 
@rebolek Eg. pop3 scheme, you would define length? to return the number of emails sitting in your pop3 store.
that list you linked to rebol.net/wiki/Schemes:Notes#Port_Actions is wrong I think
 
@GrahamChiu ok then. It seems I can edit the wiki. Nice.
 
so if you use length? append etc on a url, it treats it as string!
@rebolek Can you? I don't have an account ( or I don't remember it )
 
@GrahamChiu Yes, I removed length?from port actions in the wiki so it won't confuse someone else too :)
 
Looks like Gregg authored that page.
 
10:46 PM
I also added full list of series actions for reference.
 
didn't realise that there were so many.
 

« first day (885 days earlier)      last day (2895 days later) »