What does HackerNews think of ewig?
The eternal text editor — Didactic Ersatz Emacs to show immutable data-structures and the single-atom architecture
https://github.com/arximboldi/ewig
https://github.com/arximboldi/immer
See the author instantly opening a ~1GB text file with async loading, paging through, copying/pasting, and undoing/redoing in their prototype “ewig” text editor about 27 minutes into their talk here:
https://m.youtube.com/watch?v=sPhpelUfu8Q
It’s backed by a “vector of vectors” data structure called a relaxed radix balanced tree:
https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf
That original paper has seen lots of attention and attempts at performance improvements, such as:
https://github.com/arximboldi/ewig
It's design is covered in these talks:
- Postmodern immutable data structures: https://www.youtube.com/watch?v=sPhpelUfu8Q
- The most valuable values: https://www.youtube.com/watch?v=_oBx_NbLghY
He also released his source for Value Oriented Data structures
Juan Pedro is a next level programmer who I think has pushed the craft forward through his work on bringing Value Oriented Design into the C++ world.
Talk I https://youtu.be/sPhpelUfu8Q
Talk II https://youtu.be/SAMR5GJ_GqA
Data Structures: https://github.com/arximboldi/immer
Application Structure: https://github.com/arximboldi/lager
Text Editor: https://github.com/arximboldi/ewig
Good luck.
https://github.com/arximboldi/ewig
Check out the talks from Juan Pedro Bolivar Puente. They are truly next level imo.
A couple of years ago I wrote a text-editor to have a realistic example of what I consider a nice modern architecture using immutable data-structures. In the README there is also a link to a talk where I cover some of the design and structure:
https://github.com/arximboldi/ewig
Libraries that it uses:
Regarding your skeptism of immutable data structures, it's best to think of immutable data and data structures as copy-on-write instead of update-in-place. This is a technique that is currently very underused, for example most programming languages do not come with "persistent" copy-on-write collections.
Here is an example text editor built using immutable data structures in C++: https://github.com/arximboldi/ewig
Advantages are excellent support for concurrency (background save works while you edit) and trivial support for undo/redo.
Library: https://github.com/arximboldi/lager
Ncurses example (full text-editor): https://github.com/arximboldi/ewig
SDL example: https://twitter.com/sinusoidalen/status/939539173584916480
Immutable data: https://github.com/arximboldi/immer
(There was a talk about Lager at MeetingCpp this year, still waiting for it to be published online...)
I work as a freelancer and at the moment I do client work 3 days a week and dedicate the rest of the time to the open-source work. The open-source work includes doing research and implementing these tools, but also preparing the talks, which is a very time consuming task for me. Doing conference talks is very emotionally exhausting, I dread the previous weeks to the talk---but the feeling afterwards is very good and it is a good way to get exposure, I hope.
My dream is to some day form a social company with a coop structure that works full-time on open-source, either directly or indirectly helping clients use these tools in their system. I hope I am set up in the right direction.
Recently I opened a Twitter account to talk mostly about my open-source stuff [1]. I admittedly hate Twitter as a social network, but I've been convinced that it is a good place for networking in our industry, so I just play the game.
I keep telling myself that I should open blog too, but then I realize that one can't simply do everything all the time, so I guess maybe I'll never do it.
To your last question: is it unfair to not do marketing to your work? Totally not. Just do whatever feels right to you. If one day you realize you have built something really useful, probably you'll get the urge to tell people about it.
[1] Immutable data-structures for C++: https://github.com/arximboldi/immer
Example usage: https://github.com/arximboldi/ewig
[2] https://www.youtube.com/watch?v=sPhpelUfu8Q
Excuse me the shameless plug, I'd like to show mine too: https://github.com/arximboldi/ewig
It is written in C++, but using a style that is unlike what most C++ developers use: it is composed mostly of pure functions. The architecture is very much like that of Elm programs, and there is even a `store` class like in Redux.
Like the project from OP, it is about 2K lines of code. But it also supports asynchronous loading/saving, copy-paste (you can copy-paste a 1GB file instantly), very robust undo, dirty markers, UTF-8 (not perfect), etc.
The magic? Immutable vectors based on RRB-Trees. This is like the vectors in Clojure/Scala, but also supports log(n) slicing, concatenations, insertions---these operations are fundamental for a text editor, and I'd say, to most interactive software supporting big data models [1].
The code has been written in a style as simple as I could. I'd like to think that even non-C++ developers might be able to understand it. It might be specially interesting for web developers invested in Clojure, Elm or Redux and the single-atom architecture.
Probably one day I should go ahead and just write a blog post about it or a tutorial or something. But so far I don't have a blog I am not really a social media person. The code is still moving also...
PS. And thanks a lot to @kostspielig her help writing and reviewieng the code! <3
[1] The data-structure can be found here: https://github.com/arximboldi/immer