TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Red Programming Language

213 点作者 hotpocket77712 天前

22 条评论

taylorallred12 天前
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.
评论 #44048786 未加载
评论 #44048609 未加载
评论 #44047814 未加载
评论 #44050138 未加载
评论 #44051015 未加载
评论 #44055308 未加载
评论 #44046667 未加载
评论 #44049114 未加载
评论 #44049265 未加载
评论 #44049725 未加载
kstrauser12 天前
This is a successor to REBOL[0], designed by Carl Sassenrath[1] who designed the Amiga kernel.<p>I&#x27;ve looked it a few times over the years. It&#x27;s neat. I&#x27;ve never written a single line of it, though.<p>[0]<a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Rebol" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Rebol</a><p>[1]<a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Carl_Sassenrath" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Carl_Sassenrath</a>
评论 #44047245 未加载
评论 #44046100 未加载
评论 #44045458 未加载
评论 #44045956 未加载
justin6612 天前
I figured they were cooked when they started doing weird cryptocurrency-related stuff. I really hope they get to their 1.0 release someday.
评论 #44045187 未加载
评论 #44047677 未加载
greggirwin2 天前
1) I&#x27;m part of Team Red. 2) You can like, dislike, embrace, or discount a language (or anything for that matter) for any reason that&#x27;s important to you. 3) I&#x27;m not here to convince anyone of anything, just to provide some information and my own thoughts and opinions. 4) I&#x27;m not going to justify or argue the state of things in Red today. It is what it is. Lots of high level things are easy to talk (or complain) about, while some other really cool tech lives in the shadows, but is also important. 5) In Red we call embedded DSLs &quot;dialects&quot;, just for clarity in what I write.<p>Red is more different than you may think, just by looking at it. It is designed such that things that look familiar may work very differently under the hood. That&#x27;s good for making people comfortable, but also means you can&#x27;t judge a book completely by its cover.<p>Red is a data format first. That&#x27;s very Lisp-like, but Red goes further with the large number of datatypes that have a lexical form. e.g. email, url, pair, point, file, date, time, money, etc. Where Lisp* says code is data and data is code, we tend to say &quot;Everything is data until it is evaluated.&quot; Rebol was only interpreted, but Red (not all Red however, as some things are too dynamic and require JiT, which we don&#x27;t have yet) can be compiled.<p>Red compiles to Red&#x2F;System (R&#x2F;S) code. R&#x2F;S is a static dialect (DSL) of Red, which compiles directly to machine code. No external compiler or C code gen. So you can write DSLs in Red, and those DSLs can be higher or lower level. We call this Metal to Meta programming. Compile a small R&#x2F;S program, and you will see it&#x27;s fast, and fully standalone. Compile Red in Dev mode, where the runtime isn&#x27;t rebuilt, and it&#x27;s also fast (after the first time). Compile in encap mode and...more to explain. Compile for release and it takes time, but gives you a standalone EXE. It&#x27;s slow for a number of reasons. Just the current state of things. Compilation speed has not been a priority.<p>On APIs vs DSLs, a key distinction for me is that API don&#x27;t have a natural way to enforce the order of operations. That&#x27;s where a grammar adds value. And because Red is often self-consuming data, the ability to write grammars (`parse` rules) that are very BNF&#x2F;PEG like, it makes data handling quite powerful. I also think it&#x27;s easier than most other systems, but that&#x27;s me, and I&#x27;ve been in the Redbol (Red+Rebol) world for a long time. Two related notes on that. 1) `parse` is, itself a dialect of Red. 2) You can parse not only at the character&#x2F;string level, but at the value and datatype level, including literal values and typesets. Typesets are a way to express datatypes that are related. e.g. the `number!` typeset matches `[integer! float! percent!]` types. All that said, Red is a multi-paradigm language, including functional (though not pure functional), so you can absolutely build things in an OOP&#x2F;lib&#x2F;API manner if you prefer.<p>Infix came up, and the model is simple. Infix ops have a higher precedence than func calls, but there is no other operator precedence. Strictly left to right for ops. And, yes, operators are a datatype and you can make your own from most 2-arity funcs.<p>Func args are not enclosed in parens or brackets. This is a fundamental aspect that takes some getting used to. Once you do, at least from what I&#x27;ve seen through the years, it feels natural. We call this &quot;free ranging evaluation&quot; and it&#x27;s a powerful aspect of Red. It also plays into dialect design. Red is sufficiently flexible that you could hack around this if you want, but then you&#x27;re fighting the language, rather than working with it.<p>Red is high level and garbage collected, but it is not &quot;safe&quot; by some standards. Mutability is the default, values are strongly typed but variables are not, you can mix Red and Red&#x2F;System pretty much however you want, and R&#x2F;S is basically a C-level language. We talk about these tradeoffs a lot, and how to find a balance. Nothing comes for free.<p>One of the main dialects in Red, along with `parse`, is the `VID Visual Interface Dialect`. This is how you describe GUIs for Red&#x27;s cross platform GUI system. You could also build a tree of faces manually, or write your own GUI dialect or API.<p>Another cross-platform note. Yes, we are 32-bit only at the moment. It hurts us as much as it hurts you. But Red can cross compile from and to any system it runs on. No other software or compilers needed; just a command line switch.<p>One of our primary goals is to &quot;fight software complexity&quot;. That doesn&#x27;t mean Red will look like C, or JS, or Python. It doesn&#x27;t mean any one thing. It means a lot of things working in concert. We also hope to keep Red small and easy to set up. Today you can still just drop the EXE somewhere and go. The toolchain (interpreter+compiler) is ~1.5M and the REPLs (text mode and GUI mode, separately) are just over ~2M. We may offer more options at some point, ideas like using LLVM come up a lot. While they solve some problems, they create others. So far, the costs have been deemed unacceptable, and we don&#x27;t have any showstoppers (other than time). But since Red is open source, with a permissive license...<p>Happy Reducing!
ksymph11 天前
Here [0] is an example of what it looks like. Took some digging to find, really should be more prominent on the site.<p>It&#x27;s very elegant! I can&#x27;t fully grasp everything that&#x27;s happening but the visual appearance of the syntax alone is interesting.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;red&#x2F;code&#x2F;blob&#x2F;master&#x2F;Scripts&#x2F;clock.red">https:&#x2F;&#x2F;github.com&#x2F;red&#x2F;code&#x2F;blob&#x2F;master&#x2F;Scripts&#x2F;clock.red</a>
评论 #44048246 未加载
评论 #44049155 未加载
fuzztester12 天前
I have tried Rebol out a little, multiple times over the years. it&#x27;s a cool language. I like it.<p>I also got to know about Red early, followed it and tried it out for a bit.<p>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&#x27;t jive with crypto as a way of doing it.<p>sad about it going that route
ttoinou12 天前
This is like the only programming language I could never learn. I just don&#x27;t understand anything and I can&#x27;t build any mental model of what&#x27;s going on behind the hood
评论 #44045570 未加载
评论 #44045530 未加载
评论 #44046197 未加载
bsrkf12 天前
When I look at a programming language site, especially for a &quot;new&quot; 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...<p>Sites which do this well (just from the top of my head):<p><pre><code> https:&#x2F;&#x2F;odin-lang.org&#x2F; immediate code sample visible &quot;See the Full Demo&quot; &quot;See More Examples&quot; https:&#x2F;&#x2F;ziglang.org&#x2F; immediate code sample scroll down a bit, &quot;More Code Samples&quot; </code></pre> Here on red-lang.org... I can barely find a consecutive meaningful chunk of code... ?<p><pre><code> &quot;Getting Started&quot; Nope &quot;Documentation&quot; Nope &quot;Official Documentation&quot; link to github https:&#x2F;&#x2F;github.com&#x2F;red&#x2F;docs&#x2F;blob&#x2F;master&#x2F;en&#x2F;SUMMARY.adoc &quot;Home&quot; merely a chronologically sorted blog newest entry links to 50 line &quot;script&quot; by chance showing off multi-monitor support (doesn&#x27;t seem like a super helpful sample) ?</code></pre>
评论 #44046935 未加载
评论 #44050266 未加载
zerealshadowban12 天前
ah, this is not about the Red Language that Intermetrics designed in 1977-79 to satisfy the Steelman requirements of the DoD&#x27;s High Order Language Working Group... (the Green Language won and became known as Ada).<p>I thought maybe someone had put the DoD&#x27;s Red language spec online.<p>And yes, someone has: <a href="https:&#x2F;&#x2F;iment.com&#x2F;maida&#x2F;computer&#x2F;redref&#x2F;" rel="nofollow">https:&#x2F;&#x2F;iment.com&#x2F;maida&#x2F;computer&#x2F;redref&#x2F;</a>
HexDecOctBin11 天前
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).
评论 #44048172 未加载
spjt11 天前
Maybe it&#x27;s just bias based on what I&#x27;m familiar with but I don&#x27;t really like the syntax, or at least I can&#x27;t understand any of it intuitively. Looking at the few examples I can find, it doesn&#x27;t appear to be obvious without having to look at and interpret a bunch of surrounding context for clues to what a particular token is, e.g. a function name, a variable, an argument to a function and what function it is an argument to, the type of a variable, a value being assigned to it, etc. I see a lot of lines of code that are just several strings in a row without any sort of punctuation.
lagniappe11 天前
<p><pre><code> 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:&#x2F;&#x2F;www.red-lang.org&#x2F;p&#x2F;about.html anyway.</code></pre>
评论 #44048158 未加载
aabbcc124111 天前
I know asciidoc from red and erlang, it&#x27;s a nice language. Not sure why it is not as popular as markdown.
评论 #44049820 未加载
评论 #44049189 未加载
ConanRus12 天前
32 bit only
评论 #44048060 未加载
debo_11 天前
In Red, you&#x27;ll presumably always know what color your functions are.
kscarlet11 天前
&gt; Red’s ambitious goal is to build the world’s first full-stack language, a language you can use from system programming tasks, up to high-level scripting through DSL.<p>Pretty nonsensical statement. We have that for 50 years. Common Lisp, for example.
croemer12 天前
The website looks like 2013 and much of the content is as well. There&#x27;s a GitHub repo that I couldn&#x27;t find from the website: <a href="https:&#x2F;&#x2F;github.com&#x2F;red&#x2F;red">https:&#x2F;&#x2F;github.com&#x2F;red&#x2F;red</a>
评论 #44047811 未加载
评论 #44046019 未加载
niek_pas12 天前
I haven’t looked at this in detail, but it seems they confuse “human-friendly syntax” with “absence of (&lt;[{“.
dittonedo7 天前
Seems lovable
sim7c0011 天前
I cant find some stuff from the docs. What i am wondering is:<p>For &#x27;platforms&#x27; it notes for x86_64, &quot;linux&quot; and other operating systems.<p>is there a compiler option for this thing to make it spit out a &#x27;freestanding&#x27; binary for the architectures it supports?
emmelaich11 天前
(2011,2013)<p>Seems the last release (alpha) was in 2015.
3812 天前
red was terrible in 2018, and its terrible now - just tried to compile hello world and it takes 36 seconds<p><a href="https:&#x2F;&#x2F;github.com&#x2F;red&#x2F;red&#x2F;issues&#x2F;5615">https:&#x2F;&#x2F;github.com&#x2F;red&#x2F;red&#x2F;issues&#x2F;5615</a>
评论 #44047152 未加载