HNHacker News
TopNewBestAskShowJobs

alquemist

244 karma · joined July 1, 2020

submissionscomments
alquemist··on Cover Your Tracks
What I want for Christmas is javascript disabled by default, plus one-click ability to enable for specific sites.

Random browsing => no javascript.

Play a browser game => javascript.

I have this today with Flash, would be nice to have it for all client-side code execution.

alquemist··on All Hail Geometric Algebra
Fun stuff! Also found this interesting tidbit:

https://slehar.wordpress.com/2014/03/18/clifford-algebra-a-v...

> Multiplication of all three basis vectors (e1^e2^e3) produces a three-dimensional volume segment or trivector, with unit cubed volume. This trivector has some peculiar properties that represent the scale of the whole space, it is often called the pseudoscalar of the space, I, it performs the function of the imaginary number i, but extended into three dimensions. Multiplication by the trivector represents a 90 degree turn in all three dimensions. Therefore two such 90 degree turns in each of the three dimensions results in a total reversal of direction, which is equivalent to a simple negation, and thus I2 = -1.

alquemist··on All Hail Geometric Algebra
For those curious, ∇ . F is called 'interior derivative' and relates to divergence, whereas ∇ /\ F is called 'exterior derivative' and relates to curl.

https://en.wikipedia.org/wiki/Geometric_calculus#Interior_an...

alquemist··on All Hail Geometric Algebra
That's cheating. One would need to also define F, c, ε0, J, assuming ∇ is known from calculus. Which would make for 5 lines :)
alquemist··on All Hail Geometric Algebra
Thank you kind stranger. The technical machinery makes much more sense now. But the intuition still lacks.

An attempt. To map an R^2 vector into G^2 is trivial, (a,b) => a x + b y = (1, a, b, 0). The reverse is hard. s 1 + a x + b y + d xy = (s, a, b, o) => (?, ?). Or perhaps G^2 is a superstructure of R^2, and most elements of G^2 can only be projected (somehow? perhaps trivially?) to R^2, but with loss of information. Which leaves the grok question: what does a vector in G^2 actually represent? Perhaps scale + x position + y position + orientation angle, as the use of 'i' suggests? If so, then in R^3 xy, xz any yz represent rotations in the respective planes? Which leaves a bonus puzzle: what does (multiplying with) xyz represent?

FWIW, at this point it's likely I can compute the answers using the code in the OP and well crafted multivectors. Time permitting :)

alquemist··on All Hail Geometric Algebra
Thanks. Appreciate taking the effort to answer. What I'm trying to do is to gain an intuition of what kind of objects GA manipulates, then stash it for whenever I'll need that kind of manipulation, which, sadly, can be never.

Within that context, just grokking R^2 or R^3 would be great progress. To be fair, the article does present the fundamental identity, uv = u.v + u /\ v, where u.v is the usual dot product (scalar denoting relative projective size) and u /\ v = |u||v|sinθi (something related to area and the plane induced by u and v). Even if the article does exemplify with R^2 by defining i = xy, and then dropping the ball: "i is interpreted to mean the plane generated by x and y". I can't grok this part :(

* This looks like (almost) a circular definition, defining uv in terms of the specific xy, where x and y are the two orthonormal R^2 vectors forming the basis. What is xy? Is it a scalar? A vector? A normal vector? How does a normal vector work in R^2?. A tensor of some dimensions? For example, assuming x = (1,0) and y = (0,1), how does one compute i = xy?

* Plane generated how? a u + b v, given any two scalars a and b?

* When moving to R^3, i'd think uv / xy define a plane. What does uvw / xyz mean?

* Minor quibble, is it sin(θ * i) or sin(θ) * i?

alquemist··on All Hail Geometric Algebra
Ooof. This is almost useful.

There is a simple mechanism to model multiplication of vectors represented using elements of an orthonormal basis. Each (multi)vector is a linear combination of terms, and each term is an ordered sequence of basis elements. Multiplication of (multi)vectors works as usual. Multiplication of terms simply concatenates the 2 terms, then canonicalizes using identities vv = |v|^2 and uv = -vu. There is a cost, the number of terms in a (multi)vector is O(2^n) for an n dimensional space, but that's OK.

And then I'm lost. How does this map back to geometry? What does '2 + 3xy + 5yz - 7xyz' mean geometrically speaking? What does multiplication mean geometrically speaking? Can't build an intuition, not even for R^2 or R^3 :(

alquemist··on Ramanujan's Easiest Formula
How would a mere mortal could possibly divine equations like this?

There is a method behind it. The formulas are derived from the study of relatively simple ODEs, in this example f'(x) = x.f(x) + 1 and g'(x) = x.g(x) − 1. The latter was solved 100 years prior by Jacobi. While the solutions are non-trivial, they are fairly compact, accessible to a high schooler. The presentation linked from the blog is pretty good at unveiling the magic.

This is to say that, with proper guidance, the kid down the street can too become as cool as Ramanujan.

https://math.ucr.edu/home/baez/ramanujan/ramanujan_whittier_...

alquemist··on To find great remote employees, prioritize candidates with strong writing skills
Title. Abstract. Details.

Most people will skim the title. Some will read the abstract. Few will read a specific paragraph or two of details. Yet, the writer doesn't know who's going to read what. Could be the writer himself, 6 months down the line. Often times those details are pure gold.

alquemist··on Object-oriented programming: Some history, and challenges for the next 50 years [pdf]
Obviously. Yet the 'FP doesn't scale for distributed systems' is too broad. MapReduce / Flume / Spark / BigQuery are distributed systems. What he probably meant is one can't use pure FP for OLTP at scale. This is again a bit too broad, as most systems benefit from having a FP 'business logic' core with some mechanisms to integrate with the rest of the world. Often times distributed systems are build of purely functional layers talking RPC with the lower layers. Even Erlang, the canonical example of 'we really meant actors when talking about objects' is heavily functional in its design.

For reference, I use FP as in 'eschew mutable state', and not 'let's use category theory to solve FizzBuzz using compile-time type metaprogramming'.

alquemist··on Object-oriented programming: Some history, and challenges for the next 50 years [pdf]
Speculation. The FP community prizes mathematical beauty, for which symmetry is an important factor. It is simply ugly to promote one function argument (which one?) to a privileged role, even if the linguistic side of the brain screams that's the right thing to do.

Re autocomplete, there is no technical reason why auto-complete couldn't trim down the search space based on the arguments of the functions, for example by using reverse polish. But reverse polish is unusual, we really like SVO anyways, and modules as subjects are very useful, if only as an autocomplete anchor, in tooling or in one's brain. OOP/SVO is here to stay for the foreseeable future, and embracing pure functions principle makes it rather pleasant to work with. If only we could decouple 'modules as namespaces' useful idea from all the misguided baggage that comes bundled with OOP, of which the 'active data' antipattern deserves special 'please avoid' mention.

alquemist··on Object-oriented programming: Some history, and challenges for the next 50 years [pdf]
The seductive power of OOP has little to do with the technical merits. As you mention data oriented programming leads to better programs. Even when using OOP technology, programs usually tend to become data oriented (hello protos), and 'objects' become glorified pure functions.

The big OOP idea is the subject-verb-object interface, confusingly named object-method-arguments. The SVO structure matches the cognitive linguistic bias of the human brain, thus feels obviously right to most humans. Even if better programming alternatives exist. The endless litany of new Verber(args0).verb(args1) is here to stay.

alquemist··on Object-oriented programming: Some history, and challenges for the next 50 years [pdf]
It depends on what the meaning of the word 'scale' is. Analytics is definitely using a ton of FP-flavored computation at gigantic scales. The #1 principle of FP is the insistence on computation with no side effects. Relational algebra (SQL, MapReduce, Linq, etc.) is adhering to this principle, making it arguably the most successful application of FP, running some of the largest computations on the planet.
alquemist··on Ask HN: Wouldn't it be great to be able to follow fellow HN users?
Please no. For better of worse, HN is one of the few public outlets not afflicted by celebrity culture.
alquemist··on PyPy: Faster Python with Minimal Effort
This is amazing, and obvious in retrospect. Gradual compilation can be adopted, well, gradually, without breaking existing code. 100% upside, 0% downside. PyPy team should consider making this delivery mode the #1 priority. Even worth reconsidering the object management impedance as well, and go for 100% compatibility with CPython object model. I suspect this would have a small runtime cost, but a would be a huge boon for smooth risk-free adoption.
alquemist··on Eleven Years of Go
Thanks, appreciated. Your example rhymes with u/jhoechtl remark that there is no standardized way to manage stack traces, aka stacked error contexts. Perhaps the Golang elves will come up with an elegant solution. By 2025 :)
alquemist··on Eleven Years of Go
Can you please share some examples of the harder spots?
alquemist··on Introducing the next generation of Mac
light level down, light level up, mute, volume down, volume up.
alquemist··on Eleven Years of Go
Granted, explicit error handling is a good idea. At some level, it depends on the personal style. Perhaps I'm missing something, but I like to write a ton of assertions to validate code invariants. On assertion failure, which obviously never happens as I write perfect code that never violates invariants, all I want to happen is 'write the error in the logs and return 50x'. I suppose panic/recover is the way to go, but I have the impression they are shunned by the community and not recommended by Golang official docs.

https://golang.org/doc/faq#assertions

> Why does Go not have assertions?

> Go doesn't provide assertions. They are undeniably convenient, but our experience has been that programmers use them as a crutch to avoid thinking about proper error handling and reporting. Proper error handling means that servers continue to operate instead of crashing after a non-fatal error. Proper error reporting means that errors are direct and to the point, saving the programmer from interpreting a large crash trace. Precise errors are particularly important when the programmer seeing the errors is not familiar with the code.

> We understand that this is a point of contention. There are many things in the Go language and libraries that differ from modern practices, simply because we feel it's sometimes worth trying a different approach.

alquemist··on Eleven Years of Go
It's really a joke :)

Fundamentally, the Go team made the correct choice between explicit and implicit error handling. Yet one would hope for a bit terser syntax and language supported stack traces, 11 years after launch.

For a good overview of the issue: https://go.googlesource.com/proposal/+/master/design/go2draf....

alquemist··on Eleven Years of Go
Next on the list: error handling. Which is absolutely not a problem, and works very very very well as is. Then again, one can hope that maybe by 2025 :)

https://github.com/golang/go/issues/32437

https://github.com/golang/go/issues/32437#issuecomment-51203...

https://github.com/golang/go/labels/error-handling

alquemist··on A Primer in BERTology: What We Know About How Bert Works
Intelligent trial and error.

1. Transformers are an extension of the attention mechanism, a well known LSTM extension that worked well for machine translation (2014, https://arxiv.org/abs/1409.0473). A transformer model is essentially building a multi headed attention module, analogue to CNNs, then stacking several layers of them, analogue to CNNs / stacked LSTMs. (1998, http://yann.lecun.com/exdb/publis/pdf/lecun-01a.pdf)

2. Transfomers use residual blocks, which were introduced by the ResNet CNN arhitecture (2015, https://arxiv.org/abs/1512.03385). At the time, ResNet was topping the ImageNet benchmarks. This technique helps preventing the vanishing gradient problem during training.

3. Transformers use normalization extensively. Layer normalization and attention normalization. This helps keeping internal vectors in the neighborhood of 1 and prevents vanishing gradient training collapse.

4. Correct initialization of the network vectors also helps preventing the vanishing gradients problem.

5. Unsupervised pretraining was one of the first tricks to make deep networks work (2009, https://www.jmlr.org/papers/volume11/erhan10a/erhan10a.pdf)

6. Pretraining was used extensively in the vision community for transfer learning, i.e. reusing the weights of a network trained on ImageNet and replace the top layers / loss function to tackle a different problem.

7. Finally, language modelling, that is predicting the next word in a sentence, was a well known technique to make machine translation work better. Researchers were looking for better language modelling techniques using large corpora (2013, https://arxiv.org/abs/1312.3005, https://www.kaggle.com/c/billion-word-imputation)

alquemist··on Advanced Join Patterns for the Actor Model Based on CEP Techniques
Nitpick: Actors or goroutines or async are mostly used to deal with concurrency. CUDA & friends are used for parallelism.

The paper: The motivation is a problem suitable to be solved via rule systems. It's a bit unclear why the rule system needs to be grafted on top of an actor model.

Actors: Programming with async messages is hard. Message ordering matters, no clear error reporting, no stack traces, distributed state. This is hardware hard, as in bring in formal verification methods hard. To be avoided in favor of a centralized coordinator solution if at all possible.

I wonder if, alternatively, one could use Rx processing over the stream of events.

Motivating example from the paper:

1. Turn on the lights in a room if someone enters, and the ambient light is less than 40lux.

2. Turn off the lights in a room after two minutes without detecting any movement.

3. Send a notification when a window has been open for over an hour.

4. Send a notification if someone presses the doorbell, but only if no notification was already sent in the past 30 seconds.

5. Detect home arrival or leaving based on a particular sequence of messages, and activate the corresponding scene.

6. Send a notification if the combined electricity consumption of the past three weeks is greater than 200 kWh.

7. Send a notification if the boiler fires three Floor Heating Failures and one InternalFailure within the past hour, but only if no notification was sent in the past hour.

alquemist··on Anu: A sound, distributed version control systema
You are correct, there are no diff3 conflicts, thanks again for the clarification. The problem is fundamentally ambiguous, and the argument a bit more subtle. As a rule of thumb, when two heuristics are available, pick the simplest one (e.g. the one requiring fewer inputs), especially if a human needs to wrap their head around the rare cases where the heuristic goes wrong.
alquemist··on Anu: A sound, distributed version control systema
Thanks for the example. History manipulation is a nono. While I'm not a git/diff3 expert, could one say 'make patch K from commit triple K0,K1,K2', meaning 'all changes between commits K1 and K2, with respect to origin K0', then make independent PRs out of them? Maybe will be only 95% correct, but that's what tests are for.
alquemist··on Anu: A sound, distributed version control systema
You are correct, thanks for the clarification. From https://www.gnu.org/software/diffutils/manual/diffutils.html...

> You can think of this as subtracting older from yours and adding the result to mine, or as merging into mine the changes that would turn older into yours.

The point stands: taking history in account is unconvincing, as it assumes intent where none is explicitly given. In the example, if the top branch had a single commit, AB => ABGAB, then there is no way to reliably infer that A 'intended' [+ABG]AB, vs. AB[+GAB]. Even with the given history, maybe the author of the top branch really intended AB => AB[+GAB], but made an error, corrected in the 2nd commit. The problem is fundamentally ambiguous. We can argue which of the diff3 or anu/pijul heuristics are better. In practice I suspect the difference is not that large.

For completeness, here's a guess of what diff3 does, assuming merging top into bottom, following https://blog.jcoglan.com/2017/05/08/merging-with-diff3.

    [bottom] => A [+X] B
    [top] => AB [+GAB]

    B    O    T

    A    A    A

    +X 

    B    B    B

              +G
              +A  
              +B
Resulting in A[+X]B[+GAB] without conflicts.
alquemist··on Anu: A sound, distributed version control systema
What are those weak points and how does Anu fix them? I found a technical example in https://anu.dev/documentation/associativity.html, but it was unconvincing. In their example, three way merge should produce a conflict for a human to resolve it. Which is good, we don't want a 'smart' tool to do the wrong thing and silently introduce bugs. If the argument is that pijul/anu reduce the number of conflicts by exploiting history, is there a quantization of this benefit for practical workloads, e.g. popular git repos?
alquemist··on Build a Collaborative Chatbot with Google Sheets and TensorFlow
Chatbots are the wrong metaphor. Having a series of successfully refining queries is useful. Pretending that this happens through a dialogue with an intelligent interlocutor is false and misleading given the current level of technology. And hopefully it stays that way. As a biological human, I'm absolutely not looking forward having silicon & iron competition.
alquemist··on Rethinking Attention with Performers
Huggingface is the best, Tensorflow or Pytorch.
alquemist··on Supercharging TensorFlow.js with SIMD and multi-threading
Some people care to deliver ML-enhanced services without peeking over the shoulder of their users for every keypress. Client inference performance matters.
← PreviousPage 2 of 4Next →