r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Tech News] Interesting technology

btiffin
9-May-2007
[2191]
For a POSIX layer of Icon with easier TCP, check Unicon
http://www.drones.com/unicon/
JaimeVargas
10-May-2007
[2192]
Brian, Do not worry. I put Scheme, ML, Rebol, SmallTalk and Icon 
in the fringe category. Java, Python, Perl, C, etc are not fringe 
for me.
btiffin
10-May-2007
[2193]
Thought so.  :)  Just had to be sure.  For me fringe always means 
'requires an
uncommon form of thinking' leading to low adoption rates.
BrianH
10-May-2007
[2194]
I used to use Icon as well, mostly for the things I use the REBOL 
parse dialect for now.
btiffin
10-May-2007
[2195x3]
Where I see REBOL, scripting will always be the domain of the computer 
programmer,

but the data model is so close to being the domain of everybody, 
I think we are one
small (yet huge) step away.
Icon is an awesome learning step for anyone thinking of languare 
design.  But it does
require being 'smarter than the average bear'  :)
Brian;  Cool.  I'm still in BooBoo land when it comes to parse, but 
I can read and mod
dialects now.  Just not ready to write one.  :)
BrianH
10-May-2007
[2198]
It was harder to debug Icon than any other language I've used. Not 
because the language required you to be smarter, but because error 
handling was badly designed. It always seemed ironic to me: In a 
language where "failure" was the name of a common control flow, real 
failure wasn't handled very well.
btiffin
10-May-2007
[2199]
True...it could get pretty hairy, tracking the backtracking .
BrianH
10-May-2007
[2200]
I never had any problem with the backtracking - that's where much 
of my understanding of PARSE control flow came from. The problem 
came when there was a real error, not an expected "failure", and 
it just backtracked like normal or worse, ignored it.
btiffin
10-May-2007
[2201]
Brian;  That's because you seem to be accepting of 'uncommon forms 
of thinking'.  :)
BrianH
10-May-2007
[2202]
Ain't that the truth :)
btiffin
10-May-2007
[2203x2]
Like most rebols...
I'm still going to push for LOAD/RELAX.  It'll help make UIs that 
construction workers

can feel empowered working with.  I've seen it.  A boss typing his 
own data in 

notepad, they get a real sense of being in charge, and not lead by 
the nose...Boss

type personalities like to feel in charge of their surroundings. 
 No other language I've
seen even comes close.
BrianH
10-May-2007
[2205x2]
I still prefer the opposite. Did you see the discussions we had on 
the blog? If you modify my proposal for the additional parse operation 
in the way Volker suggested, by getting rid of the LOAD keyword, 
you can unify the block and string parse dialects. That way you can 
leverage the REBOL loader right in your parse rules but still fall 
back on string parsing if that doesn't work.
And by fall back, I mean backtrack in the Icon sense.
btiffin
10-May-2007
[2207]
:)  It's why I mentioned it...  I like that approach...but I'd still 
like to be able to explain

the scripts I write (in front of bosses) without going too techie. 
 Maybe we'll get both :)
BrianH
10-May-2007
[2208]
Do you have to do a line-by-line explanation, or can you give an 
overview?
btiffin
10-May-2007
[2209x3]
Both.  Line by line for the simpler, then I'll code a few lines and 
wait to see if they ask
what the sequence is doing.
It puts them in a very comfortable zone and in a head space where 
they can think
about and request very specific options and outcomes.
And I don't have to write UIs that don't attack the problem at hand 
(their problem at
hand, not the one I the coder nerd might be thinking).
Anton
11-May-2007
[2212]
Btiffin, from previous discussions, I'm probably with BrianH on this 
one. But I'd like it if you could come up with some scenarios from 
real life. Then each of us could try our approach to solving the 
problems and compare.
Volker
11-May-2007
[2213]
load/relax can be written based on this: http://www.rebol.net/cookbook/recipes/0042.html
;)
btiffin
11-May-2007
[2214]
Volker; Not sure.  This type of thing happens when bosses type their 
own data...They

don't really really need to type their own data, but it empowers 
them.

10-Mar-2007 $12,002.34 "Home Hardware" "Tile Saw"
1--Mar-2007 $12002.34 "Home Hardware" "Tile Saw"


It's the fact that REBOL "knows" it's a syntax error, that got me 
to thinking about 

gibberish! or the invalid? test in the first place.  I'd like to 
be able to show the user

where the data failed, call notepad and let them try again.  Now 
I just say
try again
 and call notepad,  can't help them much.
Volker
11-May-2007
[2215x3]
text: {
10-Mar-2007 $12,002.34 "Home Hardware" "Tile Saw"
1--Mar-2007 $12002.34 "Home Hardware" "Tile Saw"
}
parse text blk-rule: [
    some [
        str:
        newline |

        #";" [thru newline | to end] new: (probe copy/part str new) |
        [#"[" | #"("] blk-rule |
        [#"]" | #")"] break |
        skip (
            either attempt [
                set [value new] load/next str
            ] [
                probe :value
            ] [
                new: find str " "
                print ["GIBBERISH" copy/part str new]
            ]
        ) :new
    ]
]
based on that you can build your own load (add code to collect stuff 
in blocks) and add "spellchecking" in the gibberish-part.
ml-contest, smartest loader? :)
btiffin
11-May-2007
[2218]
Cool...
Gabriele
14-May-2007
[2219x2]
Jaime, (f a b) *must* be quoted or be in a quoted list (maybe using 
the "funny" way of quoting available for macros ;) for it not being 
a function call.
Jaime: you can write a REBOL interpreter in C but you can't compile 
REBOL to C. You can compile Scheme to REBOL but you can't compile 
REBOL to Scheme. The conclusion is that there is something in REBOL 
that Scheme lacks. If you make a language X that has the same features 
as REBOL, then it becomes easy to compile REBOL to X (X will need 
to be an interpreter - well, always assuming you don't have a special 
CPU that can make REBOL compilable).
Pekr
14-May-2007
[2221]
Gabriele - isn't it in fact big defficiency of Rebol, that it can't 
be compiled? That way we are one level slower than others, forever, 
no? :-) well, I probably oversimplified it few bits :-) I suspect 
that is the price for the ability to have self modifying code, but 
if I understand it correctly from what Jaime says, Scheme or Lisp 
are self-modifying too, yet those can be compiled .... Where is the 
difference? Any simple clarification for non low-level language person 
like me?
Gabriele
14-May-2007
[2222x4]
rebol is not compilable because it can express things that a compilable 
language cannot express.
if you are willing to give up the advantage in expressivity, you 
can just use a compilable dialect and compile to rebcode or even 
C etc.
also keep in mind that 90% (or maybe even 99%) or rebol scripts that 
people write could be compiled, as they don't take advantage of 100% 
of rebol
(but I guess that 80% of my scripts are not compilable ;)
Volker
14-May-2007
[2226x2]
hotspot can compile code which changes later, so i am not conviced 
:)
i think self and its "childs" could do it.
Anton
14-May-2007
[2228]
Err... most of my code surely cannot compile either :)
Gregg
14-May-2007
[2229]
Remember, too, that REBOL is not first and foremost a programming 
language. If that had been the main goal for REBOL, I have no doubt 
that Carl would have designed it to be compilable, and probably provided 
a compiler from the beginning.
BrianH
14-May-2007
[2230]
I still think that most of my code is compilable - you just need 
to think about the semantics in the right way.
Volker
14-May-2007
[2231]
Its compilable if some of the info is gathered on runtime IMHO. Maybe 
with the option to switch back to the intepreted code, to solve gabireles 
changed 'if.
BrianH
14-May-2007
[2232x2]
One of the tricks you would need is to realize that there is no "REBOL" 
language. Each dialect is semantically a seperate language, with 
a different execution model. You can't treat REBOL data as a particular 
dialect until you know which one, and you often don't know until 
runtime. Because of this you would have to compile at runtime, or 
at least function build time. Any attempt to compile ahead of time 
would change the semantics, in a similar way to how prebol does.


Even at runtime the semantics would be different, but not as different 
as you think. Few people realize that while the DO dialect looks 
a lot like a Lisp or Scheme clone, its underlying semantics are quite 
different - and yet they still are able to program in REBOL just 
fine. You could change the underlying semantics to a completely different 
model and keep all but the most guru of programming similar enough 
that most people won't notice the difference. The only main change 
would be to make the code blocks of compiled functions unchangeable 
once the function is built - so no more patching running code.
Don't expect too much of a speedup though. REBOL is really fast already, 
and runtime compilation has some overhead itself.
Volker
14-May-2007
[2234x3]
Yes, compilation must be done on block-level, and preferably after 
the block has already been interpret. to find function-boundaries. 
but self could go half as fast as c, and hotspot even faster. while 
switching back and forth between compiled and interpreted code.
and for scripting there would be a slowdown, except if the vm could 
store the results of the compilation as exe, with the original interpreter-code. 
kind of quick loadable memory-dump.
(dont ask me how that works, i only know some system can do it)
btiffin
14-May-2007
[2237]
Volker;  Thank you.  Your parsing data code made me and REBOL look 
like heroes

today.  :)  Another happy boss, less afraid of his computer.  We 
all win.  Thanks!
Oldes
14-May-2007
[2238]
I really would like to see some of my functions compilable, using 
rebcode or something else... Since I'm now working on a new version 
of my rebol/flash dialect, I found very difficult to bind functions 
into another (recursive) function's context. At this moment I still 
have to define these "inside" functions in the recursive function 
always when I call it, so it must be slower. Maybe it would be enough 
form me, just to have some more easy and fast way how to get such 
functions into specified context. But maybe I just have bad approach.
JaimeVargas
14-May-2007
[2239x2]
(f a b) *must* be quoted or be in a quoted list (maybe using the 

funny" way of quoting available for macros ;) for it not being a 
function call." This is simply not true. Not with syntax-case macros. 
You need to know that Scheme Macro system is different and a lot 
better than the one used by lisp as pointed by the article.
See example 6. That introduces a macro for setters and getters, and 
depending the position of the variable it behaves one way or another.