« first day (3949 days earlier)      last day (900 days later) » 
00:00 - 09:0009:00 - 00:00

9:16 AM
@lyxal can't reproduce. What mobile browser are you using?
do you get the "Copied to clipboard" message?
If not, try reloading the page
 
@pxeger I do
@pxeger duckduckgo
 
@lyxal it looks like ddg browser doesn't support the async clipboard API. github.com/duckduckgo/Android/discussions/1311
I'll add a backup mechanism using the old clipboard DOM API
 
@UnrelatedString How often do you see a Jelly answer with balanced parens? lol
 
...that is a good question
the opening paren has to be in Ø( or a string literal unless it's some weird challenge since ( is one of the characters that just breaks parsing alone
and then you'd have to either have ) in a string literal or have some occasion to use it as a chain separator in the same program
 
9:29 AM
or just have no parens
 
most jelly answers do in fact not have unbalanced parens
 
9:52 AM
I meant answers with parens but not unbalanced parens
lol
 
10:23 AM
I've discovered that JS events have .target, .originalTarget, .explicitOriginalTarget, .currentTarget - And all of them do different things...
Try going to about:mozilla in firefox
 
The Book of Mozilla is a computer Easter egg found in the Netscape, Mozilla, SeaMonkey and Firefox series of web browsers. It is viewed by directing the browser to about:mozilla.There is no real book titled The Book of Mozilla. However, apparent quotations hidden in Netscape and Mozilla give this impression by revealing passages in the style of apocalyptic literature, such as the Book of Revelation in the Bible. When about:mozilla is typed into the location bar, various versions of these browsers display a cryptic message in white text on a maroon background in the browser window. There are eight...
 
Ik lol
o/
 
10:55 AM
@UnrelatedString just noticed it was on a highly appropriate question as well lol
 
 
3 hours later…
2:15 PM
@lyxal i could’ve seorn there were 321 before
At 1 point i had 1 failing and 320 passing
Ih well
 
 
1 hour later…
3:30 PM
the lean lotm thing died out but here's another thing area51.stackexchange.com/proposals/126242/proof-assistants
we created this proposal this week!
we are inching closer and closer to private beta lol
 
Nice, I just committed!
I don't get why you need to make a separate account for Area 51. It's like another website entirely
 
I think it runs a very old version of the SE software, so it's barely part of the network
 
It's an SE 1.0 site, yeah
That's (sort of) what SO looked like when it first started (that kinda design style)
 
Oh dear, I wonder how SO managed to take off then
 
those were different days
and I'm guessing the original SO didn't have quite such a wacky space theme
 
3:36 PM
Back when crappy HTML ruled the internet :P
@pxeger No, it was the standard orange + white colors
@UnrelatedString Tbh, I'm going to instead appreciate the fancy chaining there, as the only chain/group thingy used is the ɓ
 
@cairdcoinheringaahing and ɓ hardly even counts, all it does is swap arguments!
 
4:36 PM
Suppose you have two functions and their stackframes are going to be the exact same, and one function returns the result of the other function, can you replace the stack of one with another when such a tail call happens? Like
def foo(n):
  x = goo(n)
  if n:
    return x
  else:
    # Can you reuse foo's stackframe here?
    return bar(x)

def bar(n):
  x = goo(n)
  return something else
Basically, can you do tail call optimization without having recursion?
 
I'm assuming this isn't in Python, because Python can't have TCO at all
 
Yeah I'm just using Python as pseudocode
Thinking of making my own basic interpreter
 
This is basically just function inlining
 
But inlining wouldn't work if bar were recursive (and not tail recursive) or something, right?
 
if bar were recursive on itself, no that wouldn't work
But if bar were mutually recursive with foo, for example, it could still be inlined inside foo
So an optimising compiler might look at bar and think "that's a small function, so I'll inline it". Now in every place there's a q = bar(n) it replaces it with _bar_x = goo(x); q = something else
 
4:43 PM
I more meant if you could reuse foo's thing for bar again instead of doing it at compile time itself
(so that fewer stack overflows happen)
 
the idea behind TCO is just if you have return f(...), you can compute ..., save it, delete your current stack frame, move into f, load ... back in where the argument would be, and now you don't create a new stack frame so you can do this repeatedly
 
But I assume if it's possible, C++ already does it, and if it isn't, then there's no reason for me to try it, so ¯\_(ツ)_/¯
 
@user ah so you mean rather than creating a new stack frame for bar and then unwinding it and then unwinding foo's, you just replace foo's with bar's and then unwind that
 
Pretty much (like what HN said but instead of calling f the second time you call a different function (here, bar))
 
IIRC TCO just allows you to optimize any return where you immediately call a function (so return f(...)) and then just cleans up the frame before entering the new one, meaning the amount of space taken doesn't increase by 1, whereas if you have return f(...) + 1, then you have to go into a new stack frame for f and then once it returns, add 1 and exit your stack frame, which increases the depth by 1
 
4:50 PM
@hyper-neutrino f(...) + 1 could be optimised away as well, equivalent to creating func g() { return f(...) + 1 }, inlining f inside g, and then basically doing a tail call on g
 
I think what HN meant was that if you have additional operations you can't do TCO (like a bad fibonacci impl)
 
@user but only if those additional operations include more calls to f, right?
 
@pxeger well sure, but I meant the most basic of TCO
 
I don't think so? Those additional operations could be non-tail recursive (or whatever it's called) themselves, or perhaps they could be inlined but it'd not be worth it because you have to inline everything
 
really good compilers can totally unroll recursive functions into for loops but that's beyond what I'm trying to talk about :P
 
4:54 PM
Ooh, how do they do that?
 
I don't actually really know, lol
 
F
 
if you compile a very simple recursive factorial with -O2 (godbolt.org/z/zdzaxf6sG) note that the resulting assembly actually doesn't have any recursive calls, it just unrolls it into a loop (well, just a bunch of jumps lol)
if you don't use optimization it does just make it recursive (godbolt.org/z/rKvvrGzYv)
i don't have the slightest clue how the compiler figures this out
 
That is absolutely amazing
 
@user I believe CPython does something a bit like that: github.com/python/cpython/pull/27077 github.com/python/cpython/pull/28488
 
5:02 PM
Cool
@hyper-neutrino That seems to do something like what pxeger suggested? (make another function that wraps around it)
idu assembly, but L3 looks like a helper that does h = (n, a) => n == 0 ? a : h(n-1, a*n)
 
L3 isn't really a function, because f jumps to L4 which is slap bang in the middle of L3
 
Is it a label inside f then?
 
L3 is just a loop
 
Oh
 
@user yes
L3 is the "start of each iteration" label, and L4 is the "break" label
 
5:10 PM
Sadly, a naive fibonacci doesn't do too well
 
f(int):                              // entry point to function F taking an int
        mov     eax, 1               // move 1 into the eax (return value) register
        test    edi, edi             // AND edi (argument) with itself; set ZF (zero flag) if result is 0
        je      .L4                  // jump if ZF is set to label L4
.L3:                                 // LABEL: top of loop
        imul    eax, edi             // eax *= argument
        sub     edi, 1               // argument -= 1
 
Thanks, that makes it quite a bit clearer
I really need to learn to read assembly
Why can't it directly set ZF to 0 instead of doing an AND?
 
no clue how that works and why it does that
 
here's a low-level pseudocode translation ato.pxeger.com/…
 
Godbolt's whole thing is that compilers are incredible. That's a big reason why he made the site in the first place. He's done some great talks covering some of the amazing optimizations compilers make
 
5:16 PM
@user test x, x is just the simplest way of setting zf = (x == 0)
 
Oh, interesting
 
@pxeger (probably the fastest way, in fact)
 
Wait, that's faster than directly doing ==?
 
x86 doesn't really have an == AFAIK
test x, x calculates x & x (which is just x), and sets the zero flag according to whether x & x is zero (i.e., according to whether x is zero)
 
5:19 PM
Weird
 
@emanresuA well, .target is the element on which the event happened, .currentTarget is the element which you attached the event listener to, then Firefox adds .explicitOriginalTarget which is the text node on which the event happened (because .target can only be an element) and .originalTarget which is used for its anonymous content binding system to find the anonymous content on which the event happened
 
So I tried my original example and it seems to just inline bar instead of doing anything interesting. Probably need something more complex to test it out
 
CMC: check if the number is odd in Python?
 
That is a very Mini challenge lol
 
2 .__rmod__
 
5:27 PM
@hyper-neutrino 1 .__and__
-1 byte!
 
@pxeger no, the answer is lambda n:n&1!
-n bytes!
 
@pxeger oh, ofc. nice :P
 
@Fmbalbuena You'd need lambda n:
 
@user I found a programming language similar to Malbolge!
 
6:14 PM
for those of you writing languages with overloads, what behaviour (if any; answer as few as you wish) would you expect for a) unary minus on a string b) eval on a number c) pop on a number d) pop on a string e) tolower on a number f) toupper on a number g) ~ on a float h) ~ on a string i) abs on a string j) & on floats k) & on strings l) | on floats m) | on strings n) ** on strings o) [] on a number
@DLosc looks like my ruse worked, you got another star
 
a) reverse/lowercase b) identity c) pop a digit d) pop a character e) -|x| f) |x| g) -1-x h) reverse/lowercase/swapcase i) uppercase j) cast to int k) filter? l) cast to int m) concat? a + (b \ a)? n) no clue o) digit access
 
@Neil agree with most of what h-n said; for c), remove the first digit, because removing the last digit is too easy to do another way (integer division by 10);
 
6:45 PM
@hyper-neutrino I think for a) swapcase might be more fitting in the whole "f(f(x)) = x" property of unary minus
 
that's a good point
same goes for tilde tho, so maybe assign reverse to one and swapcase to the other
also given e) and f) there's already a to-lower and to-upper lol. didn't read ahead
 
7:02 PM
@Neil I'm just going to answer with what Vyxal does - a) swapcase b) length of pprime factors c) Stringify first d) remove the last char e) -2 f) +2 g) round first h) any letters uppercase j) remove whitespace j) roound first k) pad one to length of other l) round first m) join on longest common pref-x+suffix n) Length of regex match b in a
 
@Neil I agree with HN too, except for e) and f) being floor and ceil, respectively because that's what APL does, and n) turning a string into a square (using newlines) of side length len(string) * the number you're raising it to the power of
 
oh yeah floor/ceil makes more sense
 
How to prevent unicorns from eating daisies?
 
** on two strings would be weird, I guess your choice would depend on what string multiplication does
@Fmbalbuena You eat the unicorns, ez
 
@user then answer this
 
7:10 PM
Those are terrible answers, and unicorn meat is pretty tasty too
 
@user i found a bug
in MSE
 
(Meta stack exchange)
 
What's this bug?
 
click the link
 
7:12 PM
And?
 
??? if you're talking about the URL, i have no clue what the hell you're trying to do
 
@hyper-neutrino i'm not hacking the url.
 
Okay, but what bug have you found?
 
the bug is HTML layers.
 
I don't understand
 
7:16 PM
@user Huh? Why?
 
What do you mean by HTML layers? What should be happening when you click the URL? (or shouldn't be happening?)
 
@user HTML Layers is Z-Index in CSS
 
Okay, but what's the bug here? What's going wrong with that link?
 
@Fmbalbuena what browser and version are you using
 
@hyper-neutrino I use Google Chrome
 
7:21 PM
Is the page not loading for you or something?
 
and what's the issue; everything looks normal to me
 
@hyper-neutrino Uh the question tour moves to left.
 
That sliding thing seems to be the intended behavior
 
thanks for the suggestions, I forgot one last one, square root of a string
 
do you have something for square of a string
 
7:27 PM
no
 
To be more general, what does string multiplication do?
 
string * float repeats the string e.g. "ab" * 1.5 results in "aba"
 
If you consider squaring a string abc to be turning it into abc\nabc\nabc, then unsquaring it could be the same as getting the diagonal, and on strings that don't contain newlines, it'd be identity
@Neil I meant string*string
 
it inserts the rhs in between each pair of characters in the lhs
e.g. "foo" * "|" results in "f|o|o"
 
Oh cool, so unmultiplying would mean getting every other character?
 
7:32 PM
well, "f|o|o" / "|" results in ["f", "o","o"] I think
compare to "f|o|o" - "|" which results in "foo"
 
 
1 hour later…
8:44 PM
@Neil assuming this is for a competitive golfing language: for a few of these (b, i, j, l, m, n) I'd leave them as errors until you think of something good to put there because you don't want to be unable to put something really useful on them just because you didn't think of it earlier
 
@cairdcoinheringaahing it basically went =€Ø(ISaṪe”)ṭØD¤Ɗ -> ”)ØD;iṪ =€Ø(ISaÇ -> =€Ø(ISɓ”)ØD;iṛƒa -> =€Ø(ISɓ”)ØD;faƒ where the actual biggest thing was deciding to use f because spits out a singleton list instead of an actual single character but i had no idea that was why i wasn't working
 
9:02 PM
@pxeger yeah these are operations that currently error
 
probably have to sit down and think of the use cases for the choices available
for bitwise operations on floats i'd almost say just do them on the actual binary representations of the floats but i think js coerces floats to integers for bitwise stuff and it seems to be fairly useful in golf for reasons i can't remember
 
You could look at existing golfing languages for useful-looking builtins and add them as overloads for any available operator whether or not the symbol for that operator makes sense for that overload
e.g. finding a pattern with regex in a string is a somewhat useful operation, so you could use that as string exponentiation even if it has nothing to do with exponentiation
 
9:17 PM
@Neil Without looking at anyone else's answer: a) reverse; b) the number itself; c) the first digit of the number; d) the first character of the string; e) floor; f) ceil; g) -1-x; h) maybe swapcase? i) not sure; j) truncate to int, then bitwise and; k) multiset intersection of the characters; l) truncate to int, then bitwise or; m) multiset union of the characters; n) not sure; o) assuming this is indexing, nth digit
After looking: turns out my answers are in sync with the Nineteenth Byte hivemind, nice
But also what @user just said.
There's a lot of "this doesn't correspond, but oh well" in HBL
 
CMC: Guess the context
 
@DLosc Regex operations would be a lot more useful than multiset intersection of characters, I believe
@user The AI singularity
 
Although using & and | for set/multiset stuff would be nicer for a language aiming to be intuitive
 
For sets and multisets, definitely. For strings, maybe not so much
 
Well, you could treat strings like lists, and lists like multisets
 
9:41 PM
i'm a fan of strings-are-just-lists but then you really don't have as many good options for character overloads as you do for string overloads
 
 
2 hours later…
11:14 PM
So apparently some kids at my school have been running a site where people can post "funny" quotes, and when I looked up my name, I found the one stupid thing I said in 10th grade that I would've liked everyone to forget ಠ_ಠ
They always tell you how everything you put on the internet stays there forever, but I didn't even do that, and now my past self's cringe will haunt me permanntly >:(
 
11:27 PM
@user ooh were talking about stupid things we've said are we?
Mine would be when I once accidentally wrote that 10 - 1 = 19
We were doing a Numbers game from Countdown (letters and numbers for the Australians here), and I thought I had a solution
 
Did you make sure to burn the evidence? :P
 
Kinda hard to when it was on a white board in front of my entire math class
 
Oof
 
This was when I was 13 btw
 
00:00 - 09:0009:00 - 00:00

« first day (3949 days earlier)      last day (900 days later) »