Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
sfvisser
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
12 ms
·
91.
▲
by
sfvisser
4y ago
Isn’t toTreeF just ‘out’ as in ‘newtype Fix f = In { out :: f (Fix f) }’ ?
92.
▲
by
sfvisser
4y ago
No open source code base I can point to right now unfortunately. But this is fun stuff, so I couldn't help creating a simple gist to demonstrate the concept: https://gist.github.com/sebastiaanvisser/cd6ee46356e3ecc
93.
▲
by
sfvisser
4y ago
These patterns might seem abstract and obscure at first, but have proven tremendously powerful in practice to me. The current project I’m working on in Rust has a big recursive data type with quite some branches and different instantiations
94.
▲
by
sfvisser
4y ago
That definition is just one of the many possible definitions. And one of the obscurer ones tbh. :) It’s an abstract concept that you can implement in many different ways.
95.
▲
by
sfvisser
4y ago
Don't think your comment makes a lot of sense in the context of the article. Author explicitly wants to create/use/drop some WASM instances in the JavaScript world without leaking memory. Piggybacking on the existing JS GC is
96.
▲
by
sfvisser
5y ago
My intuition for this is: given a fixed and known scoring range (say 0..100), when scoring very low there is simply a lot of room for overestimating yourself and when scoring very high there is simply a lot of room for underestimating yours
97.
▲
by
sfvisser
5y ago
Interesting related paper by Jeroen Fokker: The Systematic Construction of a One-Combinator Basis (1989) https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.19....
98.
▲
by
sfvisser
5y ago
Definitely yes! It's a loooong time ago, but the pattern exhaustiveness checker of GHC wasn't up to this last time I tried. But my guess is things are much better now and this might actually work.
99.
▲
by
sfvisser
5y ago
Contrary to what many comments here state, I don’t think this is only useful in a dynamic runtime kind-of environment. I often think I could use some form of this in Rust and/or Haskell. In a very specific way: I often want a single co
100.
▲
by
sfvisser
5y ago
> Functional programming, however, suggests we should create and destroy these structures willy-nilly. It really saddens me that some people completely miss the point of what FP is about. How did this happen?
101.
▲
by
sfvisser
5y ago
You’re right here I think, but it is a hard problem in practice I noticed. Hard in the engineering sense, because you’re sometimes writing generic library-level code that needs a domain specific notion of error bars and tolerances. So you
102.
▲
by
sfvisser
5y ago
No, we’re always at the beginning of infinity.
103.
▲
by
sfvisser
5y ago
True. Also many of these are not actual issues and are just behavior inherent to using JavaScript. If you don’t like your conditional logic in your template just give them a name and explicit boolean type and be done with it. Still a useful
104.
▲
by
sfvisser
5y ago
Maybe I’m a bit naive, but I’m convinced any great traditional software engineer or devops engineer in combination with a data scientist/ML person should be able to setup the ops pipeline for a ML project. The details and algorithms th
105.
▲
by
sfvisser
5y ago
I don’t think that’s the natural conclusion per se. The feature is just spec’ed from one side, the webapp side. It’s up to the browsers to implement some export feature to expose it to the system side. Maybe some simple generic browser exte
106.
▲
by
sfvisser
5y ago
The errors used to be somewhat better in the past, but more features have been added to the language, type system and std libs. Those features required the core parts to be slightly more expressive and generic, resulting in more abstract er
107.
▲
by
sfvisser
5y ago
I don't think this is really about programming languages. The world of software (and specifically everything network based) is oscillating between fat servers and fat client every few years or so. To me the innovation seems to be ortho
108.
▲
by
sfvisser
5y ago
> But why create a new formatter? When we began our Rust rewrite, we fell in love with rustfmt, Rust’s own formatter. It formatted code instantly, unlike JavaScript formatters which could often take quite a few seconds on larger files. I
109.
▲
by
sfvisser
5y ago
What’s crazy about it? And how would contexts by more ergonomic than method chaining? Hard to imagine honestly. You can always use intermediate variables if you want to.
110.
▲
by
sfvisser
5y ago
My guess is the author just picked the simplest syntax to parse in order to demonstrate the tech. If it works and shows to be successful you can always write a GHC (or whatever) backend that compiles to this runtime. Maybe come up with some
111.
▲
by
sfvisser
5y ago
Type variables are sometimes called generics and a part of the type language, so JavaScript doesn’t have them. Typescript, but also Rust, Haskell, Java, the ML-family have them. Type variables abstract over types and are analogous to functi
112.
▲
by
sfvisser
5y ago
The article seems to be mixing up type synonyms with type variables. Type variables have an actual well defined meaning. They act like variables that can be instantiated during inference/checking, analogue to how variables in the expre
113.
▲
by
sfvisser
5y ago
But a zipper on a tree I assume.
114.
▲
by
sfvisser
5y ago
It's easier to see what's going on when you consider the spread operator to be an operator working on the function not the parameters: const dotdotdot = <A>(f: Function) => (list: Array<A>) => f.apply(thi
115.
▲
by
sfvisser
5y ago
I think this argument makes sense in _some_ usecases, but definitely not everywhere. There are genuine places where a FP approach to API/DSL design makes sense and writing code that abstracts away from concrete parameters and focuses o
116.
▲
by
sfvisser
5y ago
VSCode’s speed and resource usage are not best class, but – on my relatively modern machine – are definitively good enough.
117.
▲
by
sfvisser
5y ago
You are right and I phrased my comment the wrong way. The confusing part is not calling this process compilation, the confusing part is now calling something a compiler for which the consensus previously was calling it a pre-processor. Now
118.
▲
by
sfvisser
5y ago
This is not about elitism about terminology, but about sloppiness in using well established words in a specific context to mean something new. It happens rather frequently in the frontend world - which I’m sometimes a part of - and it’s inc
119.
▲
by
sfvisser
5y ago
I've obviously read that. Most of those features are what we used to call CSS pre-processors, but I'll happily call that compilation if that's a thing now.
120.
▲
by
sfvisser
5y ago
What does it mean to compile CSS? Pack multiple files into one? Resolve and inline variables? Convert nested rules into flat CSS? Something else? I'm really not sure.
More ›