« first day (1764 days earlier)      last day (2016 days later) » 

1:39 AM
I keep finding more reasons that throw should not let you pass an ERROR! by default. Rather it should require a switch. I was thinking that throw/only would be particularly fitting if it would evaluate a block given to it by default.
However, I think the logic of Rebol is such that it shouldn't do that. So... hm. throw/error ? throw/i-mean-it? throw/any?
 
2:06 AM
In Ren/C++, a c++ throw does not mean Rebol THROW... it means "raise". So it's flipped. You're only allowed to throw ERROR! values. That's due to the norms of meaning in C++. Also, we couldn't use C++'s throw of a value to mean Rebol's THROW in isolation anyway... there's no way to pass a NAME. So you'd have to create a separate object to pass anyway.
 
 
1 hour later…
3:08 AM
@HostileFork how about \= for <>?
 
@JacobGood1 Backslash is a tricky character to use in general, so many mediums (including Markdowns) use it often to mean escaping. Avoiding it in ordinary code is good, but I think the special case of being between spaces for the interstitital "expression barrier" is a good opportunity for it to play a role.
I don't think we want to see backslashes in Rebol words
 
or the lisp way... not=
looks better non infix though
not= 1 2
1 not= 2
 
It isn't the worst idea, but != is pretty well understood. Thing is, that I'm a pretty active opponent of ! as "not" in C++, where I use the not keyword instead. (I also use and instead of &&, or instead of ||...)
! is too slight to see in a mix of expressions considering the fact that it completely inverts the meaning
 
i dont really like it on the end of types
 
So when I see Rebol having ! as not, I want to see that go.
 
3:14 AM
dang it I have to go afk
 
tell me what you think of it being on the end of types so i can read that when i get back =)
 
I think we don't have any better answer, and the one place where I think deferring to legacy makes sense is when really it seems nothing is better than anything else.
Being able to have a variable called block is nice, and in general having variables as nouns with the name of the type undecorated is good.
This doesn't necessarily mean that type specs have to be stuck using the exclamation points, so you could say foo: function [x [integer string] y [date]] [...] and the context of being in the spec could lead it to imply the !.
But there are some consistency and mechanical problems with that, especially because that list of types gets evaluated... words are looked up, so you can define your own typesets etc. Removing the ! becomes a hack.
It is probably rare that people would write integer: 10, but I think that's just conditioning. It's nice to have words like "date" and "time" and "block" free. Unfortunately we don't have function or object free, because those are used as "makers".
I've wondered if we could sidestep this somehow, one idea was to consolidate the name for a "Rebol function-like thing" as ACTION! or ROUTINE! or something... that way the idea that FUNCTION is a "builder" wouldn't be so weird. routine: function [...] [...] => type-of routine = routine!
A similar sort of "we don't have any predefined words for the un-decorated type" trick might be done if OBJECT made a CONTEXT!
The thing about the "marketing liability" of ! as a type decorator is I don't know if other characters would be better, and we're beating pretty heavily on the list of symbols that are on a keyboard as it is.
They don't technically need to use a symbol. It could be integer-type, string-type, etc. But that's wordy. It could be something more clever like an-integer, a-string.
foo: function [x [an-integer a-string] y [a-date]] [...]
But ! is clearly better than that. So then we get to wondering about other symbols...like is there something too disturbing about ! that makes it a bad thing for types.
foo: function [x [@integer @string] y [@date]] [...]
Maybe part of it is being at the end of the type instead of the beginning, so it seems less like an operator and more like it's trying to "say something".
foo: function [x [!integer !string] y [!date]] [...]
 
A quickie Q @HostileFork, it would be madness to assume that there was even a tiny chance that Remove_Series could GC, check?
And, so everyone'll be forewarned, here's what this preliminary angle-word commit does NOT contain:
1) decorated slash-words (set, lit, or get)
 
3:30 AM
@MarkI I want to formalize the GC or not GC ability of routines in some way (passing a token which is checked in debug builds but compiles out completely in release builds, or similar). For now I think it's safe to assume that Remove_Series does not GC.
 
2) single-segment files and urls in paths
 
@MarkI e.g. foo/http://bar/baz is two elements long?
 
Currently, and post-angle-words-preliminary, correct.
 
I'm leaning toward wondering if we should just disallow it, and say you have to use a construction syntax or parentheses
 
I have left multiple options open for that puppy.
 
3:32 AM
It depends, on how NewPath is adapted. I think I've agreed on @rgchris's "URL currency" premise, that the burden is on something to make a URL be processed vs process it implicitly.
 
@HostileFork I looked at the code, and it memcpy()s, of course, but I would like a better contract also, to ward off future fiddlers.
 
That there is value in saying "this is a literal URL" and that literal URL wins the default of http://whatever...
 
Anyone use @rgchris's altjson library? I'm just after an example of creating an array as per my SO question which will show up here sooner or later
 
@johnk Haven't... but what does it do with just [ [ label: "one" ] [ label: "two" ] ]?
 
@HostileFork {}
 
3:48 AM
@johnk Is there a reverse operation to turn JSON to Rebol? If so, what structure does it use to represent the string you're looking to get as output when it's fed in?
 
@HostileFork good thinking. I'll have a play
 
1
Q: Create JSON array using altjson library

johnkI am using this JSON library for Rebol http://ross-gill.com/page/JSON_and_REBOL and I am struggling to find the correct syntax to create JSON arrays. I tried this: >> to-json [ labels: [ [ label: "one" ] [ label: "two" ] ] ] == {{"labels":{}}} I was hoping for something like: == {{"labels": ...

 
@johnk I will add it as a comment such that our questions look more active. :-)
 
Hmm. Playing with examples from w3schools.com/json/json_syntax.asp load-json gives me ** User error: "Not a valid JSON string"
Might need to wait on @rgchris to come to the rescue. I have plenty of other stuff to do
 
4:13 AM
>> do reb4.me/r3/altjson probe load-json {{"employees":[{"firstName":"John", "lastName":"Doe"},{"firstName":"Anna", "lastName":"Smith"}]}}
 
; Brought to you by: try.rebol.nl
== RESULT is an object of value:
   employees       block!    length: 2
; Brought to you by: try.rebol.nl
make object! [
    employees: [
        make object! [
            firstName: "John"
            lastName: "Doe"
        ]
        make object! [
            firstName: "Anna"
            lastName: "Smith"
        ]
    ]
]
== RESULT is an object of value:
   employees       block!    length: 2
 
@johnk Perhaps you need objects and not blocks then.
 
Something is still not quite right
>> do reb4.me/r3/altjson to-json make object! [ labels: [ make object! [ label: "one" ] make object! [ label: "two" ] ] ]
 
; Brought to you by: try.rebol.nl
== {{"labels":["make","object!",["set-word!!","one"],"make","object!",["set-word!!","two"]]}}
 
@johnk Your nested makes wouldn't be run, try compose/deep'ing them or something.
Stuff that #(...) notation would deal with...
>> do reb4.me/r3/altjson to-json make object! compose/deep [ labels: [ (make object! [ label: "one" ]) (make object! [ label: "two" ]) ] ]
 
4:22 AM
; Brought to you by: try.rebol.nl
== {{"labels":[{"label":"one"},{"label":"two"}]}}
 
Great. Well done. It seems a bit clunky. Maybe a future enhancement to altjson with a block syntax is possible?
If you don't mind I'll post your answer on SO
 
@johnk Works for me. :-)
You might mention the #(...) notation from Red.
#(labels: [#(label: "one") #(label: "two") ])
I still say I would have liked @(...) better. :-/ Hm.
 
@HostileFork I'm not familiar with that. Altjson also uses issue! as the json-set-word thingy but that is a word! now, not a string so the same constraints still apply
 
@MarkI Good to see you making code. :-) Without reading for implementation at the moment, it looks like from your commit that there are some issues with things like tabs (for the moment we are trying to enforce tabs vs. spaces, until we intentionally switch to spaces-not-tabs).
 
@HostileFork I completely forgot that quagmire, my apologies. Should I have tabbed it up proper?
Because that file is one of the worst, and it overlaps with style, which I think it also violates in a few places.
So I was saving that change for later, but if it helps people now I can do whatever, just tell me.
 
@MarkI Ren/C has a pre-commit script: github.com/metaeducation/ren-c/tree/master/git-hooks
 
@HostileFork Help! My eyes! You made me look at Perl code ...
Seriously, just tell me if you want tabs, and at what indent.
 
@MarkI Well, my preference is that you work against Ren/C and PR there. earl has been managing those changes when he thinks it's important/relevant enough to include, and that's his process not mine. You might just try cloning Ren/C and then applying a new commit against that.
A couple things: I'd prefer not using the multiple-declarations on one line, so one-line-per local variable.
The idea of splicing the definition of something into the comment text, the way function prototypes are done now, is likely to be supplanted by an automatic tool that formats comments, and we're going to have the prototype and definition after the comment block. So extending the practice to #defines isn't necessary, the #define can just go after the comment block about it.
 
5:04 AM
'Night.
 
@MarkI I'm starting with formatting commenting because it's easiest, but a technical review of what it does will take longer.
 
@HostileFork it seems that Ren/C is something to do with the json issues I am seeing. Running the above in a freshly built ren/c gives == {{"labels":{}}}
 
@johnk Ah. Well that's maybe something @rgchris can help with narrowing down as well...he might have an easier time finding the exact source of the difference than I would
I can try and look
 
>> do reb4.me/r3/altjson to-json [ <labels> [ [ <label> "one" ] [ <label> "two" ] ] ]
 
; Brought to you by: try.rebol.nl
== {{"labels":[{"label":"one"},{"label":"two"}]}}
 
5:16 AM
The issue based syntax works :-)
@HostileFork I'll have a play and see if can find a minimal failure
 
@MarkI The indenting is important, if it seems like I'm picking a detail, because if you look at the code it can't really be read in the file diff.
 
@HostileFork to-json [] returns "[]" in r3 and "{}" in Ren/C. I started tracing through what was happening, but I am out of time for the minute.
bbl
 
@johnk Thanks!
 
another simple case is to-json [a] - gives {["a"]} in r3 and "{}" in ren/c
 
@johnk Looks like an ANY-BLOCK! parse related issue... that parse uses the symbol literally perhaps?
So when ANY-ARRAY! was introduced, a parse rule looking for ANY-BLOCK! doesn't match. Maybe...
>> s-alias: string! parse ["foo"] [set x s-alias] print x
 
5:28 AM
; Brought to you by: try.rebol.nl
foo
 
Hm, well that works.
>> s-alias: string! parse ["foo"] [s-alias]
 
; Brought to you by: try.rebol.nl
== true
 
Well, so maybe not that... will look...
 
5:50 AM
posted on August 30, 2015 by hostilefork

For the following code: do http://reb4.me/r3/altjson to-json make object! compose/deep [ labels: [ (make object! [ label: "one" ]) (make object! [ label: "two" ]) ] ] R3-alpha returns: {{"labels":[{"label":"one"},{"label":"two"}]}} Ren/C returns: {{"labels":{}}} Via @johnk on StackOverflow chat

 
if any [file? json url? json][
    if error? json: try [read (json)][
        throw :json
    ]
]
@rgchris ^-- What's the reasoning behind that? It seems odd for a few reasons... the parenthesization of (json), trapping an error and then using THROW on it.
That script with those use statements looks like a good candidate for wrap...
 
6:45 AM
1
A: Create JSON array using altjson library

Graham Chiu>> ?? labels labels: [make object! [ label: "one" ] make object! [ label: "two" ]] >> to-json make object! compose/deep [ labels: [ (labels) ]] == {{"labels":[{"label":"one"},{"label":"two"}]}}

0
A: Create JSON array using altjson library

johnkAs suggested by @hostilefork using the inverse operation shows us how it works. >> load-json {{"labels": [ {"label": "one"}, {"label": "two"} ]}} == make object! [ labels: [ make object! [ label: "...

 
7:01 AM
Interesting. I see Anton Rolls posted a comment on rebolforum. Haven't seen him active in Rebol for years.
 
@HostileFork Try this:
>> parse [[]] [into [some [tag! skip]]]
 
; Brought to you by: try.rebol.nl
== false
 
@HostileFork At some point I'd likely used COMPOSE to finesse the error, probably didn't remove the parenthesis when I took out the COMPOSE.
 
@rgchris Yup, that is giving TRUE. :-/ I'll look at it...
 
@HostileFork Yes—it is a good WRAP case. I still like the exercise of enumerating locals with USE, but it's not really necessary.
 
7:11 AM
@rgchris But why the throw?
 
This was one of my first Rebol 3 conversions, THROW is just a leftover...
An oversight.
 
'k. I'm thinking of moving on my "don't allow ERROR! as argument to THROW by default" thing.
So ideas on what to call the "I mean it" refinement are welcome.
I also think DO on errors to raise them is probably a mistake.
 
@johnk Which example gives an error?
@HostileFork Yeah, don't like that.
 
What do you think of n: 10 alert/error ["combine your error here with n: " n] as being something where /error forces the alert to "also error"? alert alone does not have connotations of stopping the program (more like a notification) but alert/error might be able to make that suggestion.
So /error would bump up the severity to the point of it being a raise. Then keep RAISE but you have to pass it an ERROR!
People would probably not use it all too often then, so the fact that its name is wonky wouldn't matter that much.
I guess the question then being, what if you passed an ERROR! to alert.
 
ALERT is still somewhat tied to the alert modal dialog—I'd be somewhat more inclined to just using RAISE: raise ["combined" error] and using RAISE/ONLY to return the error without triggering it...
 
7:26 AM
Hi people!
I would like to have your opinion about some ideas:
1) add user actions to objects, à la Python; this way they can replace utypes
2) extend vector to matrix, with some native support for linear algebra
3) new type complex32bit
4) we need some standard library, à la Python
 
4) yes, but how to guarantee that it's there indefinitely?
 
we can start with a github repository...
 
@giuliolunati I've been thinking about (1). I need to understand modules better, but when I do I'm thinking that Rebol can have a single OBJECT!-like type for both OBJECT! and MODULE!. One difference about module from object is that it has a spec. That spec could have a richer language about how to interpret the object's "body".
In that line of thinking, I have thought that OBJECT would have a spec and body, so it would be arity 2. But then there would be an arity 1 version called HAS. This means OBJECT would be like FUNCTION with a spec and a body, while HAS would be like DOES with just a body.
The arity-2 object would use the "object spec dialect", and that would be where the behaviors module has would be expressed, riffing off of things like the way functions work with <tag-attributes>
 
@giuliolunati While I agree—GitHub is as transient as any. Could you be certain that it's not another SourceForge in 3-5 years?
 
@giulolunati Included in that spec dialect, I think, could be functionality that could describe what people want from UTYPE could be expressed. But we need to refer back to things like your complex numbers for study, as I think that's the most complete work anyone has done in the area
@rgchris This is why I want the dereference through tags... do <json>, then just point your install to your trusted repo...
 
7:34 AM
@rgchris none. My mistake. I forgot to add the { } around the string
 
@HostileFork Although technically it's named <rgchris.json> unless it were somehow accepted as generic...
 
@HostileFork I can write and submit an object-version of that
 
(or <rgchris.altjson> indeed)
@johnk NP, just checking. Poor effort from W3Schools to have JSON source that isn't valid JSON... :)
 
@rgchris something needs to be blessed, but that can be another directory service step in the mapping.
 
@rgchris then we can migrate...
 
7:37 AM
For most searches where W3Schools is the first result, I usually look for the second result that is invariably developer.mozilla.org and is invariably more informative...
 
@rgchris I agree with that^
 
@giuliolunati As mentioned, I'd definitely like to take advantage of your enthusiasm. :-) I think, though, what we really need is to keep a fairly strong focus for the moment on nailing down and packaging what is there already. I want--for instance--to be able to run a script on the command line with rebol http://url-to-script/blah/blah/blah...and I want some standard script aliases to say rebol "<script-name>" and have it fetch them from a name service (good for tools AND libraries)
I'm trying to pin down the C source as tightly as possible to give a leg to stand on tactically for any modifications that we come up with. But I also want the long missing features and general usability to go up.
@giuliolunati With Rebol able to do so much, it would be nice to have it show itself as useful for some task right now that people want to do. Look at jq for instance. I think there is a space where Rebol could do a lot of things well... and it just isn't getting deployed to do that thing...
Why can't I say something like rebol "<filter-lines>" "[some {a}]" < datafile and get it to spit out the output of all the lines that are one or more {a}?
 
posted on August 30, 2015 by Arnold

Created and uploaded the video of how to compile the game of Xiangqi programmed in Red. http://youtu.be/5xjky_Ox1l4

2
 
I think adding new features for math etc. are important in the long run, but the "fit and finish" isn't there, and it's telling that the command line only just recently got attention to be a good citizen... it still can't run scripts from a URL.
So I guess I'd say we should be focusing mostly on (4) in the sense of giving a good experience people can get into today
 
@HostileFork ok, thanks!
 
7:53 AM
It would not hurt at all to start gathering good scripts that are candidates for libraries, make sure they all run in Ren/C.
Pick through rebol.org for what looks good, scrounge about elsewhere and fill in gaps. Putting it on GitHub is fine too, for now.
 
however, I have the code for point 1) and 2)
 
@giuliolunati I'm interested to see your work--and of course a PR to review would be welcome. But right now, a lot of what I'm working through is focus on organizing the code to get it under more control for what's already there. I'd like to get the code to a good stable baseline before adding big features.
The exception in terms of features I'm focused on adding are the big black holes. The things that should have been there, that people might have expected, but weren't. Things that were oversights or unimplemented.
 
While not uniformly the case, I tend to find scripts in rebol.org to be written in isolation with little attempt to suppress leakage into the global namespace. Similarly there's a tendency to include demos in the code (often with print statements) and not in documentation.
 
@rgchris I doubt any would be able to used without modification, but the question is if any of them are "salvageable". I guess it's just a matter of clipping through them, marking them so or not.
@rgchris I know that there was a hypothetical scrape of rebol.org that was to be finished and such, and it wasn't. If all the rebol.org source code could be scraped and just thrown into a GitHub repo, it might then be organized and remarked upon more easily.
 
I have a copy of much of the code behind rebol.org but not the data.
 
8:10 AM
@rgchris @johnk For a fun game, let's play "spot the mistake in the transformation for the SYM_INTO case"
Okay, it's not that fun a game. fixed :-)
(If you're curious as to why the parse state was manually expanded there, it's because this is an interim refactor. Once a few other things flatten out, it will be factored again, but differently.)
Small steps toward readability, one at a time. Need to make them one at a time, and keep testing, and we see why.
 
 
1 hour later…
9:29 AM
@rgchris There's a script by Max that runs on desktop that takes a copy of the whole script library I think
Or maybe it's just a GUI interface to the library
looks like it downloads all the scripts locally
 
9:58 AM
@GrahamChiu It couldn't hurt to just give it a go-over. If there's consensus among everyone here that something is not a priority or has been superseded, it could just be deleted.
 
I would presume it's just a question of creating a new repo, and adding them
 
We'd probably like that repo to be under rebol/rebol
As suggested once, rebol/rebol.org
 
in that case ... earl?
 
When he gets back from... wherever he went. With the issues import it will be time to just go ahead and proceed, but need to get back in touch with Carl about the .net and .org situation going forward.
It would be easy to say that this is kind of a swimming-in-tar thing and give up, but I do think that dominos can fall if people take it seriously to push through the tasks.
Anyway, the repo can be made and worked out anywhere for starters
 
11:10 AM
@HostileFork wow - that was quick :-) Confirmed fixed here
 
The features that I miss the most in Rebol are 1) customizable polymorphism (utypes/Python objects)
2) iterators / port parsing
@HostileFork totally agree with you about priorities
 
 
1 hour later…
12:18 PM
@HostileFork FYI this is the github import approach that @earl found I am reading it again in more detail and I think I misread it first time through
As far as I can tell it still only allows you to import 1 issue per http request, but it does allow you to set the time/date stamp, add comments and close the issue in a single hit
"issue or comment will be parsed and rendered using Markdown if the created_at value is set to a time after 2009-04-20T19:00:00Z, and using Textile if it's older." - could be messy
 
12:48 PM
posted on August 30, 2015 by giuliolunati

e.g. : v: charset "aeiou" parse "rebol" [ any [ copy t to v | end opt skip ]] r b l

 
1:02 PM
Hmm .. the "Check status of issue import" function seems not to work so you are flying blind on whether or not your imports are working, although it does check the syntax. In this way it is worse than the normal API as at least that gives you a direct reference to the issue you have just created.
 
1:14 PM
Hi everyone. Can someone explain to me how I can use random with forskip?
I want to forskip by an increment of 2 and pick one of those values randomly
 
@HostileFork I actually find the long lines more unreadable than the indenting. Both will be fixed. This is pre-li-mi-na-ry, and it works.
 
1:45 PM
@RebolBot
t: [1 2 3 4 5 6 7 8]
forskip t 2 [print t/(random 2)]
 
; Brought to you by: try.rebol.nl
1
3
5
8
 
@fadelm0 see ^^
 
1:57 PM
And if I want to print only one of them, not all?
 
..t: [1 2 3 4 5 6 7 8]
random/seed now
r: random length? t
t/:r
@RebolBot
t: [1 2 3 4 5 6 7 8]
random/seed now
r: random length? t
t/:r
 
; Brought to you by: try.rebol.nl
== 1
 
Go to try.rebol.nl to try this indefinit without bothering this SO chat too much with your experiments ;-)
@giuliolunati You nailed, what @fadelm0 asked for, on the head. If you'd ask me.
 
@iArnold @giuliolunati Those don't exactly do what I wanted, but I'll see what I can work out with your suggestions. Thanks
 
2:12 PM
@fadelm0 you're welcome
@iArnold I don't understand... my English is very poor, sorry ... :-/
 
2:37 PM
@giuliolunati To "nail something on the head" means to get it exactly right
 
Ah, thanks @iArnold @fadelm0 :-)
 
 
4 hours later…
6:37 PM
I have a VID-related question, which I'm thinking of posting as a question.
@HostileFork In some cases I find it's better to post there, because it's easier to formulate questions and answers in an understandable way. So maybe you can create a tag to separate "direction Rebol is going" questions from questions like mine?
 
@RebolBot
t: [1 2 3 4 5 6 7 8 9 10]
forskip t 2 [
t: skip t (random 2) - 1
print t
]
 
; Brought to you by: try.rebol.nl
1 2 3 4 5 6 7 8 9 10
3 4 5 6 7 8 9 10
5 6 7 8 9 10
8 9 10
 
@RebolBot
t: [1 2 3 4 5 6 7 8 9 10]
forskip t 2 [
t: skip t 1
print t
]
 
; Brought to you by: try.rebol.nl
2 3 4 5 6 7 8 9 10
5 6 7 8 9 10
8 9 10
 
posted on August 30, 2015 by giuliolunati

parse "test" [ copy content to [<a>] (print content)] BEFORE: >> test< AFTER: >> test

 
7:02 PM
@GrahamChiu I guess that'd work and good enough to scrape docs too.
 
7:20 PM
0
Q: Rebol text fields - checking values and changing colors

fadelm0In the following prototype test code, I'm trying to create a comparison system that compares two fields, and colors them depending on whether they are equal or not. comparecolors: [ either answer-user/text = answer-correct/text [ answer-user/font/color: green answer-correct/f...

 
 
1 hour later…
8:45 PM
0
A: Rebol text fields - checking values and changing colors

Graham ChiuWhenever you see multiple fields affected when you change the attribute of only one, it means that VID has made an optimization so that all those fields are sharing the same data structure, and in this the same font structure. So, we need to force VID to allocate a new font structure like this: ...

 
9:02 PM
@johnk Jeez. I don't even know what Textile is. :-/ Does this mean if you go back in time and edit old GitHub comments they won't be in MarkDown... or if you edit them will they be converted to MarkDown and then you save them and it works? I guess you can test that and find out.
@fadelm0 rebol2 is a fine tag for "old questions". Any question with code is fine, I just meant a question that's one sentence asking where a feature is might be too short...
@MarkI Do make sure we know exactly what it does from the commit body. We write long ones (!). Remember that we talk about a lot of things, so it's not exactly clear which ones your commit covers...so some "before" and "after" examples are helpful.
Concrete examples are good in the code comments too. Note that listing "if a character is a <, a +, or a -" is covered by things like if (strchr("<+-", foo), but the big picture "if this line weren't here, <== would be a tag but <==> would not" helps one realize the broader impact.
See if reading Comments should say WHY and not WHAT gives inspiration to how you might look over it and tune that a little, especially if you can explain more of the surrounding code. If we're going to keep the lexer instead of tossing it, we need to know how it works.
@MarkI And as you get your first-commit indoctrination, don't forget... The Seven Rules...
The one thing in particular with your changes that we need to understand is kind of a list of what used to work that doesn't work anymore and then what didn't work that now does. Basically "what all changed". Because of the way the lexer is implemented, it's really hard to formalize.
 
10:02 PM
@Morwenn I've been bringing Ren/C++ up to alignment with the changes to Ren/C as things tighten up. I will say that mixing a C "fake exception" system which also has throw/catch for non-local control with a C++ real exception system, proxying it through stacks of C++ and non-C++ code, has a lot of... nuance.
Rebol has THROW/CATCH which are not longjmp-powered. That is a specially marked return value, with a bit that says "I am a throw, you must handle or rethrow me". This is used as the mechanism for returns, breaks, continues, and the generic "throw/catch"
 
A kind of expected monad?
 
It's very much like a burrito, in some ways. In other ways, it is not. :-)
 
x)
 
Having several kinds of error handling has always been a problem in several languages :p
 
10:06 PM
Well, THROW/CATCH are specificially not supposed to be for error handling, and I thought an interesting subtlety would be to disallow error as an argument to THROW as a default. You'd need a specific refinement to say "no, I mean, really... I am THROWing an error to a CATCH". So THROW/ERROR or THROW/ANY or something.
 
@HostileFork Nice one :D
 
Because it's chronically confusing.
 
You don't say. In other words, it is a specific control flow mechanism, not really related to errors, but using the error reporting terminology nervertheless.
 
The idea that THROW and CATCH are error-related is not universal.
It can just be a convenience for non-local control.
 
That's true, but in most programming languages, they are hardly used for anything else.
 
10:08 PM
In Rebol they are used for BREAK, CONTINUE, RETURN...
 
I tried to have a kind of "return type dispatch" with exceptions in C++ at some point, but it was aweful x)
 
The terminology difference is a bit of a trick, so my take for Ren/C++ is to land on the C++ side. If you THROW a Value, it has to be an Error.
If you throw a non-Error value you get an assert and a problem, not the non-error value you tried to throw.
If you want to use the Rebol sense of THROW, you have to throw a ren::evaluation_throw
 
At least it allows to differetiate the to, which is good :)
 
One reason why you need an object for this is because that might need two values... the value thrown, and a value representing the "name"
Because there is throw value and throw/name value name
 
That's exactly the question I was going to ask xD
 
10:11 PM
I thought about it because it could be biased the other way
You could make the C++ throw act like the Rebol throw and disallow ERROR! by default
But (a) what about names? and (b) isn't the desire to raise an error way more common than implementing some kind of non-local control for Rebol constructs from C++
 
I guess that it would be confusing for the average C++ programmer?
 
And (c), that.
Doing puns on the language constructs to make them look like the same language is kind of a really weak axis of support in a binding.
Although... I was thinking about that weird idea of using division to simulate path access...
There is one property where a/b/c has an advantage over a[b][c]... which relates precisely to its weakness of having to "build up a chain of state before it reaches the final evaluation"
That is: you have an opportunity to optimize and not generate intermediates. The production that builds that chain gives the "dispatch" a chance to elide things you don't actually need to make.
(At the cost of building the representation of the production.)
 
Don't worry, operator/ is already overloaded for path concatenation in the upcoming std::filesystem::path.
 
Oh noes. Really?
That's a very "NewPath" idea.
 
And it's also overloaded for Path in Python.
 
10:18 PM
So they have to do that? Build a chain representation of all the intermediates, append at the tail?
 
You don't "have" to do that, but when you have an absolute root path and a relative one, it makes concatenation both easy and expressive.
 
Let me fill you in briefly on a performance/technical problem:
 
>> help append
 
; Brought to you by: try.rebol.nl
USAGE:
    APPEND series value /part length /only /dup count

DESCRIPTION:
    Inserts element(s) at tail; for series, returns head.
    APPEND is an action value.

ARGUMENTS:
    series -- Any position (modified) (series! port! map! gob! object! bitset!)
    value -- The value to insert (any-type!)

REFINEMENTS:
    /part -- Limits to a given length or position
        length (number! series! pair!)
    /only -- Only insert a block as a single value (not the contents of the block)
 
10:21 PM
@Morwenn This may not be your thing, but I have liked this a bit. It's a young-people band, saturated a bit with techno.
Funny is that, I used to listen to Metallica and such. :-) These days maybe I just have a bit less patience, but at the same time the bands have gotten a bit more oppressive in that direction...
 
It sounds a bit like complextro from time to time, I like it :)
 
Back to the technical issue.
So think of yourself from the perspective of the interpreter looking at something like append/only. You have a structure that is 2 elements long, it contains two words.
Out in definition space, you have APPEND's declaration. It also has a list. The list (at this time) looks like /part length /only ... so not in the order you expect to process necessarily.
Today, what happens if you write a/b/c/d/e and it determines C is a function it passes the remainder of the path to the function dispatcher. So it gets d/e
 
What if C has refinements?
 
That's why it's passed d/e
To decide if those refinements are good, and to use the order of the refinements to interpret the order of parameters.
But a key weakness of this is that it really is passing d/e to the function dispatcher, which means it has stopped doing path evaluation at C.
 
Uh...
 
10:27 PM
@RebolBot
foo: 'only
append/:foo [a b c] [d e]
 
; Brought to you by: try.rebol.nl
; rebol.com/r3/docs/errors/script-bad-refine.html
    *** ERROR
** Script error: incompatible refinement: :foo
** Where:
** Near: try load/all join %/users/try-REBOL/data/ system/script/args...
 
I think that should work.
The reason it doesn't work is because it stopped path evaluation at APPEND, passed :foo to the function dispatcher, which then went all literal-like.
If it were going to be made to work, we face a performance-killing prospect.
That prospect is that each step in path evaluation create an object capable of snapshotting the intermediate state... so this would work too:
@RebolBot
apo: :append/only
apo [a b c] [d e]
 
; Brought to you by: try.rebol.nl
== [a b c d e]
 
That silently failed to be equivalent to append/only [a b c] [d e] because it just grabbed the function and ignored the /only
@RebolBot
append/only [a b c] [d e]
 
; Brought to you by: try.rebol.nl
== [a b c [d e]]
 
10:31 PM
When I bring up the performance-killing spectre, it is the spectre of path evaluation forcing you to make an object intermediate at every step. And if that object requires allocating a new series (such as an adjusted function spec) you have to GC that spec.
 
That indeed sounds like a serious problem...
 
But...! Easy to finesse if path dispatch is complicit with you.
 
I didn't understand that last sentence at all :o
 
You only bother with the GC-seen making of an object if it leaks out of the dispatch...
So append/only/dup [a b c] [d e] 3 can avoid creating the append-only-dup function object because it runs at the end and it can do a sort of "global analysis"
You're out of luck if you say foo: :append/only/dup and you will make a new function with a new spec, but I'm okay saying "that's life"
Having the GC be aware of it is all right because it makes sense for it to be.
My point about the difference between a[b][c] and a/b/c is that the former would force each step to generate an object, while the latter gets an opportunity to do a simliar elision.
It's about trying to make a/b/c/d behave always as if it had been written ((a/b)/c)/d while maybe getting some benefit out of seeing the whole picture.
Which in fact suggests a good debugging mode... do it both ways, ensure same result.
It's very much a "down the road" thing for Ren/C++. The array form will never do the production of a chain to process, it will always rotely make a new Value at each step.
>> print ["Hello" reverse "skcoSnIxoF@" "and welcome to... [Rebol and Red]"]
 
; Brought to you by: try.rebol.nl
Hello @FoxInSocks and welcome to... [Rebol and Red]
 
10:45 PM
I think that I'm slowly getting the problem, but my head hurts ><
 
And C++ doesn't make your head hurt? :-)
If you missed my comment about this pursuit:
Aug 27 at 18:42, by HostileFork
Trying to program everything using an antiquated language and doing everything super basically...but then pulling out complex analysis tools...is sort of like being Amish where you have a rule that you're only going to use hand tools and technologies that were available 200 years ago or prior. But in one room of your barn you have a bunch of computers you use to plan and map what you're going to do with those tools.
Rebol and Red in a nutshell.
 
@HostileFork I have been practicing C++, encountered and solved problems with it. So... of course I'm more used to it :p
@HostileFork I didn't miss that one ^_^
 
I was thinking about one of the things that is very integral to Rebol that keeps me interested, and I think parentheses as a block-like element that evaluates really is one of those things.
>> probe [1 + 2 [1 + 2] (1 + 2)]
 
; Brought to you by: try.rebol.nl
[1 + 2 [1 + 2] (1 + 2)]
== [1 + 2 [1 + 2] (1 + 2)]
 
>> probe (1 + 2 [1 + 2] (1 + 2))
 
10:49 PM
; Brought to you by: try.rebol.nl
3
== 3
 
Speaking of programming languages, tools, concepts, etc... I was trying to understand Scala today and I have no problem to understand the concepts being manipulated, probably because it's close to computer science and I can throw name of concepts at it without a problem. Rebol is all about evaluation on the other hand, and it's mentally harder for me to understand how it works :)
 
>> probe (1 + 2 [1 + ] 2 (1 +) 2)
 
; Brought to you by: try.rebol.nl
; rebol.com/r3/docs/errors/script-no-arg.html
    *** ERROR
** Script error: + is missing its value2 argument
** Where:
** Near: try load/all join %/users/try-REBOL/data/ system/script/args...
 
@Morwenn You can't understand Rebol so well from the outside-in.
Whether the tail wags the dog or not, which can be argued, you have to understand the tail.
 
Sometimes, I really have the feeling that you have to understand how Rebol works to really understand how Rebol works, it you know what I mean :p
 
10:52 PM
@Morwenn I know I repeat myself, forgive me for being old, but I see a lot of the sort of machinery building feeling of Spacechem (older, cool) and Infinifactory (newer, cool) in this.
I think the examples above with the parens and blocks shows a little more of the mindset, it's got a game feel. But we're playing the game against modern things like URLs and such.
I would think to cite Java as a serious fun-killing language
 
@HostileFork I can see what you mean.
 
There is basically no axis on which Java programming is fun.
Or JavaScript.
Despite being completely unrelated except by name, they both are no fun.
 
@HostileFork I totally concur. I can't say that it's a bad language but I find it seriously boring.
 
So I guess they do have something in common by sucking.
"The only thing JAVA and JAVAscript have in common is that they both suck."
@Morwenn Dig once again, the FOR loop...
for: func [
    {Execute a "C-style" FOR loop with an initialization, test, and step}
    init [block!] test [block!] step [block!] body [block!]
    /local out
] [
    init: context init

    while bind/copy test init
        bind compose/deep [
            set/any 'out (to paren! body)
            (step)
        ] init

    get/any 'out
]
We immediately notice the oddity of WHILE not needing delimiters. The way you can say while condition body. The code indentation still tries to mimic the form.
Mimicry of the form helps suggest the way the condition is being built, by which the test gets bound to the init to pick up the variables in it.
Similar binding is done to the body, which is assembled from the body and the step.
It's more like SpaceChem and Infinifactory than like Haskell, it's haphazard, but the fun is there
 
11:35 PM
@HostileFork
What do you think of this? :
fraction: object/spec [num: 3 den: 4] [
form: function [x] [
ajoin [x/num "/" x/den]
]
<... other methods ...>
]
print frac
-> 3/4
 
@giuliolunati My concept of spec was that it would be the part that gave directions on how to interpret the body if it were a normal object, but that the body would still be "normal". So without having a precise proposal I'll show that direction:
fraction: object [
     form: 'form
] [
    num: 3
    den: 4
    form: function [x] [
        ajoin [x/num "/" x/den]
    ]
]
I'm not sure exactly how it all would work, but binding would be important.
e.g. the FORM you'd be specifying in the spec would be bound to wherever you wanted the action overload archetype to be, and then you'd be mapping that to the object's form.
This is in the spirit of the needs of module, where the spec is the controls for interpretation of the body.
I do not think objects should immediately assume that just because they have a method with a certain name, that that name be picked up as a dispatch to a function by that name someone else wrote.
The object is the one with the responsibility of declaring that intent. "When I say 'form' I don't just mean that you can call fraction/form, I mean that if there is a FORM function out there in the wild somewhere--past or future--I want this to be dispatched by a call to that if I am the first argument"
Exactly how to say that in the spec I do not know.
In other words, I don't want to call one of my methods "foo" and then have someone write a function called foo and all of a sudden what I once thought was an ordinary method is getting picked up by a foo my-object vs. passing my-object by value.
And to restate, my idea is that if you don't want a spec at all you say fraction: has [num: 3 den: 4]
That object always has a spec, and it's harmless enough to write fraction: object [] [num: 3 den: 4]
Then wipe out UTYPE! and MODULE!
 
ok. We can break back-compatibility?
 
There are several kinds of backward compatibility breakages.
One kind is the kind that can be glossed by redefinitions. Those are less concerning.
Then, if you have code written to the old standard that hasn't been converted, you can just say: object: :lib/has module: lib/object
When we start getting into changing things like how indexes are interpreted or something like that, it's a bigger deal.
 
Or, as intermediate step:
object/spec spec body
but
object body
 
Shifty, but possible... as it means that the refinement is adding a parameter but bumping the old parameter out of the way.
@giulolunati If you want to research it, perhaps you could research this as extensions to "module"? Because module is really the arity-2 construct that I want to overtake the idea.
It would be great if you could understand what module does today. I don't.
It has a spec and a body. I have proposed that whatever it is that module does by way of its spec is likely a feature you might want to have on a general object in some way or another.
@giuliolunati If you can read up and understand the likes of isolate for instance... chat.stackoverflow.com/transcript/message/15004885#15004885
Our new idea is that in specs, we use attributes as tag, maybe like <isolate> for an option.
 
11:54 PM
Uhmmm... modules are too hard for me...
I'll try the object way.
Where can I find def of OBJECT?
 
MODULE!, ERROR!, and PORT! are all handled as OBJECT! in a mechanical sense, just with a different type flag.
 
I mean, def of OBJECT constructor function, not OBJECT! type
Where I must eventually add /SPEC refinement
 

« first day (1764 days earlier)      last day (2016 days later) »