Live data from Hacker News

Red programming language 0.6.2: LibRed and Macros

red-lang.org

71–80 of 86 posts

Re: Red programming language 0.6.2: LibRed and Macros

#71

Earlier quoted context omitted.

Per Nick's comment, above, Red likely won't generate C, because that would add a dependency on a C toolchain. Red is completely self-contained, and would like to stay that way. However, you could write those tight bits in C and put them in a DLL or something, to call from Red.

Also very nice. If I added a C dependency like GSL as a DDL, Red could compile a binary using it?

It has an FFI, but no static linking to C libs at this time. Not sure if that will come, but technically it's possible, as Red's linker is written in Red/System. I'm a huge fan of Pieter Hintjens' work, and have written lots of code generators and FSM stuff, inspired by GSL and Libero.

Re: Red programming language 0.6.2: LibRed and Macros

#72

Earlier quoted context omitted.

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

> QT is GPL licensed Wrong. It is triple-licensed (GPL, LGPL and commercial).

Thanks for the clarification. Still not compatible with Red's licensing model IMO.

Re: Red programming language 0.6.2: LibRed and Macros

#73
post #55

Earlier quoted context omitted.

At 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 ?.

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

We, 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.

Re: Red programming language 0.6.2: LibRed and Macros

#74
post #5
post #2

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

I 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/

This link has all the links from red-lang.org that were posted on HN:

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

which mentions the funding etc.

Re: Red programming language 0.6.2: LibRed and Macros

#75
Rebol 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...

Re: Red programming language 0.6.2: LibRed and Macros

#76
post #68

Earlier quoted context omitted.

I'll add to my reply, because this is a really good question. Red doesn't have all types in place yet (e.g. date! is coming, and maybe an @ref type, among others), but can still load the following: at 10:00 send gregg@host.dom a link to http://red-lang.org (216.239.32.21) delete %/c/temp/junk.dat assign #DECAFBAD-7337 to John make the main window 800x600 with a color of 255.0.0 answer: yes Here's a quick console sess…

No need to apologize, that was a good example :) I liked this big: >> unique collect [foreach val blk [keep type? val]] == [word! time! email! url! paren! file! issue! pair! tuple! set-word!] I think it could almost be read and understood by a person who does not know REBOL or Red.

Yup. We often write code like normal programmers, but sometimes we do build up vocabularies more, even when not using `parse` to write DSLs.

"Red or REBOL" = Redbol (sounds like Red Bull) :) And where Perl has Mongers, Ruby has Rubyists, Python has Pythonistas, and Rebol has Rebolers, Red has Reducers.

Re: Red programming language 0.6.2: LibRed and Macros

#77

Rebol 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...

Red 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?

Re: Red programming language 0.6.2: LibRed and Macros

#78

Earlier quoted context omitted.

That is exactly its goal.

Awesome. That's why I hope the System code is fairly fast, because compilation won't matter if it is still super slow. If y'all do a version on the JVM you get fast, but also a bloated dependency and then you're not much different than anything else with a JVM backend (Scala, Clojure, Groovy, Perl6, PicoLisp...etc). I really am excited by Red btw. Hopefully performance can be a thing at some point before 1.0. The Per…

You might also want to look at ren-C (https://github.com/metaeducation/ren-c), a fork of the open sourced Rebol 3 (which isn't an active repo). It can be build with an embedded TCC so you can write C in-line for functions where you need a speed boost.

Re: Red programming language 0.6.2: LibRed and Macros

#79

Rebol 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...

Red 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?

thanks 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.

Re: Red programming language 0.6.2: LibRed and Macros

#80

Earlier quoted context omitted.

Red 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?

thanks 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.

Got 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.

Post reply on HN