Git Product home page Git Product logo

rebol's Introduction

Rebol [R3] Source Code Distribution
Date: 12-Dec-2012
Version: 2.101.0
From: Carl Sassenrath
Web: www.rebol.com


Build Target:

This first release is intended for non-Windows systems like Linux, Mac, BSD,
Android, etc. However, it will build for Windows, but I've not included the
typical MSVC project files. I'll try to get that added, but it's not that
tough to create one yourself. You will need to set struct align to 4 bytes.


About the Makefile:

You might notice that the makefile is a bit old-fashioned. That's because I
still support Rebol on some very old systems that don't offer newer makefile
features. So, please keep that in mind and stick with this simple format.

Also, the makefile is built by Rebol. Typing "make make" will rebuild it,
and you can also select a different platform target by providing
the Rebol platform identifier typing e.g. "make make OS_ID=0.4.4" (Linux
Libc6 2.11 platform version).


Build Instructions:

Parts of Rebol are built by Rebol. So, to build it, you'll need to download a
running binary into the local make directory. Call it r3-make.

The build happens in the make directory. It will create an obj sub-dir for
storing the object files. I prefer this over mixing the source and object
files into the same directory.

You may need to do "make clean" for clean make session.

The biggest step is to do the "make prep" which will use Rebol to configure
and build a number of important C header files.

If you are building for a new platform that has no existing Rebol, you can use
"make prep" to build all the files you need on an existing platform and copy
them to the new platform.

After the prep, just run "make" or "make r3" and the rest of the system will
build.


Toolchain Note:

Rebol builds on many different compilers over a range of systems. Although
the C source doesn't strictly follow any one standard, it's quite portable
and I've yet to find a toolchain that won't build it. You can even cross
compile it for embedded systems quite easily. If you run into a problem,
it's probably something fairly simple. Don't over complicate it.


Note to Contributors:

I welcome your help with porting Rebol to many more devices and making various
improvements. I just ask that you:

1. Keep code clear and simple.
2. Document unusual code, reasoning, or gotchas.
3. Use same style for code, vars, indent(4), comments, etc.
4. Keep in mind Linux, OS X, BSD, big/little endian CPUs.
5. Test everything, then test it again.

Enjoy your new Rebol freedom,

-Carl

Bug reporting note:

Report bugs, wishes, etc. at the

    http://curecode.org/rebol3/view-tickets.rsp

site.

rebol's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rebol's Issues

Rebol doc site

Carl, at www.rebol.net you wrote:

"REBOL DocBase (old Wiki)"

Users are having problem with the "(old Wiki)" characterization. Could you, please, remove it?

Interpreter drops into REPL when encountering errors while running scripts

When the interpreter's error reporting when running a script seems to be more tailored toward exploratory programming than toward running scripts:

$ cat test.r 
#!/usr/bin/r3

print (1 / 0)
$ ./test.r 
** Math error: attempt to divide by zero
** Where: / do either either either -apply-
** Near: / 0

>> 

There are two problems here:

  • There are neither file nor line numbers here. In a small script it's easy to figure out, but in a large script that contains many lines it can be a nightmare to debug.
  • After printing the error message, it drops into REPL instead of terminating. This may be nice for debugging when you try stuff in the REPL, but if you use other tools to run the scripts(build systems, text editors, other programs) it can be very annoying because now these tools need to be able to properly tunnel the REPL's PTY to the user(far from trivial). It also means you can't use it for automated scripts, because you can't have an automated script suddenly require human attention...

Interpreters that run scripts should behave nicely. Python, for example:

$ cat test.py 
#!/usr/bin/python

print(1 / 0)
$ ./test.py 
Traceback (most recent call last):
  File "./test.py", line 3, in <module>
    print(1 / 0)
ZeroDivisionError: division by zero
$ echo $?
1
$ 
  • It prints the file and line where the error occurs, so we can easily find it in the codebase.
  • It terminates itself with an error code, so that tools/automation managers that invoke it can know that it failed instead of requiring a human to interact with a REPL.

in function spec, a type specified for a refinement is reflected in types-of, but has no influence

it is possible (without error message) to specify one or more types for a refinement in the function spec; this information shows up in the result of the reflector types-of, but is not used otherwise (e.g. for type-checking) except under apply

Example code:

>> f: func [/a [integer!]][type? a]
>> types-of :f
== [make typeset! [integer!]]
>> f
== none!
>> f/a
== logic!
>> apply :f []
== none!
>> apply :f [true]
** Script error: applier does not allow logic! for its /a argument

Reference: http://curecode.org/rebol3/ticket.rsp?id=974

GitHub Wiki

Where is the Wiki of GitHub? It disappered!

Arithmetic bug with decimal

A bug which appears on Rebol2 and r3-a111-3-1 at least on Windows and Linux:
Some simple arithmetic leads to incorrect results with decimal type.
Here is a simple example:

>> -8.45 + 8.0 + 0.45
== 7.21644966006352e-16

Should instead be 0.

Sequence Point undefined behavior in c-do.c

This line in c-do.c is an example of something for which the order of operations is not defined:

// Get first block value:
pvs.path = VAL_BLK_DATA(pvs.orig = *path_val);

(Note that VAL_BLK_DATA is a preprocessor macro, and not a function.)

One might think that means that the compiler could choose to do the pvs.orig = *path_val, then call VAL_BLK_DATA on that, then put the result in pvs.path or put the VAL_BLK_DATA (pvs.orig) into pvs.path, and then do pvs.orig = *path_val. But as pointed out here, it's not an either-or situation in principle. It's undefined behavior.

http://stackoverflow.com/a/13714644/211160

Happened across this just by trying to build the sole file c-do.c with warning levels turned up, adding things like -Werror=sequence-point, which would be a good idea in general to do.

dtoa.c out of date

The dtoa.c used in R3 repo is out of date and has some bugs.
In R3

>> 212839188833879E-21
== 2.1283918883387901e-7

In Python

>>> 212839188833879E-21
2.12839188833879e-07

Incorrect use of APPEND_BYTES

In d-crash.c, APPEND_BYTES is strncat and used as: APPEND_BYTES(buf, s, sizeof(buf)).

This will over-write the buf if s is longer than buf and buf is not empty. The last argument of strncat is max number of characters to append to buf, so if buf is not empty, passing sizeof(buf) allows for overwrite.

A quick hack would be to define APPEND_BYTES(dst, src, len) as strncat(dst, src, len - strlen(dst) - 1 > 0 ? len - strlen(dst) - 1 : 0 )

with TIME! values, out-of -bounds numerical selectors give NONE, with DATE! they give an error

Since the introduction of /hour /minute /second selectors for date! values which do NOT correspond to numerical selectors, it is an error for numerical selectors to be outside the range 1 .. 9.
With time! values, out of bound numerical selector values give simply none.
In an earlier issue Carl said that "none is the correct return value for an out-of-range ordinal selector".

BTW, why could not /hour /minute and /second correspond to, say, /10 /11 and /12?
To be noted also that /julian == /yearday (== /8) on date values but it does not exist on the now function.

Reference: http://curecode.org/rebol3/ticket.rsp?id=1375

Been busy. Will check-in more frequently in March.

Sorry folks, Dec-Feb is the "crazy crazy busy" time for new product development. Yes, I know, I'm bad. But, I'm quite addicted to making new products... especially cute little electronic ones that sell in all the major stores in the US. Each one presents special new challenges that I just can't resist.

Starting in March I'll break away for a few hours a week to take care of things here.

Also... I really want to try using R3 with graphics running on DirectFB. It would be quite cool.

One other thing... has anyone got R3 running graphics on Raspberry Pi yet? If not, let's talk about how we can make that happen. What do we need?

set-path! expression with first word referring to a function does not do anything

Normally, when a word is set to a function, then setting it to a value of another type supersedes the function value. Not so when the function it was set to, had one or more refinements, and the new setting is done with at least one of these specified. See code.

>> f: func [/a][]    ; simplest example
>> probe :f          ; check f is a function
make function! [[/a][]]
>> f: 1              ; set f to an integer
>> probe :f
1                    ; it is indeed
>> f: func [/a][]    ; again
>> probe :f
make function! [[/a][]]
>> f/a: 1            ; now set f/a 
>> probe :f          ; this hasn't done anything, but isn't forbidden either
make function! [[/a][]]

Reference: http://curecode.org/rebol3/ticket.rsp?id=1558

TRANSCODE /part option

Embedded scripts need to decode the binary source from a start position only to a particular end position, and shouldn't go any further. This kind of thing happens with the length-specified embedded scripts that sys/load-header enables, but it could also happen with something like RSP template dialects. When we needed to support such limits in sys/load-header for checksums and decompression, we added a /part option to checksum and decompress. We need a similar /part option for transcode.

For this example data:

>> s: to-binary {rebol [] print "Hello!" stuff after the script}
== #{
7265626F6C205B5D207072696E74202248656C6C6F2122207374756666206166
7465722074686520736372697074
}

Code required now if you use to block!:

>> d: to block! copy/part s 23  ; note the copy overhead here
== [rebol [] print "Hello!"]
>> e: skip s 23
== #{2073747566662061667465722074686520736372697074}

Code required now if you use transcode:

>> d: head clear back tail transcode copy/part s 23  ; still copy overhead
== [rebol [] print "Hello!"]
>> e: skip s 23
== #{2073747566662061667465722074686520736372697074}

Yes, the head clear back tail stuff is dumb, but that will be discussed in another issue.

Code required now if you use transcode/part:

>> d: transcode/part s 23  ; no copy overhead here
== [rebol [] print "Hello!" #{2073747566662061667465722074686520736372697074}]
>> e: last d
== #{2073747566662061667465722074686520736372697074}
>> head clear back tail d
== [rebol [] print "Hello!"]

Still has the stupid API clear back tail problem (another issue), but at least it doesn't have the copy overhead anymore.

Cannot render anti-aliased text

According to the DRAW Dialect Reference, text can take a render-mode like anti-aliased, but REBOL errors:

view layout [text anti-aliased "Hello World"]
** Script Error: anti-aliased has no value
** Where: do-facets
** Near: anti-aliased "Hello World"

The default text rendering is aliased:
view layout [text "Hello World"]
screen shot 2016-07-10 at 7 43 39 am

Likely crash in do_callback

In f-extension.c:

*/  REBNATIVE(do_callback)
/*
**      object word arg1 arg2
**
***********************************************************************/
{
    RXICBI *cbi;
    REBVAL *event = D_ARG(1);
    REBCNT n;

    if (VAL_EVENT_TYPE(event) == EVT_CALLBACK) {
        if (cbi = VAL_EVENT_SER(event)) {
            n = Do_Callback(cbi->obj, cbi->word, cbi->args, &(cbi->result));
        }
    }

    SET_FLAG(cbi->flags, RXC_DONE);

If event is not EVT_CALLBACK, cbi will not be initialized and the code will likely crash trying to access it.
I guess it's possible to write a test script to exercise this codepath, but I'm not there yet.

Pull R3 host changes

We should pull over any important R3 host changes into this main distribution.

R3GUI license

R3GUI still refers to

http://www.rebol.com/r3/rsl.html

However, that page does not exist. I suppose that the Apache 2 license shall now be used?

arm64 support?

What would be required for supporting 64-bit ARM? I want to run Rebol on my laptop (Acer R13 -- MediaTek MT8173(c) 64-bit ARMv8) but currently I get this error:

./rebol-view/rebol: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory

Meanwhile I do have X11 installed and other X11 applications seem to work.

Here's the version of rebol I'm using:

$ file Downloads/rebol-view/rebol 
Downloads/rebol-view/rebol: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, BuildID[sha1]=13961069bc477d1233c6edd300fee274f8f798e7, stripped

And this is my system:

$ uname -a
Linux localhost 3.18.0-14875-g438cb8ab27c6 #1 SMP PREEMPT Sat Sep 16 09:49:59 PDT 2017 aarch64 aarch64 aarch64 GNU/Linux

R3GUI site

Supposing that R3GUI shalll have the Apache 2 license, I guess that it should be decided where to put its source code...

Wish: allow literal strings as path elements

Currently, the following lexical and syntactical forms are allowed as path elements:
literal value except string, lit-word, word (which is not evaluated), get-word (evaluated, result may be of any type), and parenthesized expression (evaluated, result may again be of any type)

BrianH says: The " character is a delimiter, and apparently of higher precedence than paths (or is it lower?). This is the same as R2, but it would be useful to change because using strings as keys in blocks and maps is extremely common.

This could be easy to implement without impact since the current behavior results in an error.

Reference: http://curecode.org/rebol3/ticket.rsp?id=746

Add option to disable stripping of build results

Currently, you can disable stripping the symbols of the build results with

make ... STRIP=echo

It would be nice if there was a simple+consistent way to disable stripping during development.

Native support for 64bit builds

It would be nice if r3 supported 64bit platforms natively.

Currently, you have to install a 32bit compatibility layer to build and run REBOL on 64 bit platforms.

Demo

I would eliminate the demo entry in splash intro and help, since it's not available.

I always check pull requests before issues.

Just thought I would mention: I always check pull requests before issues, so it is not necessary to add an issue along with the pull... unless you think there really is an issue.

[OS X] The builtin editor freezes permanently on exceptions.

I was following this tutorial and it suggested introducing a bug to see the error message. I tried it and it froze every Rebol window on my system. I tried it a number of times, and everything works perfectly until you hit Ctrl-E in the editor with any error in the source. It just freezes [little spinning umbrella thingy forever.]

OS X 10.10.2
Model Name: MacBook Air
Processor Name: Intel Core i5
Processor Speed: 1.3 GHz
Number of Processors: 1
Total Number of Cores: 2
L2 Cache (per Core): 256 KB
L3 Cache: 3 MB
Memory: 4 GB
Boot ROM Version: MBA61.0099.B18
SMC Version (system): 2.13f15

strange behaviour in windows 8

From: http://rebol.informe.com/forum/rebol-2-f8/strange-behaviour-in-windows-8-t132.html

It seems rebol has a bug that appears in windows 8 (or maybe it is windows 8 which has a bug)

when you create a file in root partion of disk C it becomes unvisible in windows explorer, windows command line and whatever windows program accesing c:\ folder, that file is in another universe for windows point of view.

>> save %/c/a.txt "hello universe!"

c:\> dir

(no clue about a.txt)

But if you do a dir list in rebol view console, it is there! and you can read it, load it and even delete it

>> ls %/c/

$Recycle.Bin/ a.txt Users/ Windows/

The effect of this weird bug is you cannot open any file created from rebol view 2.7 with any windows program, files created inside rebol are only visible to rebol. But this only happen with files created in root folder, if you create files in any other folder all seems to be ok.

>> save %/c/aeat/b.txt "hello universe"
>> ls %/c/aeat
b.txt

any idea of this weird windowness?

Improve a way to sublaunch other processes

Currently it seems that the only way to sub-launch another os executable is with call, which is very limited.

Real programs need at least the following additional functionality:

I'm not proposing the exact syntax, as I don't have a good feel for rebol but it could be done by extending call or implementing a new command, like exec.

Even more advanced functionality would be to be able to communicate with launched process by reading it's stdout/stderr and writing to its stdin in response.

Can't read URLs with exclamation points (!) in them

Results in a 404 not found error. For example:

image: read http://www.elle.nl/var/ellenl/storage/images/mode/nieuws/like!-nieuwe-cruyff-collectie/1918159-1-eng-GB/LIKE!-Nieuwe-Cruyff-Collectie_home_news.jpg

** Access error: protocol error: "Server error: HTTP/1.1 404 Not Found"

Another example:

content: to-string read http://www.metacritic.com/game/xbox-one/guacamelee!-super-turbo-championship-edition

Content then contains the HTML for metacritic's 404 Not Found page.

Both examples work fine in Rebol 2.

`make all` fails with "strip: 'libr3.lib': No such file"

When running "make all", it fails at the end with

make[1]: Entering directory `/home/adigulla/packages/r3/make'
gcc -o host objs/host-main.o objs/host-args.o objs/host-device.o objs/host-stdio.o objs/dev-net.o objs/dev-dns.o objs/host-lib.o objs/host-readline.o objs/dev-stdio.o objs/dev-event.o objs/dev-file.o  libr3.so -lc -lm  -ldl -m32
strip libr3.lib
strip: 'libr3.lib': No such file

This is probably just because it uses the wrong file name.

I'm on Linux x86/64 with 32bit compiler + 32bit dependencies installed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.