« first day (1736 days earlier)      last day (2044 days later) » 

12:22 AM
The idea of keeping angle brackets for tag to start with a space, then allowing it to end with a space, doesn't make a lot of sense. So tag!< start and end with space > seems flawed. It does feel like there has to be something different about the end :-/
Construction syntax is needed for types like functions and objects because they don't have a "natural" notation, they are created by code. Construction syntax is needed for types like TAG! because not all legal strings for them to contain are LOADable as naturals. It's fairly different, but that different requirement suggests it needs to be formulated so you don't have to escape in construction syntax...because if you do, what was the point?
tag!<^_start with space embedded ^> and end with space^_> buys you nothing. You could already do that.
 
 
7 hours later…
7:15 AM
0
Q: Can strings be 'late bound' as if they were words in the same positions?

HostileForkWhen you LOAD a string, it biases to the user context by default: >> f: 3 >> outside: object [ f: 4 getter: does [ print reduce compose [(load "f")] ] ] >> outside/getter 10 This turns out to be an artifact of LOAD's implementation, which uses intern to "Import (internali...

 
^-- I know the answer is "no". Or think I do. But felt like writing a question anyway. There should be more of them.
Anyway, that would make COMPOSE on a string require a list of contexts to bind into as a parameter, which limits its usefulness somewhat. Or you could do it like reword, but pass in the words to substitute. compose <foo color="(color)"> [color] Though even that presumes that string compose would go deep into strings to find parens for substitution.
This makes the idea of some kind of string compose "in the box" less compelling, as it points out that it really does take an awareness of the rules of your target to know that <foo color=(color)> needs to be <foo color="red"> and not <foo color=red>. Still, having the structure checked can be useful.
 
8:05 AM
@HostileFork AFAIK, it's not a CommonMark standard.
 
@rebolek How's CommonMark going these days? Any new standards releases?
 
@HostileFork Latests version is from June, just some bugfixes.
 
Speaking of bugfixes, StableStack is coming along. Development speeding up now that Ren/C is increasingly similar to what I was working with.
Current status: tests at one regression from Rebolsource (PNG-related, haven't looked at it)...38 progressions...no crashes. A bit deceptive in terms of "all being well" since I haven't turned the non-zero-fill memory on yet, but hopefully that won't take long to get the results patched in. Smaller bits.
The "big" change coming after StableStack is going to be the reconciliation of manual memory management and GC, where there's a proper "incubation" period before a series has been shared with the garbage collector where you can still free it.
I will probably be much more liberal for starters about allowing series to be given to the GC even if they might not need to be than I was the first time around. The code complexity to avoid certain situations probably didn't warrant the savings.
There are a few "big" cases where you don't want to grow and grow the memory use with stuff you can reasonably avoid ever letting the GC be aware of the series used for some temporary internal process, but most error conditions are rare enough that you can just let it go.
 
8:28 AM
Great!
 
It's boring in a way, because I am not working on "whizzy features". And I think, coming from an engineering background, that's one of the things that makes me irritated a lot about software demo-itis.
The tendency for programmers to be building Rube Goldberg things that collapse like Jenga towers... this Bravery video being always on point when I think about it, especially the ending.
But, it will get more fun after the fixing. Then watch. :-)
It will be a bit more like...
 
so you guys work with REBOL huh? like for real work? :-)
 
@mindplay.dk Yeah :-)
 
So what's that like? I've been lurking on that language for many years, but never had the gusto to pick it up and try it for myself.
 
@HostileFork Well, given some features you want to introduce, it's a good thing, that you're doing just bugfixing ;-)
 
8:35 AM
I guess I should ask more specific questions, heh ;-) ... how is IDE support for this language? is there any?
 
@mindplay.dk I love it. It's really a big relief when I got some Rebol-related job instead of HTML/CSS/JS one.
 
@mindplay.dk "refreshing, inspiring, and frustrating" (Douglas Crockford on Rebol, putting aside the last snarky mail I got from him for a moment.)
 
LOL :-)
does it have tools at all? or you just use text editors?
 
@mindplay.dk There's no specific IDE (yet, there will be one for Red language that is based on Rebol), but there's support for Rebol in lot of text editors (SciTE, Sublime, lot of others).
 
but just syntax highlighting?
 
8:37 AM
Yes.
But the IDE is in works.
 
how is the language in terms of static analysis? I mean, is there any type information or other static information for an IDE to pick up, to do intelligent things like type-checking at design-time?
or is completely interpreted?
 
@mindplay.dk Rebol is completely interpreted. Red attempts to hybridize this, in ways that I would say aren't fully clear in how much of the "cool stuff" it will break.
 
Rebol is completely interpreted, Red can be compiled.
But there are already tools like Anamonitor that are able to analyze running script, so you can expect something like this in the IDE.
 
@mindplay.dk I'm sort of a formalist and "pin everything" down kind of person. Haskell-leaning modern C++ programmer, basically. Always hated interpreted languages; too little static analysis. Never got that much into Lisp, but I'd say if there's no homoiconicity in an interpreted language I'm not really interested. And I wasn't all that interested in Lisp, just didn't grab me.
 
8:41 AM
Compilation is not a big priority for me, but static analysis is... this is the main reason I still stick with a crappy language like PHP for web development after this many years. I'd love to be programming in something else, but haven't found anything that really works, especially when it comes to views...
@HostileFork I hear ya.
 
@HostileFork You can invoke interpreter at any time from compiled program using simple DO [...], so you won't lose anything.
 
The goal of Rebol is to make creating a DSL so easy that the amount of code to study is less. That the EXE running it is smaller, that the cruft is gone and you can really see what's being expressed.
 
@HostileFork okay, but it doesn't need to be interpreted to do that. Have you seen Nim?
 
@rebolek Except the ability to have consistent behavior between what happens inside and outside the DO.
 
@HostileFork Not sure why you think it's going to be inconsistent.
 
8:44 AM
@rebolek Compiled code that has bound specifically to some implementation of a function won't notice when you reassign that word to another function, for instance.
@mindplay.dk No... but there are many languages I haven't seen. I'm sure they're all very nice, but from a look at it, it's definitely not a superset in terms of the tenets.
My current interest in Rebol is linked through a few incidental/accidental aspects, and then an interest in the philosophy. I happened to use it to do some web scraping at one point, and then continued to do so, and at various points when I've thought of leaving it I simply don't find anything to be suitable vs. just fixing the problems with it.
@mindplay.dk For instance, have you read any about PARSE?
 
parse, in Red?
 
Rebol and Red both have it.
It's a dialect.
 
Looks interesting - yeah, I think that sort of thing is possible in Nim as well... what distinguishes Nim is that it is a systems programming language with no run-time dependencies, but it has syntax features and brevity like a really high-level scripting language. It's interesting, however, it's a risky bet, since it's written and maintained by one guy.
 
Well, we're not too far away from that, but there's been people rotating around through time. :-)
Corporate investments over time, also varied: youtube.com/watch?v=jIw7aRP6JPU
 
8:55 AM
@mindplay.dk Why Rebol, Red, and the PARSE dialect are Cool, old article by me, there aren't so many articles so it's a reasonable one to read.
 
@Morwenn not quite, more like Nim :-)
 
> Why should I be excited?
 
@HostileFork interesting - looks like others things are spawning from Rebol ideas too, seen this?
 
Seems that I will have things to read today, thanks :)
 
@mindplay.dk AH, Topaz. It's not developed anymore, though.
 
9:00 AM
@mindplay.dk I think Topaz has halted with rough belief that some kind of WebAssembly backend for Red or similar is the future, or an emscripten'd Rebol, which we also have but no one's really jumped on promoting.
 
@rebolek oh, well, like most new languages ;-)
 
@mindplay.dk Yeah :-) But JS will one of compile targets for Red, so there will be replacement.
or js.asm I guess
 
Rebol was closed source for about a decade and a half, and people tried making clones, none ever got to the more-than-one-person-using-it state until Red. Boron maybe got to 2.
 
well, you guys should take a peek at Nim maybe - it's probably the most interesting new systems programming language around. I kind of wish the guy would try to get a company to back it, like Google or Facebook, so it could get some traction and some more talented engineers to push it forward. There are a lot of really progressive ideas in it...
 
@mindplay.dk Well no time like the present. Show me something small enough to paste into this chat that you think represents a particularly great thing about Nim.
Something you've written in it, if possible.
 
9:04 AM
My money was on Go for a long time, but they're just not adding the features that would make it comfy to program in. It's a cool language with many nice ideas, but, for one, list management is a PITA, I don't understand how anyone can live with that ;-)
hmm..
well, I'm particularly interested in Nim (or any language) as a web development tool, so... and this is dead, but - interesting:
https://github.com/flyx/emerald
 
proc templ(youAreUsingEmerald: bool) {.html_template.} =
    html(lang = "en"):
        head:
            title: "pageTitle"
            script (`type` = "text/javascript"): """
                if (foo) {
                    bar(1 + 5)
                }
                """
        body:
            h1: "Emerald - Nimrod HTML5 templating engine"
            d.content:
                if youAreUsingEmerald:
                    p:
                        "You are amazing"; br(); "Continue."
                else:
So some things to mention about what Rebol/Red empower, pursuant to recent discussion, is the TAG! string type.
 
and this web framework is interesting:
https://github.com/dom96/jester
really shows the expressive power, I think - DSLs come out really legible, and type-safe.
 
tag: <div id="foo"> is a legitimate assignment.
And what you have done, is you have assigned to the variable tag a "flavor" of string, that you can sense as a unique type.
 
@mindplay.dk I'm looking at Nim description and it looks a lot like what Red aims to be- system programming garbage-collected language with support for concurrency. It's just not there yet :-)
 
So one can tell the difference. e.g. str: {<div id="foo">} would be a string whose first character is <, and last character is >, and whose type is STRING!.
While tag is a string whose first character is d, last character is ", and whose type is TAG!
If you need to print or otherwise output a tag as a string, then the formation process will put the leading < and trailing > into the representation.
You can write a function with polymorphic behavior when it sees a TAG! as opposed to a STRING!. You may think of it as a tinkertoy in dialect design.
 
9:11 AM
oh, this:
https://github.com/nim-lang/Nim/blob/master/examples/tunit.nim#L36
unit testing is awesomely expressive - no assertions necessary, it just picks up any stand-alone expression and makes assertions, prints out the expression and result on failure.
 
@mindplay.dk Here we've already seen a couple of powerful pieces of difference in philosophy. Nim's string literals are as weak as anything else I've seen, and I do not think that the code you've supplied above looks good. It looks like junk. Three quotes here, no "frame". It's skeletal, like you were coding in JSON.
The meat of the language behind it may well be fantastic
But it lacks the beauty.
 
Also, if you are looking for a web-framework done in Rebol, I wrote (and am using) one.
 
Jul 12 at 13:29, by rgchris
See also: Twitter, Etsy, S3...
 
really? I think this is awesomely beautiful - no noise, no ceremony, yet it's packed with implicit static information.
2
 
@mindplay.dk ^-- Look at those API wrappers for Twitter, Etsy, and S3. If you don't like the colors, use D for dark, G for gray, L for light.
(I prefer gray)
Here you see an innovative use of the tag string type. In the header, it has structure. That structure uses the TAG! as a placeholder to tell you where to put configuration information if you don't want to parameterize it. You can just poke in the data for your real options there, and the script will use it.
Not only do these pack a punch, those are Rebol2. We can do better with Rebol3.
(e.g. FUNCTION instead of FUNC, which isn't just a better name, but an interesting twist as function generators go.)
Self documenting, you type help twitter/timeline and you get help reflected out.
@mindplay.dk If you find the source for that Nim code above beautiful, and can't appreciate those APIs, then Rebol is not for you.
Again bearing in mind I'm making no argument about the function of the Nim code.
It may well be that you can map an intention well for everything you meant to say to a point in the code. And you can say "there it is".
 
9:21 AM
@HostileFork I don't know it well enough to say that it is or isn't - primarily, what makes is interesting to me, is that everything is statically typed and open to static analysis, which is really unusual in a language with this little ceremony. That's partially what attracted me to Go, I lost interest primarily because, like, removing an item from a list is like two lines of unreadable junk - I don't know how anyone can live with that ;-)
 
@mindplay.dk Well, if turnkey web stuff is what you're interested in, in terms of little ceremony... there is Uniserve and Cheyenne. I've not studied them in detail for their ideas, but others like it. @draegtun used it recently for something.
As those were from Red's developer, it's likely he will be going in a similar direction again.
@mindplay.dk Another piece of webstuffs... our SO Q&A feed aggregator for this room: reb4.me/r3/so-answers
@rgchris ^-- needs to be updated with your tag trick. NewPath would let you say Feed: http://<feed location>/so.feed with that being a TAG! in a PATH!. Another argument for. :-)
@mindplay.dk Here is the source for the "Why Rebol, Red, and the Parse dialect are cool" article. GitHub doesn't word wrap: github.com/hostilefork/hostilefork.com/blob/master/entries/…
Changes to multi-line strings should make source excerpts fit in the proper indentation level.
Which I could do today, by stripping it, but I want the language to have conventions for it.
@mindplay.dk See also Lest if you're looking for things like your web example.
Or StyleTalk for a CSS language.
But long story short, low odds of static analysis. I suppose you could take my word for it that it's an interpreted language whose other merits make it worth the dive. Like putting away your CAD program and picking up oil paint or clay.
I would not recommend it for doing one's serious web work. The main reasons for a person to learn Rebol pragmatically right now is swiss-army knife tasks; a good self-contained and literate tool for parsing and slice and dice on data.
It's a speculative experiment, that tries to give one moments of "well I've never seen that before..."
In a language of any size. And a goal toward having every character and word on screen be "pleasing".
(At least, I care about that, which is why I'd like to see rejoin and remold and funct monstrosities go away.)
 
9:43 AM
@HostileFork "I would not recommend it for doing one's serious web work." - why? Lot of people are using it for serious web work.
 
@rebolek You are free to recommend it. :-) I say "for one's serious web work" because if you're talking about time value of money, the benefits do not currently outweigh the disadvantages. It's not about whether it's possible or not, it's whether the general frustration of that is outweighed by the support/stability/etc. of other solutions.
Cheyenne having stalled on development, only running in Rebol2, etc. etc. leads me to discourage it for anyone but die-hards who like Rebol for other applications.
 
@HostileFork What disadvantages?
 
@HostileFork I think I'm too far gone to go back to interpreted ;-)
 
@mindplay.dk Then go to Haskell and stop mucking around.
Install Yesod and read a book.
 
@HostileFork also, I started out in my formative years learning Pascal as my first real language, so I have had a good understanding of static.
Haskell :-D
yeah :-)
 
9:46 AM
Everything else is wasting time...
 
hahaha
but sursly tho. Haskell. :-D
 
@mindplay.dk If you have spare spin cycles to spare and want to learn the mechanics of something new, that can happen here. "A language that doesn't affect the way you think about programming, is not worth knowing."
 
From a purely academic point of view, I totally get Haskell - but as a practical programming language, I mean... it's one of the most unreadable languages still alive in the wild ;-)
if the only thing I cared about was being "technically correct", Haskell or Clojure would be it for me ;-)
 
Depends. If you don't speak English, it's more readable than most.
 
you mean, if you're a mathematician ;-)
(I'm not.)
 
9:50 AM
Programmers, like mathematicans, are interested in solving puzzles for yet to be invented answers. This leads to both honour and exploitation.
 
To a mathematician, I bet this is the most awesomely legible language ever. Perhaps the only right language even.
To developers solving more than theoretical or mathematical problems, I think something more legible is required...
 
I don't know if I find it all that opaque in its own right. It's simply that there is a mapping between what I mean to say and the Haskell program to do it, and the penalty/cost of performing that mapping must be outweighed by the importance of that task and the likelihood that compositional coherence is needed.
Haskell is about that question of "well, what part of your system do you want to break if a requirement changes?" and the answer is "I don't want any of them to break ideally, but I'm only willing to accept a certain cost for that."
 
Automated refactoring and other static analysis tools answer a lot of that in languages that are more readble, I think?
And if so, I'd rather go with a readable language, and let the machine suffer the burden of parsing code intended for people to read - it can do so more effectively than I can parse code intended for the machine.
 
@mindplay.dk Well, you're talking to someone who worked on this and in that sense I don't even believe in representing programs as text. Give each declaration a UUID, link with an editor, project the code out from that. Change the name of a variable referenced millions of times...even in documents not on your machine...generate no merge conflicts unless someone else edited the name of the variable.
Why parse at all.
So if I'm going to bother with text, it better be darn good text.
@rebolek You have to be very much a self-starter, and the people who support the technologies may or may not have time for that support. I doubt DocKimbel is going to make a lot of time on his schedule to stop working on Red and help people with a Cheyenne installation. On a point under your control: note that Lest's homepage has a commands link that doesn't go anywhere. So, these are among the disadvantages that you won't have with something like Django or Rails, and even Node sort of.
And I'm not joking about the Haskell thing, they've got that under reasonably good control too with Yesod.
 
10:11 AM
@HostileFork you have to understand, having written a paper on that, puts you at a level of understanding far above where 90% of developers could even understand what you're talking about. It's great in theory, but it practice, we have shit that needs to get done, and we need programmers, now, not in 10 years when they're done taking a really advanced education :-)
@HostileFork the real challenge for people like you, is to figure out how to take these qualities and make them accessible to Mortal Developers ;-)
 
@mindplay.dk Trying to make Rebol that. :-)
 
@HostileFork go, man, go! :-)
 
If you're willing to take off the "no interpreter" bias, then I think you could find entertainment in it, if nothing else. Some entertainment from putting my improv classes to use:
 
11:05 AM
 
 
2 hours later…
12:44 PM
I guess that I have decided that optional arguments being NONE, as opposed to unset, is okay. While it is true that using unassigned variables gives you an unset in the console, at least one can reason that arguments to a refinement have been named. That is a point of distinction which makes being able to access them and get a none more "reasonable"
And it seems from practice and usage that people like it how it is, so you don't have to "disarm" the unset-ness of an unfulfilled parameter. It'll probably lead to some errors, but the additional concerns to avoid them makes code ugly, and the errors are likely not that severe/common.
However, one thing we could do would be to assume you don't take NONE! as a type for refinement arguments by default. That would prevent accidentally conflating cases of not getting the parameter at all with being passed NONE purposefully.
The proposition of benefit there being that foo/bar none (with none being the argument to the bar refinement) wouldn't allow code inside the function to have been written assuming that the none-ness or non-noneness of the refinement arguments was enough to tell if the refinement had been supplied... it would be forced to confront a test of bar to realize it had been given.
Unless you changed the spec to foo: function [/bar [valid!]] [...] (Where VALID! was the interim name idea for the typeset of "as long as it isn't UNSET!")
 
1:06 PM
posted on August 02, 2015 by fork

[Wish] Currently, a refinement's arguments will be NONE! if they are not supplied. So the following is legal: foo: func [/bar param] [ if param [print "Got the param."] ] It's more convenient than UNSET!, which is harder to handle. Were they UNSET!, it would mean that each attempt to use a refinement argument would first have to test the refinement itself: foo: func [/bar param] [

 
 
1 hour later…
2:35 PM
@HostileFork Some could be reused for awesome dubstep chiptune music *-*
 
 
3 hours later…
5:22 PM
Touching on the tag! discussion (sorry for the fleeting appearances): I'd be adamant that we don't end up with a natural tag type where you can't express things that markup (and pre-processor) tags commonly do. Seems each counter-proposal to my suggestion makes uneasy (to my eyes) compromises. Would rather have the status quo.
But would prefer a more nuanced approach based on commonly used tag patterns.
 
@rgchris I think the <% > %> and <!-- ------> --> show a clear line of demarcation with me, as "no."
 
Unrelated: the idea that you can compose a tag is cute, but I'd see two problems: 1) context, and 2) even with a very conventional tag, you can get parenthesis that are meant to be there: <a href="https://en.wikipedia.org/wiki/James_Joyce_(rugby_union)">
 
That would be protected by the quotes, under the theory.
 
@HostileFork <%= a > b %>
 
Same category.
Not interested
There's a lot of junk out there in the world, no need to be part of it.
There should be a way to make any tag content you want. It doesn't have to be "beautiful". The mission cannot be expanded to "keep PHP beautiful when embedded without escaping in Rebol code".
 
5:30 PM
It's a fair point that it's not a pretty piece of code, but I'd say there's value in supporting it where the cost is minimal.
 
It already isn't beautiful. What's an escaped ^> going to do to hurt that?
It's not a minimal cost.
While you've come up with a number of clever applications of tag naturals, and that's fine and well, we must also know when to draw the line and say "use a string like you would elsewhere"
 
Well, can't say I haven't expressed an opinion on it.
 
Won't say that. :-)
One of the things that I think kills Rebol is that there's this spirit and impression that it's magic when you see it at first, and then it falls flat as "not much there". TAG! is one of those things that I found exciting at first and then went "wait, it's...just a string?"
It is impressive how even that small wedge can be used; which points out just how un-expressive most languages can be, in terms of the look of the code.
In any case, I am interested in seeing ways that TAG! might grow to more of a purpose or differentiator. Because if people say "you're giving me nothing I can't do in my language with t("<div>") they're going to be over it very quickly and wondering why the rest of the system falls apart.
So SuperTAG! is in that vein of "I'll bet your language can't do THIS!"
 
6:17 PM
@ShixinZeng , can you describe the steps needed when using your cmake branch?
 
@rgchris If we go to an interpretation where a space followed by a greater than or less than cannot alone close a tag, and a tag can only be closed by a non space character followed by a >, then that could be another angle.
 
@HostileFork Hey, I found the time to benchmark my sorting algorithm :)
 
I'm not sure what that would imply for <sometag symbol=">">. Aesthetically I'd prefer to say that the "> closed the tag and then it was an error.
@Morwenn Related topic, if you've never thought about the issue: "Psychic" sorting algorithms
 
@HostileFork Let me read that ^^
 
Well the only new information is going to be the table of numbers.
If you haven't seen it.
@Morwenn ...strange graph. You'll need a stable_sort too...
And cutoff at 35-ish or so I guess.
 
6:34 PM
@HostileFork Well, my benchmarking isn't that good...
Well, above 32 elements, it falls back to std::sort. That's pretty clear from the graph.
 
@Adrian Are you getting build errors? What are they?
@Morwenn Er... not entirely clear. Odd spikes. You're not testing on a simulator?
Benchmark on a simulator first.
 
@HostileFork I generally don't do benchmarks. So I don't know how to have stable results.
Well, by "clear" I meant that the blue line goes from "always faster" to "always as fast?" :)
 
@HostileFork That was an interesting read :)
 
It was an outgrowth of me starting trying to explain how sorting comes from leveraging the transitive property to someone, and getting partway through trying to derive it and going... wait a second...
"Hmmm. How ... what's the theoretical lower bound on a sort?" I had expected it to be an obvious formula.
 
6:43 PM
Aaaannnnd, you wrote an article. So much like you ^.^
 
Might as well.
 
6:59 PM
@rgchris For your purposes, how is TAG! that cannot start or end with ' ', '=', '~', '<', '>'...may not start with ')', ']', '}'...may not end with '(', '[', or '{'...
A tag terminates when any of the non illegal ending characters is seen with a > after it.
This would permit <% > %> and <% => %>, but not <% -> %>.
I'm wary to allow <% ">" %> on the basis that "stay in the tag if the thing after the > is not a space" due to the shaky ground it puts you on with (for instance) ">), because then you've got an otherwise legal tag character of ')' being illegal. Same for ] and / and such. It feels messy to get involved with it, and it also feels messy with so much 'lack of interpretation' to try and go in on the quotes.
My "if and it's a big if" is that it's either SuperTAG! or "basically just a string" tag. For "basically just a string" tag it should be hands off with quotes interpretation.
 
@HostileFork Interesting angle, in this write-up.
@HostileFork I take it you are in fact aware of the theoretical lower bound of comparisons for a comparison sort?
ceiling of log2(n!), that is.
 
Yes, bound. I meant "minimal number"
the "in theory" part being "if you could theoretically wrote a perfect sort that made the lower bound, what would that number be".
Perhaps not previously realizing that the bound being expressed vaguely instead of precisely as a function of N was because the number is dodgy.
As in "I thought that 'bound' was the number / limit"
(Which is to say, before writing that article, that is what I thought.)
 
7:14 PM
It basically is the limit, the rest is "rounding" :)
The exact minimum number of comparisons required in an actual sort implementation is always at max +1 to the ceiling of the bound, for the known (so far) minimum-comparison sorts.
The other interesting aspect is, that I thought that std::sort was a sort known to be notoriously underperforming, esp for smaller lists. Not that your "heavily peer-optimized" exactly implies that you thought otherwise, but still.
Would be interesting to compare the results with Python, or another Timsort user.
 
std::sort implementations either use an hybrid introsort (libstdc++) or a pattern-defeating quicksort (clang++).
 
Wasn't aware std::sort would be underperforming in this day and age.
 
MSVC's implementation might be slower.
 
I tend to trust people have that kind of thing covered, but perhaps not.
 
Timsort is excellent when there are patterns, but not so good for shuffled values.
By the way, which sorting algorithm does Rebol use?
 
7:25 PM
So GCC 5.2.0 and Clang 3.6.2 (still need to check if Clang is using LLVM's libcxx, or GCC's libstdc++) give me the exact same comparison counts as in your article.
@Morwenn Bentley & McIlroy's Quicksort.
 
@Morwenn Yes. But as mentioned above, we are using very small lists here. N<17.
So Timsort should run purely as insertion sort in these cases, IIRC.
 
@earl Nope, these are for arrays of 1000000 elements here.
"Sorting 10^6 elements"
 
@Morwenn Talking about HF's article.
 
@earl Oh, sorry. My mistake then.
Well yeah, timsort, introsort and pattern-defeating quicksort all fall back to insertion sort for small values.
My sorting algorithm uses sorting networks for compile-time small values then falls back to std::sort. If using Boost was ok, I could have it fall back to Boost's spread_sort which also falls back to std::sort when the collection is not large enough. That would make for a 5-level sorting function :D
 
7:35 PM
@Morwenn Heh :)
For  1 items: 'Minimum'  0, Python  0, C++  0
For  2 items: 'Minimum'  1, Python  1, C++  1
For  3 items: 'Minimum'  3, Python  4, C++  4
For  4 items: 'Minimum'  5, Python  6, C++  6
For  5 items: 'Minimum'  7, Python  8, C++ 11
For  6 items: 'Minimum' 10, Python  9, C++ 16
For  7 items: 'Minimum' 13, Python 14, C++ 18
For  8 items: 'Minimum' 16, Python 17, C++ 23
For  9 items: 'Minimum' 19, Python 20, C++ 29
For 10 items: 'Minimum' 22, Python 21, C++ 24
For 11 items: 'Minimum' 26, Python 27, C++ 31
For the lists of numbers HostileFork's C++ code generates.
 
The comparisons made by my library are between these two (always fixed, whatever the input). That said, I didn't write the algorithms; I generated them.
Sorry, I mistook "Minimum" for "Python". My library has an average number of comparisons a bit smaller than Python.
Well, only for the smallest inputs actually. I have more comparisons for the bigger ones.
 
7:52 PM
Here's the quick Python hack I whipped up: gist.github.com/earl/92184df75bfe7173eb61
Also contains the exact lists of numbers both C++ and Python ran over.
(And to confirm something from earlier: yes, my Clang build was not using libcxx but libstdc++.)
 
Hmmm.
 
The question is: how does it less than the minimum?
 
@earl As I am doing something else, can you explain how Python compared fewer times than the minimum?
Yes, my question
 
@HostileFork Taking advantage of pre-sortedness, I assume.
 
You have to compare to know that it is pre-sorted.
 
7:59 PM
But not 42 times for 15 items.
 
I do not know what that means.
 
You write about this just as well.
How many comparisons do you need to sort this list: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]
 
Oh well, of course. The minimum is like a minimum upper bound.
 
Okay, so it lucked out and was somewhat psychic
Haven't focused on this for a while
 
The number of comparisons is bounded by the Shannon entropy in the list to be sorted.
 
8:03 PM
Well. Then it's time to take a shower.
 
:)
@HostileFork "Lucked out" just about nails it :)
And to make this a bit more on topic, "sortcount.reb" added to the Gist: gist.github.com/earl/92184df75bfe7173eb61#file-sortcount-reb
Here's the results with a fresh Ren/C build:
For  1 items: 'Minimum'  0, Rebol  0, Python  0, C++  0
For  2 items: 'Minimum'  1, Rebol  1, Python  1, C++  1
For  3 items: 'Minimum'  3, Rebol  3, Python  4, C++  4
For  4 items: 'Minimum'  5, Rebol  5, Python  6, C++  6
For  5 items: 'Minimum'  7, Rebol  8, Python  8, C++ 11
For  6 items: 'Minimum' 10, Rebol 12, Python  9, C++ 16
For  7 items: 'Minimum' 13, Rebol 10, Python 14, C++ 18
For  8 items: 'Minimum' 16, Rebol 21, Python 17, C++ 23
For  9 items: 'Minimum' 19, Rebol 24, Python 20, C++ 29
 
@earl Any good reason not to just do whatever Python is doing?
(Other than the "not really a priority" part.)
 
@HostileFork Lots of code. But now that we don't even rely on the standard libc qsort anymore, not really, no. Just needs someone extracting it.
Maybe that extraction is even already mostly done, given that others are now using Timsort as well. Haven't looked at it in a long while.
 
8:23 PM
Well, let's put it in the infinite queue.
 
8:48 PM
Should not be too hard to adapt it to C.
 
>> collect [loop 3 [keep ()]]
== [unset! unset! unset!]
Should COLLECT maybe ignore UNSET!s?
(We'd already have a KEEP/only, which we could use to toggle UNSET!-keeping.)
Compare with e.g. MAP-EACH, which drops UNSET!s:
>> map-each x [1 2 3 4] [either even? x [x] [()]]
== [2 4]
@Morwenn Looks good, thanks.
 
@earl I'd say NONE should require an /ONLY as well, a rule I'd like to see applied more pervasively. Not just in COMPOSE and COMBINE (join) but elsewhere as well.
append [a b c] if 1 > 2 ["this won't append"] => [a b c]
So keep seems a candidate as well.
If you wanted the word NONE you would have to literal it anyway (or have it in a block), and putting value nones in blocks is kind of dodgy.
 
@HostileFork On the fence about NONE! (I think I have good use for that regularly), but pretty convinced about UNSET!.
 
9:03 PM
You can regularly use /ONLY then. Keep doesn't evaluate its argument.
 
No need for keep to evaluate in keep none.
 
What I mean is, keep/only doesn't change its character to where passing in block arguments will behave differently.
 
@HostileFork As blocks are one of our primary data structures, and none is our primary "missing value" value, I'm not sure what's particularly dodgy about nones in blocks.
 
Well they will need to be rendering as # or similar, because the classic #[none!] shows as none is awful.
I've campaigned against the pattern of things like compose [foo (either condition [...] []) bar] when you could have said compose [foo (if condition [...]) bar], and I see most of these things as being in the same class. BrianH insists that putting NONE! values is a chronic need, yet it's a chronic need I somehow need very rarely.
He has endorsed /ONLY as a good solution for the above.
 
As a matter of fact, in this very moment, I'd actually be at an advantage if NONE!s were dropped silently as well.
It is so rare an occurrence, that I'm tip-toeing around how to express what I want most cleanly.
@HostileFork I'm fine with having some additional and better templating tools in the box, which ignore NONEs. I'm not so convinced about the basic building blocks such as APPEND.
On the other hand, as a long-standing sceptic about the utility of UNSET!, this proposed move of NONE! towards more UNSET!-like semantics gives me a feeling of validation.
(Because: if NONE! is so much the same as UNSET! in many practical circumstances, why again do we really need both?)
>> append [foo bar] ()  ;; Current R3
== [foo bar unset!]
 
9:14 PM
Silent vs. noisy failures on the attempts to use a result of a function that has no result, mostly, I guess.
Probably arguments either way.
append [foo bar] (either condition [blah blah 1 + 2] [print "No, we will print"])
Would the world be that different if it were [foo bar 3] or [foo bar] vs [foo bar 3] or error?
Is one world of notably greater quality?
accessing a nonexistent variable should give you trouble, but you can unset a variable without having an unset value
 
Eliminating the notoriously irregular unset! datatype as something externally visible would certainly have a quantifiable quality in my eyes.
@HostileFork Better: [foo bar "No, we will print"]
But I guess I have to come up with a reasoned account for this unset-unlike one day. Maybe it'll turn out to reconcile myself with unset.
 
That has a cost; if you are asking the printer to generate a value for all clients.
It can't chunk its output, has to build a whole string.
 
@HostileFork Certainly.
Ah, you can still chunk your output. Depending on if you always return a string, you'd just have to also keep your chunks around.
But I'm not necessarily suggesting that it should always return a string. Can just return the value that it was passed (like e.g. PROBE).
Still has a (potential) cost, of course.
Can also ultimately return just NONE, if that's deemed the best cost-benefit ratio.
And now that the sentences are getting less and less coherent: have a nice one. L8r.
 
Later...
 
 
1 hour later…
10:55 PM
Well, reviews or non-reviews aside, I think the error overhaul has to go in for progress to continue. I went through all the tests and fixed things that had gone awry, so it's better than it was when I asked after the general "putting it in and having it not crash" in testing. If there are mistakes in it, people can still read that isolated unit and perhaps find them.
But the next review, if there is any, will need to be of StableStack.
 
11:52 PM
I changed the benchmarking method. The results are much more consistent now.
 
Looks better.
As for me... taking a break from the mean computer for a while. But I'll be back to fight later.
 
I makes it pretty clear that std::sort is used above 32 values and that the specialized algorithms are more efficient otherwise :)
I'm ready to go to sleep anyway. See you later ^^
 

« first day (1736 days earlier)      last day (2044 days later) »