1,521 karma · joined May 25, 2012 (14y ago) · 286 submissions
comment 7y ago · link · parent
WCF could operate over pipes which was cool for machine local IPC, but beyond that I think gRPC is superior.
But I asked your exact question to the dotnet team and architect David Fowler gave me a decent answer.
> "I don't know that we have a definitive answer as yet and the GRPC experience while great isn't nearly as smooth (as of writing) as the WCF experience. I would say that it's definitely going to be one of the main RPC option of choice going forward but it;s a bit early to say that this is THE blessed new way."
128.
Failure Detection and Consensus in Distributed Systems with F#(github.com ↗)
2 points · by algorithmsRcool · 7y ago · discuss
129.
Failure Detection and Consensus in Distributed Systems with F#(github.com ↗)
2 points · by algorithmsRcool · 7y ago · discuss
132.
A compiler framework for managed code(github.com ↗)
2 points · by algorithmsRcool · 7y ago · discuss
comment 7y ago · link · parent
Images and video sure, but everything from html, just, css, svg isn't compressed.
In fact compression is critical to modern SPA frameworks to keep initial download times lower.
Also this post has little to do with http compression. ZSTD is used it many other circumstances.
comment 7y ago · link · parent
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.
comment 7y ago · link · parent
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
comment 7y ago · link · parent
Any doctor (or mechanic, accountant, etc...) could benefit by providing false/sub-standard services to keep the client returning regularly.
As for the measurement, it's almost entirely based on feedback from the patient.
I can see how a depressed or mentally ill person could be more susceptible to accepting medication that wasn't in their best interest, but that problem seems intrinsic to all medication.
comment 7y ago · link · parent
So List<int> doesn't necessarily get JItted even though List<long> has been. This poses a bit of a problem for AOT compilation.
You would essentially have to either
A) Trace all possible execution paths and determine every needed generic instantiation and precompile and ship them all. This ain't easy, and it might be impossible. Also expect massive binaries due to all those types.
B) Bundle a JIT and lazily emit code as needed.
C) No generics?
comment 7y ago · link · parent
You can do function composition in C# but I've virtually (heh) never seen it. Classes and Interfaces are the default abstractions in C# land even if there are other available.
comment 7y ago · link · parent
But that struct example is less than great.
Just last night I had a readonly C# struct like that, that I used as a dictionary key and wondered why my perf tests took a nose dive when the Dictionary hit a few dozen entries.
My boneheaded mistake was i forgot to override GetHashCode and Object.Equals. Great my perf was looking decent, but even then I was allocating 32 bytes of memory on every lookup.
I forgot I needed to also implement IEquatable<> to prevent boxing on calls to Object.Equals.
My little 2 item struct is 3 lines of definition and 7 lines of boiler plate to get it right. and my GetHashCode impl is suboptimal.
F# records do all of that for you. every time. automatically.
comment 7y ago · link · parent
I was writing a little program to help glue some things together in our build/release pipeline. This tool would be deployed to the build server and get invoked by the build agent. (This could have been a script, but the complexity got to be too much to keep organized)
The tool had two halfs:
- The frontend whose job was to gather up all the 'input' from CommandLine and Env vars, do some parsing, then spit out proper types/objects.
- The backend that would interpret this data and make decisions, make some API calls and maybe copy some files.
Because of the way our our software is built, we have 5 or 6 different 'flavors' of our app that needed special treatment during build. The complexity of branching on if it was a build step or a release step, the different flavors of our app and the need to deal with input data that may or may not be there got the best of me and I spent weeks making tweaks to deal with NREs at runtime because i hadn't handled some weird case.
So i trashed the tool and rebuild the front end in F#. I spent a little time making a very accurate type representation of the data model. Including defining a lot of stuff as optional and introducing a lot of discriminated unions to represent possible branches. Then i essentially just filled in the blanks (match cases) and fixed the compile errors until every case was covered and I was done. No bugs.
You see the big, big win of F# is the default path doesn't let your cheat yourself.
You MUST handle every switch/match case.
You MUST fully construct your records.
If your function may fail, you MUST use Option to express None/Null
And you MUST handle every option type as potentially None and write handling logic
When you define your data model, just be on honest about what data needs to be where and the compiler will keep you on the straight and narrow.
comment 7y ago · link · parent
Safer threading with immutability
Safer programming with null-safety
Safer logic with precise domain modeling
The precise domain modeling is the real paradigm shift.
The whole point of static typing is to inform the compiler about your intent so that it can provide guarantees about correctness. F# makes it easy to define lots of small types that precisely model state so that you can give more responsibility to the compiler to verify your program.
I cannot overstate how important this is to maintaining correct software overtime. If you guard your touches with non F# code, you need far fewer unit tests and probably even less runtime checks because you already know if the types are right, so is the logic. And when you need to write unit tests, the functional style makes your tests very easy to write.
I have personally struggled with domain complexity in C# that i was able to model precisely in F# and have it work perfectly on the first try.
149.
Trill: high-performance in-memory streaming analytics engine(github.com ↗)
2 points · by algorithmsRcool · 7y ago · discuss