1. 26
    1. 16

      Ooh! This is the first Jai codebase I’m ever looking at. Exciting!

      1. 3

        Not to be confused with another simple and fast text editor:

        https://github.com/jamii/focus

        1. 1

          The author credited that project:

          The editor was inspired by Jamie Brandon’s blog post. Nothing other than the name was borrowed from his editor - the name was just too good.

          1. 2

            Missed that, thanks!

        2. 3

          Wait, is Jai available now?

          1. 8

            It’s in a closed beta stage. If you’re friends with Jonathan Blow or somehow catch their attention he might give you access, entirely at his discretion.

            I get why he did this for the first couple years. But continuing with this development model for over 10 years made me realize Jai is and will likely always be closed source software.

            1. 2

              Doesn’t seem like there’s a public release of it yet.

            2. 2

              I’ve been using Zed lately and enjoying it.

              1. 2

                I never heard about the jai language which this is written in. I googled it and found this introduction. https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md

                Really interesting. I love the fact that it is built with practical utility in mind and that it negates so many dogmas that other languages are built on.

                1. 2

                  This editor is not designed for editing very large files.

                  I wonder what they mean by very large files….

                  1. 3

                    And for that matter what they mean by fast…

                    1. 3

                      I read the source code a little bit. It looks like the text is stored as a flat byte array (not sure which encoding) + a separate array for offsets of line starts.

                      So editing is O(n) where n is the size of the buffer.

                      For example, here’s the char insertion. It calls insert_string_raw, which calls array_insert_bytes_at, which shifts the rest of the buffer and inserts the given bytes.

                      Edits also mark the buffer as “dirty” and before redrawing it does a scan over the bytes array to re-generate the line starts.

                      Assuming 60 FPS is responsive enough, you can measure how many bytes you can copy with memcpy in 16ms and that should give you an idea of when this editor will start feeling slow when editing large files.

                      I don’t know if there are other inefficiencies.

                    2. 1

                      This is ambitious! Written in Jai, a brand new programming language not even releases publicly yet. Supporting Linux/macOS/Win from the start. Rendering a GUI instead of a text UI. Curious to see where this will go.

                      1. [Comment removed by author]

                        1. [Comment removed by author]