World: r3wp
[rebcode] Rebcode discussion
older newer | first last |
BrianH 15-Oct-2005 [372x2] | Yeah, with braw I wasn't concerned with the 2 opcodes you would have to add before any call to braw to make it usable; I was more concerned with actually being able to get the address offsets to compute with without having to write a compiler (which I am going to do anyways, just not right now). That was why I came up with that HERE assembler directive. |
Still, an absolute braw would take less than half the time that using a relative braw takes when you have to compute those offsets. | |
Pekr 15-Oct-2005 [374x2] | Have you tried to communicate that with Carl? |
BrianH - you seem to be skilled in that area. What speedup do you think compiling rebcode could achieve? And - how large the compiler would be? | |
BrianH 15-Oct-2005 [376] | Gabriele says he relayed my concerns, but the rewrite of fix-bl hasn't been incorporated. Sounds like Carl hasn't agreed. |
Pekr 15-Oct-2005 [377] | then there must be some reason :-) let's wait for an explanation. IMO Carl is opened to suggestions ... |
Rebolek 15-Oct-2005 [378] | rebcode12 added GLT (a < b < c) and GLTE (a <= b <= c). It's nice to have intervals, but in practice I use intervals that are open from one side and closed from second side or vice versa, i. e. (a <=b < c) |
BrianH 15-Oct-2005 [379x3] | As for how large the compiler would be, it depends on the source language and how ambitious you are. If the language is REBOL-based, then at least I don't have to write a lexer. It would depend on what kind of optimizations you want to incorporate and how static you are willing to make the language dialect that you want to compile. Type inferencing would add a lot too, but would have a major benefit when translating from a dynamic language like REBOL to a static one like rebcode. |
Parse would help a lot, obviously. | |
Carl is open to suggestions when he has time to hear them. He is very busy, and niether he nor Gabriele have suggested I contact him directly about this. | |
Pekr 15-Oct-2005 [382] | ah, you talk about separate compiler? I thought you will just JIT rebcode? |
BrianH 15-Oct-2005 [383] | That's Carl's job. A job which could make rebcode twice as fast to be sure :) |
Pekr 15-Oct-2005 [384] | where in rebol such stuff as JIT belongs? Would it be just a function you would point to a rebcode code? |
BrianH 15-Oct-2005 [385x2] | In theory, it would be an implementation feature of the rebcode VM. Now that you mention it though, there are a few JITs that can be called as a library, such as libjit, LLVM and libtcc. If you took the finished rebcode code block you could translate it to one of their intermediate languages and have them translate it to native code. Sort of like a to-native function. |
The apply and do opcodes wouldn't survive the trip though. | |
Pekr 15-Oct-2005 [387] | hmm, but then you just will have few helper funcs in rebcode to speed your code execution here or there. OK, so you produce JIT using some external library, but how you link it back to rebol? (maybe wrong question not understanding properly how this stuff would work :-) |
Volker 15-Oct-2005 [388] | Rebol would have to provide better hooks. To access rebol-values directly. |
Pekr 15-Oct-2005 [389] | yes, that might be the interface I asked about last time Carl was here. He told me he planned to provide API to rebol internals, but he told something like it could become complex (even security was mentioned iirc) and that rebcode replace it, so .... |
Volker 15-Oct-2005 [390] | Starting with a c-compiler as "jit" would make that easy (sharing includes etc). And an extra speedup *30 is nice. |
Pekr 15-Oct-2005 [391x3] | Look at the Tuesday discussion here with Carl, few interesting notes (it was related to how plug-ins were planned) ... |
ok, but how would you translate rebcode to C? Hmm, maybe it would not be so difficult, it is somehow between the assembler and C anyway :-) | |
btw - is there any cross-platform, small C compiler eventually? so that we could create kind of "module/component/plug-in" later and have it included? :-) | |
Volker 15-Oct-2005 [394x2] | Right. WOuld be nearly another kind of markup for most things. This computed gotos may not work, but the rest should. |
tcc, even available as library. But x86 only afaik. | |
Pekr 15-Oct-2005 [396] | so you could e.g. convert rebcode to dll and redirect the call, to get native C level speed? Hmm, sounds like there are some options for the future :-) |
Volker 15-Oct-2005 [397x2] | Yes, that would be possible. Similar to doing it with a jit, only slower compilation and bigger compiler. |
Butmost easy to start with IMHO. Once it works, Carl cant resist to beat it with something own anyway :) But not really possible without access to rebol-values. | |
BrianH 15-Oct-2005 [399] | Volker, you wouldn't need to provide hooks if you pass those values as parameters. |
Pekr 15-Oct-2005 [400] | I wonder if there would be someone so insane to try convert rebol interpreter iself into rebcode :-) |
Volker 15-Oct-2005 [401] | But we are talking rebcode, and rebcode can do more. for example you can write a forall in rebcode, but not with routines. |
Pekr 15-Oct-2005 [402] | ... hmm, that would be slower after all, forget that .... |
Volker 15-Oct-2005 [403] | I guess Carl will be that insane, one day, in hollydays. :)) |
BrianH 15-Oct-2005 [404] | Pekr, that's the compiler I was thinking to build :) |
Volker 15-Oct-2005 [405x2] | I guess Pekr did not mean to compile rebol, but to have a real interpreter, as the one which is now in c. |
or? | |
Pekr 15-Oct-2005 [407x2] | Volker, I know, but some time ago I though that e.g. you have rebol block for e.g. and I thought that there might be some api, kind of DOM, so that from C library, you would access it via such structure and you would manipulate rebol datatype value directly |
I e.g. did small dll some time ago to do some histogram etc. stuff with image. Image is easy - four bytes of values per pixel - worked well, but I modified binary value directly. Now imagine how would you work with rebol block in C level eventually :-) | |
Volker 15-Oct-2005 [409] | Yes, that is what i would want too. then you can jit rebcode with a c-compiler. |
BrianH 15-Oct-2005 [410x2] | Volker, I've heard that some people are trying to make tcc portable (to ARM so far) but they aren't that far yet. |
That's why I suggested LLVM. | |
Volker 15-Oct-2005 [412] | AFAIK AmigaDE has good compilers for various cpus, around 40k. But that means money. |
BrianH 15-Oct-2005 [413] | Or for that matter, Mono is available as a library, and you can access the .NET runtime that way too. |
Volker 15-Oct-2005 [414] | Or java. Problem with that is, they are not optimized for unions, and rebol depends on them. |
BrianH 15-Oct-2005 [415] | Oh well, now that there is an official (alpha) release of rebcode, I submitted my HERE directive to RAMBO. |
Volker 15-Oct-2005 [416] | But Carl said once, a good jit like ADE would take him a month. Now if we can put him that long on vacation.. :)) |
Pekr 15-Oct-2005 [417x2] | BrainH: use RT Q & A group here, that might be faster :-) |
hmm, but most of that stuff is several times the size of rebol itself :-) | |
Volker 15-Oct-2005 [419] | Jump on Gabriele when he shows up.. |
Pekr 15-Oct-2005 [420] | Isn't there really a stuff like 40KB, free, crossplatform, so that we could have it "onboard"? :-) |
BrianH 15-Oct-2005 [421] | I tried that. It only worked with things they were already working on. Gabriele and my sleep schedules have very little overlap :( |
older newer | first last |