Replies: 5 comments 3 replies
-
|
I find this amusing because I engineer custom RTOS solutions for a living. Nextvi has been designed with this in mind; to be as minimal as possible but still useable in a pragmatic way. Making RTOS out of it shouldn't be super bad, especially if you link it with something like picolibc. This RTOS idea have crossed my mind previously, though without practical use case or need. [0] https://github.com/picolibc/picolibc Of course, you could also just roll out your own allocator for malloc and free, snprintf, memcpy, etc. Since there would be no TTY subsystem and terminal on an RTOS, you need to roll out your own way to control the terminal and parsing the ANSI escapes. This should be your the first focus after you get basic functions like write() and read() working. Other nice to have things can be commented out without much risk in term.c Do you plan on publishing any of this open source? I would love to see it happen :) |
Beta Was this translation helpful? Give feedback.
-
|
ESP 32 is quite tight, with 520 KiB RAM you may need to strip down some things, current smallest statically linked binary I can make is around 181.9K . You can save around 15K if you unmacro this case sensitive path which duplicates the whole regex engine just to get rid of the costly tolower branching. [0] https://github.com/kyx0r/nextvi/blob/master/regex.c#L628 You can also replace the sbuf macros with actual functions to force compiler to reuse more. This will hurt the cpu, but leave you with smaller binary with more capacity to edit. [1] https://github.com/kyx0r/nextvi/blob/master/vi.h#L79 You can adjust the sbuf allocator down to exact size instead of 1.5x growth here: [2] https://github.com/kyx0r/nextvi/blob/master/vi.h#L42 Buffer growth cost won't be amortized, but no byte of memory will go wasted. Everything else in the editor I consider optimal, there isn't much more you can do without removing features. |
Beta Was this translation helpful? Give feedback.
-
|
Well, you can also edit this struct and replace pointers with int offsets for chrs. |
Beta Was this translation helpful? Give feedback.
-
|
Hi Kyryl, I finished my dream project based on your nextVi, embedded in a ESP32s3. Thanks for all the encouragement. |
Beta Was this translation helpful? Give feedback.
-
|
Congratulations!
If this is referring to Nextvi's code, yeah it can be surprisingly deceptive. Nextvi aims to do many things with very little, which is the ultimate goal. If you just wanted minimalism and almost no capability, text editor like kilo would have been a better fit. However, I'm glad that you figured how to strip down the things you don't need to fit your project. That's very powerful. Nextvi is getting a lot more capability slowly with every major release. Though I suspect that will plateau soon. 6.0 will have infinite registers and marks which is the last bit of code that was limiting it & somewhat suboptimal. I intend on stopping changing the core soon, or I hope so. This is important for your project since memory is limited. Though its been years in development and finding perfection on a open ended task is pretty difficult. Kind Regards, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
Any comment please?
Beta Was this translation helpful? Give feedback.
All reactions