Languages that encourage making DSLs are a two-edged sword. On the one hand, you get to make a language that is more clear and fine-tuned to your use-case. On the other, you have an ad-hoc language with no support that you have to maintain along with the documentation (considering that you can't expect anyone else to know the DSL ahead of time). As I've gotten older, I've determined that well-designed APIs in a well-known language are a better alternative to DSLs.
vidarh · 2h ago
An API is just as much a DSL.
90s_dev · 2h ago
No, an API uses existing rules, but a DSL uses its own ad hoc rules.
GP is right. Don't make DSLs, make APIs, which are:
* More composable
* More reusable
* More simple to reason about
* More natively supported
* More portable
* More readable
* More maintainable
tuveson · 1h ago
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 purpose language.
Those are things that spring to mind that I think are unequivocally DSLs, but if you’re willing to consider markup languages as DSLs, the list could get a lot longer.
90s_dev · 1h ago
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.
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 day. Once I decide to use `define-syntax` I've then got to decide whether I also want to wade into dealing with also implementing a syntax colorer or an indenter as part of my #lang. And if I do decide to do that, then I've got a bunch more work, and am also probably committing to working in DrRacket (otherwise I'd rather stay in emacs) because that's the only editor that supports those features, and it just turns into a whole quagmire.
And it's arguably even worse outside of Racket, where I might have to implement a whole language server and editor plugin to accomplish the same.
Versus, if I can do what I need to do with a reasonably tidy API, then I can get those quality of life things without all the extra maintenance burden.
None of this was a big deal 20 years ago. My expectations were different back then, because I hadn't been spoiled by things like the language server protocol and everyone (finally) agreeing that autoformatting is a Good Thing.
AnimalMuppet · 2h ago
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.
fn-mote · 38m ago
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.
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.
kstrauser · 6h ago
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.
I wrote a small app in REBOL once, just too automate some stuff for some managers in a job about 20 years ago. It's quite nice, but I don't think I'd want to write anything significant with it.
Izkata · 1h ago
I don't remember how I found it, but REBOL was one of the first programming languages I learned around 25 years ago. Most of my personal projects are still written in it.
I have yet to try converting anything to Red.
kbelder · 4h ago
I used it once to build a simple web scraper and image downloader, and it worked really great for that. It was right in the wheelhouse for the language. (That was REBOL, not RED, and many years ago.) Honestly I'd just do it in Python, now, even though it's not as interesting.
dev_l1x_be · 5h ago
"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 Internet TV set-top boxes."
What a legend!
kstrauser · 5h ago
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.
Izkata · 1h ago
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).
tejtm · 41m ago
pretty sure he finished out his post Rebol career with Roku
ksymph · 19m ago
Here [0] is an example of what it looks like. Took some digging to find, really should be more prominent on the site.
It's very elegant! I can't fully grasp everything that's happening but the visual appearance of the syntax alone is interesting.
I figured they were cooked when they started doing weird cryptocurrency-related stuff. I really hope they get to their 1.0 release someday.
7thaccount · 5h ago
Same. I was regularly following it until they started talking about an ICO and began focusing too much on making a dialect for block chain stuff.
The idea between having the red system language, regular scripting language, cross platform gui, and native executables was really cool though. I remember being interested back in ~2015, so my question is...what's going on as it's been a decade. I know the project is crazy ambitious of course, but how close are we to where this is at a stage where most would consider it production worthy.
troupo · 5h ago
IIRC think their original roadmap had 1.0 around 2020. And that was going to include everything, including async written from scratch in a language where nothing was made for async.
Then the roadmap slipped, and then never mentioned again.
But I haven't looked at the language or discussions around it for a long while now.
For me, it even went off the rails before, when Nenad went to China because he was able to raise funds for the project. But he hadn't anticipated that he would be in charge and not the other way around. The situation seems to suit him perfectly. I don't think Red has any future at this point. In any case, the roadmap has always been stratospheric.
em-bee · 1h ago
can you elaborate what you mean by not anticipating that he would be in charge?
btw, i met him in beijing while he was there.
lagniappe · 53m ago
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.
ttoinou · 5h ago
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
TOGoS · 5h ago
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 up being grouped like
(send friend@rebol.com (read http://www.cnn.com))
(which I think is valid syntax; that AST node is called a 'paren').
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.
[1] 'parsing' happens so late that it feels funny to call it that. The thing that knows how to treat an array as a representation of an evaluatable expression and evaluate it.
Izkata · 27m ago
> 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?"
it's lisp with square braces instead of parens (and then a whole bunch of other random things like a gui library in the standard library?)
timbit42 · 5h ago
It's actually more like Logo, which is Lisp with square brackets instead of parens and fixed arity.
Sassenrath wrote Amiga Logo before starting REBOL.
TOGoS · 5h ago
The square brackets aren't really analogous to Lisp's parentheses; REBOL / RED use parentheses for the same purpose, if you need them. The square brackets are more like square brackets in Factor or Joy; they are 'quotations' around a list of words (or other syntactic structures; basically they make a list that is not evaluated immediately).
dmitrygr · 4h ago
>This is like the only programming language I could never learn.
I spent too long trying to learn this & hoon, not worth it ;_;
bsrkf · 3h ago
When I look at a programming language site, especially for a "new" language, I want a quick way to navigate to a reasonably sized decent code sample, ideally documented, showing off significant language features, idiomatic syntax and usage patterns etc...
Sites which do this well (just from the top of my head):
https://odin-lang.org/
immediate code sample visible
"See the Full Demo"
"See More Examples"
https://ziglang.org/
immediate code sample
scroll down a bit, "More Code Samples"
Here on red-lang.org... I can barely find a consecutive meaningful chunk of code... ?
"Getting Started" Nope
"Documentation" Nope
"Official Documentation" link to github
https://github.com/red/docs/blob/master/en/SUMMARY.adoc
"Home"
merely a chronologically sorted blog
newest entry links to 50 line "script" by chance
showing off multi-monitor support
(doesn't seem like a super helpful sample)
?
But no one has bothered to write a complete manual like Carl did for Rebol, and the language is a partial implementation in Rebol which has a hybrid Rebol/Red syntax that must ultimately be bootstrapped in Red. In short, you have the scaffolding around it and if you are not a total fan or a dev of the project it is not even worth it.
HexDecOctBin · 1h ago
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).
croemer · 4h ago
The website looks like 2013 and much of the content is as well. There's a GitHub repo that I couldn't find from the website: https://github.com/red/red
worldsayshi · 4h ago
The repo seems to be alive and kicking.
niek_pas · 4h ago
I haven’t looked at this in detail, but it seems they confuse “human-friendly syntax” with “absence of (<[{“.
emmelaich · 31m ago
(2011,2013)
Seems the last release (alpha) was in 2015.
zerealshadowban · 3h ago
ah, this is not about the Red Language that Intermetrics designed in 1977-79 to satisfy the Steelman requirements of the DoD's High Order Language Working Group... (the Green Language won and became known as Ada).
I thought maybe someone had put the DoD's Red language spec online.
I have tried Rebol out a little, multiple times over the years. it's a cool language. I like it.
I also got to know about Red early, followed it and tried it out for a bit.
but as others have said, that move to crypto, to fund the dev work and make the devs money, put me off for good. nothing wrong with making money, let them make plenty, I just didn't jive with crypto as a way of doing it.
sad about it going that route
ConanRus · 5h ago
32 bit only
38 · 3h ago
red was terrible in 2018, and its terrible now - just tried to compile hello world and it takes 36 seconds
Go compiles massive codebases in that time. V can recompile itself probably 2-3x in that time.
I don't take any new language seriously unless it's memory safe, free of UB, able to interoperate with what already exists including optional shared libraries (because static linking the world every time in everything is memory and disk wasteful), and assists formal proofs of correctness. Otherwise, what already exists seems preferable for serious use and hobbies can remain fun distractions.
GP is right. Don't make DSLs, make APIs, which are:
* More composable
* More reusable
* More simple to reason about
* More natively supported
* More portable
* More readable
* More maintainable
Those are things that spring to mind that I think are unequivocally DSLs, but if you’re willing to consider markup languages as DSLs, the list could get a lot longer.
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.
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 day. Once I decide to use `define-syntax` I've then got to decide whether I also want to wade into dealing with also implementing a syntax colorer or an indenter as part of my #lang. And if I do decide to do that, then I've got a bunch more work, and am also probably committing to working in DrRacket (otherwise I'd rather stay in emacs) because that's the only editor that supports those features, and it just turns into a whole quagmire.
And it's arguably even worse outside of Racket, where I might have to implement a whole language server and editor plugin to accomplish the same.
Versus, if I can do what I need to do with a reasonably tidy API, then I can get those quality of life things without all the extra maintenance burden.
None of this was a big deal 20 years ago. My expectations were different back then, because I hadn't been spoiled by things like the language server protocol and everyone (finally) agreeing that autoformatting is a Good Thing.
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
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
I have yet to try converting anything to Red.
What a legend!
It's very elegant! I can't fully grasp everything that's happening but the visual appearance of the syntax alone is interesting.
[0] https://github.com/red/code/blob/master/Scripts/clock.red
The idea between having the red system language, regular scripting language, cross platform gui, and native executables was really cool though. I remember being interested back in ~2015, so my question is...what's going on as it's been a decade. I know the project is crazy ambitious of course, but how close are we to where this is at a stage where most would consider it production worthy.
Then the roadmap slipped, and then never mentioned again.
But I haven't looked at the language or discussions around it for a long while now.
Edit: found some old discussion here. In 2018 they were at version 0.6.4 https://news.ycombinator.com/item?id=18864840
In 2025 they are at version 0.6.6: https://github.com/red/red/releases
btw, i met him in beijing while he was there.
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.
[1] 'parsing' happens so late that it feels funny to call it that. The thing that knows how to treat an array as a representation of an evaluatable expression and evaluate it.
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?"
Sassenrath wrote Amiga Logo before starting REBOL.
Wait till you hear of Urbit and see this: https://developers.urbit.org/overview/nock
Sites which do this well (just from the top of my head):
Here on red-lang.org... I can barely find a consecutive meaningful chunk of code... ?But no one has bothered to write a complete manual like Carl did for Rebol, and the language is a partial implementation in Rebol which has a hybrid Rebol/Red syntax that must ultimately be bootstrapped in Red. In short, you have the scaffolding around it and if you are not a total fan or a dev of the project it is not even worth it.
Seems the last release (alpha) was in 2015.
I thought maybe someone had put the DoD's Red language spec online.
And yes, someone has: https://iment.com/maida/computer/redref/
I also got to know about Red early, followed it and tried it out for a bit.
but as others have said, that move to crypto, to fund the dev work and make the devs money, put me off for good. nothing wrong with making money, let them make plenty, I just didn't jive with crypto as a way of doing it.
sad about it going that route
https://github.com/red/red/issues/5615
I don't take any new language seriously unless it's memory safe, free of UB, able to interoperate with what already exists including optional shared libraries (because static linking the world every time in everything is memory and disk wasteful), and assists formal proofs of correctness. Otherwise, what already exists seems preferable for serious use and hobbies can remain fun distractions.