Project Description

There is this text editor vis, modal text editor based on the Plan9 structural regular expressions and se(1). However, comparing to sam(1) or acme(1) it feels mostly like advanced vi(m) not something completely new (and it is not mouse-driven).

There are some presentations about it: from FOSDEM 2018 (slides) and some random screencast.

And yes it is packaged for Factory (both stable vis package and my nightly repo).

Goal for this Hackweek

There is my plugin vis-par as a vis frontend for par(1). However, it doesn’t work well and it doesn't calculate various indentation correctly.

Resources

If you want to help with vis and you are friendly with Lua (or you want to learn), please let me know.

Looking for hackers with the skills:

vis plan9 par(1) lua

This project is part of:

Hack Week 21

Activity

  • over 2 years ago: dsterba liked this project.
  • over 2 years ago: mcepl started this project.
  • over 2 years ago: mcepl started this project.
  • over 2 years ago: mcepl added keyword "lua" to this project.
  • over 2 years ago: mcepl added keyword "plan9" to this project.
  • over 2 years ago: mcepl added keyword "par(1)" to this project.
  • over 2 years ago: mcepl added keyword "vis" to this project.
  • over 2 years ago: mcepl originated this project.

  • Comments

    • mcepl
      almost 2 years ago by mcepl | Reply

      Specifically, if anybody can fix https://todo.sr.ht/~mcepl/vis-par/2, it would be a great help!

    Similar Projects

    A sane DSL for udev rules by mwilck

    Description

    The "language" in which udev rules are written as documented in udev(7) is horrible. To name just a few problems:

    • The only control statements are LABEL and GOTO.
    • Conditionals are the most important part of the language, but it supports only conjunction ("AND"), forcing developers to use GOTO even for simple "OR" relations.
    • The AND operation is denoted by a comma (,).
    • Conventions for quoting are weird.
    • There aren't even basic string handling facilities.
    • There is no API for passing flags between different rule sets, just a set of global environment variables.
    • Environment variales are written in ENV{FOO} when assigned to, but $env{FOO} or %E{FOO} when dereferenced.

    While this is ok-ish for the simple set of tasks the language was originally intended for, it makes larger rule sets with complex logic almost impossible to read and understand. Examples for such complex rule sets are the device-mapper and multipath rules.

    While working on the multipath rule sets a few weeks ago, I found myself desparately translating the rules into some pythonesque pseudo-code in order to make sure I fully understand the code flow.

    This project wants to explore the possibilities to replace this weird DSL with something saner. The idea is to embed Lua in udev, and rewrite the udev rule sets as Lua modules.

    It's meant as a fun project that may have practical merits. I am aware that it's questionable whether the systemd maintainers are going to embrace this. I think it will only have a tiny chance if it really improves readability of rules massively, while impacting neither performance nor code size too badly. I have good hopes in terms of performance as Lua has the reputation to be fast, but code size will of course increase, and so will the list of dependencies of systemd.

    Goals

    1. Learn how to write Lua, and how to embed it in C code and write C modules for it. I've read the manual, but I can't say that I'm fluent with it yet.
    2. Design an API for udev in Lua. Figure out how to expose status like device properties (environment variables), tags, and other variables like ACTION and SUBSYSTEM to Lua code, and tentatively re-write a set of representative rule sets in this new DSL. This may need several attempts until the rules can be written in an intuitive way.
    3. Create the basic framework for embedding Lua in udev and providing the environment for the Lua code.
    4. Write libraries with helper funtions to be used by the Lua. For example, we'll need code to access sysfs in order to provide ATTRS and similar features of udev. I'm not certain yet but for most of this it will probably make sense to write the code in C and make it callable by Lua, as udev already has powerful mechanisms for accessing sysfs attributes.
    5. One problem is that the Lua standard library provides getenv but not setenv. We need to be able to set environment variables in order to work with external programs to replicate the functionality of the PROGRAM and IMPORT{program} directives.
    6. Eventually, make the entire feature set of the udev language available.
    7. Eventually, rewrite the entire set of upstream rules (to the extent we're aware of) in Lua.
    8. While I'd love trash the original language, I guess it needs to continue to exist.