Hi all, recently I wanted to try and write a text-based app, like nano, and play around with it (on Linux). I wanted to try it with Go, but after having a hello world have 1.3M bytes of text, I decided it was a bad idea, so now I'm here.
First of all, is there a ncurses kind of library with Nim? For text-based output/UI?
Second of all, what is nim's object model? I'm talking constructors/destructors, abstract classes, static classes, interfaces, virtual functions, etc. What is present, what is not, how does it work?
Also, how does amount of features/ general language difficulty/ executable speed/ size compare to that of C++? I'm a huge C fanboy, and want something of similar sucklessness.
Oh, one more thing, does the compiler allow building fully functional loadable-unloadable dynamic libraries? Not Go plugins, actual libraries. Does working with them not require C/ break garbage collection?
Thank you.
"Is there a ncurses kind of library with Nim?" YES https://github.com/rnowley/nim-ncurses
Second of all, what is nim's object model?
Nim does support object oriented programming. Many libraries don't use and go for C or Pascal style struct/generics/polymorphism instead.
My personal opinion is that OOP sucks and is an accident of history:
Why it sux: https://www.youtube.com/watch?v=QM1iUe6IofM More proof on why it sux: https://www.youtube.com/watch?v=IRTfhkiAqPw It’s just a historical accident: https://www.youtube.com/watch?v=QyJZzq0v7Z4
You can do anything you can do with C/C++ in Nim. You can easily interface with any C/C++ library and get your code to run as fast as a reference C implementation.
"functional loadable-unloadable dynamic libraries" - YES in fact nim's hot-code reloading works this way. https://www.youtube.com/watch?v=7WgCt0Wooeo