3 ms·
I have started pure pointers algorithms and data structures library half year ago. Got hit by lack of generics of pointers and unmanaged generics. These seems f
by dlahoda 8y ago
I have started pure pointers algorithms and data structures library half year ago. Got hit by lack of generics of pointers and unmanaged generics. These seems fixed in preview of f# and c#. There are many other improvements to have non GC runtime going and considerrd in C# and F# code and other movements into Rust like features. So it may be reasonable to write low level code in c# within 2 versions I guess. F# even better as it has templates(c++ like generics) and other non oop compositional stuff. Given this tendency I stopped to try to learn Rust.
- oneplane 8y agoBut why use C# at all if your target has actual options?
- dlahoda 8y agoMay be write something not in the internet yet but soon will be and check limitations of lang
- platz 8y agoPretty sure F# allocates like nobody's business
- algorithmsRcool 8y agoBy default yes, but that's the price of using immutable objects and datastructures. However, you can cut pretty much all of those allocations with a bit of care and still retain some F# niceties. I recently wrote a very low allocation text file parser that could ingest log files at over 200MB/s single threaded. All in F# using structs and Span the same way I would in C#. Except I get the safety, terse syntax and rigor of options, records and matches
- platz 8y agoThat's pretty cool. I wish some of the foundational f# libs and webserver were written that way. They probably use more idiomatic code which means application code pays those costs too.
- algorithmsRcool 8y agoFor years, a lot of pain was caused by F# using classes for critical types such as Option, Tuple and Choice. Additionally most records should have been structs by default. They have started fixing this by introducing value tuple, value option and supporting C# performance primitives like Span. But they have a way to go still.
- platz 8y agoAh, that summary is helpful, thanks
- dlahoda 8y agof# is multiparadigm and can do same low level as c#. you can not to allocate if do not want so.