HNHacker News
TopNewBestAskShowJobs

jmaa

63 karma · joined March 31, 2017

submissionscomments
jmaa··on The social obligation to be bad at things
Well, depends what he means with "your"; OP specifically, or an arbitrary person? Because I think we are getting dangerously close to shooting down useful criticism and discussion for fear of hurting someones feelings. It's obviously insensitive to say that OP is a bad person because he is doing one-on-ones, but it should be totally acceptable to say "this is weird (from my perspective), I can see several issues with this, I wouldn't personally do this, but you-do-you", and often "(from my perspective)" and "but you-do-you" parts are implied; their absence shouldn't necessarily be taken as proof of mocking.

(Disclaimer: I have no opinion on partner one-on-ones.)

jmaa··on Grid – A Lua Game Engine
Apparently the developers are reading this thread, so I have a request: Please reduce your website's dependence on javascript. Doesn't leave a great impression when I need to fiddle with noscript before seeing static text.
jmaa··on In Further Praise of Dependent Types
No; lookup Calculus of Construction. Dependent types allows you to specify an dependence between different values in your type directly within your type system; which has great implications for type safety and so on.

A classic example is that you can specify the 2-vectors on the unit circle as "{ (x,y) : x,y in R | x^2 + y^2 = 1 }" (read as "the set of real 2-tuples, where their norm is equal to 1".) This is not possible in most languages; the closest you can get in most languages is "{ (x,y) : x,y in R }".

My personal pet peeve with dependent types and proof-driven programming in general is the wealth of options in formulating propositions. I've seen at least five different ways of defining equivalency.

jmaa··on Everything You Didn't Want to Know About Lua's Multi-Values
I do not really agree with the article's (implied?) statement that multivalues are an ugly part of Lua. It's subtle yes, but like most of Lua, is incredibly consistent.

For example, let's compare with Python: In Python, you can return multiple arguments as a tuple; it's not possible to have an optional return value without a lot of painful type matching and unpacking. In Lua you can:

  local result, errmsg  =  do_stuff()
  if not result then
    error("Error in do_stuff:"..errmsg)
  end
  print(result + 5)
If you don't want the error message, just remove ", errmsg", and it will work as expected. This is incredibly flexible, which is exactly what I want in my dynamic languages. In Python, you would get an type error when attempting to add together a tuple and an integer.
jmaa··on Why does `True == False is False` evaluate to False in Python? (2013)
Pedantic point: The whole "reading the bible in Latin" is a very Catholic thing (and maybe Orthodox?). The Protestant churches I've been in has read from the bible in the native tongue, and it was indeed one of Luther's criticisms of the Catholic church.
jmaa··on Show HN: Tail Recursion Optimization for the JVM
Well, yes, it would be that hard.

The whole idea with tail call elimination is that a stack trace shouldn't be able to see the frames for the tail calls, because the tail call reuses the frame. To add support for tracking the tail call stack frames, you would need to modify the compiler to output code that specifically keeps track of "elided tail call frames", and you would need to update the stack trace traversal code to be able to recognize the extra debug information.

Sure, it's something you could build into a new toolchain, but adding something like this to the JVM would be harder due to the constraints already placed on the JVM. Furthermore I don't know of such support in any toolchains, not even for Lua or Scheme, both of which guarantee tail call optimization. (If anybody has an example, please share!)

jmaa··on Downturns are accounting crooks’ worst enemy
Thanks. It is easy to forget how much reporting is specifically about the US, and that a lot of the rest of the world doesn't really have the same problems.
jmaa··on Some shirts hide you from cameras, but will anyone wear them?
That sounds more realistic than one might expect. Most printers will apparently reject printing of patterns containing the EURion pattern [1], commonly found on paper cash. Not a far stretch that some facial recognition tech might contain deliberate hidden patterns in the future.

[1]: https://en.wikipedia.org/wiki/EURion_constellation

jmaa··on Luxury hotel guests keep stealing mattresses
May be a similar system to Denmark, where one of the major POS system sellers operator sort-of on a subscription basis. The retailers don't own the card machines themselves, but the machines are swiftly replaced when card standards are upgraded.
jmaa··on How to Match “A B C” where A+B=C: The Beast Tamed (2018)
Not sure where you get those weird infinity results from, but the "a = b = c = 0" solution is easily show:

Note that "a + b = c" implies "b = c - a", and given our assumption that "a = b = c", we can rewrite as "a = a - a = 0". This obviously results in "a = b = c = 0".

EDIT: Modifying the proof above, it becomes apparent that this is a property of groups (most number systems are groups): Again "a + b = c", iff "a + a = a" iff "a + a + (-a) = a + (-a)" which is "a = e".

Note that addition over IEEE754 floats do not constitute a group, (in part) because "inf + inf == inf" evaluates to true.

jmaa··on Google are removing URLs entirely from search results?
Thought experiment on funding models for dating sites, assuming omniscience (exclusively regarding relationship longevity, and success rate of services):

- Monthly: Incentives variable, but generally low quality results (for slot machine psychology.)

- For each match/hookup/"real" relationship: Incentives results that produce relationships that last exactly long enough to be considered a match/hookup/"real" relationship.

- One-time upfront: Incentivize finding the best available candidate ASAP in order to save server costs.

- Monthly, cost propositional to success rate: Optimizing for some specific length of relationship that someone calculated to be optimal.

There are most likely other funding possibilities, and I've most likely misunderstood some rule of economics. Note that none of these optimize specifically for happiness in relationships, only for longevity.

jmaa··on EU data watchdog raises concerns over Microsoft contracts
Remember, states (and multistates) are large collections of people. The people who are negotiating the contracts with companies are most likely several steps removed from the people who are making laws.
jmaa··on Pop culture loves the 'butterfly effect' and gets it wrong
The word "predictable" implies "deterministic", but they are not identical. The universe can be governed by strong deterministic laws, while being too complex to simulate and thus predict.

This poses some difficult questions for science, given that most science up to now has been about predicting something, trying it and checking whether theory and practice matches.

jmaa··on Why Didn’t Denmark Sell Greenland?
Having lived in Denmark for 20 years, I find this in many ways reprehensible. Cooking down the complex geopolitical problem of whether to sell a large piece of territory (with people!) to exclusively monetary concerns.

This is as culturally daft as asking "why is Ireland such a problem for Brexit? Just build a wall!"

jmaa··on Does the UK Think It Can Police the Internet?
I'm really conflicted at this. I do not want the internet to be censored, but at the same time, I think that big internet companies are making the world worse through inaction.

Even if a user or $/yr minimum is implemented in law, then what happens as distributed and federated technology becomes more common? What does Mastadon or Scuttlebutt count as?

jmaa··on Pattern Matching Without Regex – Introducing the Rosie Pattern Language
I don't see the difference between this and any other Context-Free Grammar specification language. Yacc is an industry standard, and even SNOBOL4 (1967) had first-class CFG datatypes. Maybe he's just excited about being able to use CFGs in the cmdline?
jmaa··on How to implement strings
Slightly related: Lua will intern every string ever created, that is two strings are equal if and only if their pointers (as represented internally) are identical. This results in slow string creation, but very fast equality checking and lookups, as it converts the problem to comparing integers.
jmaa··on Why Aren’t We Eating More Insects?
I haven't read the article, but one reason may be the unappetizing portrail. The photographs in this article are bleak and chaotic, in sharp contrast to the colorful and organized way food is depicted nowadays.

Unrelated, I've encountered energy bars with an insect: Standard energy bars, but extra expensive and with minuscule amounts of insect. Selling cheap eco-friendly insects as an expensive "cool" gimmick is a cruel sort of irony.

jmaa··on Learn You a Haskell for Great Good
I'm with you on Functional Languages being solid and useful, I've done quite a lot of work in Standard ML, but the parent's point wasn't only do it for the education, it was at least do it for the education.
jmaa··on The Eno notation language
What non-indented markup languages gain by avoiding indentation, they lose in succinctness. What is the difference between a section, a list, and a field set? When would I use one instead of another?

If your aim is data representation, why not go for JSON, Lua table-notation or S-expressions? These do not need different syntax for sections, lists or field sets, but have very clear syntax for a few primary data structures, which you can them compose however you want.

jmaa··on Eden: a Lua-based scripting language in Clojure
> Excited to see that finally someone has written an imperative language in a functional runtime. Normally it's the other way around - countless Lisp implementations running in C, because those are trivial to write.

This is not as hard as one might imagine; the first assignment for a compiler course I took, was to write a interpreter for a simple imperative language, running in SML, a mostly functional language. The rest of the course was to write a compiler for another imperative language, again in SML. As soon as you know the "tricks" (some might call them patterns, if we were talking OOP), writing imperative code in functional languages is relatively easy.

The course followed "Modern Compiler Implementation in ML", if anyone is interested.

jmaa··on It appears my Google account is slated for deletion
Well, it's a trade-off between comfort and privacy. You should self-host what you are capable of and deem of higest importance / privacy.

To upgrade from gmail, you don't even to jump directly to self-hosting. There are pay-to-use email-providers, who treat you like the customer, not the product. Similar services exist for video, etc.

jmaa··on Why I’m Frustrated with Go
Go was explicitly designed to be a simple language, without a rich tapestry of data structures to suit every use case.

Languages are like tools. If you need a saw, use a saw, instead of complaining about the knife you are using.

jmaa··on Bitcoin May Have Solved Its Scaling Problem
I already have issues with my smartphone's drain-rate. Withstanding the issue of a huge ledger, you don't what to be mining on your smartphone.
jmaa··on Anyprint: use any language's print statements in Python
This is one of the reasons I love Lua. I'm constantly pleasantly surprised by Lua. It defines a few simple primitives, and allows you to do whatever you want with them, even to the absurd.

Hell, it even allows you to do this:

> somefunc "1string" "2string" "3string" > somefunc {} {} {}

jmaa··on Why I can’t have conversations using Twitter (2014)
Discussing anything of substance on a social media is a bad idea. These sites incentivise short arguments. Twitter very forcefully. Facebook implicitly with its "See more" links, for when comments get long.

But it's also a result of the reactionary culture of those sites. People want to be offended. They think that because the comment is on the internet, that it's final, and intended as is. But it rarely is.

jmaa··on How we exploited a code execution vulnerability in math.js
Alright, so there are simply too many unique functions accessible through the math.js API, for blacklisting to be feasible.

I'm curious why he didn't go down the whitelisting path in the first place. Basic maths don't require that many functions anyway, so he could've started with a small list, and expanded it as people asked for more. Alternatively he could have allowed for custom whitelists.

jmaa··on How we exploited a code execution vulnerability in math.js
I'm not really an expert on JS, but I'm guessing that the constructor function is the same function object, although it can be accessed in different ways. Wouldn't it be possible to blacklist the function object itself, instead of the access path?