Interview with Nenad Rakocevic Red on the language, the successor to Rebol

After the last interview with Brian McKenna for This is not a Monad tutorial we interviewed Nenad Rakocevic, Creator of the programming language Red.

From my subjective point of view Red and Rebol rather strange creatures! But don't get me wrong, it does not mean anything bad. For example, I don't know many high-level languages with such capabilities as an embedded DSL for standard low-level programming or with 50 built-in types. You should try it, you will find many interesting ideas in programming at Red.

Write to me on Twitter @unbalancedparen your comments or suggestions for an interview for This is not a Monad tutorial. Stay tuned!



Tell us a little bit about the appearance of the Red. Why was it created?


I started programming micro-computers, the Amiga, in my case, young. At the moment I've been programming for over 30 years. After my first experience I was dissatisfied with existing programming languages and tools. Mostly due to the fact that they weren't very productive or friendly to me. So when I came across Rebol in 1999, he opened my eyes to what was wrong with the so-called "modern" development practices. (In our time it is even worse). The struggle with complexity on all fronts software was a logical course of action.

In 2010, the Rebol source code was closed. I felt that his approach could offer much more, but Rebol is practically not developed. This was the signal to start work on a relative Rebol open source, with much greater ambitions and wider scope.

What are the main arguments in favor of Red?

the

    This is the first web full stack-programming solution: combined in one tool, the ability to write high-level code (GUI-applications, scripts and DSL) and fast low-level code (device drivers, operating systems, native interfaces, etc.). Moreover, Red is oboudostoronne technology (client and server).
    the

  • cross-platform compiler to native code for any platform that supports toolchain, you can compile to more than 15 other platforms with a simple command-line option (-t Windows-t Linux-t Darwin-t RPi, ...).
  • the
  • Extremely lightweight: Red is one file of size 1MB, no installation, no configuration, all toolchain. It downloaded in seconds and you can immediately start to write and run code, it is absolutely nothing it is not necessary to configure (just awful that this is the exception and not the norm...).
  • the
  • Solution with batteries: contains a very rich runtime library, despite its size, covers almost everything you need for normal operations.
  • the
  • DSL-oriented environment: Red comes with many built-in DSL'she created for specific needs (like GUI or system programming). DSL'and are a very powerful way to reduce the complexity emerging from the frameworks or APIs, and radically increase productivity. Red includes DSL (called Parse) to create DSL'her.
  • the
  • Red (and Rebol) is a derivative of Lisp, but with a human syntax (without bracket Ada). Red is the data format itself. All code is considered data until you begin executing it, the serialization code/data is free.
  • the Philosophy behind Red (and the same for Rebol) is to make a simple easy and the difficult possible.


What did the Rebol main inspiration for Red?

Rebol is one of the most innovative programming languages created over the past 20 years. Unfortunately, he remained out of sight as it was closed source, at a time when languages are open source, like Perl, Python, and Ruby made their way into the industry. The Rebol approach undermines the very Foundation of what programmers consider to be "simple" or "effective" in development. In General, the API, which in other languages would call "simple" looks pointless complicated when you're used to looking at the world through glasses Rebol'. ;-) Here are a few odnotrahniki for example (for Rebol2 REPL):
To create a graphics window with a button, on click of the print "Hello" to the console:

the
view layout [button “Click Me” [print “Hello”]]


Print the contents of the web page to the console:

the
print read http://rebol.com


To get the title of the web page:

the
parse read http://rebol.com [thru <title> copy text to </title> (print text)]


Send a list of files the current directory by email:

the
send user@domain.com mold read %.


Get all records from MySQL and print them:

the
foreach row read/custom mysql://root@localhost/books [“SELECT * FROM authors”] [print row]


Note that even though you've never seen code in Rebol before, you can still read it and understand what makes a large part of it.

what is the main difference between Rebol and Red?

the

    Red can be (cross-)compiled to native code, Rebol is interpreted only. The compiled code runs much faster than the interpreted. the

  • Red gives the opportunity for system programming and writing low level fast code, Rebol stuck at the level of scripts.
  • the
  • Red relies on native widgets and native support for GUI, Rebol has its own engine. With Red, your graphics application will look more natural and better integrated in the OS of the user.

Besides the languages themselves are very similar, somewhere in the 95%. If you know Rebol, you know Red.

Red covers a whole class of abstraction between low-level and high-level programming offering dialect in Red/System with C-like semantics and Rebol-like syntax. Was there a difference between Red and Red/System in the original design? What benefits did you get using Red/System?

Of course, the Red/System was one of the main reasons for the creation of a new language stack instead of duplicating the implementation of Rebol. Red/System is a statically compiled language, designed for native code (like C). Red/System serves two major purposes:

the
    the
  • to provide an embedded DSL users Red to support rapid code and the needs of system programming
  • the
  • to be the language of the intermediate representation for the compiled code in Red

As far as I know, Red is the first high-level language with features such as an embedded DSL for universal low-level programming.

Who uses the Red/Rebol?

The Rebol community was relatively big in the early 2000s, but it is greatly reduced with the cessation of development. Many users were surprisingly diverse scale of skills. Many liked the simplicity for simple tasks, and cross-platform engine for the GUI, others were more interested in depth (dynamic linking, easy-to-create DSL'her serious possibility of meta programming, ...).

Since then, only hardcore fans or company that built your system, continue to use and promote it. This is largely the same people, and they formed the first supporters of Red along with many other people who were interested in Rebol, but not satisfied with its proprietary nature. Some of them write libraries for Red, the other small toys, or even drivers for devices for Windows! :-) As soon as the Red will be ready for production, we are confident more people will join them and will get pleasure from using Red.

For what tasks, in your opinion, suitable Red?

Red solutions is a software utility, which should be good enough for any programming tasks. In practice, this is limited to (only) available frameworks and libraries. So Red is very well suited for these tasks:

the
    the
  • scription / the link code
  • the
  • graphical interfaces (in the upcoming v0.6.0)
  • the
  • of the Android app (v0.6.1)
  • the
  • data processing
  • the
  • parsers grammars / create DSL
  • the
  • system programming
  • the
  • device drivers
  • the
  • programming of devices for the Internet of things (running on Intel or ARM)
  • Once we reach 1.0 (next year), Red will also be very good for:

    the
      the
    • web application
    • the
    • create server
    • the
    • 2D games
    • the
    • robotics

    Rebol and Red offer a huge variety of built-in types for practical applications. Some believe that it is better to have a small core language features. What do you think about that?

    Rebol and Red have more than 50 data types with the runtime a little more than 500KB. Among them, two-thirds have a special literal form (eg. money, email, url, time, date, colors,...) that gives you out of the box, a rich set of literals to create a built-in DSL'her.

    Another plus is that most of the features needed for everyday computing is already here, as first-class objects that are well integrated with the rest work exactly the same on each supported platform. This greatly raises productivity and makes learning/using the language much more enjoyable (no need to do imports for each simple task). Such languages are pragmatic and are aimed at reducing the cost of software development.

    How Red is implemented in General? Written all the components (parsers, code generators, garbage collectors, etc.) hands? What dependencies have Red?

    Except for the good of the unit tests that are generated by the script, everything else is written by hand. We deploy Red using Rebol, so toolchain (compilers, linker, assemblers) written in Rebol2. Rebol has a DSL for parsing, which is very effective in combination with the powerful features of meta programming, the need to use other tools just disappears. Scripts Red can be interpreted from REPL'and or compiled into native code, using Red/System as an intermediate representation. The runtime library consists of a mix of code Red and Red/System.

    Executable files usually have Red the size is about 0.5 MB and have no dependencies.

    How a full Red in the middle of 2015?

    A lot has already been implemented, so I better describe what is not enough. Right now we are completing support for cross-platform GUI with the first backend for Windows. Backends for Android, Linux, and OS X will be next. I/o is still limited to simple file operations, and HTTP client. Modular compilation, a full garbage collector and support for competitiveness — the main goal to release 1.0. We plan to release 1.0 in 2016.

    How do you see the future of Red?

    Red has the potential to seduce many developers (especially free developers who have freedom of choice) are not satisfied with the existing tools (even so called "simple"). I expect Red to be widely spread in the next couple of years, helping programmers to solve many of the problems with pleasure and making their lives easier. Red will expand many powerful DSL's under different region, offering excellent replacements for direct use of existing libraries. For example, we will promote it in the field of robotics and AI.

    What are the most important insights you have made from the development of Red?

      the
    1. Open source is the best way of creating high-quality (Red just reaffirmed this fact).
    2. the
    3. to Work "in the open" is not always good, sometimes you need to isolate yourself from the surrounding "noise" to complete a complex task (mainly in terms of design). The growth of the project to do this becomes more difficult.
    4. the
    5. the Need to interact with the growing community of users eats up a lot time. It is very important to find people for this task.
    6. the
    7. design a good syntax is much is more complex than the design of good semantics. This moment missing many of the creators of the languages, which leads to excellent semantics but terrible syntax.
    8. the
    9. to Write a compiler to native code for a statically typed language is actually not hard, most programmers with a minimal knowledge in computer science can do it, they just don't know what they can do that.
    10. the
    11. Any large project should start a team of at least two very motivated and equally skilled developers. To work alone on large projects it's crazy, and not guarantee the best results.
    12. the
    13. If you are working on a project with open source, which is quite attractive and is gaining followers, you can live on the donations of users (I lived this way for two years, covering all my basic living expenses). I didn't think it was possible when I started and wasn't counting on it. Maybe I just got lucky that the Red is a great community.

    What do you recommend to read for the writing of the first programming language?

    A good overview of all the necessary things are in books such as Modern Programming Languages: A Practical Introduction. If you want to go deeper and dive into more abstract categories, "Dragon Book" still the best (publisher Williams recently released translation of the last regali approx. translator).

    But the most useful way is to study the implementation of a number of small languages, it will give you a better understanding of how to do it yourself. For example, release 0.1.0 Red only 24KB in a zip archive, but has already a working compiler/linker for Red/System and many features (including FFI). Download it here: https://github.com/red/red/releases/tag/v0.1.0

    what languages and technologies you see?

    the
      the
    • Go: this is the fastest growing language in recent years, understanding of the reasons for this could be the key to Red is also began to grow faster. The model of competitiveness to Go, seems to attract users, so it's worth learning.
    • the
    • Lua: trying to figure out where it goes and how it grows.
    • the
    • Python 3.x: trying to figure out where it was going, but I'm not sure that I understand his plans.
    • the
    • Webassembly: Foundation for the future of web programming.
    • the
    • MagicLeap: the future of human-machine interfaces!


    the translator: I almost didn't see mention on habré, and just do IT in the CIS of Rebol, so I'll give a little background information about him.
    Carl Sassenrath — Creator of the Amiga OS, which brought multitasking to personal computers, programming in languages like Ada, Pascal, Smalltalk, Lisp, Forth, SPL. Worked in research OU Apple with IT many legends, including Alan Kay, Larry Tessler, Dan Ingalls, Bill Atkinson, who helped shape his view of languages and systems. In 1996, when the popularity began to gain Java, Perl, and Python, he decided to share with the world their ideas, which resulted in the language REBOL (relative expression-based object language). However, as mentioned in the interview, the language was proprietary, distributed in different "trim levels", and some of them were only available under license. Later Carl made REBOL3, with the initially open source, but it is very far from the possibilities REBOL2 and as of today is not developed. At this time is actively developed Red.

    Interested I strongly recommend to play with REBOL2, download on the official website http://www.rebol.com/download.html version 2.7, try this megabyte binary with the network stack, GUI and other things, to break patterns in terms of how compactly you can write so many things and begin to study Red/REBOL =)
Article based on information from habrahabr.ru

Комментарии

Популярные сообщения из этого блога

March Habrameeting in Kiev

PostgreSQL load testing using JMeter, Yandex.Tank and Overload

Monitoring PostgreSQL with Zabbix