Showing posts with label REBOL. Show all posts
Showing posts with label REBOL. Show all posts

Saturday, October 29, 2016

Red-Lang: Live-coding of a clock demo, EVE-style

By Vasudev Ram



Clock live-coding image attribution

This is cool. I was just reading this HN thread:

Eve: Programming designed for humans (witheve.com)

which, BTW, is at the top of the HN front page at the time of this writing, and is about a new programming language called Eve from Chris Granger (and maybe others).

The Eve web site.

The home page of the Eve site says: [ Eve is a programming language and IDE based on years of research into building a human-first programming platform. From code embedded in documents to a language without order, it presents an alternative take on what programming could be - one that focuses on us instead of the machine. ]

Chris Granger may be known to some as the person behind Light Table, an innovative "open source IDE that lets you modify running programs and embed anything from websites to games", that was also discussed quite a bit on HN some time ago. I'm guessing Eve builds upon Light Table, for the IDE part of it.

[ Update: Chris's HN profile says: Co-founder of Kodowa, the company behind Eve and Light Table. YC alum. Ex-Microsoft Program Manager for C# and VB in Visual Studio. Chris also says in this comment on the HN thread, that the language part of Eve (it has other parts too) is a variant of datalog. ]

I had not checked out Light Table but I had briefly checked out Noir (another project by Chris), a micro-framework that allows you to rapidly develop web sites in Clojure, and had liked what I saw of it.

Anyway, in the HN thread about Eve, someone posted a link to a demo of live-coding a digital clock, using the Red language, which I had also checked out some months ago. I found Red and its goals interesting; reducing the complexity of modern software development is a big goal, another is being cross-platform (to desktop and server and mobile) and being a full-stack language - that last point, a bit like the D language - i.e. from being able to use assembly (Red may not supports that, but D does), all the way up to high levels of modeling power - but Red does have a lower level language, which Red is in fact built upon, called Red/System, which is supposed to be at the conceptual level of C - but with Red-style syntax). Red is at a somewhat early stage of development - v0.6 or so, but usable. I could even compile a simple Red program to an EXE and run the EXE - it was quite small too. Yes, RED has both an interpreter and a compiler - and like REBOL, the whole Red package is astonishingly small in size.

Red is a sort of successor to REBOL, but by a different person / team. I had played around with REBOL some years earlier and liked it too.

Here is the clock live-coding demo in Red - the drawing of the clock actually updates on the screen, live, as the code for the clock is being written. This works due to some language features of Red, including, as they say on that page:

[ Yes, livecoding (using native widgets!) in Red can be that simple. As you can see, there's no built-in "livecode" widget or feature, it's an emergent behavior resulting from the combination of existing Red features, homoiconicity being the most fundamental. ]

Interestingly, as the Wikipedia article (linked in the preceding sentence) says, assembly language (at least for systems using Von Neumann architecture) can also be considered to be homoiconic - because both code and data are just bytes in memory.

The image at the top of the post is a screenshot I took, of when the live-coding, and hence the (iterative and exploratory) drawing of the clock was in progress.

The image below is another screenshot taken after the clock was fully drawn. If you load that page in your browser, you can see the whole thing happening.


- Vasudev Ram - Online Python training and consulting

Get updates on my software products / ebooks / courses.

Jump to posts: Python   DLang   xtopdf

Subscribe to my blog by email

My ActiveState recipes

Managed WordPress Hosting by FlyWheel



Tuesday, June 4, 2013

Multiple Python one-liners

Notes from MPUG, June 2013: “Python one-liners” talk | Curious Venn

Saw this today, interesting and useful.

The page linked above also has links to other pages with more such Python one-liners, including a discussion on StackOverflow.

Many of the Python one-liners shown, use the "python -m" technique, but that's not all there is to it - some of those also show innovative or non-intuitive uses of that technique.

Two of my favorites from the one-liners shown, are the 'e' module on PyPI :-), and the use of the gzip or zip modules on the command-line as a substitute when you don't have access to a native (un)zip or g(un)zip binary/executable, but do have Python available. "Batteries included" wins here.

You can also run simple Internet servers or clients for HTTP, FTP, POP, SMTP, telnet, etc., using the -m option of Python.

These uses of Python one-liners for Internet purposes reminds me of the REBOL language, in which you can also do such things:

http://jugad2.blogspot.com/2012/12/rebol-language-that-influenced-json-is.html

Update: I saw the MPUG Python talk (linked above) via Hacker News, here:

https://news.ycombinator.com/item?id=5814165

and then wrote this post. Just after writing my post, I visited Planet Python and saw that the MPUG post, by Graeme Cross (curiousvenn.com) was already on the planet.

Anyway, I'm not deleting my post.

Update 2: The HN thread also mentions this other list of one-liners on the Python Wiki:

http://wiki.python.org/moin/Powerful%20Python%20One-Liners

(some good ones there too), and that list also mentions PyP, a Python tool by Sony ImageWorks to create hjgh-performance image-processing pipelines. I had  blogged about PyP and related Python pipe tools some time ago, and those tools were what gave me the idea to create my pipe_controller project:

http://jugad2.blogspot.in/2011/09/some-ways-of-doing-unix-style-pipes-in.html

http://jugad2.blogspot.in/2012/08/pipecontroller-v01-released-simulating.html

http://jugad2.blogspot.com/2012/09/using-pipecontroller-to-run-pipe.html

http://jugad2.blogspot.com/2012/10/swapping-pipe-components-at-runtime.html

https://bitbucket.org/vasudevram/pipe_controller

- Vasudev Ram
dancingbison.com

Thursday, December 13, 2012

REBOL, language that influenced JSON, is now open source

Comments on: R3 Source Code Released!

REBOL is an interesting language. It's free to download, available for both Linux and Windows, and quite small in size (MB).

UPDATE: Carl's comment on building REBOL from source, in the REBOL repo on Github, mentions Android as a platform that REBOL can be built for. Interesting  ...

It can be used at the command line for useful one-liners, in command-line scripts, and even to write GUI programs.

It has built-in support for some common Internet protocols.

And many other features.

I had tried out REBOL  for some time, somewhat soon after it was first released several years ago, and found it fun to use.

REBOL  was created by Carl Sassenrath, who also was the main designer of the Amiga computer and OS, a very advanced PC for its time, including multitasking and advanced multimedia when almost no other computers had it.

Main REBOL site for downloading the language interpreters, documentation, examples:

www.rebol.com

REBOL is now open source:

https://github.com/rebol/r3

Hacker News thread about the open sourcing of REBOL:

http://news.ycombinator.com/item?id=4912963

Has interesting points. More than one commenter pointed out that REBOL was an influence on JSON, which was News (heh) to me:

https://erikeldridge.wordpress.com/2009/07/28/notes-bayjax-meetup-yahoo-sunnyvale-727-crockford-the-json-saga/

- Vasudev Ram
www.dancingbison.com