Replies: 3 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.
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