Better HN
topnewbestaskshowjobs
Log inSign up

algorithmsRcool

1,521 karma · joined May 25, 2012 (14y ago) · 286 submissions

https://github.com/AlgorithmsAreCool
Submissions

comment 7y ago · link · parent

Are there any thoughts about where compression fits into this model?

I know networks are getting very fast but with this size of data I wonder if there are realizable gains left with modern algorithms like Snappy.

comment 7y ago · link · parent

This response feels very hyperbolic to me.

I can barley call this an ad, especially since the subject of the ad is free, open source and a successor product to the current one.

comment 7y ago · link · parent

But isn't Tableau owned by Salesforce now? That evens the playing field some.

Also, this is a free and now open source tool from Microsoft Research that is independent of PowerBI.

comment 7y ago · link · parent

I liked kinda liked it, but trying to unify HTTP, TCP, Pipes and MSMQ into a single framework was probably overly ambitious. WCF always felt very complicated with all sorts of sharp edges to me.

comment 7y ago · link · parent

Well in this case they have made clear that WCF isn't going to be supported officially in dotnet core.

They are just being non-committal about gRPC being the successor. But I have seen Fowler poking around in the RSocket codebase recently, so who knows.

comment 7y ago · link · parent

Short answer is yes for most workloads. It's fast, scalable and well supported.

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."

https://github.com/dotnet/core/issues/2278

comment 7y ago · link · parent

The only real features that i see on display here are Option and Sum types. Which are great, but far from unique to Rust.

F# and it's ML ancestors are great for this also.

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

comment 7y ago · link · parent

I enjoy his content and I have found some of his explanations novel and enlightening.

I don't know why him spending untold hours producing detailed content is a bad thing. Even if it is for self-promotion.

comment 7y ago · link · parent

I'm a bit confused.

Are you critical of the size of the monorepo, or the number of builds?

132.

A compiler framework for managed code(github.com ↗)

2 points · by algorithmsRcool · 7y ago · discuss

comment 7y ago · link · parent

But this is flatly untrue.

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

For 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.

comment 7y ago · link · parent

By 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

comment 7y ago · link · parent

I don't think your first point very well thought out.

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

In dotnet land generics are JITted on demand at runtime when you first execute a specific instance of that generic type.

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

Well you're right of course. But my only thought here is that Dustin's code looks like idiomatic C#, but yours does not.

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

I mostly agree about mutually recursive types, but I really hate having to keep my files ordered in the project honestly.

It might be my least favorite thing about F# (Except that Option<T> is a class not a struct)

comment 7y ago · link · parent

The command you are thinking of is probably `dotnet publish -r debian.8-x64`

comment 7y ago · link · parent

Or to be even more pedantic it's

Func<T[], T[]> where T : IComparable<T>

But maybe all of that is just stronger arguments for F#'s inferred typing...

comment 7y ago · link · parent

Dustin is definitely giving a hard sell here I conceed

comment 7y ago · link · parent

Just to be clear, you are arguing the superiority of partial application/currying here right?

Because your F# example is the same except it's trading Func<List<int>, List<int> for (int list -> int list)

comment 7y ago · link · parent

You are right about the first example (although the F# version looks nicer =D)

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

> There is no unspoken agreement...

Yes! That is exactly right, F# give you the tools to express your actual model with little/no ambiguity.

comment 7y ago · link · parent

I don't think i can release the exact code but my case was like this.

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

F# is 3 big things to me:

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.

comment 7y ago · link · parent

Finally! I've been wanting a tool like this to help get my gRPC development flow to parity with REST

149.

Trill: high-performance in-memory streaming analytics engine(github.com ↗)

2 points · by algorithmsRcool · 7y ago · discuss

1
456
10