Live data from Hacker News

REBOL Oneliners

rebol.com

11–20 of 54 posts

Re: REBOL Oneliners

#11
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

Re: REBOL Oneliners

#12
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.

Re: REBOL Oneliners

#13
post #5

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.

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

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

Re: REBOL Oneliners

#14

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.

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 ?

Re: REBOL Oneliners

#15

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

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

Re: REBOL Oneliners

#16
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.

Re: REBOL Oneliners

#17

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.

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 ?

sending someone a link via email is a relatively common task.

why would it be undesirable to write short code that can do that?

Re: REBOL Oneliners

#18

Earlier quoted context omitted.

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

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

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.

Re: REBOL Oneliners

#19

Earlier quoted context omitted.

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

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

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.

Re: REBOL Oneliners

#20

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

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

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
Post reply on HN