Live data from Hacker News

The Red Programming Language

red-lang.org

81–90 of 135 posts

Re: The Red Programming Language

#81
post #69
post #27

Earlier quoted context omitted.

An API is just as much a DSL.

No, an API is a contract. Just like an object or a class or a structure is not a DSL. None of these modify the syntax or keywords of the language used to implement them, and only objects and classes actually have the ability to override operators. Just grouping things together in a particular order and giving the group a name does not make a DSL.

The API creates a language just the same modifying syntax, by introducing new words with new meaning.

The point is that however you want to group it, the effect is the same: You introduce a whole new vocabulary that you need to learn the rules of.

Re: The Red Programming Language

#82

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-…

An API is an interface, metaprogramming is a technique for building such interfaces by treating code as data. They aren't interchangeable concepts.

Metaprogramming comes in handy when ordinary programming results in a lot of complex, hence unmaintainable, code or can't achieve something due to how the language is implemented. It can vastly simplify how you express application logic, e.g. when interfacing with foreign programming languages such as SQL or generating code from data.

Any sane metaprogramming regime allows you to do something like macro expansion, i.e. look at the code the metaprogramming is compiled into in the current context.

Re: The Red Programming Language

#83
post #51

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. [0] https://github.com/red/code/blob/master/Scripts/clock.red

Seems someone built an ETL product from XML to databases.

https://redata.dev/smartxml/

If it's robust it seems rather neat.

Re: The Red Programming Language

#84

I know asciidoc from red and erlang, it's a nice language. Not sure why it is not as popular as markdown.

It's a little more complex, but I like it too. I've worked in teams that put all in-repo documentation in Asciidoc, it was really nice for adding in diagrams of complex systems and dependency trees.

Re: The Red Programming Language

#85
I cant find some stuff from the docs. What i am wondering is:

For 'platforms' it notes for x86_64, "linux" and other operating systems.

is there a compiler option for this thing to make it spit out a 'freestanding' binary for the architectures it supports?

Re: The Red Programming Language

#86

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-…

this is a very important lesson. I remember the frustration of dealing with the Gradle and whatever was the name of the DSL used by Fastlane. Gradle especially kept changing so documentation was never really useful and there was zero help from the tooling

Re: The Red Programming Language

#87
post #54
post #3

I figured they were cooked when they started doing weird cryptocurrency-related stuff. I really hope they get to their 1.0 release someday.

Interesting, that at least explains why this happens a little bit. https://i.imgur.com/a/phd4lVr

Holy nanny state. The authors of a language have thought about using cryptocurrency, so it's flagged as a phishing and scam site? Literally 1984.

Re: The Red Programming Language

#88
post #50

Earlier quoted context omitted.

> 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,…

From your brief description that is likely incomplete, it looks as if the length? function is treated as a prefix operator of low precedence relative to the infix operators. The infix operators are all at the same precedence level and have left-to-right associativity. I made an infix parser in which certain prefix operators (named math functions) have a low precedence. This allows for things like 1> log10 5 + 5 ;; i.…

Not sure why you got downvoted, but Rebol is not a Lisp. It doesn't work because of precedence rules or special rules, but because arguments accumulate until there are enough to eval the previous function in the stack, so you can do stuff like

  print tostring 5 + cos pi
Works a bit like a shift/reduce parser, with heavy use of fexprs (blocks in Rebol parlance)

I know you enjoy Lisps, so you might like this toy Rebol evaluator written in Scheme: http://ll1.ai.mit.edu/marshall.html

Re: The Red Programming Language

#89

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-…

I heard that in Lisp every program becomes a DSL?

Re: The Red Programming Language

#90
post #87
post #54

Earlier quoted context omitted.

Interesting, that at least explains why this happens a little bit. https://i.imgur.com/a/phd4lVr

Holy nanny state. The authors of a language have thought about using cryptocurrency, so it's flagged as a phishing and scam site? Literally 1984.

It's a community maintained block list. You may be able to do something about it. So, not 1984 all the way.
Post reply on HN