imetallica

imetallica

After watching this talk from Stuart Halloway, I wonder how cool would it be to implement the general idea with Elixir. :slight_smile:

Showing Posts 1 to 10

AstonJ

AstonJ

Could you add more info please @imetallica ? What is ‘REBL’? Any other sites/resources you could link to with further info?

imetallica

imetallica OP

Just watch the talk…

mischov

mischov

As it so happens, I have a TL;DW for it.

TL;DW, In Clojure, new protocol datafy (make this thing data) + new protocol nav (go somewhere) + allowing protocols to be implemented on instances of data as metadata permit what they call REBL which is “Read Eval Browse Loop”, to be able to browse in a consistent, lazy manner across things like Clojure data, and java class info, and namespaces, and web pages, and info in Datomic, etc.

Several people have likened it to smalltalk’s interactive dev environment.

NobbZ

NobbZ

Not everyone has the time to sit down and watch half an hour of a random talk that has nothing been said about.

Therefore its always nice to provide a short description about the talk itself.

14
Post #4
NobbZ

NobbZ

Thank you such a thing always helps!

Sounds a bit like the “go to definition” of my editor in the REPL… Nothing I’d miss in iex, but maybe some kind of necessary in a language that is said to be such slow to compile that one actually does only use the REPL for coding and at the end of the day somehow saves that into a file… As far as I remember this was “clojure”… Oh, I just see, this is about clojure…

I never did smalltalk, but perhaps I’ll put it on my list some day or the other.

mischov

mischov

I do think that if you want to dismiss the idea you should probably watch the video, because it’s probably not productive to base your sentiments on a gross simplification (which is what my TL;DW is).

The driving concern behind REBL is one of being able to provide generic tooling that allows a developer to dig into disparate and not necessarily predefined data from any number of sources in a potentially lazy fashion, and I think that’s something that should at least pique the interest of any functional programmer who works with large complicated data sets.

For example, one could imagine using something similar to build generic tooling to simply walk through and dig into the result sets of paginated Ecto queries during development, fetching the next page automatically when you move into it.

Whether or not the idea has any place in Elixir it is interesting, and their solution is pretty elegant and well worth watching to video for.

NobbZ

NobbZ

Do you have a transcript or some bloggified form for me? Maybe even some interview in a podcast would work, as those are easily consumable during commute, either by TTS or simpe audio.

Its hard to find some time to actually watch a video, as those is usually only possible on my workstation at home.

mischov

mischov

I don’t know of any, sorry. The talk was only recently given.

Qqwy

Qqwy

TypeCheck Core Team

I don’t think a readable 1:1 transcription will help very much because there are some great visual examples in the talk.

But let me try to write down a summary of the talk:


As far as I’ve understood it so far(updating as I continue watching the talk), Closure 1.10 and up has two new protocols (akin Elixir protocols):

  1. Datafy can turn something that implements it into a readable (REPL-inspectable) format.
  2. Nav can be used to go from one piece of ‘something’ to another.

Together, this allows you to e.g. browse an insanely large or infinite collection at your own leisure. Or expand only the subnodes of trees that you want to look at in the REPL, etc. It basically gives you a much more sophisticated control mechanism of how you interact with results than simple settings like Elixir’s Inspect.Opts can.

Of course, you do need to create a tool that interacts with these protocols, but there can be many such tools, both command-line ones and graphical ones. In the talk, these tools are called REBLs.

The talk then goes on to show that a REBL tool could:

  • look at a collection as a spreadsheet table.
  • expanding any item of a collection to look at it in more detail.
  • look at a numerical collection as a graph.
  • look at code as the AST in data format.
  • look at code as highlighted source code.
  • look at an exception as data
  • look at an exception’s stack trace and expand any of the stack trace lines, looking at those in more detail.
  • look at a (potentially infinite) recursive datastructure, such as representations of the files/directories on your computer.
  • look at a Clojure class and see it’s methods, superclasses, documentation, etc.
  • browse a database query’s responses, pulling them live from the database.
  • follow foreign keys in the database responses to query other parts from the database.

And then, at any point you might take any of this data, and read it in as a variable into your REPL, so you can continue working with it in your code snippets.

Clojure implementation of Datafy and Nav in Elixir-terms:

defprotocol Datafy do
  @doc """Returns your_thing, but then as flat data!"""
  def datafy(your_thing)
end
defprotocol Navigable do
  @doc """
    Returns a (possibly transformed) version of `value` ,
    based on `collection` and `key` (a key/index or `nil`). Defaulting to `value` itself.
  """
  def nav(collection, key, value)
end

The REBL-system in Clojure also uses something called ‘metadata’ which is something you can store ‘with’ your main data but is only used by things that look for it, rather than altering the identity of your data. (I am not entirely sure why this is used/useful and what analogous system we might use in Elixir for this.)

mischov

mischov

Good summary.

I could be wrong, but I think that the point of datafy isn’t to turn something into a REPL-inspectable format, it’s to turn something opaque-ish (like a Java class) to less opaque, plain ol’ Clojure data (ie. maps and vectors) that can then be used by a some other thing in Clojure, which could potentially be a renderer.

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 94592 917
New
cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
caslu
I want to open this thread for you all to discuss and help those who really like Ash but are still hesitant to use it in a real project. ...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
heathen
Quite interesting article Google brought me. Didn’t find any mentions about it here. What do you think in general? Would you use togethe...
New
maennchen
:warning: Security advisory: Decimal DoS vulnerability A vulnerability has been published for decimal where very large exponents can cau...
New
marciol
It would be helpful to have a list of companies worldwide that hire engineers without prior experience in Elixir. Often, it can be quite ...
New

Other Trending Topics Top

marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
Aludel - LLM Evaluation Workbench Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews