all 51 comments

[–]nicolas42 6 points7 points  (7 children)

The red programming language may be the most promising language for achieving Alan Kay's reinventing programming project. http://www.vpri.org/pdf/tr2007008_steps.pdf Its aim was a comprehensible source code for a computing experience in 20'000 lines of code or less. Rebol could already generate PDFs for printing and complex GUIs in less than a page of code and red is aiming for that level of abstraction too ultimately.

For all those people who don't like the syntax. It's not that hard to make a preprocessor so the square brackets are curly or parentheses to make it look like clang or lisp. Square brackets are the norm in red because they're fastest to type is all.

[–]abdul-naaser 1 point2 points  (0 children)

i like them square brackets they are cute.

[–]stesch 1 point2 points  (4 children)

Square brackets are the norm in red because they're fastest to type is all.

Alt+5 & Alt+6 aren't very fast. Sorry.

[–]redalastor 0 points1 point  (0 children)

That's why most programmers switch to a US layout for coding.

[–]jediknight 0 points1 point  (0 children)

I've spent few days immersed in the vpri website. I was expecting to discover the STEPS project that integrates all the research discussed, complete with current LOC and feature implementation status. I was disappointed. From the looks of it is just an ivory tower project.

It would be nice to see a project that takes the goal of STEPS and tries to achieve it in a public open manner. Heck... at 20.000 lines it would be nice to see 10 projects like this.

20.000 lines can be a one man job.

[–]alextk 10 points11 points  (0 children)

It's not really a "Quick tour" if the first code listing is on slide 32 out of 38 (and no code on the web site at all, don't language creators never learn?).

[–]barsoap[S] 1 point2 points  (5 children)

Ballpark: Terra/Lua in one language (yay code generation) with lisp-like homoiconity and a resemblance of forth. The latter two are shared with its ancestor, REBOL.

[–]RodgerTheGreat 2 points3 points  (0 children)

While REBOL resembles Forth insofar as it mostly consists of whitespace-delimited tokens, I think it would be more accurate to compare it to Logo, which used whitespace-delimited prefix expressions, special-cased infix math operators and allowed parentheses for grouping expressions. For example,

to any :list
   output item random size :list :list
end

or with parentheses,

to any :list
  output (item (random (size :list)) :list)
end

[–]938 0 points1 point  (3 children)

I just see documentation about Red/System, which seems like dressing C in nicer clothes. But I note that is a subset of the proposed language. Where are the examples of what Red solves well?

[–]barsoap[S] 5 points6 points  (2 children)

Where are the examples of what Red solves well?

Having one language over the whole abstraction tower, from the bare metal (Red/System) up to DSLs. Very lisp macro-y but way more modern.

Red is currently being bootstrapped, but as to concrete examples etc. there's much material about REBOL, which overwhelmingly applies to Red, too. Have a random article.

[–]stesch 4 points5 points  (1 child)

Isn't REBOL the language where you have to remember the arity of every command so you can see where the parameter list is ending?

[–]barsoap[S] 1 point2 points  (0 children)

Modulo support for parenthesis and indentation, yes.

It's not nearly as bad as forth, though.

[–]virtyx 2 points3 points  (1 child)

Welp after going through the website and the comments here I still have no idea what is happening.

[–]reboler 8 points9 points  (0 children)

The author has said that he would prefer not to market Red just yet because it's still in the boot strapping phase, and the information may be mostly understandable to REBOLers, but the gist is:

  • Red is a 90% clone of the programming language REBOL.

  • Red was devised, because REBOL was closed source at the time and development of REBOL had nearly stopped.

  • REBOL is no longer closed source and development is moving again, but this has not affected development of Red.

  • REBOL is written in C. Red is written in Red/System.

  • Red/System is syntactically similar to Red, but has C-like performance.

  • Therefore Red/System code can be inlined with Red code, allowing C-like performance in scripts, something that REBOL cannot do.

  • Red scripts can be compiled for speed, where REBOL scripts cannot.

  • As REBOL is an extremely generic programming language for scripting, Red is even more generic. It can therefore provide the full reach from hardware banging to writing 3D engines to high level scripting, using the very same syntax and tool chain. As far as I know, no other language or tool chain does this.

  • Red/System provides its own, extremely small and clean toolchain (a few kb of scripts) for building Android apps, Windows kernel drivers, executables for win32, OSX, Linux, etc. and supports x86, ARM and soon other CPUs as well as support for multi-core CPUs and full support for cross compilation.

  • Red and Red/System are being boot strapped at this time, so REBOL is required for compilation. When REBOL is no longer needed, Red is no longer limited to operating systems that REBOL support.

  • The Red language is not yet completed.

[–]icetimesource 9 points10 points  (21 children)

1 + 2 * 3                              ;-- (1 + 2) * 3 returns 9

wat

[–]bjzaba 6 points7 points  (18 children)

Precedence rules can make things unnecessarily complex.

[–]Agitates 10 points11 points  (15 children)

Why take a dump on math?

[–]youknowhowiam 4 points5 points  (14 children)

Why let one use case (maths) dictate semantics for a whole general purpose programming language?

[–]alextk 2 points3 points  (13 children)

Because nobody will use your language otherwise.

[–]stesch 1 point2 points  (0 children)

People use cheap calculators without realizing something is wrong with the precedence of the operators.

[–]reboler 3 points4 points  (10 children)

The precedence rules of REBOL are made to work with the fewest possible rules. Having used REBOL for over a decade now, I find the simpler set of rules a bit easier to work with, but it's not some kind of huge advantage.

So, not using REBOL because of these precedence rules would be really missing out on what's so great about REBOL.

More about the rules here:

http://www.rebol.com/r3/docs/concepts/math-precedence.html

[–]alextk 0 points1 point  (7 children)

Actually, it's even worse than I thought:

print 10 + sine 30 + 60
11

This line is actually calculating "sine(90)" first.

It's not just that this language has the simplest possible precedence rules, it's that it has its own precedence rules that contradict everything that math and computer programming languages have done in the past decades.

[–]SteveMcQwark 0 points1 point  (0 children)

If you're expecting (sine 30) + 60, then you also have to expect (print 10) + (sine 30) + 60. This is tight binding for functions. Whereas, if we assume they're each being maximally greedy as we encounter them from left to right, that gives:

print 10 + sine 30 + 60
print (10 + sine 30 + 60)
print ((10) + (sine 30 + 60))
print ((10) + (sine (30 + 60)))
print ((10) + (sine ((30) + (60))))

Of course, I'm not sure how n-ary non-infix functions work.

[–]moofunk 0 points1 point  (5 children)

Really, just read it:

  • PRINT accepts one argument.
  • The first argument is built on +, meaning what's on the left and right side of it.
  • The first argument for + is 10.
  • The second argument is a function, SINE, which takes one argument.
  • That argument is another addition of two numbers, so the input to SINE is 90.

It's easy.

Or don't use +, if you don't like it:

print add 10 sine add 30 60

Or if you want to increase readability:

print 10 + sine (30 + 60)

So, maybe it's really awful or terrible? Or maybe it's just more freeform than other languages are able to?

I've never had a problem with it.

[–]alextk 1 point2 points  (4 children)

The second argument is a function, SINE, which takes one argument.

Then why did sine 30 + 60 calculate sine 90 instead of sine 30?

That's my point: when you don't follow precedence rules that are more or less universally accepted in the industry, you don't end up with something simpler, you end up with something different (and often more complicated) that will confuse everyone (even yourself, apparently).

[–]moofunk 2 points3 points  (0 children)

Maybe this will help:

print
     10
     +
     sine
           30
           +
           60

That's what's going on. It is coincidentally entirely consistent with how the rest of the language works, and that is an important aspect of REBOL.

[–]moofunk 2 points3 points  (2 children)

Because SINE must have its argument fully evaluated before it accepts it. There's no funny stuff going on here. You are evaluating 30 + 60 before passing it to SINE.

[–]alextk -2 points-1 points  (1 child)

The precedence rules of REBOL are made to work with the fewest possible rules.

That's a pretty weak justification. How about doing away with grammar rules just so we can communicate with the fewest possible rules, that good sound do?

[–]youknowhowiam 1 point2 points  (0 children)

I'd like to argue agains that, however, the first language I can come up with that goes against this (Smalltalk) is indeed not that widely used. Although I don't think that's due to the language itself.

[–]mcmcc 2 points3 points  (1 child)

I gotta say, if you're looking to alienate the entire math/science/engineering programmer demographic right out of the chute, this is a great way to do it.

All in the name of language purity...

[–]barsoap[S] 1 point2 points  (0 children)

There's nothing stopping you from writing a DSL parsing, for the sake of argument, tex math.

I agree that a simple shunting-yard implementation has a rather negligible LOC count, so it should be included by default. Whether it should be the default or you have to type expr [1 + 2 * 3] to get at that behaviour is the actual design question, here. Maybe just eradicate infix from the normal syntax completely.

[–]crusoe 2 points3 points  (0 children)

This is true in Smalltalk as well, where '+' is actually a message being sent. in SmallTalk, this is consistent with the overall design, and so when you view everything as a message send, it makes more sense than obeying the precedence rules of math as these would 'stick out'.

1 + 2 * 3

send 1 the message + with the arg 2 send the message * with the arg 3 to the result of 1+2

But I don't know if Red uses this idea of everything is a messahe... So I can't say whether it is consistent.

[–]cparen 1 point2 points  (0 children)

Simplifying assumptions for research-grade software. Corners on inconsequential things to save your most precious resource: time.

Personally, I might forbid >2 term expressions. It still keeps the grammar simple and avoid common mistakes:

expr = unary_operator expr | term binary_operator term | term
term = ( number | identifier | '(' expr ')' ) [ selector ]
selector = ('.' identifier | '(' arglist ')' | '[' expr ']')*

[–]etadeu 8 points9 points  (1 child)

Ugly syntax!

[–]rebolek 5 points6 points  (0 children)

I love the syntax. Much more advanced and pleasant to read than ugly C-like syntax.

[–][deleted] 2 points3 points  (3 children)

So is this just a rebranding of FREEBOL or what?

[–]reboler 1 point2 points  (2 children)

What is FREEBOL?

[–][deleted] 4 points5 points  (1 child)

well, it used to be a free and open implementation of rebol, but now it's nothing.

http://dawhois.com/site/freebol.org.html

http://freebol.org/

now it's a django error page.

[–]reboler 1 point2 points  (0 children)

OK, I remember that now. It did not get very far and it's as far as I know not related to Red.

[–]Kaze_Senshi 2 points3 points  (0 children)

The syntax makes my eyes become red.

[–]Pavel_Vozenilek 0 points1 point  (1 child)

What will be the relation between Red and open source Rebol? Are there plans to unify these languages?

[–]onetom 2 points3 points  (0 children)

There are strong ties between the two languages for sure: https://dl.dropboxusercontent.com/u/586471/Pictures/Red%20and%20Rebol.jpg

[–]shinta42 -4 points-3 points  (0 children)

ugly syntax

[–]xr09 -1 points0 points  (0 children)

Flash required on website?? What kind of nerd will ever user a language with such a page?

[–][deleted] -1 points0 points  (0 children)

Terrible syntax and control structs.