unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [RFC] poke.el - Emacs interface for GNU poke
@ 2022-03-30 17:06 Jose E. Marchesi
  2022-03-30 19:15 ` tomas
  0 siblings, 1 reply; 3+ messages in thread
From: Jose E. Marchesi @ 2022-03-30 17:06 UTC (permalink / raw)
  To: emacs-devel


Hi good Emacs peoples!

I recently started writing an Emacs interface for GNU poke
(https://jemarch.net/poke) which is an extensible and very powerful
binary editor with support for defining your structures and operate on
them using a DSL (the Poke language.)

poke has a CLI, which works well enough, but of course my personal World
Domination Plan (TM) includes building a nice integrated IDE based on
Emacs and make it the mother of all binary editors.  No more hexl-mode
for me ;)

The interface is still in an early stage of development, but already
works and is already useful enough that I am not using the CLI anymore
in my daily poking.

The WIP interface has a repl, byte viewer, structure editor, mappings
list/tree, settings buffer, code evaluation buffer, output buffer.

You can see the WIP interface in action in this video which is an
introductory poke talk performed at the recent Libreplanet:

  https://framatube.org/w/eMXntiH1syB81a2Tk2zhJX

I am reaching out here because my Emacs lisp sucks and I would greatly
appreciate if people would look at it and let me know if I am doing
something terribly wrong and whether I am on the right track
implementation/design wise.  I would hate trapping myself into a massive
dead-end if it could be avoided :)

The plan is to contribute poke.el to ELPA once something stable is
achieved (and poke 3.x released.)

The interface lives in the emacs/ directory of the master branch in the
poke git repo: git.sv.gnu.org:/srv/git/poke.git.  It requires master
poke (what will become poke 3.x in a few months) in order to run:
currently released poke 2.x versions won't work.

Some notes on the implementation:

- The implementation is in a single file poke.el.  There is an
  accompanying manual poke-el.texi, which is of course WIP as well:

  emacs/poke.el
        poke-el.texi

- Not to be confused with poke-mode.el which is a major mode for editing
  Poke code (based on SMIE and also in need of much love :/).
  poke-mode.el lives in the etc/ directory in the poke source tree.

- GNU poke is incarnated in the form of:

  + A shared library libpoke.so which contains the Poke incremental
    compiler, support for IO spaces, etc etc.

  + A CLI program `poke' that links with libpoke.so.

  + A little program `poked' (the poke daemon) that links with
    libpoke.so.
  
  poke.el communicates with poke running an instance of poked (not the
  CLI) and then maintaining several asynchronous network processes over
  an Unix domain socket.  You can find information on poked and how it
  works in this talk by Mohammad-Reza Nabipoor:
  https://www.youtube.com/watch?v=5FN5uhcoAgc

- The interface is comprised by a set of related components that can be
  used relatively independently of each other.  Together they conform
  the IDE:

  + poke-repl is a REPL based on comint-mode.  I'm using the usual
    dirty trick of having a fake process associated with the comint
    buffer.

  + poke-out is where the stuff written by Poke programs is displayed.
    It is narrowed to the latest emitted output.  You can widen the
    corresponding *poke-out* buffer at any time to look at the output of
    previous interactions.

  + poke-code is a buffer where you can write Poke code and evaluate it.

  + poke-vu is a pokelet that shows a byte dump of the current open IO
    space.  It provides something similar to what hexl does.  It only
    fetches the minimum amount of data to fill the currently shown
    window (i.e. not the full file being edited) and emulates scrolling.
    Needs a lot more work to allow in-place editing etc.

  + poke-maps is a list of mapped Poke values.  You can use it to
    navigate through hierarchical structures like arrays and structs.

  + poke-edit is an editor for Poke complex structures (arrays and
    structs).  It uses the widget library.  Needs much love yet.

  + poke-settings provides a widgets-based little buffer to configure
    the run-time settings of poke (like output numeration base, etc) in
    a friendly way.

  + poke-ios provides a menu with a list of the currently open IO spaces
    (these are the entities edited by poke, like files, memory buffers,
    process' memory, etc.)

  + poke-complete is a pokelet that handles auto-completion of Poke
    code at the poke-repl.  It currently uses `completion-in-region' but
    it doesn't work very well.

- Most of the communication is done by sending Poke code to be evaluated
  by poke (see the poke-elvel pokelet) which often results in poke
  sending elisp code back to Emacs to be evaluated.  This is exceedengly
  fun and also very powerful: way better than using limited fixed
  protocols.

Any feedback is so very welcome!  (patches work best).  Feel free to
send it to either poke-devel@gnu.org or in this thread (if it is not
deemed too off-topic for emacs-devel.)

TIA, much appreciated!



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC] poke.el - Emacs interface for GNU poke
  2022-03-30 17:06 [RFC] poke.el - Emacs interface for GNU poke Jose E. Marchesi
@ 2022-03-30 19:15 ` tomas
  2022-03-31 16:15   ` Jose E. Marchesi
  0 siblings, 1 reply; 3+ messages in thread
From: tomas @ 2022-03-30 19:15 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 528 bytes --]

On Wed, Mar 30, 2022 at 07:06:01PM +0200, Jose E. Marchesi wrote:
> 
> Hi good Emacs peoples!
> 
> I recently started writing an Emacs interface for GNU poke
> (https://jemarch.net/poke) which is an extensible and very powerful
> binary editor with support for defining your structures and operate on
> them using a DSL (the Poke language.)

That sounds exciting. Actually I've been dreaming of such a thing myself.
Now it's there :)

Currently somewhat swamped, but I'll check it out, for sure!

Thanks
.-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC] poke.el - Emacs interface for GNU poke
  2022-03-30 19:15 ` tomas
@ 2022-03-31 16:15   ` Jose E. Marchesi
  0 siblings, 0 replies; 3+ messages in thread
From: Jose E. Marchesi @ 2022-03-31 16:15 UTC (permalink / raw)
  To: tomas; +Cc: emacs-devel


> On Wed, Mar 30, 2022 at 07:06:01PM +0200, Jose E. Marchesi wrote:
>> 
>> Hi good Emacs peoples!
>> 
>> I recently started writing an Emacs interface for GNU poke
>> (https://jemarch.net/poke) which is an extensible and very powerful
>> binary editor with support for defining your structures and operate on
>> them using a DSL (the Poke language.)
>
> That sounds exciting. Actually I've been dreaming of such a thing myself.
> Now it's there :)
>
> Currently somewhat swamped, but I'll check it out, for sure!

Thanks :)



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-31 16:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-30 17:06 [RFC] poke.el - Emacs interface for GNU poke Jose E. Marchesi
2022-03-30 19:15 ` tomas
2022-03-31 16:15   ` Jose E. Marchesi

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).