HNHacker News
TopNewBestAskShowJobs

xkapastel

621 karma · joined May 16, 2016

submissionscomments
xkapastel··on Flutter: a Portable UI Framework for Mobile, Web, Embedded, and Desktop
I'm confused about the mentions of Chrome OS here. In particular:

> You can also publish Flutter apps for Chrome OS to the Play Store

Do they mean, you can publish an Android app and then run it with Chrome OS's support for that? How else are you supposed to run Flutter apps on Chrome OS? The only other way I see is "web" unless I'm missing something.

xkapastel··on Flutter desktop shells
> Subtyping is set theory, and sets are obviously more fundamental than arithmetic! :D

In case this wasn't clear, the "arithmetic" in question is being performed on sets (or types). For example, for sum types, the number of inhabitants of the type is the sum of the inhabitants of the components. All three of addition, multiplication and subtyping are operations on sets (types). So this was a strange thing to say.

> Simplicity is a virtue because it lowers the cognitive load of a language. I don't know if mapping something to arithmetic tells us something actually profound about the productivity of a language feature, even if it gives me a little shiver of delight when I think about it.

My real point is this: if you are deciding to build a language, as far as I'm concerned, it is very strange to add multiplication (why don't structs count as multiplication? I would say they do), then not add addition and instead add something much more complicated than addition. It just doesn't make any sense. It's not about the "productivity" (how do we measure this?) of the feature, it's about it not making any sense to do this! You add multiplication, you add addition, that's really all there is to it. I don't know, I guess I'm just repeating myself now and you won't find it convincing, but to me it's like trying to defend Roman numerals after being shown the Arabic system.

> You must have an uncharitable view of those people if you presume that all of them are making a choice that goes against their own self-interest to be happy productive programmers.

I don't think so at all. It's not really a fair choice; people choose languages in order to build things, and it's easier to build things in languages that other people are using. The full range of options is not obvious to every programmer (does the average webdev even know about ML?), and most of the time there are more important concerns than whether your language has a nice theory behind it.

xkapastel··on Flutter desktop shells
First, I just want to say that I use Dart pretty regularly now and enjoy the language. I don't want to come across as overly negative; Dart is a solid language that's made web programming a lot more fun for me. So thank you, and everyone else on the Dart team for the hard work!

I just want to address these lines:

> Thousands of successful applications and a billions of lines of UI code have been written in object oriented languages.

> More code is written in languages doing subclassing every day than in languages with sum types. Despite the fact that sum types have been around since the 70s. You have to have a very uncharitable opinion of all of your fellow programmers to believe they've all been getting this wrong for decades.

I agree that there's a huge amount of code out there using subclassing and not sum types. I'm not disputing the utility of subclassing; I just think the analogy to arithmetic is compelling, in that a closed sum type is a more primitive notion than open ended subclassing. It's easier to describe what a sum type is than what a subclass is; sum types have a smaller impact on a type system than subclassing. Pretty much any metric you can think of, sum types are just simpler, and more widely applicable. Any time you are describing a data structure, an ADT is immediately useful; subtyping may or may not be useful and is always more complicated. It's very difficult for me to understand how anyone could possibly say subtyping is on the same level as a basic operation like addition. Subclassing may or may not be nice but sum types are a primitive in a way that subclassing simply cannot be.

I don't know how to break it down more than this: we already have multiplication of types, and everyone accepts this as a primitive. Well, you can also do addition of types! Multiplication, addition, a neat little pair, just like algebra class[0]. Subclassing is way more complicated than this. That's it, that's a bullet proof argument as far as I'm concerned.

I suppose I do have an uncharitable opinion of mainstream programming languages, because I do think they've been getting this wrong for decades. It's nothing personal, it's just that industry has other concerns besides how clean their languages are. My browser being written in C++ is not an argument in favor of subclassing, though. You can build anything out of toothpicks if you're paid enough.

[0]: https://typedefs.com/introduction/

xkapastel··on Flutter desktop shells
> There's a reason OO and UI have been married together for decades.

People repeat this a lot, that OO goes with UI, but I don't think it's actually true, and I think e.g. React Hooks and immediate mode GUI in general demonstrate that it's not true. OO has been coupled with UI out of inertia, not because OO has unique strengths when applied to UI.

Sum types are a primitive language feature, akin to product types, which absolutely no one rejects the value of. The sum/product analogy to arithmetic is compelling to me: they are the building blocks of complex types and deserve recognition. I think that "zen koan" you mentioned earlier is being very generous to subclassing. You want ADTs most of the time!

xkapastel··on Google backtracks on Chrome modifications that would have crippled ad blockers
Yeah I'm not good at detecting that, especially not online where people say all sorts of weird things :)
xkapastel··on PHP code generated by GPT-2
What is fishy? This isn't even state of the art for program synthesis. Here's another simple example trained on the Linux kernel: http://karpathy.github.io/2015/05/21/rnn-effectiveness/

I'm not sure what point you're trying to make. Do you think a neural net is not capable of generating the code in the gist? Because it's pretty easy to do that. The harder part that we're still trying to figure out is getting that code to do something meaningful.

xkapastel··on Replace Apt with Snap as Default Package Manager
This was posted on 2019-01-07, but I don't see any comments or discussion. Did anyone react?
xkapastel··on Autocomplete Using Markov Chains
> I wonder what the result would look like if this were applied to source code. IMHO a probabilistic algorithm for code completion could turn out interesting.

Neural program synthesis is similar to what you describe, here's a sample paper:

> We consider the task of program synthesis in the presence of a reward function over the output of programs, where the goal is to find programs with maximal rewards. We employ an iterative optimization scheme, where we train an RNN on a dataset of K best programs from a priority queue of the generated programs so far. Then, we synthesize new programs and add them to the priority queue by sampling from the RNN. We benchmark our algorithm, called priority queue training (or PQT), against genetic algorithm and reinforcement learning baselines on a simple but expressive Turing complete programming language called BF. Our experimental results show that our simple PQT algorithm significantly outperforms the baselines. By adding a program length penalty to the reward function, we are able to synthesize short, human readable programs.

https://arxiv.org/abs/1801.03526

xkapastel··on Autocomplete Using Markov Chains
Keep in mind this is essentially the same concept as the big scary AI from OpenAI that is making the news recently. They use neural nets, not markov chains, but the idea is similar: given a word, predict the next word.

> It's surprising how easy this can be turned into something rather practically useful

Given the above, it's not so surprising: this word prediction problem is fundamental, with a wide range of applications.

xkapastel··on Google backtracks on Chrome modifications that would have crippled ad blockers
Did you read the article? That's what it's about. I'm actually really surprised you posted this, the whole article is about Cliqz doing a performance test and finding that the claims about ad blockers hurting performance were not true.
xkapastel··on Google backtracks on Chrome modifications that would have crippled ad blockers
Google did NOT backtrack on ANYTHING. From the new thread:

> Another clarification is that the webRequest API is not going to be fully removed as part of Manifest V3. In particular, there are currently no planned changes to the observational capabilities of webRequest (i.e., anything that does not modify the request). We are also continually listening to and evaluating the feedback we’re receiving, and we are still narrowing down proposed changes to the webRequest API.

"We are still narrowing down proposed changes" means they still plan on removing the part of webRequest that everyone cares about, the feature that lets it block requests.

There was an initial thread about these changes: https://groups.google.com/a/chromium.org/forum/#!topic/chrom.... Lots of people made great comments about why the proposed change was a bad idea. What did Google do? Ignore the thread and post another about how they are "iterating" on Manifest V3. Google's strategy is clear: wait for the outrage to subside, keep making new threads to divert discussion if you have to, then go ahead and make the changes you were planning on anyway.

Keep in mind that their story about performance has been shown to be a complete lie. There is no performance hit from using webRequest like this. This is about removing sophisticated ad blockers in order to defend Google's revenue stream, plain and simple.

xkapastel··on Google backtracks on Chrome modifications that would have crippled ad blockers
No, what they're doing is nerfing webRequest so that the ad blockers cannot use it to block ads anymore.
xkapastel··on Replacing JavaScript Hot Path with WebAssembly
No, it's not like IE at all because IE was closed source. This was what I was trying to say earlier: the whole reason IE was "bad" was because it stagnated, which would not have been possible if it was open source. In this case, it's more like Linux.
xkapastel··on C# 8: Switch expressions
> I suggested that a c# lite or a rethinking of c# would be awesome.

"a rethinking of C#" is a good description of F#.

xkapastel··on Replacing JavaScript Hot Path with WebAssembly
> By that logic it was a waste of time for Firefox to exist -- there was already IE,

No, IE would need be to be open source for that logic to be applicable there, since the idea is to use a well-developed open source code base instead of rolling your own thing.

> or it was a waste of time for webkit to exist as there was already khtml, or blink because webkit,

You actually undercut your own point with these examples: WebKit was a fork of KHTML, Blink was a fork of WebKit. The developers in question believed that it would have been a waste of time to start from scratch, and so they didn't!

xkapastel··on Apple, Google criticised for Saudi Absher app that tracks women
What exactly are you trying to say? This post is nothing but empty snark. For example, are you trying to say that Saudi Arabia is not a sovereign nation?
xkapastel··on Google Edge TPU Devices
It does require a cloud based compiler, the accelerator doesn't run TF-Lite models directly. The cloud based tool is what gives you the actual executable.
xkapastel··on Orca – Live Programming Environment
> How can web projects be taken seriously when they won't even take the platforms they supposedly support seriously?

That's a pretty extreme reaction to someone not capitalizing the name correctly. Don't forget that they changed the name in the last few years, and not everyone is in the Apple orbit enough to absorb all of those shifts in branding.

xkapastel··on The Hanabi Challenge: A New Frontier for AI Research
It's a game, because why do you think everyone is going to follow the same rules?
xkapastel··on Switching to Firefox, Concerned with UBlock Origin Changes
What makes you think it's unlikely? The Chromium team seems unreceptive to the idea that e.g. `webRequest`'s ability to block a request entirely is a security/privacy feature, and instead views it as a bug to be fixed.

I haven't seen anything in the discussion thread that makes me think the Chromium team might decide to change course: https://groups.google.com/a/chromium.org/forum/#!topic/chrom...

xkapastel··on Browser diversity starts with us
They created a discussion thread, but the Chromium developers have been absent for a while: https://groups.google.com/a/chromium.org/forum/#!topic/chrom...
xkapastel··on A Python Interpreter Written in Rust
Most of the popular languages are not making a serious effort to compile to WebAssembly, though. It's totally reasonable for Rust to focus on.
xkapastel··on Cargo's next few years
What about the "next" instead of "new"?
xkapastel··on Fermentation and Daily Life
This article was frustrating because it danced around my main issue: I'd be worried about getting sick. There was maybe one sentence that acknowledged this:

> I think the fear of contamination and making one’s self sick is the biggest barrier.

This is a big deal, but the article makes light of it, doesn't even give it its own section, and instead presents a bunch of flowery prose about making death a part of life.

As one example of this, how are you supposed to protect these fermented foods from pests? I get the sense you're supposed to leave them out, uncovered, but that assumes you live in an area that allows you to do that.

xkapastel··on Coding Problems from Programming Job Interviews
> I once asked the infamous 'how man tennis balls on a 747' question - and the interviewee started calculating how many balls would fit in the area of various body parts, it was ridiculous.

I guess the implication here is that this was a bad approach? This is why I would be skeptical of this sort of question, it's really not clear to me why you think that answer is any more ridiculous than the question.

xkapastel··on Google proposes changes to Chromium which would disable uBlock Origin
I don't think I can go back to the internet without uBO+uMatrix.

On a related note, why doesn't Chrome for Android have extensions? I get the sense it's because it was more strategic to ban extensions entirely than to allow ad blocking on mobile.

xkapastel··on I'm going to work full-time on free software
A "living" despite the fact that it's negative income. UBI is absolutely relevant to people who want to see this sort of thing become possible.
xkapastel··on Halo was written with a Lisp dialect called blamscript (2014)
Screenwriting is not a term people use for programming languages, I think you're looking for "scripting".
xkapastel··on Rise and Demise of RSS
Does that amount of RSS data include Atom? If so, what is the ratio, and if not, how much Atom do you serve?
xkapastel··on Unifying Logical and Statistical AI (2006) [pdf]
Here's a short, textual introduction to probabilistic soft logic, the formalism presented in the video:

> A Short Introduction to Probabilistic Soft Logic

http://stephenbach.net/files/kimmig-probprog12.pdf

And a longer, more formal treatment of the same:

> Hinge-Loss Markov Random Fields and Probabilistic Soft Logic

http://www.jmlr.org/papers/volume18/15-631/15-631.pdf

← PreviousPage 4 of 4