News for hackers. Stuff that matters.
Re:REBOL Oneliners by tejtm on Sunday March 08, 2020 @08:44PM (#22521875)
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.

Re:REBOL Oneliners by twsted on Monday March 09, 2020 @04:03AM (#22523763)
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

Re:REBOL Oneliners by EFruit on Sunday March 08, 2020 @05:20PM (#22520697)
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 by xearl on Sunday March 08, 2020 @09:03PM (#22521982)
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.

Re:REBOL Oneliners by xgchiu on Monday March 09, 2020 @04:56AM (#22523960)
You've probably forgotten but at one stage the red.r script was ported to ren-c.
Re:REBOL Oneliners by 9214 on Sunday March 08, 2020 @09:29PM (#22522112)
For what it's worth, only 1/4 of the toolchain (Red → Red/System compiler and Red/System → native compiler + loader/linker) depends on Rebol2, which in turn is 90% compatible with Red.
Re:REBOL Oneliners by 7thaccount on Sunday March 08, 2020 @08:07PM (#22521665)
Red will be self hosted at some point. I know they're working towards it, so it shouldn't put you off forever.
Re:REBOL Oneliners by superdisk on Sunday March 08, 2020 @03:40PM (#22520064)
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.
Re:REBOL Oneliners by WaxProlix on Sunday March 08, 2020 @04:03PM (#22520215)
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)

Re:REBOL Oneliners by analognoise on Sunday March 08, 2020 @04:17PM (#22520302)
Red died the minute they announced they were going to launch their own crypto currency.
Re:REBOL Oneliners by 9214 on Sunday March 08, 2020 @09:18PM (#22522055)
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.

Re:REBOL Oneliners by kaminari on Monday March 09, 2020 @05:24AM (#22524083)
So the cryptocurrency stuff isn't at all part of the language or stdlib?
Re:REBOL Oneliners by 9214 on Monday March 09, 2020 @08:11AM (#22524724)
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.
Re:REBOL Oneliners by kaminari on Monday March 09, 2020 @09:00PM (#22531689)
I don't think it is, I (and I assume many developers) just want to stay far away from anything cryptocurrency-related.
Re:REBOL Oneliners by praptak on Sunday March 08, 2020 @04:17PM (#22520307)
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.
Re:REBOL Oneliners by greggirwin on Sunday March 08, 2020 @09:29PM (#22522116)
Rebol2 was closed source, and is no longer maintained. Red has a non-restrictive license.
Re:REBOL Oneliners by xgchiu on Monday March 09, 2020 @04:59AM (#22523982)
Low number of users doesn't mean dead. A Rebol 3 version now compiles to wasm. You can check the interpreter running in a browser at hostilefork.com/media/shared/replpad-js/
Re:REBOL Oneliners by pyuser583 on Sunday March 08, 2020 @04:20PM (#22520334)
Red is pretty awesome. Last I tried it out, it was not ready for graphics work on Linux.
Re:REBOL Oneliners by 9214 on Sunday March 08, 2020 @09:08PM (#22522011)
GTK backend is in a fairly good state, albeit lives in a separate development branch (which you are encouraged to check out).

https://www.reddit.com/r/redlang/comments/dzobh0/latest_gtk_...

https://static.red-lang.org/dl/branch/GTK/linux/red-latest

https://gitter.im/red/GTK

Re:REBOL Oneliners by timbit42 on Sunday March 08, 2020 @03:55PM (#22520155)
Logo on steroids.
Re:REBOL Oneliners by soapdog on Monday March 09, 2020 @05:30AM (#22524102)
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.

Re:REBOL Oneliners by gyrcom on Sunday March 08, 2020 @11:46PM (#22522828)
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.
Re:REBOL Oneliners by 9214 on Sunday March 08, 2020 @11:49PM (#22522843)
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.
Re:REBOL Oneliners by lbj on Monday March 09, 2020 @03:46AM (#22523690)
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?
Re:REBOL Oneliners by Izkata on Sunday March 08, 2020 @06:35PM (#22521100)
First programming language I learned, back around 2000. I still use it often for my personal projects.
Re:REBOL Oneliners by voldacar on Sunday March 08, 2020 @04:24PM (#22520358)
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 by noobdood on Sunday March 08, 2020 @04:57PM (#22520574)
IIRC I read somewhere that Rebol is homoiconic but not sure.
Re:REBOL Oneliners by Izkata on Sunday March 08, 2020 @06:29PM (#22521074)
It is. For example, in the third example:

  foreach file load %./ [if not dir? file [write/binary join ftp://user:[email protected]/ 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
Re:REBOL Oneliners by noobdood on Monday March 09, 2020 @02:05PM (#22527862)
Thanks.
Re:REBOL Oneliners by 9214 on Sunday March 08, 2020 @09:20PM (#22522066)
Curious ones can find a brief explanation of this core idea in a Github wiki (shameless plug!).

https://github.com/red/red/wiki/%5BDOC%5D-How-Red-works:-a-b...

Re:REBOL Oneliners by noobdood on Monday March 09, 2020 @02:06PM (#22527886)
Thanks.
Re:REBOL Oneliners by Zelphyr on Sunday March 08, 2020 @06:48PM (#22521196)
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.
Re:REBOL Oneliners by lwb on Sunday March 08, 2020 @04:10PM (#22520257)
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.
Re:REBOL Oneliners by adamzegelin on Sunday March 08, 2020 @04:18PM (#22520312)
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
Re:REBOL Oneliners by pmarreck on Sunday March 08, 2020 @04:36PM (#22520435)
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 by samatman on Sunday March 08, 2020 @06:26PM (#22521054)
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 by pmarreck on Wednesday March 11, 2020 @02:22AM (#22543529)
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.

Re:REBOL Oneliners by jlarocco on Sunday March 08, 2020 @07:18PM (#22521380)
Not really. I'm mostly on Debian, only using OSX for photo editting and some development, but I honestly didn't realize 32-bit desktop apps were still a thing.

I understand the frustration, though. Apple's spent the last 5 years or so dropping features I care about and breaking things important to me, across my iPhone, iPad, and MBP.

Re:REBOL Oneliners by mushufasa on Sunday March 08, 2020 @06:18PM (#22521008)
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 by kragen on Sunday March 08, 2020 @07:28PM (#22521441)
I think they're dropping support for installation on 32-bit machines, not the 32-bit libraries needed to run 32-bit software on a 64-bit OS.
Re:REBOL Oneliners by michaelmrose on Sunday March 08, 2020 @09:48PM (#22522199)
The former already happened. In this case it was the latter. this would have ruined wine right when stream was beginning to make running games with wine easy.
Re:REBOL Oneliners by kragen on Monday March 09, 2020 @04:47PM (#22529609)
Oh, thanks!
Re:REBOL Oneliners by xgchiu on Friday March 13, 2020 @08:22PM (#22572012)
There are r3 alpha builds for PPC and x64 from rebolsource.net but they're from 2013. There are sometimes daily builds of renc which are uploaded to S3 including x64 OSX from Travis-ci.
Re:REBOL Oneliners by pampa on Sunday March 08, 2020 @04:18PM (#22520318)
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/

Re:REBOL Oneliners by kragen on Sunday March 08, 2020 @07:29PM (#22521451)
Probably because they don't have a Snow Leopard machine left.
Re:REBOL Oneliners by haolez on Sunday March 08, 2020 @06:36PM (#22521110)
Looks a little like FORTH, but with batteries included.
Re:REBOL Oneliners by abrax3141 on Sunday March 08, 2020 @04:29PM (#22520388)
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 by samatman on Sunday March 08, 2020 @06:30PM (#22521079)
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.

Re:REBOL Oneliners by Izkata on Sunday March 08, 2020 @10:22PM (#22522366)
> 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.

Re:REBOL Oneliners by jmnicolas on Sunday March 08, 2020 @04:51PM (#22520526)
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 by glofish on Sunday March 08, 2020 @05:35PM (#22520779)
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 by abrax3141 on Sunday March 08, 2020 @07:39PM (#22521500)
Not undesirable, just odd to make a big deal about it. Like making a big deal about Unix pipes. Yeah, when they were invented, okay. Nowadays ... old hack.