Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
weberc2
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
65 ms
·
661.
▲
by
weberc2
7y ago
Could have been a lot sooner if the languages that first implemented type inference also focused on the more pragmatic aspects of programming. 'Type inference' is a small consolation if the tooling and ecosystem are impoverished a
662.
▲
by
weberc2
7y ago
I don’t know what that graph is showing but it’s not the sales tax I pay at the register. In Illinois it’s usually 9-11% if I recall correctly. I’m in Chicago, so maybe the local sales tax is much higher than the state average?
663.
▲
by
weberc2
7y ago
Yes, I do. Especially when you start considering multiline examples with flow control. There are probably a couple of factors at play: 1. Familiarity. Like (presumably) most programmers, I'm familiar with languages in the C syntax fami
664.
▲
by
weberc2
7y ago
Easily visually scanned and parsed with little mental overhead.
665.
▲
by
weberc2
7y ago
Middleclass Americans' income taxes are around or above 20%. Americans generally are opposed to taxes because there is a perception (rightly or wrongly) that our government is inefficient (due to some combination of corruption and in
666.
▲
by
weberc2
7y ago
Yeah, Rust is the best ML for the things I care about, but after 5 years of on-and-off use, I still haven't adapted to the borrow-checker and a GC is just fine for the applications I write. And learning curve is important too--I need t
667.
▲
by
weberc2
7y ago
I don’t want to overstate the problem; I think it is a bit less readable. While types are rarely so indescriptive as “x”, they are often still plenty indescriptive, and I don’t know why we should introduce a syntax that depends on the clari
668.
▲
by
weberc2
7y ago
That's a fair point, but there are still times when being explicit is useful or even required, and it doesn't hurt to use syntax that disambiguates easily.
669.
▲
by
weberc2
7y ago
This is confusingly phrased. Do you mean "If Go people were ever shown ... ML"? I would totally drop Go for an ML language if any of them had a sane syntax, usable build tooling (including native, static compilation by default), a
670.
▲
by
weberc2
7y ago
Reverse(x)(y) Is that a function that returns a function or a generic Reverse function specialized over type x, invoked with argument y?
671.
▲
by
weberc2
7y ago
As jerf mentioned, there has been lots of talk; every single time the question of generics is raised here, /r/programming, or any Go-specific forum, it's addressed. With respect to interfaces vs contracts; interfaces are ab
672.
▲
by
weberc2
7y ago
Agreed, specifically it creates ambiguities in parsing (for computers but worse: for humans). Given Foo(x), you can’t tell if it’s a function call or a generic type without knowing what x refers to. You need context from afar to disambiguat
673.
▲
by
weberc2
7y ago
And also only works if your project requirements are entirely foreseeable from day 0.
674.
▲
by
weberc2
7y ago
Agreed. There are good objections to generics; this is not one of them. EDIT: If any Apple employees are reading this, I really wish autocorrect would stop confusing generics and generics. :)
675.
▲
by
weberc2
7y ago
It seems like you’re objecting to the messaging (not referencing an existing language, which doesn’t work for people not familiar with the implementation of that language) and also that, at its inception, Go didn’t pick (randomly?) a langua
676.
▲
by
weberc2
7y ago
Agreed that devirtualization exists and improves performance, but it doesn’t address the semantic problem in that interfaces are about heterogeneity (and thus dynamic dispatch) while contracts are about homogeneity (which naturally lends it
677.
▲
by
weberc2
7y ago
Because they have different semantics. Contracts are generic over multiple types and as /u/munificent mentioned elsewhere, they allow you to write code that enforces homogeneity. You can write a generic function that takes a slice
678.
▲
by
weberc2
7y ago
A couple of additional notes: * Regarding performance: a compiler could devirtualize the virtual/interface calls if it can prove there are no necessary dynamic dispatches * contracts additionally differ from interfaces in that the form
679.
▲
by
weberc2
7y ago
I agree with your position, but you’ve missed the point. Everyone recognizes the benefits of genetics; the debate is about whether they’re worth the cost. Not everyone can even bring themselves to admit there are costs.
680.
▲
by
weberc2
7y ago
This thread is debating that premise. Your argument is ultimately circular: “the problem with leftpad was npm because the problem with leftpad is npm”. pcwalton may well be correct (we often disagree and frustratingly he’s probably right mo
681.
▲
by
weberc2
7y ago
Agreed. I think this would go a long way toward addressing the original concern.
682.
▲
by
weberc2
7y ago
I'm sympathetic to many anti-generics positions, but this argument is lazy. You rarely know all of your requirements up front, and walking back a language change a year or more into your project is almost always prohibitively expensive
683.
▲
by
weberc2
7y ago
In general, I have a lot of sympathy for your concern--I've used Go and other languages with generics, and the difference is noteworthy. I personally think generics is worthwhile on balance, but I respect that others don't share t
684.
▲
by
weberc2
7y ago
To clarify further, I think the concern is that people will start adding dependencies for things that could be implemented concretely in a dozen lines or so, e.g., a generic slice.Map function or even a linked list. Note that this comment i
685.
▲
by
weberc2
7y ago
Or take leftpad. The point is there is a spectrum along which the cost/reward calculation varies. Absolutely don't roll your own crypto and absolutely roll your own leftpad. Maybe this is a bad conclusion, but I think it's im
686.
▲
by
weberc2
7y ago
Presumably it means that Purescript compiles to Go which can then be built with "go build" instead of compiling to C++ and leaving it to the user to figure out how to compile it with their other C++ sources.
687.
▲
by
weberc2
7y ago
That’s the point. The same principle applies to Docker. Although conceivably the daemon could be just about process/container management instead of image management as well.
688.
▲
by
weberc2
7y ago
It depends on how much of the “Python” implementation was actually C.
689.
▲
by
weberc2
7y ago
Your link indicates that it predates Caesar by a good while.
690.
▲
by
weberc2
7y ago
Not sure, but is it possible that the runtime (or parts thereof) isn’t linked in in that example?
More ›