Live data from Hacker News

The Red Programming Language

red-lang.org

41–50 of 135 posts

Re: The Red Programming Language

#41
post #35

Earlier quoted context omitted.

Even without the new spiffs, I still don't see the point of DSLs. From where I sit, I see exactly zero problems where I think that new syntax is what I need to be able to write a solution.

Regex

Fair point, though I learned regexes a long time ago, so that they weren't on my "problems that I can solve with new syntax" list, but instead on the "syntax that's already there" list.

Re: The Red Programming Language

#42
post #39
post #37

Earlier quoted context omitted.

There are plenty of places where it makes more sense to use DSLs (or where they’re flat-out required). SQL and regex both spring to mind. Pretty much any HTML templating language is simpler to use than concatenation a bunch of strings together. JSX is usually easier read than directly calling React functions directly. A line of a shell script can be much nicer (and more portable) than 20 lines of a more general purpo…

Most people think of DSLs as a language you can create within a language . All the things you named are either entire languages themselves like HTML, SQL, and the shell family, or formal extensions of existing languages like JSX. A DSL would be something you could create inside JS tagged literals or Ruby.

I don't think of DSLs as strictly being embedded in another programming language. The term I would use for that is "eDSL", short for Embedded Domain Specific Language. See: https://wiki.haskell.org/Embedded_domain_specific_language

Re: The Red Programming Language

#43
So, REBOL and Red are basically Fexpr-based Lisps, right? They never describe themselves this way (instead using terms like definitional scoping, etc.), but it all just seems like a non-rigorous Fexpr based Lisp (almost like a light-weight version of vau-calculus of Kernel).

Re: The Red Programming Language

#44

Earlier quoted context omitted.

"In 1988, Sassenrath left Silicon Valley for the mountains of Ukiah valley, 2 hours north of San Francisco. From there he founded multimedia technology companies such as Pantaray, American Multimedia, and VideoStream. He also implemented the Logo programming language for the Amiga, managed the software OS development for CDTV, one of the first CD-ROM TV set-top boxes, and wrote the OS for Viscorp Ed, one of the first…

Right? And I think that's what keeps bringing me back to REBOL, and thus Red. They don't appeal to me on the face of them. Like, the code examples look interesting but in a "magical" kind of way that strikes a little bit of fear into my engineering heart. But with that kind of pedigree, I can't dismiss the ideas. If Sassenrath came up with it, I bet there's a kernel of awesomeness inside.

I suspect a lot of the magic will fall away after realizing the block data structure (the square brackets) are pretty close to a Lisp list. And just like in Lisp, they're used for both code and data. One big difference is words are evaluated by default instead of just the first word in a list, so there's nowhere near as much nesting, and whenever an expression ends the next one can begin with no delimiter (but use newlines for legibility).

Re: The Red Programming Language

#45

    red-lang.org is blocked!

    Phantom believes this website is malicious and unsafe to use.

    This site has been flagged as part of a community-maintained database of known phishing websites and scams. If you believe the site has been flagged in error, please file an issue.

    Ignore this warning, take me to https://www.red-lang.org/p/about.html anyway.

Re: The Red Programming Language

#46

This is a successor to REBOL[0], designed by Carl Sassenrath[1] who designed the Amiga kernel. I've looked it a few times over the years. It's neat. I've never written a single line of it, though. [0] https://en.wikipedia.org/wiki/Rebol [1] https://en.wikipedia.org/wiki/Carl_Sassenrath

"In 1988, Sassenrath left Silicon Valley for the mountains of Ukiah valley, 2 hours north of San Francisco. From there he founded multimedia technology companies such as Pantaray, American Multimedia, and VideoStream. He also implemented the Logo programming language for the Amiga, managed the software OS development for CDTV, one of the first CD-ROM TV set-top boxes, and wrote the OS for Viscorp Ed, one of the first…

pretty sure he finished out his post Rebol career with Roku

Re: The Red Programming Language

#47
post #39
post #37

Earlier quoted context omitted.

There are plenty of places where it makes more sense to use DSLs (or where they’re flat-out required). SQL and regex both spring to mind. Pretty much any HTML templating language is simpler to use than concatenation a bunch of strings together. JSX is usually easier read than directly calling React functions directly. A line of a shell script can be much nicer (and more portable) than 20 lines of a more general purpo…

Most people think of DSLs as a language you can create within a language . All the things you named are either entire languages themselves like HTML, SQL, and the shell family, or formal extensions of existing languages like JSX. A DSL would be something you could create inside JS tagged literals or Ruby.

Martin Fowler on DSLs, including internal and external DSLs:

https://martinfowler.com/books/dsl.html

https://martinfowler.com/dsl.html

Also see:

https://en.m.wikipedia.org/wiki/Domain-specific_language

including the References section.

Re: The Red Programming Language

#48

Earlier quoted context omitted.

Kind of, except that a non-DSL API doesn't create any new syntax. Which means that you get to keep all sorts of quality-of-life tools like syntax highlighting and correctness checking in the editor, autoformatting, possibly some amount of linting, etc. A few years ago I revisited Racket after a long hiatus, and that was maybe the biggest thing I noticed. I really don't like syntax macros as much as I did back in the…

Even without the new spiffs, I still don't see the point of DSLs. From where I sit, I see exactly zero problems where I think that new syntax is what I need to be able to write a solution.

I used to feel that way. I’m still not a convert, but now I’ve seen a lot more complexity papered over by a nice DSL.

Standard math syntax is a DSL. I understand math a lot more quickly than I understand the same thing written in 20 lines of code.

I think the language we use to express ourselves influence the quality of the product. If your language encapsulates complexity, then you can build more complicated things.

I’m not arguing in favor of specific (“pointless”) DSLs, but there’s a nice paper about making a video editing language in Racket [1] that makes a DSL seem pretty convincing.

[1]: https://www2.ccs.neu.edu/racket/pubs/icfp17-acf.pdf

Re: The Red Programming Language

#50
post #9
post #7

This is like the only programming language I could never learn. I just don't understand anything and I can't build any mental model of what's going on behind the hood

I wrote a paper on REBOL back in college. It is very interesting, but the syntax is definitely weird. You might think of the function call syntax as being sort of Forth-like, but with the tokens in reverse order. So like a Lisp, but without required parentheses. e.g. in the example send friend@rebol.com read http://www.cnn.com `read` knows that it takes one argument, and `send` knows that it takes two, so this ends u…

> Weirdly, the language also has some infix operators, which seem a bit out-of-place to me. I have no idea how the 'parser'[1] works.

There are no keywords or statements, only expressions. Square backets ("blocks") are used for both code and data, similar to a Lisp list. The main language (called the "'do' dialect") is entirely polish notation with a single exception for infix operators: Whenever a token is consumed, check the following token for an infix operator. If it is one, also immediately consume the immediately following one to evaluate the infix operator.

This results in a few oddities / small pitfalls, but it's very consistent:

* "2 + 2 * 2" = 8 because there is no order of operations, infix operators are simply evaluated as they're seen

* "length? name < 10" errors (if "name" isn't a number) because the infix operator "<" is evaluated first to create the argument to "length?"

Post reply on HN