Git Product home page Git Product logo

tylr's Introduction

tylr Build Status

tylr is a tiny tile-based editor, a new kind of structure editor that, like a text editor, supports linear token-level editing workflows but, unlike a text editor, ensures your manipulated tokens can always be parsed back into a well-formed abstract syntax tree (AST).

Other structure editors restrict you to simple operations on the AST. For example, if you have the expression 2 + 3 * 4 in Scratch or MPS, you can't select things like * 4 or even 2 + 3—never mind directly manipulate them—because they don't correspond to complete subtrees in the AST. Uniquely among structure editors, tylr lets you select and manipulate near-arbitrary range selections, including those corresponding to sub- and cross-tree portions of the AST.

You can play with a running instance of this code at tylr.fun. Click on the help button in the upper-right corner for a gif-laden Twitter thread on how it works.

Building and running tylr locally

Install OPAM version ≥2.0 and use it to install OCaml 4.08.1 as described here.

Clone this repo, run the following commands in the root directory, and paste the output of the final command into your browser address bar.

make deps       # build dependencies (locked in opam.export)
make            # build tylr src
make echo-html  # echo path to compiled page

tylr's People

Contributors

dm0n3y avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tylr's Issues

Runtime error when re-inserting then-token

A runtime error I encountered while playing around in the june version:

  1. enter a conditional like if x then y else z
  2. remove then, so it becomes if x|y else z
  3. enter a space and move left to make if x| y else z
  4. attempt to enter then
  5. observe runtime error:
Async_kernel: Unhandled exception (Failure "impossible: bin encountered empty or singleton stack")

And maybe this is a separate bug, but if you go
4. enter then (without a leading space) to make if x|then y else z
5. separate x from then with a space to make if x |then y else z
6. observe that the then is not recognized as a keyword and remains in the backpack

Can't insert = between tokens in let-expression

Hi! I was just playing around with the June 2022 version after the FoC meetup and thought I should report a bug I encountered.

First, I entered the expression let fact = x in a, then I remove the = and it becomes let factx in a. If I then insert a space between fact and x and move the cursor next to the x (so it becomes let fact |x in a with | as the cursor) and I try to insert a =, the = is not inserted and I get an exception:

(Exception
   "(Failure \"impossible: bin encountered empty or singleton stack\")")

I also just want to say that I love the concept and it looks gorgeous. I hope you manage to make this into a robust prototype!

This is more than amazing :)

I wanted to create an issue and just say what a masterpiece this one is. Having the honor to be the first like and first issue was amazing so let me make the first issue about saying how awesome this project is! What a job!

tylr - the most amazing project I've ever seen!

Hi everyone.

idea

  1. I believe that tylr's graphical interface is very innovative. What I'm going to talk about here is different, unique and strange.
  2. Lately I've been getting involved a lot with open projects - of all types and sizes. And of different types of audience and purpose or scope.
  3. One thing that has always caught my attention is version control: git.

why?

  1. I use git version control a lot to manage each of these open projects that I talked about initially, but... one of my problems with git is its complex commands for an end user like me. There are no great GUIs for git. I'm thinking of using tylr for git.
  2. One of the things that caught my attention is the idea of how tylr is made. One crazy idea I had was to create a git client with a block interface instead of typing commands.

how?

  1. In my idea it would be possible to use git as a block with tylr.
  2. I've been developing an idea of a version control made from blocks of code and related to a database.
  3. My idea is to make life easier for developers by creating something as innovative as git. One of the ideas that I consider to be good is to use the graphical interface of tylr to manage the version control.

example?
image

img-description: My idea would be to have positional version control, with that in mind we have a versioned dictionary of words in any programming language for any open project. So, as we can see in the conceptual image we have a code block in tylr to control the software version.

source-code
Here we have a positional version control generated by tylr - we know words or code snippet has been removed, added.

0-43:h3
45-139:p
1185-1191:em

What do you think of this idea? What do you think of this idea of ​​a command-block interface?

Is there a white paper or the like?

Hi!

tylr looks very interesting. I came Jack Rusher's talk at Strange Loop 2022 (https://www.youtube.com/watch?v=8Ab3ArE8W3s).

Is there a technical dive somewhere into why and how it works? In terms of the algorithm and any generalizations that came from designing it, not necessarily this particular implementation.

I'm not an expert in this area, so can't reference specific terms, but I'd still be very interested in such a write-up.

Example of what I'd be looking for: How plausible would it be to design something like tylr for different existing languages? For some, more difficult than others; or maybe it needs some special grammar properties to work at all. What does that entail, etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.