Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
uryga
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
43 ms
·
391.
▲
by
uryga
7y ago
> Go has polymorphism polymorphism is often distinguished into ad-hoc polymorphism (interfaces) and parametric polymorphism (generics) – i'm guessing GP was referring to the latter?
392.
▲
by
uryga
7y ago
would you consider Lambda Calculus to be math?
393.
▲
by
uryga
7y ago
> What does a while loop evaluate to in your favorite language? depends on what you want! for example this Haskell package¹ defines three versions of while: -- collect the result of each iteration into a list whileM :: Monad m =>
394.
▲
by
uryga
7y ago
> "iterate through a list of strings, and print each one" print(*lst, sep='\n') :)
395.
▲
by
uryga
7y ago
> calling efforts to fight cheating "evil" is silly their method (blocking Wine) is questionable though. it reminds me of websites that block Central/Eastern European IP's "because of bots" (yeah, it happens
396.
▲
by
uryga
7y ago
> Processing eg consecutive elements is often annoying the only place i saw a higher-order function for this is the K language with its `eachpair` combinator (spelled `':` iirc). i wonder why it isn't more common! (though in Ha
397.
▲
by
uryga
7y ago
i recently hacked together my first simple compiler and the way i handled stuff like break/continue is that every loop pushed a "context" onto a stack, so when the compiler encounters a break/continue it just looks into
398.
▲
by
uryga
7y ago
ah sorry, i was skimming and misread your comment as > The Haskellite approach that says "what operations are available on that thing" is the wrong way round which left me pretty confused!
399.
▲
by
uryga
7y ago
edit: misread the parent as saying the opposite of what it actually meant > The Haskellite approach would also say that "what operations are available on that thing" is the wrong way round; you define your operation, and the
400.
▲
by
uryga
7y ago
> It is never clear why a map reduce is better than a for loop or vice versa. to me map/reduce feel like a further development of structured programming. a map(...) call is less expressive / more constrained than a loop and th
401.
▲
by
uryga
7y ago
i think Agda has a whole bunch of Unicode operators, and you can define your own. you can do that in Haskell as well, but it's pretty uncommon. Perl 6 has some Unicode stuff too
402.
▲
by
uryga
7y ago
we used that at school! i can't remember much though – i've used english Logo afterwards and it overwrote most of the polish commands in my memory. the only one i can remember is `np`, the polish equivalent of `fw` ("naprzód&
403.
▲
by
uryga
7y ago
it doesn't have to be an url shortener, but i believe that you need some external link to get self-reference here. as a rough handwavy analogy, linked lists use a pointer to the tail, not a value of the tail (here the value being the s
404.
▲
by
uryga
7y ago
indirection! you could make the website text link to self: http://url.shortener/some-vanity-url and then get the vanity url and point it at your site's link.
405.
▲
by
uryga
7y ago
iirc php is the only (popular) language with messed up ternary-if associativity, it works as you'd expect pretty much everywhere else
406.
▲
by
uryga
7y ago
> If you're being offered a licensing opportunity, it should have to be marketed as such. Yes, this would confuse consumers. idk, spotify et al seem to be doing alright...
407.
▲
by
uryga
7y ago
relevant quote from the linked docs: > `unsafeInterleaveIO` allows an IO computation to be deferred lazily. When passed a value of type IO a, the IO will only be performed when the value of the a is demanded. This is used to implement la
408.
▲
by
uryga
7y ago
i think i know the feeling! though i played guitar, not drums
409.
▲
by
uryga
7y ago
i recommend this article if you're interested: https://www.ableton.com/en/blog/james-holden-human-timing/ tldr: there's been some research into it – turns out that if you have a few parts (instrumen
410.
▲
by
uryga
7y ago
i think of exporting like compiling. the .xcf is the "source" (layers, non-destructive effects, vector paths, etc), and i only want to save when i'm working on that. when i want to "build" it into a flat .png that p
411.
▲
by
uryga
7y ago
just noticed i forgot to reply to the rest of your comment! i'm not sure how it's done in practice (except for "thinking about it really hard"). i came up with something though: `map` should be easy, because it's pr
412.
▲
by
uryga
7y ago
> Deciding type-safety of code also requires solving the halting problem, but haskell still tries! does it? afaik typechecking is decidable for most type systems, and only becomes undecidable with something like dependent types (or c++
413.
▲
by
uryga
7y ago
> How do we write tests that fail (instead of hang) if an infinite list is mishandled? easy, just solve the halting problem!
414.
▲
by
uryga
7y ago
tbh i don't know Go too well. as i understand it, `panic` can indeed hijack the control flow, i.e. stop it. but any function¹ can do that: just do `while 1 {}`! control flow won't return to the caller either way. so it's not
415.
▲
by
uryga
7y ago
it uses the same syntax as functions, but it doesn't behave like a function – functions generally can't manipulate control flow like that. so calling it a function is weird because it's closer to a language construct like `aw
416.
▲
by
uryga
7y ago
i'm on my phone, but wouldn't something like this work? *::before, *::after { user-select: text; // or `all`? }
417.
▲
by
uryga
7y ago
"(flip divide) 2" can also be written as "(`divide` 2)" – i saw that idiom recently and i'm warming up to it!
418.
▲
by
uryga
7y ago
i saw https://areweasyncyet.rs/ linked here, it mentions future extensions
419.
▲
by
uryga
7y ago
looks like it's a mobile imgur thing, the images are less compressed on the desktop version
420.
▲
by
uryga
7y ago
(disclosure: i know Haskell but not Rust, and haven't actually implemented anything like this in a compiler. please let me know if i'm wrong!) best guesses: - dynamic dispatch usually involves carrying around¹ some function pointe
More ›