Git Product home page Git Product logo

bf's Introduction

Hi! I'm Nelson Earle

About me

I am a...

  • ๐ŸŽ“ Computer Science student at the University of Missouri
  • ๐Ÿ–ฅ๏ธ Linux enthusiast
  • ๐Ÿง™ Bash wizard
  • ๐Ÿฆ€ rustacean

GitHub Stats

nelson137

Reach me

Email: nelson.earle137@gmail.com Linkedin: nelson-earle

bf's People

Contributors

nelson137 avatar

Watchers

 avatar  avatar

bf's Issues

Live: use metrohash for file hashing

Metrohash is almost 3x faster than sha1. See file_hash bench.

Metrohash likely has a much higher collision rate than sha1, but the likelihood of collision is low for users due to the data being file contents. The performance win of this change is worth the increased probability of false negatives for detecting if the editor is "dirty".

Live: drag editor/output border to resize

The output pane height is currently set as the number of output lines. Cap this at some value (~40%) so that it doesn't take over the content area and provide a way to scroll the pane. Allow the user to drag the divider between the editor and output to change the cap %.

Always shrink the output pane to fit the output if that is easier to do.

Live: allow disabling auto-run

For scripts that take a long time to run, the user may not want it to automatically re-run the script on every change to the code. Add the ability to disable auto-run. When auto-run is disabled, the user should have the new ability to run the script manually. Like there is currently, once a script is running there is no way to stop it.

Live: only draw when UI needs update

Ratatui does double buffering to efficiently update the terminal by only writing out what changed between draw calls. However, the UI is always redrawn every tick, and Ratatui is an immediate-mode framework meaning that the entire UI must be rebuilt in memory. Most of the time there will be no or few changes, meaning most of the just-created widgets will not be used.

Taking inspiration from the paradigms used in tui-realm, only call Terminal::draw if an event causes a state update. The main loop and event processing may need refactoring to make this easy.

Additionally, gather some metrics to see how this affects performance:

  • Measure how long it takes to render per tick
  • Monitor CPU usage before/after the change

Live: exit on `^C` in the exit-confirm modal

Currently, if the user presses ^C when any modal is visible it will close the modal. Sometimes users will spam ^C to force quit terminal applications. Support this expected behavior by exiting the app on ^C, but only when in the exit confirmation modal.

Add more aliases for CLI commands

The current list of commands and their aliases:

  • run
  • generate/gen
  • live
  • input-debug
  • inline-scroll

Add more aliases:

  • r
  • g
  • l/edit/e
  • input/i

Add colors to disambiguate cells

In live mode, when ASCII is enabled, it is impossible to tell whether a cell that contains a digit 0-9 is showing:

  • its numerical value, or
  • its ASCII value that is a digit, i.e. numerical value is 48..=57

Live: better Save As modal

The Save As modal should have an initial path that

Initialize the input of the Save As modal with the absolute path of the current file, with -copy appended to the stem of the basename.

e.g while editing the file examples/hello-world.bf, the Save As modal should be initialized with:

/absolute/path/to/examples/hello-world-copy.bf

If that filename exists, try appending -copy-2 to the original stem:

/absolute/path/to/examples/hello-world-copy-2.bf

Increment the number until the path does not exist.

Overhaul widget rendering

Improve TUI widget rendering.

  • Reduce allocations as much as possible
  • Improve code clarity
  • Separate app ("business") logic from rendering logic:
    • Move the following TUI widgets into crate::widgets:
      • CellWidget
      • ChunkedTapeDisplay (rename to ChunkedTapeWidget)
      • WindowDisplay (rename to TapeChunkWidget)
  • Use ratatui for run subcommand

Restructure bin as lib + bin

Turn the project into a virtual workspace with crates:

  • bf
    • move the module currently at bf::interpreter
    • extract and move the script gen strategies that are currently at bf::commands::generate
  • bf_cli
    • rename the current crate to this
  • bf_tui
    • move the module currently at bf::widgets
    • maybe the ones at bf::commands::live::widgets too โ“

That leaves bf::util which will get broken up and moved into the correct crate. Anything shared can be moved to bf::utils or a bf_utils crate can be created.

Live: enable the exit-confirm modal

At some point the unsaved changes modal was disabled. This modal would appear when a user requests that the app exit while there are unsaved changes to the file. Re-enable this feature.

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.