[HN Gopher] REBOL Oneliners
       ___________________________________________________________________
        
       REBOL Oneliners
        
       Author : damir
       Score  : 58 points
       Date   : 2020-03-08 19:17 UTC (3 hours ago)
        
 (HTM) web link (www.rebol.com)
 (TXT) w3m dump (www.rebol.com)
        
       | superdisk wrote:
       | 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.
        
         | pyuser583 wrote:
         | Red is pretty awesome. Last I tried it out, it was not ready
         | for graphics work on Linux.
        
         | timbit42 wrote:
         | Logo on steroids.
        
         | WaxProlix wrote:
         | 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 wrote:
           | Red died the minute they announced they were going to launch
           | their own crypto currency.
        
         | praptak wrote:
         | It believe it had a restrictive license which was a showstopper
         | for a programming language. The current version is Apache(?),
         | but it might be too late.
        
       | Izkata wrote:
       | First programming language I learned, back around 2000. I still
       | use it often for my personal projects.
        
       | haolez wrote:
       | Looks a little like FORTH, but with batteries included.
        
       | voldacar wrote:
       | 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 wrote:
         | IIRC I read somewhere that Rebol is homoiconic but not sure.
        
           | Izkata wrote:
           | 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
        
       | abrax3141 wrote:
       | 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.
        
         | jmnicolas wrote:
         | To me all (complex) one liners are bad : they're hard to read
         | and they don't manage errors.
         | 
         | I'd rather go through 5 lines of simple statements than try to
         | decipher a "clever" one liner.
         | 
         | From the fine article : > Open a GUI, read web page, sent it as
         | email
         | 
         | You really want to do that in one line ?
        
           | glofish wrote:
           | sending someone a link via email is a relatively common task.
           | 
           | why would it be undesirable to write short code that can do
           | that?
        
         | samatman wrote:
         | 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.
        
       | Zelphyr wrote:
       | 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.
        
       | EFruit wrote:
       | 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.
        
       | lwb wrote:
       | 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 wrote:
         | 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 wrote:
           | 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
        
             | mushufasa wrote:
             | well, ubuntu is also dropping support for 32-bit. they
             | tried to a little while ago and got a lot of backlash so
             | they're supporting for a bit longer, but it's only a matter
             | of time.
        
             | samatman wrote:
             | 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.
        
         | pampa wrote:
         | Why would you even try the PPC version on Catalina? Snow
         | Leopard (from 2009) was the last mac os to support ppc.
         | 
         | The intel version is i386. 32bit, which is not supported on
         | Catalina either/
        
       ___________________________________________________________________
       (page generated 2020-03-08 23:00 UTC)