HNHacker News
TopNewBestAskShowJobs

pansa

39 karma · joined January 7, 2020

submissionscomments
pansa··on Haskell Problems for a New Decade
Julia is built around multiple dispatch - when making a call, the method to execute is chosen based on the run-time types of all of the arguments.

Once this choice has been made, Julia compiles the method, specialised for the exact types of the arguments.

So, the dispatch process and the JIT compiler are linked - both are reliant on type information every time a function is called.

This specialisation is the only way the Julia JIT uses runtime type information. Unlike JavaScript JITs, Julia does not track things like the types of local variables during execution (although it may do some static inference). Therefore type annotations for local variables can improve performance.

pansa··on A singer apologized, closed his eyes, dropped his head and died onstage
I was sure your link to a British comedian was going to be:

https://en.wikipedia.org/wiki/Tommy_Cooper

pansa··on Yukihiro Matsumoto: “Ruby is designed for humans, not machines”
Doesn’t Python’s `import` evaluate code in the same way as Ruby’s `require`?
pansa··on Copying data is wasteful, mutating data is dangerous
There is some convention in Python - for example `reverse` and `sort` are mutating, whereas `reversed` and `sorted` are not.

However, I don’t know if there is a good reason why the mutating versions are methods and the non-mutating ones are standalone functions.

pansa··on Algorithm Removes Water from Underwater Images
[deleted]
pansa··on Show HN: Beef, a new performance-oriented programming language
Wouldn’t reddish organic matter just be “red meat”? Or do you consider, for example, lamb to be a type of beef?
pansa··on Pattern Matching in Ruby 2.7 (2019)
> Genuinely curious, what makes Python look more like pseudocode? The use of colons?

I used to think it was significant indentation, but if you look at the pseudocode on e.g. Wikipedia, there is no significant preference for either whitespace or begin/end.

Therefore, it’s probably things like `if value in my_map` vs `if my_map.contains(value)` and `[x * 2 for x in my_list]` vs `my_list.map(x -> x * 2)`.

pansa··on Pattern Matching in Ruby 2.7 (2019)
> I am sure method_missing could be implemented in python using various tricks but nobody, afaik, is doing that.

You could probably implement method_missing in Python using either __getattribute__ or __getattr__.

I think this is a small example of why nobody is doing so. It’s not just culture - Python’s object model is so complex that it would be hard to get right.

> why don't people just write clear, explicit, maintainable code instead of trying to be clever

But that’s boring. Seriously, it always amazes me how many programmers allow their decisions to be guided by what’s best for their personal enjoyment rather than what’s best for the project.

pansa··on Pattern Matching in Ruby 2.7 (2019)
IIRC Guido himself is planning on adding a `match` statement to Python.
pansa··on Pattern Matching in Ruby 2.7 (2019)
> how would you showcase an experimental feature to the community?

How do other languages do it? Python has the PEP process for discussing design on paper, but I don’t know how they handle experimental implementations.

pansa··on Pattern Matching in Ruby 2.7 (2019)
> I’ll never understand how Python became the more widely appreciated language

IMO syntax is a major factor. Python looks like pseudocode, while Ruby looks like Perl.

pansa··on People Who Are Obsessed with Success and Prestige
Did tech “barely exist” when Zuckerberg started Facebook in 2004?
pansa··on People Who Are Obsessed with Success and Prestige
> A guy who [...] wants to be known as the creator of something.

I have this problem. I’m frequently distracted from doing what I want to do by ideas for things that I want to have done (and wouldn’t enjoy actually doing day-to-day).

The search for prestige is about the only reason to switch paths and start working on any of these ideas, but it’s hard to ignore.