Better HN
topnewbestaskshowjobs
Log inSign up

alipang

1,057 karma · joined Feb 21, 2012 (14y ago) · 172 submissions

Submissions

comment 2y ago · link · parent

I wouldn't really buy this in the first place for $20, maybe on sale, but in addition you can get it for free on mobile if you have a netflix subscription, so I'd have to imagine that many people do what I did and played it for a bit on their phone, so now I doubt I'll ever pay for it.

comment 2y ago · link · parent

Even Javascript has a similar syntax, though `yield` / `await` only works for certain "monads" (promises seem close enough)

comment 2y ago · link · parent

Well, why would it be taken as a given that programming should mimic the hardware?

Pure functions are easier to reason about (there may be exceptions of course), that's why they're interesting.

This paper is not related to side-effects - it's related to "totality", meaning all programs terminate. This could also be interesting for side-effecting programs, but it's of course much harder to verify in this case.

Due to the halting problem's existance a total language can not be Turing complete, but many useful programs can be verified.

I didn't see anything in the paper that claims that pure functions should be "all the way down", and the paper is not about side effects anyway.

comment 2y ago · link · parent

The idea that anyone who's opposed to narrow government regulations is somehow brainwashed by the Kochs is just an unsufferably smug attitude towards people you disagree with. It's like the "funded by George Soros therefore bad" you sometimes see on the right.

I'm sure they've spent money on promoting this, but there's many reasons you'd come to this conclusion other than having it "manufactured" for you by billionaire conspiracies.

You have to start by considering that your political opponents are capable of thinking for themselves if you want to ever do more than just preach to the choir. Declaring them idiots in the guise of "providing historical context" isn't helpful.

comment 2y ago · link · parent

If you check out the linked paper you'll see the title is "One-shot Algebraic Effects as Coroutines" - the keyword being "one-shot".

In general every Monad can be expressed "interpreting" the free monad. This relaxes the "one-shot" restriction, and can be implemented using delimited control. One-shot means faster performance though and is still useful for many things - and that can be implemented using coroutines.

If you acquire some understanding of what this means then you'll have a very good idea about the expressive power of what you can use coroutines (with nothing more) for, so it's very interesting.

comment 3y ago · link · parent

No? https://www.computerweekly.com/news/366537312/Chat-control-E...

comment 3y ago · link · parent

You don't have to memorize that log(5) = 0.7 if you know log(2) = 0.3 since log(5) = log(10 / 2) = log(10) - log(2) = 1 - 0.3 = 0.7.

Also log(8) = 0.9 because log(2^3) = 3log(2) = 0.3 3 = 0.9

comment 4y ago · link · parent

What, the anal beads is not a sensible theory? /s

comment 4y ago · link · parent

This is a really intuitive way of thinking about it. The best way I could work this out was to start with the special case of pure scaling in a single direction.

For instance when scaling by "a" in the x direction

M = (a 0; 0 1)

It's pretty easy to see by graphing an example that in order for the normal to work out correctly you must scale it by the inverse scale factor (1 / a), so the correct choice of M is the inverse, M⁻¹, i.e. M = ((1 /a) 0; 0 1).

This of course generalises to scaling in multiple directions (just multiply the matrices) - i.e. to diagonal matrices. For

M = (a 0; 0 b)

the correct choice for transforming the normals is

M = ((1/a) 0; 0 (1/b));

By applying singular value decomposition you get

M = UDV

So choosing M' = M⁻¹ᵀ you'll get M' = (UDV)⁻¹ᵀ = UD⁻¹V

Since orthogonal matrices U, V will actually correctly transform the normals (they're rotations or reflections) you can intuitively understand that M' will work for transforming the normals.

Question is - where does the transpose part actually come from? It's a of a bit "magic" choice. This article makes it very clear that this "arises from" the transpose in the dot product, (t⋅n = tᵀn), as the dot product defines orthogonality!

comment 4y ago · link · parent

I'd imagine you can use a keyboard shortcut as well to open this menu, but based on the text cursor, rather than the mouse one.

I do this a lot is vscode to auto-fix issues and automatically add imports for the identifier under the caret. It's however frustrating in that it sometimes uses the underlying platform's dropdown widget, which doesn't respect my key bindings (Emacs-like, using C-p, C-n for up, down etc).

comment 5y ago · link · parent

if (!memory[s1.id]) { memory[s1.id] = 'harvest' }

ought to do it.

comment 5y ago · link · parent

Yeah, the main coherent point I take out of this is that it makes sense to provide capabilities rather than to check them, i.e. if you have access to a certain API then you're by construction allowed to use it. It seems this is something the author has been working on.

This is then somehow shoehorned into "Parse / Don't typecheck" but it doesn't make much sense honestly.

comment 6y ago · link · parent

Not having it funded by the tax payer is not the same as outlawing it.

This all comes down to whether critical race theory is truly an unacceptable set of ideas, like e.g frenology, or not, that should be legitimately banned.

Should be easy to make an honest defense of that point if this is indeed the case?

comment 6y ago · link · parent

It’s hardly authoritarian to disallow certain ideas being funded by the tax payer. We wouldn’t be upset if frenology wasn’t allowed in government agencies.

I think the idea behind the ban is that critical race theory delivers a certain leftist ideology veiled in an intent to address race or gender issues.

Agree with this or not, but this seems where to discussion should take place.

comment 6y ago · link · parent

Found the guy who completely missed Kotlin, TypeScript and Scala.

comment 6y ago · link · parent

Monads are among the simplest abstractions you can find in computing. Compared to almost anything you need to understand in software development (how the hell do I make webpack do the thing I need?) they're ridiculously easy.

The fact that so many devs are scared of monads and believe outrageously silly things like you need a math phd to understand them seems to be similar to being afraid of drinking dihydrogen monoxide. Even though it's only water, it has a complicated sounding scary name, so it must be bad.

17.

Bulgaria to Declare State of Emergency over Coronavirus(nytimes.com ↗)

2 points · by alipang · 6y ago · discuss

comment 6y ago · link · parent

I've heard the objection about complex number not being real many times. I think the sensible answer is to argue that the natural numbers don't "actually exist" either. They're an abstraction just like the complex numbers.

Arguably we might one day find out that the universe is discrete at which point we could begin to try to define the naturals as something that "exists", at least up to some maximum large number. But even then the numbers are probably still best thought of as just a helpful abstraction.

comment 6y ago · link · parent

Sure, well aware that Babel and Webpack are not the same thing.

SWC has a Webpack plugin, whereas ESBuild seems to aim to replace both Webpack and Babel. Correct me if I'm wrong.

This is a big reason why I think SWC is more likely to succeed, and why I say they're in "competition" since they overlap partially, even if it's not 1-1.

comment 6y ago · link · parent

I believe something like this project is inevitable. You're probably thinking "Where's the Rust version of this?". I'll save you a roundtrip to Google that'll find you SWC. [1]

SWC is already more mature, at least more so than this project. Using rust does also seem to have some advantages compared to Go.

Still, nothing wrong with some competition, just think it'll be pretty hard to replace the entire ecosystem around Typescript/Babel/Webpack in one go. Not going to work for existing project - probably way too high of a risk for new ones, sadly.

[1] https://github.com/swc-project/swc

comment 6y ago · link · parent

It's almost a meme at this point, but the solution, of course, is algebraic effects. Among other things they let us implement checked exceptions, but in a sane way that's safe without requiring the annotation of every single function.

https://www.microsoft.com/en-us/research/wp-content/uploads/...

comment 6y ago · link · parent

As a westerner who's lived and worked many years in Poland, the factor that seems to explain a lot of this is that wages in Poland remain extremely low compared to most of western Europe.

The result of this is that people can't afford to just replace things as soon as they break. For instance I had a pair of nice, but not crazy expensive headphones that broke while living there.

It was very easy to find a shop that helped me repair them, but this involved a decent amount of manual work. It very unlikely this would have been more cost effective than just picking up a new pair on most other countries I've lived.

If we put higher taxes on plastics and other materials so that the cost of labour vs. the cost of physical goods were similarly changed I bet we'd see a lot of improved behaviours like this also in the more affluent parts of the world.

comment 6y ago · link · parent

"MegaCorps" in any kind of healthy market will still compete on price, so simply stating that they will "pocket the rest" of AI-related productivity improvements is ridiculous.

The more likely outcome is that prices on a whole lot of things are about to drop drastically. Of course this does nothing to help the people who are left out of a job and can no longer contribute as they are no longer cost-effective. UBI is one option to address this, at least partially. Do you have a better one? Ban AI? Do you happen to be an anti-capitalist, and your convenient solution is (big surprise) to remove capitalism as an economic system?

I'm not saying the effect of more people being outcompeted from the job market will never be a problem. Perhaps parts of it will be solved with income redistribution being increased. Perhaps part of the effort will be in creating new jobs where humans can not be replaced. Some cookie cutter "anti megacorp" rhetoric ain't likely to help much.

comment 6y ago · link · parent

Algebraic effect handlers no doubt seem to be the future of getting side-effects under control in programming languages, much like in the way of what immutability has done for data.

My (admittedly little) experience with Unison though is that it's far from ready for the spotlight however. Much of the docs 404, and joining their discord mostly resulted in the advice to wait for future releases.

I wish Microsoft would invest in something like the koka language https://github.com/koka-lang/koka. Perhaps the idea of content-addressable / immutable code could find a place too, but I think it's less critical.

comment 7y ago · link · parent

Nor is it monoid composition.

comment 7y ago · link · parent

Great incremental release.

Typescript really isn't the most exciting language, but it's very very helpful. Compared to regular javascript it saves me a lot of time, and so many pains and headaches every day.

comment 7y ago · link · parent

There's been an unfortunate trend in the JS world where a lot of frameworks are created, but without any real meaningful sense of progress, resulting in a sense of going around in cycles in various "reskins" with different syntax and conventions, all round some kind of core MVC idea.

When I say "actual CS concepts" I mean things that have been broken down into it's core using a suitable mathematical model. This is ultimately a much more suitable way bo build tools used by engineers.

My personal concerns is that Vue to me is mostly just a reskin with new syntax on things that are already in React. Hooks become the "composition api". Redux becomes VueX. Is this necessary?

Could VueX just have been an alternative to Redux, like MobX is?

Could we just have implemented a Webpack-loader to put styles and react components together?

Some people don't like that React uses `className` instead of class. Is `v-bind:class` and various `@` notations really so much better we can justify a whole new ecosystem?

So roughly - Vue provides fragmentation in the frontend ecosystem. I like competition - but what does it really offer that justifies it? I don't get it, and now what they have been working on is just catching up to React.

comment 7y ago · link · parent

The React core team has done a wonderful job incorporating actual CS concepts like algebraic effects into their framework. I understand that it's only an approximation of the real thing, but they're clearly managing to at least get the core idea out there into real production systems.

The Vue implementation seems to ultimately lack this core understanding, and comes off almost a bit cargo-cultish in comparison. React has hooks, so we must have something similar.

I don't mean this as singularly bad, I'm certain Vue can be productive and that this can be a productive feature for Vue devs - but when will we as an industry manage to evaluate software by semantics rather than the syntax we prefer? Does Vue truly offer anything over React that's not in the realm of preferred syntax?

comment 7y ago · link · parent

There are some ways in which Haskell's type system actually makes it significantly better at Elm's core job than Elm itself.

Type classes could certainly be argued to be one of those things, but also just existential types makes "reducers" a lot more pleasant to work with.

Check out e.g. Edward Kmett's library or read e.g. Gabriel Gonzales' post on folds if you want to know more.

[1] http://hackage.haskell.org/package/folds-0.7.5/docs/Data-Fol...

[2] http://www.haskellforall.com/2013/08/composable-streaming-fo...

123456