World: r4wp
[#Red] Red language group
older newer | first last |
DocKimbel 12-Sep-2012 [1631] | BTW, I might also post soon a description of a redbin format (similar concept as Carl's rebin). The overhead and footprint of the Red boot script (loading all the words and their values) is not negligeable, so I may switch to redbin option sooner than later. |
Pekr 12-Sep-2012 [1632] | Was rebin ever implemented? |
DocKimbel 12-Sep-2012 [1633] | I don't remember reading that it was ever released, so probably not. |
Henrik 12-Sep-2012 [1634] | I don't think it was. I remember the last talk about it was back in 2004. |
Jerry 12-Sep-2012 [1635] | Rebin!!! I mean Redbin!!! Great! I wanted it when I was trying to implement a simple DBMS using REBOL. |
DocKimbel 13-Sep-2012 [1636] | I will push the current Red compiler & runtime code base tomorrow, still some more code cleaning to do. It will contain the Red boot script with all base definitions (currently actions, ops, a few natives and a few char! values) and a compiler front-end (similar to %rsc.r). Don't expect too much, only MAKE has been fully implemented and FORM on integer! values only. PRINT is the only native currently. This is not the first Red alpha, but it's a working base we can implement the alpha on (basically implementing actions and natives). |
Kaj 13-Sep-2012 [1637x2] | That is great |
Can Red/System code be included yet, so the new platform can be sort of tested as a shell for Red/System programs? | |
Gregg 13-Sep-2012 [1639] | Thanks for the updates Doc. Very exciting progress. |
DocKimbel 13-Sep-2012 [1640] | Kaj: not yet, there are several ways to integrate Red/System in a Red program: - inlined in Red code: it will be done using a #system compiler directive followed by a Red/System block of code. You should be able to use it pretty much anywhere. Trivial to implement. - executed at runtime: using a DO/SYSTEM, but we need the Red/System compiler written in Red to be implemented first for that. - through Red/System exposed functions to Red: this needs a native! definition in Red. It needs some intermediary code for supporting automatic marshalling/unmarshalling arguments passed between Red and Red/System. But it could be added quickly. Red's routine! type will use the same approach for mapping imports. - by directly coding the native! in Red using something like: foo: make native! [[<spec>] [<Red/System body>]] Lot of fun in perspective! ;-) |
Kaj 13-Sep-2012 [1641x2] | I'm looking for the first "trivial to implement" to get started as quickly as possible |
The rest sounds good, too :-) | |
DocKimbel 13-Sep-2012 [1643] | You'll got it by tomorrow. And BTW, the generated Red binary is in the working directory by default. ;-) |
Kaj 13-Sep-2012 [1644] | Cool |
GrahamC 13-Sep-2012 [1645] | There will be docs from doc? |
Kaj 13-Sep-2012 [1646] | Yeah: "print <integer!>" |
Janko 13-Sep-2012 [1647] | wow, I'm very happy.. this is great! |
GrahamC 13-Sep-2012 [1648] | Ah.. I need to wait for "print <decimal!>" .... |
DocKimbel 14-Sep-2012 [1649x7] | Here we go: https://github.com/dockimbel/Red/tree/v0.3.0/red |
#system directive added. | |
I will add math ops and basic block actions later today, so we can play with it a little. ;-) | |
(BTW, please read the content of the README file displayed at the above link.) | |
@BrianH: as you can see from the source code, R3 actions are a strong inspiration. ;-) I also plan to add some actions from Topaz, but Topaz is still higher level than Red currently. | |
If you want to see how the boot.red script is compiled, use: do/args %red.r "-v 2 %red/tests/hello.red" | |
Now you know why I want redbin format asap. ;-) | |
Pekr 14-Sep-2012 [1656x2] | not trying to panick, maybe downloaded bad branch, but: >> do/args %rsc.r %tests/hello.reds Script: "Red/System compiler wrapper" (none) ** Syntax Error: Invalid word -- <<<<<<< ** Near: (line 2028) <<<<<<< HEAD |
double clicking red.r in the root causes the same error ..... | |
DocKimbel 14-Sep-2012 [1658x2] | Looks like you made some modifications in your existing code before updating and you ended up with merging conflicts (most probably you have merged two branches). You should first do a checkout to the right branch, then issue a pull. |
Easiest way to solve that is to clone the repo again in another folder. | |
Pekr 14-Sep-2012 [1660x3] | ok, will do ... |
So, I have compiled my first RED program succesfully! | |
Two notes: - when in root directory, where %red.r resides, is there a need to specify it in compilation process? do/args %red.r - or do we expect more compilers here? - executable is spilled out into the root too. I would probably use the way compatible to red/system, and create /builds subdir? Or is all above intentional to allow to compile/link from working dirs? | |
DocKimbel 14-Sep-2012 [1663] | It is intentional. You can use the -o option to redirect the binary where you want. |
Pekr 14-Sep-2012 [1664x2] | *Important*: Red will be distributed as a binary to end users and the effect of: red script.red will be to compile and run it from memory directly. So the -o option will become mandatory in the future for generating an executable without running it. During the bootstrapping stage, it is complex to support that feature, but it will be implementd as soon as possible. |
Could you please elaborate? Is red executable going to be kind of launcher for our scripts? Hence it compiles them before running it? Most probably not a solution for CGI, as the compilation stage will happen each time? | |
DocKimbel 14-Sep-2012 [1666x2] | For CGI, you should obviously pre-compile them if you want performances. The future JIT-compiler should be able to handle such cases fine though. But yes, the goal is to be able to run Red scripts directly in the same way REBOL does. The fact that Red compiles them should be transparent to users. The -o option will be roughly equivalent to what encap provides (except that scripts will be compiled to native code). |
The main drawback right now to support direct Red script execution is REBOL inability to execute native code from memory. The workaround would be to provide a DLL to pass the memory pointer and call the Red code, but as I aim at a single Red binary, this option wouldn't be very satisfying. | |
sqlab 14-Sep-2012 [1668] | I would prefer Red to compile either to the directory, where the source is by default or at least not to the system/options/home path, but to the path I get with pwd |
DocKimbel 14-Sep-2012 [1669] | Agreed, change done. |
sqlab 14-Sep-2012 [1670] | That's quick. Thanks |
DocKimbel 14-Sep-2012 [1671] | I got math ops for integers working, but I think it's time we get a better macro system. |
PeterWood 14-Sep-2012 [1672x2] | quick-test has been broken by one of the last 13 commits in branch v0.3.0. I'll try to sort it out over the weekend. |
That was under OS X, it runs okay under Windows. | |
Arnold 14-Sep-2012 [1674] | So time really is running out for REBOL |
PeterWood 14-Sep-2012 [1675] | quick-test is also broken on Linux. |
DocKimbel 14-Sep-2012 [1676] | Peter: let me know if I can help. |
NickA 14-Sep-2012 [1677] | Very exciting to compile hello.exe on my Windows PC! |
DocKimbel 14-Sep-2012 [1678] | Kaj: what do you think of that? (for Red/System) #define MAX(a b) [either a > b [a][b]] print MAX(78 12) outputs: 78 |
Arnold 14-Sep-2012 [1679] | Try it the other way around ;-) |
DocKimbel 14-Sep-2012 [1680] | Huh! :-) |
older newer | first last |