
REBOL Oneliners - damir
http://www.rebol.com/oneliners.html
======
tejtm
Back on the Amiga I once found this weird language on Aminet or a ffish disk
called "Lava" and it had all these builtin datatype for amazing things like ip
addresses, I just could not wrap my head around that. What do you mean? I
don't have to write my own token parsers in C that's outrageous! I ran away at
first but went back over summer break and it had been renamed Rebol. I used it
all through school blowing through programming assignments like they weren't
there. Remember once earning 10% of a term's grade in something like 70 chars

It was by far the most enjoyable programming I ever did. But (why does there
always have to be that But) using it at work, as I did after school, was a
disservice to everyone around me. Hardware - was all 64bit Rebol was still
32bit. Proprietary - brilliant author was from the time before, when that made
sense. Co-workers - most neither could, nor wanted to "get it" Rebol sure was
not going to help on their resumes.

It tried to go Rebol2->Rebol3 ala perl/python but when a community in the
hundreds splinters, there is just not that much left.

~~~
twsted
By the way Rebol was created by Carl Sassenrath, the designer of the kernel
(exec) of Amiga OS.

[https://en.m.wikipedia.org/wiki/Carl_Sassenrath](https://en.m.wikipedia.org/wiki/Carl_Sassenrath)

------
EFruit
REBOL and its derivative Red seem like cool languages, but I can't get over
the fact that it's impossible to bootstrap these free software projects
because Red requires REBOL 3, which is self hosting using REBOL 2, which is
proprietary.

~~~
xearl
Red requires Rebol 2, which is proprietary; Red does not require (and, in
fact, does not work with) Rebol 3.

However, Rebol 3 (and it's active descendant Ren-C) bootstraps itself; it does
not require Rebol 2.

~~~
xgchiu
You've probably forgotten but at one stage the red.r script was ported to
ren-c.

------
superdisk
This language just looks super cool. It's a shame it's sort of dead. Red (the
spiritual successor) isn't ready for production yet.

~~~
WaxProlix
It's been really active; you can hop on their gitter and get a feel for where
development is at (the sorts of things that are getting attention). I wouldn't
use it for a production load, but it's ready enough for writing internal or
personal tooling in.

(And edit to say, I think some of the core team got pretty far into the
blockchain rabbit hole at some point, so that may have derailed more
mainstream efforts)

~~~
analognoise
Red died the minute they announced they were going to launch their own crypto
currency.

~~~
9214
That's a rather bold claim. What you call cryptocurrency is an ERC-20 token
intended for experimenting with community economy (e.g. tipping contributors,
voting for features, app market, etc). It's an untrodden path and the idea is
quite interesting in its own way.

Regardless of the blockchain involvement, I encourage everyone to stay open-
minded and judge the project on its technical merits.

~~~
kaminari
So the cryptocurrency stuff isn't at all part of the language or stdlib?

~~~
9214
What makes you think it is? There are plans to offer a lightweight console
module for the Ethereum scheme and C3 dialect, but since there's very little
interest in this branch of development from the community (and a lot of
skepticism with nay-saying) it's not a priority.

~~~
kaminari
I don't think it is, I (and I assume many developers) just want to stay far
away from anything cryptocurrency-related.

------
soapdog
I've spent the best part of 2000 programming with REBOL until I made the
switch to the early builds of MacOS X and moved to program using LiveCode.
REBOL remains one of my most fond memories of being a developer. So much power
in such a little language.

I wish REBOL 2 was still being developed and its GUI was updated to latest
trends. I'd switch back to it in a heartbeat. I'm quite excited about Red and
been playing with it occasionally.

------
gyrcom
Over the years I have used 20+ languages, starting with CobolC and Watfor, and
now python is my daily driver. Rebol is by far the most enjoyable language I
have ever used, very similar to Smalltalk and Lisp. More productive than any
other system out there and a very small footprint. The language is
unbelievably versatile as you can overload any word and create your own
mezzanine functions super quickly. The drawback are that you can really messup
if you are not careful. Another thing is that compiling is out of the question
as the self modifying code possibilities of this language make it truly
dynamic. Carl did a marvellous job on this language. The design is impeccable.
If you like messaging then this is THE language.

~~~
9214
Compiling is not entirely out of the question: Red (Rebol's descendant)
handles static compilation where it can and delegates the rest to the
interpreter.

------
lbj
Its a very impressive show of one-liners, I love how expressive the language
is. I wonder however, how easy it would be to extend compared to something
like Lisp. If these idioms for parsing html weren't built-in, what would a
Rebol implementation of those funcs look like?

------
Izkata
First programming language I learned, back around 2000. I still use it often
for my personal projects.

------
voldacar
The syntax looks kind of odd - it feels a bit like trying to read lisp without
the parentheses. Seems like a very expressive language though based on the
number of characters needed to get stuff done

~~~
noobdood
IIRC I read somewhere that Rebol is homoiconic but not sure.

~~~
Izkata
It is. For example, in the third example:

    
    
      foreach file load %./ [if not dir? file [write/binary join ftp://user:pass@example.com/ file read/binary file]]
    

Those two sets of [ ] are the block! datatype, which is an array-like type.
"foreach" is a function that takes an identifier and two block!s ("load"
returns a block!), executing the second for each one in the first.

Quick example showing it:

    
    
      >> something: [print val]
      == [print val]
      >> foreach val [1 2 3] something
      1
      2
      3
      >> append something [+ 3]       
      == [print val + 3]
      >> foreach val [1 2 3] something
      4
      5
      6
    

The second example in the oneliners kinda shows this as well, but I suppose
it's not obvious without knowing more of the language. The outer block! is
actually a separate dialect being passed to the layout function as data, that
the layout function parses and handles. What's normally thought of as rebol is
called the "do dialect", because that's how you run a block! as code:

    
    
      >> X: [print 1 + 2]
      == [print 1 + 2]
      >> do X
      3
      >> X/3
      == +
      >> X/3: to-word {*}
      == *
      >> X  
      == [print 1 * 2]
      >> do X
      2

~~~
noobdood
Thanks.

------
Zelphyr
I’m really encouraged that REBOL has made it to the front page of Hacker News.
Hopefully that will translate into more contributors to the REBOL and Red
projects.

------
lwb
Looks really interesting. Anyone able to get this to work on Catalina? I'm
getting "bad CPU type in executable" for both the PPC and Intel versions.

~~~
adamzegelin
PPC definitely won't work on Catalina. PPC support was dropped from macOS
years ago.

The Intel binary is 32-bit only. Catalina will only run 64-bit binaries.

    
    
        $ file rebol 
        rebol: Mach-O executable i386

~~~
pmarreck
Does anyone else think cutting off 32-bit support basically killed off what
remained appealing about the Mac that differentiated it from being just a
“desktop iOS iPad in the iCloud ecosystem”?

I lost access to so much cherished stuff that I am currently evaluating a
switch to Ubuntu 20.04

~~~
samatman
Of all the tiny papercuts I've suffered on macOS over the last five years, I
don't miss 32-bit apps at all.

Must have just gotten lucky, but literally nothing stopped working when I
migrated to a new Catalina machine. Ok I had to do some jimmying to get
Keybase back, but that wasn't a 32/64-bit issue, that was weird kext
permissions stuff.

~~~
pmarreck
I guess it depends what you use the computer for.

Pretty much 90% of my Steam games that had Mac versions, suddenly did not
work. And there was no warning, because most of them weren't currently
installed (so the catalina installer didn't warn); I just got a cross through
them after upgrading.

"Mac gaming" wasn't something I did that much anymore, but I had a lot of
attachment to certain games (some which of course "I totally intended to
replay one day") and suddenly they became unavailable.

Many older apps I still ran now and then, stopped working.

I kept my S.O. on Mojave so that I wouldn't be forced to upgrade her Office
suite to the subscription model Microsoft is pushing.

Etc.

------
haolez
Looks a little like FORTH, but with batteries included.

------
abrax3141
The idea of a one-liner is sort of silly when applied to functional
programming. Every lisp expression, for example, no matter how long in editor
space, is logically a single line.

~~~
samatman
It's only silly if you don't apply a reasonable character limit in your
definition.

I would say < 80 is definitely a one-liner, < 100 is more-or-less a one-liner,
< 120 is really pushing it. After that, you're cheating. Even Java style
guides cut you off after 120.

12 of these "one-liners" fail even the most permissive of these criteria, but,
y'know, YMMV. None are over 140.

~~~
Izkata
> None are over 140.

Their limit is at the top of the page:

> 2\. How long is a line? Here, we limited users to 132 chars. It's the old
> line printer standard.

