12 ms·
Red programming language 0.6.2: LibRed and Macros
- sevensor 10y agoI've noticed that Red shows up on HN with some regularity, and it sounds interesting. But I don't really understand where it comes from or who it's meant for. The Red / REBOL community seems more than usually self-contained, although it's possible that it's because almost everybody involved is Czech, and I am not. It seems like most of the English-language resources for Rebol were written by one guy with a thing for really long website names like withoutwritingcode.com.
- dragonwriter 10y ago> The Red / REBOL community seems more than usually self-contained, although it's possible that it's because almost everybody involved is Czech, and I am not. REBOL being proprietary when the big F/OSS scripting languages were taking off in popularity was probably a problem for mindshare and community breadth.
- pebblexe 10y agoI remember reading somewhere that there is funding/support from China. I can't find any support for that. I stumbled upon this site in my search though http://red.reb4.me/ http://red.reb4.me/
- mapcars 10y agoAt least some part of the Red team works from China, that's true. And looks like you found an old website :)
- greggirwin 10y agoYes, Team Red (as I like to call them), got some funding from a tech incubator, and Red's creator became Entrepreneur-in-Residence there for a time.
- vram22 10y agoThis link has all the links from red-lang.org that were posted on HN: https://news.ycombinator.com/from?site=red-lang.org https://news.ycombinator.com/from?site=red-lang.org And from that I saw: http://www.red-lang.org/2015/01/dream-big-work-hard-and-make-it-happen.html http://www.red-lang.org/2015/01/dream-big-work-hard-and-make... which mentions the funding etc.
- SwellJoe 10y agoREBOL was first built by Carl Sassenrath, who is probably best known for his work on the Amiga operating system. REBOL was cool, but happened when a half dozen similarly cool languages sprung up that also had the feature of being free and open source (while REBOL was proprietary and cost a little money). REBOL had some novel ideas, and some shortcuts for some particular types of development making for strikingly concise code in some specific cases, and overall a nice design. I think it's neat that there's an OSS implementation, but I have so many other things on my todo list that I've never done more than give it a glance. I just don't see how I'd make productive use of it in the kinds of projects I do (given interop requirements I have).
- throwaway7645 10y agoPlease give Red a look. It can run like Python or can be made compiled AOT to a tiny binary using a C like systems language that runs fast. You can call Red from C and possibly vice-versa (not sure bout the latter). It has an awesome REPL, amazing GUI DSL, is homoiconic like lisp for easy macros, and is OS/free. I'm not sure where this couldn't be used as it can be both super high level or very low level.
- nickpsecurity 10y agoIll add they have Red/System for low-level. Some kernel or server coders should try putting some code through it to see how it does.
- throwaway7645 10y agoFair enough, even if it is great, it won't have 30 years of optimizations like some C compilers, but hopefully it is still really fast.
- greggirwin 10y agoThe compiler doesn't optimize at all right now, but aims for simplicity. There was an article some time back about the best switches to use for most C compilers: compile for size. It often gave some of the best performance IIRC, the rationale being better cache use on chips.
- pekr 10y agoNot everybody is from Czech, but I am. History of Red comes back to the Rebol era, which goes back to the Amiga era and AmigaOS author, Carl Sassenrath, who created Rebol. Czech Amiga scene had strong following, hence some ppl ended up following Carl and his Rebol. We moved on onto Red, which is strongly inspired by Rebol ...
- soapdog 10y agoCirca 1999 REBOL was our language of choice at our tiny company. It allowed our small team to develop faster than our competitors. We still did a ton of PHP and Java because our clients required it but lots of our internal tools were REBOL based and were quite pleasant to use and extend. I have been following Red from a distance waiting for it to be ready for the kind of usage I want to put it through (mostly small desktop apps). I think that Red / REBOL are among the most fun languages to use for personal projects. PS: Brazilian, not Czech...
- vanderZwan 10y agoIs Brazilian CompSci culture relatively oriented towards embeddable languages? Lua and Céu come from there too. Might explain the adoption rate of Red.
- soapdog 10y agoI don't think we can say that Brazilian CompSci is oriented towards embedding. I studied at the university where Lua and Céu were created, so my personal experience is biased towards such languages and yet, I don't remember us focusing on the embedding part. Our REBOL experience was also not related to embedding but towards expressiveness and quick prototyping. I think I expressed myself badly, when I said "Brazilian, not Czech", I was just referring to myself, as a new non-Czech datapoint :-D, Red is not Brazilian.
- mVChr 10y agoI've never seen a language with such a variety of built-in data types (e.g. coordinates, tags, email, url, issues). There's support for IPv4 numbers as a base type (tuples) but I can't tell if there's support for IPv6, which shows the trouble with this approach for the language maintainers.
- throwaway7645 10y agoLanguage is still in active and early development, so it could be added. Having primitive types for a lot of things makes for some very short, yet still easy to read code.
- taliesinb 10y agoWhere do you see a nice list of these types?
- throwaway7645 10y agoThe Red website has it somewhere, but they're focusing on the Lang and not the site at the moment, so it might be hard to find. I think the Rebol website (successor language that is mostly compatible although interpreted only) should have a lot of those.
- JadeNB 10y ago> I think the Rebol website (successor language that is mostly compatible although interpreted only) …. I think that this is backwards; Red is inspired by Rebol, which is relatively old: > Red is a computer programming language. Red was made to overcome the limitations of the programming language Rebol. (https://en.wikipedia.org/wiki/Red_(programming_language) https://en.wikipedia.org/wiki/Red_(programming_language) ).
- mapcars 10y agoNo need to go anywhere :) >> words: keys-of system/words >> types: collect [forall words [if datatype! = type? get/any words/1 [keep words/1]]] >> probe types [datatype! unset! none! logic! block! paren! string! file! url! char! integer! float! word! set-word! lit-word! get-word! refinement! issue! native! action! op! function! path! lit-path! set-path! get-path! routine! bitset! point! object! typeset! error! vector! hash! pair! percent! tuple! map! binary! time! tag! email! handle! image! event!]
- andrew-lucker 10y agoI hope this trend of Colour named programming languages continues. I would maybe choose Cyan, red sounds too professional :P
- steveklabnik 10y agohttp://cyan-lang.org/site/ http://cyan-lang.org/site/
- transfire 10y agoI think Red is a language to watch. It has a lot of potential. But my understanding is that Linux support is still immature. Currently the focus is Windows. Is that a correct assessment?
- sqeaky 10y agoI read their about page and their newest post. It was a lot to take in. It was concerning that all the screening had that windows look and feel. I am kind of excited to try something so large in scope and so different, but no Linux support would kill it before I even downloaded it.
- mapcars 10y agoLinux support is just the beginning. Soon you'll be able to compile for iOS, Android and other platforms.
- throwaway7645 10y agoYea, using a simple switch to compile tiny native executables for a ton of platforms is a huge draw. Not having to walk a non-coworker through a python install who doesn't want python on their computer will be nice.
- greggirwin 10y agoGUI screenshots are more exciting than console screenshots. :) Red opted to do Windows GUI first, and also to use native widgets on all platforms. A full native GUI may come later, but that's why the current look of promo material.
- mapcars 10y agoSo far Linux lacking only GUI backend support, everything else should work fine. You can still play with guy crosscompiling (as easy as `red -t Windows file.red`) and running on Wine, while GTK backend is in progress
- 10y ago
- esmi 10y agoI was hoping someone was bringing back corewar. The game was played in a language called Red Code. Pretty fun game for it's time. https://en.m.wikipedia.org/wiki/Core_War https://en.m.wikipedia.org/wiki/Core_War
- scardine 10y agoI know a lot of you may like case insensitive languages, but it just feels weird for me. And there is the "nim" language which makes no distinction between CamelCase and snake_case.
- greggirwin 10y agoAt least it doesn't force any casing on you, as some languages do. Another thing to get used to is the ability to include characters in names that you normally can't, e.g., - and ?.
- jplatte 10y ago> At least it doesn't force any casing on you, as some languages do. I'm not convinced that is actually a good thing. It really annoys me when two libraries for the same language use different naming conventions, and so far I haven't had any trouble with the strict casing rules in Haskell, or the casing conventions in Rust where the compiler emits warnings when you don't follow them (that you can disable with an annotation if you really need to).
- greggirwin 10y agoWe, as programmers, will never convince anyone that our preferences are right for everyone else, even when there are strong technical arguments. In this case (pun intended), it's subjective. A lot of it is what we get used to.
- progman 10y agoI consider Nim's approach an advantage since it prevents nasty confusion by accidental typos, in particular in big projects with many modules.
- kome 10y agoI can't wait for macOS GUI backend!
- dillon 10y agoThis is definitely a neat release. Red seems to be coming along great, and am interested in what a 1.0 release might look like. Checking their "Roadmap" they have some very interesting (great?) goals. They seem to be heading towards a sort-of "runtime purity" by (at least aiming for) targeting: - Native (bridging to Obj-C) - JVM - CLR While also supporting shared objects so my assumption is that dynamically linking is possible. On top of this it looks like they want to support a sort-of wxWidgets-like GUI programming (which I personally believe to be the correct approach to GUI abstractions). Backends they aim to support: - Windows (done) - GTK+ - macOS - iOS - Android This reminds me of the approach a lot of JVM focused languages are taking like Clojure that support the CLR, JVM, Node and Web Browser. I guess the obvious questions to ask would be: 1. Any reason for not wanting to target WebAssembly/JavaScript (and in conjunction node.js [I understand that this isn't trivial])? 2. Any reason targeting QT isn't on the roadmap? [targets for KDE, Sailfish, ect..] 3. Any reason wxWidgets wasn't a great choice as a foundation? (I believe they have a C API last I looked) 4. Is there or will there be an API for creating custom languages that can target/leverage Red's infrastructure? (basically a Red version/wrapper for flex/bison) Finally, adding support for Erlang nodes should be fairly trivial if it was a wrapper to the C Node API, but it could also be implemented via a pure Red implementation. tl;dr I'm interested to see how Red will evolve further not necessarily because the syntax intrigues me, but because of the goals the team have set for themselves as far as polymorphic runtimes go. EDIT: formatting
- greggirwin 10y ago> 1. Any reason for not wanting to target WebAssembly/JavaScript (and in conjunction node.js [I understand that this isn't trivial])? Wasm will likely be the browser target. > 2. Any reason targeting QT isn't on the roadmap? [targets for KDE, Sailfish, ect..] They wanted to go native to start. QT is GPL licensed. Not a good fit for Red. Their "small" installer, which downloads the big stuff, is 18M. Red, with self-contained toolchain and cross compiler + GUI, is 1MB. > 3. Any reason wxWidgets wasn't a great choice as a foundation? (I believe they have a C API last I looked) Targeted at C++, and also very large. > 4. Is there or will there be an API for creating custom languages that can target/leverage Red's infrastructure? (basically a Red version/wrapper for flex/bison) You can use libRed, which makes Red available as a DLL you can call into from other langs, like C. See http://www.red-lang.org/ http://www.red-lang.org/ where a couple GIFs show integration with VBA and Excel even. Ultimately, the decision not to use something comes from value added and available resources. Team Red is small, and has to pick their battles carefully.
- ZenoArrow 10y agoIf anyone wants to try out Red, I'd recommend setting up the Red plugin for Visual Studio Code, it's not essential (you can code effectively without it) but it does do the basics very well IMO. https://marketplace.visualstudio.com/items?itemName=red-auto.red https://marketplace.visualstudio.com/items?itemName=red-auto...
- _pmf_ 10y agoTheir reactive (dataflow) dialect is beautiful.
- greggirwin 10y agoYeah. It hasn't been pressed much yet, since it's new to a lot of us. Here's something I worked on to learn more about it: https://gist.github.com/greggirwin/38883ca5109175a60896d2f406ee49f6 https://gist.github.com/greggirwin/38883ca5109175a60896d2f40...
- MichaelMoser123 10y agoRebol looks interesting; what does Red do for memory management? Is it garbage collected or does it do reference counting? If it is reference counted then what does it do with circular references? i did take a glance at the documentation but did not find the answer to this question - without knowing how the thing allocates memory it is sort of pointless to invest time into learning the language...
- greggirwin 10y agoRed will have GC, but it's not there yet. Soon. Red/System is a C level language, where you have to alloc/free yourself. Why do you think it's pointless to learn without knowing how it handles memory?
- MichaelMoser123 10y agothanks for answering. > Why do you think it's pointless to learn without knowing how it handles memory? I think that a non trivial program will have to employ dynamic memory allocation, so if it is not obvious how to do that then it will not be possible to write a complex program. Learning a language that can handle only simple cases may have some uses, but you already have existing tools for that.
- greggirwin 10y agoGot it. Red does manage memory for you, but no GC yet so can't do long-running procs without care. I've written small Red apps that used 800MB, loading a large dataset. Totally stable but, again, maybe wait for GC if you're going to grind a lot. Red's complete toolchain, compiler, linker, etc. are bootstrapped entirely in Rebol2. Red is more capable than R2 (though alpha, with features pending), so it's safe to expect that it can handle more than simple cases. In fact, one of the reasons Red 1 was implemented in R2 was to prove that Red would be able to self host. It's possible most of the current toolchain would even work at 1.0, but the team has learned a lot while building this version, and has said on many occasions that Red 2 will only keep the best bits. All that said, even if you never use it in production, it's a great language to play with and expand your thinking, because it's so different.