The Red Programming Language
101–110 of 135 posts
Re: The Red Programming Language
#102Earlier 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.
Re: The Red Programming Language
#103Earlier quoted context omitted.
TBH, I feel like regexes would be much easier to understand in a more literate form with standard syntax. Something like: user_part = re.repeat(re.alnum | re.chars(".-_+")) domain_segment = re.repeat(re.alnum) domain = re.list(domain_segment,separator=".",minimum=2) email_address = user_part + "@" + domain Where, in a real program, `domain` would be defined in a "standard library of constructions" that you can just i…
recommend you check out raku Grammars … https://docs.raku.org/language/grammars
Re: The Red Programming Language
#104Languages 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-…
It has been interesting to watch the Clojure community’s take on DSLs over time. Clojure is a Lisp, and Lisps are notorious for inventing DSLs, particularly after PG’s various papers promoted that as a superpower of sorts. Clojure has gone the other direction and, while it supports macros, it generally discourages their use unless you’ve tried everything else first. But it still encourages DSLs built from the native…
Re: The Red Programming Language
#105Languages 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 like the idea of DSL, but in real projects, I hate almost every DSL introduced by coworkers.
Re: The Red Programming Language
#106Earlier quoted context omitted.
>This is like the only programming language I could never learn. Wait till you hear of Urbit and see this: https://developers.urbit.org/overview/nock
It's worth noting this work came from a prominent internet extremist. A generous interpretation would be that it is a high-effort troll.
Re: The Red Programming Language
#107Earlier quoted context omitted.
TBH, I feel like regexes would be much easier to understand in a more literate form with standard syntax. Something like: user_part = re.repeat(re.alnum | re.chars(".-_+")) domain_segment = re.repeat(re.alnum) domain = re.list(domain_segment,separator=".",minimum=2) email_address = user_part + "@" + domain Where, in a real program, `domain` would be defined in a "standard library of constructions" that you can just i…
I don't quite understand where regex gets its reputation from. I think that once you remember the meaning of the operators, it's not too bad. (And the concise syntax is actually very helpful.) I get that the meaning of the operators is not clear unless you're already familiar with regex, but neither is the meaning of !, ?, %, &, |, ^, ~, &&, ||, >, *, //, &, ++ (prefix), ++ (postfix), and so on. You learn these becau…
Re: The Red Programming Language
#108red was terrible in 2018, and its terrible now - just tried to compile hello world and it takes 36 seconds https://github.com/red/red/issues/5615
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 seem…
In my eyes it’s more important that FFI be easy, automatic, and as efficient as possible. Go imposes a significant cost on FFI, for example, and many languages have typesystems that are very unfriendly to C ABI or basically require swig.
One thing I really appreciate about Lua is that I can write Lua interfaces for my classes and methods quite easily, and even use Lua as a garbage-collected allocator for native types. Automating the generation of Lua interfaces can easily be done natively with metaprogramming, without involving dependencies like swig. It’s so good that instead of feeling like you’re figuring it out on the Lua side, it’s as if Lua puts the host language first, Lua doesn’t even need to be the owner of the process. It is almost ideal other than the clumsy interface between the stack-like C side and tables, and the dynamic parameter lists.
For so many languages FFI is an afterthought at best.
Re: The Red Programming Language
#109Earlier 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.
Re: The Red Programming Language
#110Languages 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?
That's usually what people complain about (besides the parenthesis) in that it's easy to not be very disciplined.
Lisp is homoiconic, so there isn't really a distinction between programs and data. For example, a snippet of code like a for-loop iterating through a list is also a list that can be inspected and modified. Or something along those lines (there's an XKCD comic that captures the spirit where the person says "it's all CARs" as in lisp you can build everything from CAR, CDR, and CONS I think). You'll have to dig into that on your own. The terms are historically relevant, but seem antiquated now. I've never really understood macros (compile or runtime ones) all that well though, so hopefully someone else in the comics can clarify my mumbo jumbo.