3 ms·
I get that. I just keep seeing Ada recommended for projects other than embedded systems and I don’t see how it can work.
by mcculley 5y ago
I get that. I just keep seeing Ada recommended for projects other than embedded systems and I don’t see how it can work.
- MaxBarraclough 5y agoI'm not especially knowledgeable about Ada, but looking at the docs for GtkAda, it seems they're able to do reference-counting with good ergonomics. https://docs.adacore.com/live/wave/gtkada/html/gtkada_ug/memory.html https://docs.adacore.com/live/wave/gtkada/html/gtkada_ug/mem...
- pyjarrett 5y agoI found it a lot easier than I thought it would be. Ada has RAII (controlled types) which you can use for reference counting and resource management like in C++. Septum uses a lot of dynamically allocated memory, but it's all hidden by smart pointers or Unbounded_String (built-in reference-counted COW strings). I use it routinely to search codebases in the tens of millions of lines and it's fast enough right now (single second search times) due to task parallelism I did in Ada that I haven't even bothering to tune it or do any fancy indexing yet.
- MaxBarraclough 5y agoPresumably that means you're vulnerable to issues with reference cycles?
- pyjarrett 5y agoIn theory, yes, I'm vulnerable to reference cycles, but I haven't run into this in practice. The GNAT smart pointer types supports weak pointers if I need it.
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]