HNHacker News
TopNewBestAskShowJobs

bakul

647 karma · joined July 29, 2013

submissionscomments
bakul··on A history of tea, the second most-consumed beverage in the world (2017)
Normal cha (what we call it in Gujarat) has no extra spices except perhaps some fresh ginger. Masala cha is made by boiling it with a spice mix of dry ginger, cardamom, black pepper, cinnamon, cloves, all ground to a powder. I use a proportion of 4:2:2:1:1. You can vary the proportion to your liking or add a bit of nutmeg or mace or fresh mint leaves or Indian basil (tulsi). I often add fresh grated ginger as well. At Indian grocery stores in the US you can find Wagh-bakri brand instant masala chai. Just add about 4 fl.oz of near boiling hot water to a tea pack and you get some amazingly good masala tea!
bakul··on The lingua franca of LaTeX
The old ispell used to be able to deal with TeX/LaTeX input. Though that is for the text, not {La,}TeX code. You can try using TeXworks. You can try typesetting when you want to test and see the output in a pdf preview window. tex.stackexchange.com is a good resource.
bakul··on Go Is on a Trajectory to Become the Next Enterprise Programming Language
It is more that you code around the lack of generics.

Interfaces: same API, different source code. Generics: different APIs, same source code.

This is why Go needs to have generics.

bakul··on Alan Kay on “What Made APL Programming So Revolutionary?”
This can get a bit tricky. You can do something like this today:

  d:{_sqrt+/(y-x)^2}
  ls: 2 10 # 20 _draw 0 // a list of 10 random points
  +/d':ls // total length
Now if x, y above are vectors of points (as opposed to vectors of pairs), and if points have their own - verb, total length becomes "+/{y-x}':ls". But to define such a - for point, you'd need conversion verbs (or enclose/disclose).
bakul··on Alan Kay on “What Made APL Programming So Revolutionary?”
I am more familiar with k so will use it as an example. If we were to extend it, the equivalent of some functions in compositor.nl would be something like this:

  compositeSrc:{x} // output first arg
  compositeDst:{y} // output second arg
  compositeInvert:{+(1-x[;0];1-x[;1];1-x[;2];x[;3])}
  // take a column, invert r, g, b columns and transpose
where x[i;0 1 2 3] == ith (r,g,b,a) of x. No need for "∀ (A, B) >>". This is implicit as k/APL work on whole collections. Basic operations are already overloaded. There would need to be a way to define tuples. "x[i;2]" to refer to ith blue value is a bit cryptic. You can define verb "blue x[i]" to do the same but may be some language syntax would help. I can't grasp enough of Nile through the examples I've seen so far but seems doable.
bakul··on Alan Kay on “What Made APL Programming So Revolutionary?”
Kay: > There are several modern APL-like languages today — such as J and K — but I would criticize them as being too much like the classic APL. It is possible to extract what is really great from APL and use it in new language designs without being so tied to the past.

It would've been good to see specific criticism instead of being just like classic APL.

I think many of APL/k/j verbs/adverbs can be generalized to working on streams (dataflow programming). Perhaps Dan Amelang's very interesting work on "2.5D" graphics can be cast into such an extended version....

bakul··on I found two identical packs of Skittles among 468 packs
This guy missed an excuse to build a Lego sorting machine....
bakul··on The World’s Cheapest Hospital Has to Get Even Cheaper
In UK you are using NHS, a public service, funded out of your tax dollars. NHS spent over £124.7B in 2017/2018 so your average cost is about £2000/person. Not sure how you can break out costs for heart bypass but I suspect they will be much more than $2K/surgery. Narayana Hospital is private and has been profitable continuously, with $8M profit in 2017. And still their patient mortality rate is lower than the US (1.4% patients die within 30 days after heart bypass, compared to 1.9% in the US).
bakul··on Arthur Whitney's 'B' Language
Most people have difficulty with the fact that an array expression can very compactly represent some powerful functions. For example,

  (+/*)\:
is matrix multiplication. The following computes the transitive closure of a binary relation (represented as a boolean square matrix):

  {x|x(|/&)\:x}
Its core has a similar "shape" as matrix multiplication:

  (|/&)\:
So in a sense variable names don't matter all that much! To grok this code you have to stop thinking in terms of item at a time operations and start thinking of operations over collection of items. If you know how to write unix shell pipelines you are already somewhat familiar with this paradigm except that a shell doesn't provide most of the more useful features of array languages!
bakul··on Apple announces Apple Card credit card
? It's available on Amazon Prime in the US. In Hindi, Tamil 7 Telugu. With English subtitles. Smart TVs these days allow Amazon Prime so why would try Chromecasting from your computer?
bakul··on Seven Unix Commands Every Data Scientist Should Know
> don't most CSV files contain a header?

  tail +2
bakul··on Launch HN: The Juggernaut (YC W19) – A Publication for the South Asian Diaspora
“Diaspora” comes from Greek “Diaspora”. Dispersion.

It so happens that some Indians were brought over as indentured laborers by the British to various parts of their empire which resulted in the development of a large Indian diaspora: https://en.m.wikipedia.org/wiki/Indentured_servitude#Indian_...

But that’s old news!

bakul··on Why has Plan 9 chosen statically linked binaries instead of dynamic ones? (2004)
On the original RaspberryPi it took a minute to recompile the kernel from scratch and 4 minutes to recompile all the standard programs. In comparison it took 10 to 11 hours to recompile the Linux kernel. Cross-compiling the plan9 kernel on a 2009 era amd64 computer took 20 seconds computer. And rebooting took few seconds.
bakul··on Why has Plan 9 chosen statically linked binaries instead of dynamic ones? (2004)
The idea was that individual programs would be small and loosely coupled. That is, rather than drag in a giant library, abstract out its code in a separate server and talk to it via some protocol. This worked remarkably well on the whole. So the idea of not wanting to have 100 statically linked programs all weighing in at many megabytes kind of misses the point.
bakul··on Arborists Have Cloned Ancient Redwoods from Their Massive Stumps
I believe the original meaning of cloning was indeed to grow a plant or a tree from a cutting and such plants are identical to the original — this term is still used in gardening.
bakul··on The Brain’s “Inner GPS” Creates Conceptual Spaces in the Mind
I wonder if this explains why the "Method of Loci" or the "Memory Palace" technique of memorizing and recalling facts work so well.
bakul··on Cleaning plastic from the ocean using the flow of ocean currents (2017)
From the Washington Post article: “Scientists unaffiliated with the project are skeptical that this system, or future iterations, will work as intended.” And they point out some of the reasons. May be Slat will prove them wrong. I was mainly provding an update as to what has happened since the 2017 BostonReview.net article.
bakul··on Cleaning plastic from the ocean using the flow of ocean currents (2017)
The latest reports are that Boyan Slat's invention has not worked well in practice. And experts are skeptical it will work as intended.

https://www.washingtonpost.com/science/2019/01/17/experts-wa...

bakul··on About V, the language Volt is written in
Algol68 had this property. Consider

  STRUCT (INT x, y) z = (1, 2)
Here z is a const struct. If you wanted a variable, you'd have to say

  STRUCT (INT x, y) z;
  z := (1, 2)
or equivalently

  REF STRUCT (INT x, y) z = LOC STRUCT (INT x, y) := (1, 2)
Basically a variable has a REF mode.
bakul··on About V, the language Volt is written in
May be you should say "LLVM will be considered once its code is converted to V." :-)
bakul··on The BETA Programming Language
Is this "Object oriented programming in the beta programming language" by Madsen, Møller-Pedersen & Nygaard? ISBN-0201624303. It's available online now.
bakul··on The BETA Programming Language
A much better object oriented language than C++. I was not fond of its syntax but liked its uniform treatment of a number of different abstract mechanisms via “patterns”.
bakul··on India scientists dismiss Einstein theories
"In fact the headline and first sentence sum up the whole issue very succinctly."

Surely you jest.

An April, 2016 academic study of bit.ly links shared on Twitter to BBC, CNN, Fox News, New York Times and Huffington Post articles found that 59 percent of the links were never clicked. And another study of push-through news alerts to mobile phones found that “People click on the alert about half the time.”

Source: https://honestreporting.com/tag/misleading-headlines/

What this means is most people only read the headline and not even the first line.

bakul··on India scientists dismiss Einstein theories
Of course this corruption of a science conference is a serious concern but what BBC is doing with its misleading headline is to painting all “India” scientists with a broad brush when they (as well as HN readers) should be supporting the real scientists who are aghast at what is going on.

There are indeed lots of parallels between the two men.

bakul··on India scientists dismiss Einstein theories
Still, the headline is misleading. Indian scientists are calling out these speakers for their nonsense theories. An academic that rejects scientific methods is not a scientist. Unless “scientist” too has become just another meaningless term.
bakul··on India scientists dismiss Einstein theories
I don’t consider these folks scientists.
bakul··on India scientists dismiss Einstein theories
Misleading headline by BBC. The very first sentence in the article is this: "Indian scientists have hit out at speakers at a major science conference for making irrational claims."
bakul··on 9cc: A Small C Compiler
What I was getting at is that non-freeing programs would use much more memory. This doesn't increase the "pressure" on the allocator for such a program but does increase the pressure on the OS (that has to handle memory requests for many concurrently running programs).
bakul··on Algol 68: A Retrospective
It's the compiler's job to do so, not a programmers! The programmer can do whatever makes sense. For example, in Scheme

  (define (make-counter)
    (let ((n 0)) (lambda () (set! n (+ n 1)) n)))
is guaranteed to work in any context where make-counter is called. Same in Go; though the syntax is a bit unwieldy due to having to specify types:

  func makeCounter() (func () int)) {
    n := 0
    return func () int { n++; return n }
  }
Google's Go compiler is smart enough to allocate only the captured variable (n in this case) for such returned functions on the heap. There should be no failures.

IIRC some algol-68 compiler did remove the restriction and allowed such full closures.

bakul··on Algol 68: A Retrospective
The issue is that if the local variables of A, such as X are allocated on the stack, once you return from A, the stack frame will disappear. So the example you cite can only work as long as A is active (not returned from). If A itself returns a pointer to B, at least the locals of A captured by B must be allocated on the heap and GCed once all references to a particular B disappear. Note that a number of modern languages provide full closures including Go, Haskell, JavaScript, Python, Scheme, Swift.
← PreviousPage 9 of 12Next →