Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
morelisp
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
50 ms
·
751.
▲
by
morelisp
4y ago
nil isn't cast to an empty slice (Go doesn't have casts, except maybe the new pointer-to-array syntax if you want to count that), nil is the default value of a slice, and that value is also empty. Other empty slices may be non-nil
752.
▲
by
morelisp
4y ago
What implications did you have in mind? In languages with null and type inference, `var x = null` is probably not going to infer the type you want. In languages with function overloading (which is essentially the case for Go `len`), `f(null
753.
▲
by
morelisp
4y ago
I mean, if you want Java, it's right there. The advantage is that you get the fast path by default. Since Go programs are generally not awash in buffer reuse bugs despite its semantic trickiness, this seems like something different l
754.
▲
by
morelisp
4y ago
Is it panicking on mutation because Go has some special logic, or is it panicking because the text segment is PROT_READ? If it's the latter, sure you can do that too.
755.
▲
by
morelisp
4y ago
Is the excellent tooling not also a property of a minimal language? Lisp has the "least" syntax/semantics and the best tooling, because it's so easy to write tools. Go has more complex syntax/semantics, but still mu
756.
▲
by
morelisp
4y ago
I'm pretty sure it's the JVM model. Kotlin collections are "immutable" in that they have no mutating accessors, which is not the same thing as a memory region defined to be immutable by the specification which can be rel
757.
▲
by
morelisp
4y ago
ArrayBuffers have a byteLength and a maxByteLength and this is similar to Go's len and cap, with the `resize()` being equivalent to a reslice or append on the subview.
758.
▲
by
morelisp
4y ago
You cannot "overrun the buffer" nor can a callee add stuff to the end of your list; you can give them a memory buffer with unused space and they may use it, and then you can also mistakenly use it later. Honestly, you seem to be t
759.
▲
by
morelisp
4y ago
Go slices cannot change the structure (len or cap) of their "parent" slice. (Unlike Java, the semantics of every operation are even well-defined.) In some sense this is the root of the problem - the "child" slice can sta
760.
▲
by
morelisp
4y ago
AFAIK this only works if the function has already been loaded for some other reason (i.e. in the same file as a class or an explicit require). I do cop to not having used PHP recently, so maybe 8 fixed it? At least in the PHP I'm famil
761.
▲
by
morelisp
4y ago
> It means there is special protection for strings that is not available to anything else Lots of languages have no C/C++-style const objects yet immutable strings. It's weird to pick on Go specifically for this. (Since it'
762.
▲
by
morelisp
4y ago
This statement: There is literally nothing stopping a 20 year old human who lives in Western society from growing their intellectual soul through learning. Is wildly different than: I do not believe that a youth today that desires to &
763.
▲
by
morelisp
4y ago
Because the bare value `nil` has no type. Typing it, e.g. `len([]int(nil))` works fine.
764.
▲
by
morelisp
4y ago
This is misleading enough it's a lie; to do this you need to use a function named `unsafe.Pointer` with a type named `reflect.StringHeader`, not just `[]byte` and `string`.
765.
▲
by
morelisp
4y ago
I contend that "We have had free public libraries" is not a statement about the mere existence of a public library somewhere , but rather and especially in the context of this discussion a claim about how widely available resou
766.
▲
by
morelisp
4y ago
> We've had free public libraries for centuries now. Not even a century and a half, really. The first Carnegie library was opened in 1883, for example.
767.
▲
by
morelisp
4y ago
You can namespace them, but you can't `use` them or otherwise autoload them.
768.
▲
by
morelisp
4y ago
> I just see it as an indicator of reach. That just shifts the question to why is "reach" something worth wanting? > some people with snap judge a project by number of stars and more likely use it if it has a bunch. And why
769.
▲
by
morelisp
4y ago
To begin with, the fact the "module" system is tied to classes is a horrible design flaw. (Also in Java, but Java leans into it - PHP still has functions and lots of stuff is clearer as functions.)
770.
▲
by
morelisp
4y ago
"Programmers already hated the changes to their working environment made in the past 15 years" but they nonetheless happened; it seems to me strong evidence they'll also return to office.
771.
▲
by
morelisp
4y ago
You don't need to appeal to cheeseburgers to not want to value 100 future dollars at 100 current dollars, if you can buy 100 future dollars for 80 current dollars, which is essentially what happened when rates rose. (Someone else is of
772.
▲
by
morelisp
4y ago
Carousel!
773.
▲
by
morelisp
4y ago
I can't believe we're still on day 3 and people are still arguing with the strawman that you'd have to open an account per $250k to mitigate the risk. (You need to open two or three accounts total, and beyond that you're
774.
▲
by
morelisp
4y ago
The depositors were largely those with means to manage risk but not doing so. Surely you mean you're happy for the workers, clients, contractors, etc., not the depositors? Right? The backstop was sold on the backs of those people, and
775.
▲
by
morelisp
4y ago
Given that the reasoning for dipping into the insurance fund is to prevent anything else from failing, if any more do this is just SV getting into the grift on the ground floor again.
776.
▲
by
morelisp
4y ago
It's coming out of the insurance fund, which is paid into by banks. So the cost is still ultimately borne across a wider sphere, but not the government per se. (This is what's meant by "Any losses to the Deposit Insurance Fun
777.
▲
by
morelisp
4y ago
From your mouth to god's ears, but this isn't what Tan, Cuban, Sacks, etc. have been asking for. They want a 100% commitment from the government.
778.
▲
by
morelisp
4y ago
The alternative take would be that Cuban knows exactly how it works but sees a chance to push for what's essentially a federal startup subsidy because his fanboys don't know.
779.
▲
by
morelisp
4y ago
Please keep this subthread's context in mind - it starts with > The only thing anyone is asking for... And my comment is about what those people are asking for. They're claiming they're not asking for a bailout, while aski
780.
▲
by
morelisp
4y ago
Nope. YC and other investors are explicitly asking for something beyond the normal process - no possible haircuts, no delays, $10M guaranteed, whatever. That can't be covered just by SVB assets. (It can be mostly covered. But that&#x
More ›