« first day (1614 days earlier)      last day (28 days later) » 

2:56 AM
Filter lambda has same problem
3:23 AM
@user but the method on Seqs
does that force evaluation?
Views are lazy, so it should be lazy
well the only thing which would cause mapping over an inf list to hang is to.zipWithIndex.map
which extends Seq
VList extends Seq[VAny],
      SeqOps[VAny, Seq, VList]
def zipWithIndex: Iterator[(A, Int)]^{this} = new AbstractIterator[(A, Int)] {
    var idx = 0
    override def knownSize = self.knownSize
    def hasNext = self.hasNext
    def next() = {
      val ret = (self.next(), idx)
      idx += 1
      ret
    }
  }
that's how it's implemented
Wait this is how we implemented it?
With the capability syntax?
no that's how it's implemented in Scala
I thought that was experimental
Oh ok
3:35 AM
deep down in Scala code
Okay well that should be lazy too, iterators are supposed to be lazy
is map on a seq lazy?
This one's mapping an iterator, right? So it should be lazy
Could you make a unit test that creates an infinite VList and zipWithIndexes it and maps it?
Don't have the Vyxal repo on my machine at the moment
I can look at it tomorrow if you like (just ping me)
I'm good to make the test now
one tick
poggers
3:43 AM
test pushed
ÞPƛ}5Θ should print [2, 3, 5, 7, 11]
but online it hangs
the test will be whether the test passes for jvm
Aaaaaaaaa it's hanging
okay well at least it's hanging on jvm tests too
Is it just prime numbers?
yeah
ÞP5Θ doesn't hang
Maybe we're just not constructing the prime numbers properly?
3:46 AM
the map shouldn't impact anything
e.g. ÞPƛ}4 shouldn't hang
Nope never mind
Yeah it hangs with naturals too: vyxal.github.io/…
you can tell it's forcing evaluation because that should just print 4
it's funny, if this were any other golflang, this wouldn't be an issue (well, maybe apart from 05AB1E and Husk)
because there'd wouldn't be anything infinite to break :p
Yeahhh
Could you do something like this?
val x: LazyList[VNum] = VNum(1) #:: x
val v = VList(x)
val useless = x.zipWithIndex
That'd be the whole test. Just to see if zipWithIndex does something dumb
where in?
Uhh literally anywhere
And if that doesn't hang, stick a .map after the .zipWithIndex
3:55 AM
gotta wait for node to finish installing something first
:thumbsup:
If we absolutely can't figure this out, we can write our own .zipWithIndex override that that just calls lst.zipWithIndex
it's using most my computer power Node
Love modern tech
running jvm.runLocal
@user mfw this'll take updating all instances
Wait no it shouldn't require that
It'd be called .zipWithIndex too
3:57 AM
I tried something like that but it had the wrong return type
@user you're gonna laugh
it'd errored because x isn't VAny
bruh
VList.from, I forgot
recompiling
> x is a forward reference extending over the definition of x
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa lazy val
Why can't the computer just read our minds and do the right thing
ikr
dind't hang
Hmm
So it's not .zipWithIndex by itself
4:03 AM
added map
compiling
 x.zipWithIndex.map { case (v, i) => v + i }
didn't hang there either
changing it to v.zipWithIndex.map
that errored because of type mismatch
so I'll try v.zipWithIndex because that's what I really wanted to test
Wait what's the type mismatch with v.zipWithIndex?
@user v + i
Oh ok
it was because I didn't update the map function
but anyhow, v.zipWithIndex hangs
Hmm
4:06 AM
meaning it's forcing evaluation
@user Let's just do this tbh
Should be fairly easy, just something like
def zipWithIndex: Seq[(VAny, Int)] = lst.zipWithIndex
compiling
had to make it override
Ah that makes sense
also, Int?
that'd be better as a VNum
Can't override then
4:09 AM
I know
I mean to say custom might be the solution
even if zipWithIndex works
lst.zipWithIndex itself will never give you anything beyond Int.MaxValue, so I don't think it's necessary to use VNum
Like a whole new implementation?
@lyxal I guess you could copy this then
well it worked
didn't hang
Even if you make a custom zipWithIndexVNum, I'd prefer it if there was also a lazy override of zipWithIndex
\o/
pushed
I suspect somewhere in the OOP structure something was casting to finite Seq
Maybe
4:17 AM
Pushed the zipWithBigdex function
bigdex
4:55 AM
I've had a brilliant idea
two more context variables
first is ζ
inside a mapping/filter/reduce/whatever lambda, it'll be the thing that was popped as the argument
tbd what in normal lambda execution
second is γ
now this one is a toss up between two options
a) top of outer-most stack (definitely useful)
b) last calculated value
the idea would be something like this
<value> <operation on value> <structureLambda> <reference to original value before lambda>
for the pattern where you do something to a value before lambdaing
not sure if that part is 100% useful
(hence the outer stack value)
I've also added to index from the outer stack
the idea behind these ideas is that lambdas and values outside the lambdas seem to be a bottleneck
so some way of remedying the situation seems like a good and new idea
5:18 AM
Oh no I've had a horrible idea.
Sneak list operations into string overloads by making the string overload eval first
Given that string overloads get harder to make generally useful the more you add
Like once you've gotten the basic stuff, string overloads become somewhat arbitrary
Dunno if the idea has any merit, just something as a thought
5:38 AM
@lyxal I added a glyph before you even did!
5:59 AM
The two I removed balances out :p
5
A: Smallest prime q such that concatenation (p+q)"q is a prime

pacman256Vyxal g, 50 bitsv2, 6.25 bytes Þp'⁰+nJæ Þp'⁰+nJæ­⁡​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏‏​⁡⁠⁡‌⁢​‎⁠⁠‎⁡⁠⁣‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁢⁢‏⁠‎⁡⁠⁢⁣‏‏​⁡⁠⁡‌⁢⁡​‎‎⁡⁠⁢⁤‏‏​⁡⁠⁡‌­ Þp # ‎⁡a list of infinite primes ' # ‎⁢filtered by ⁰+ # ‎⁣(p+q) nJ # ‎⁤(p+q)"q ...

TIL that g is smart enough to know that the first item is the minimum
6:48 AM
oh, one less constant too?
good for me, looked not great in the font anyways
7:17 AM
@emanresuA I don't know if it's smart or just lucky :p
Going through the implementation of monadic minimum shows no checking of the is infinite attribute of LazyLists
Ohhhh
That's sneaky
@emanresuA it isn't smart at all
Go to the link and look in the flag box
Yeah :p
The template generator doesn't put the limit flag in the answer header because, well, I never actually thought anyone would use it for golf
Turns out it's more useful than just debugging :p
Clever usage of the flag though
 
5 hours later…
12:43 PM
@lyxal what was the thing you wanted me to do
1:10 PM
I kinda forgot
@Ginger probably make it so that clicking on a codepage item inserts the character
1:25 PM
@lyxal I already did that :p
oh right it was turning off the eof marker
@Ginger not on the codepage tab you didn't
oh right
1:43 PM
@lyxal done
nice
 
2 hours later…
3:23 PM
@lyxal bracket highlighting and the EOT marker are now settings
4:07 PM
also, snow can now be turned on year-round by typing snow while the settings modal is open :3
4:38 PM
mfw there's a race condition in the utility worker
and I predicted that it would happen a week ago but assumed it was okay
4:52 PM
@lyxal the syntax info and grammar file seem to disagree? specifically about how the ngraphs starting with #: are spelled
the syntax info has #:R, #:@, #::, etc. but the grammar spells those with an extra colon
and is missing several of them
also I made λ a structure opener in the grammar because it wasn't for some reason
5:56 PM
wait no I goofed
6:19 PM
it bothers me immensely that the only way to get a generator of every positive integer is ÞṬȦu
would also be cool if there was a "nth element satisfying a predicate" thing
also I think and N do the same thing when given a function (first positive integer where predicate is true)?
6:47 PM
...is there really no "first item of list where predicate truthy"? there's like three ways to get the index of the item, but not the item itself
that's two bytes though
or /h if you prefer
@Ginger and there's three 1-bytes for the index?
*two, ᶤḋ
one's a modifier and one isn't
"find-by:" is a bad name for , it implies it returns the item and not the index
though i agree it should at least be a function and maybe a modifier too
6:52 PM
my use-case is Ω<stuff>}h, which could be ᶤϩ<stuff> and save me a byte if returned the item and not the index
and there are probably cases where arity grouping would eliminate the ϩ too, although that doesn't work here
also I think drop should take its arguments in num, list order, not the other way around
no because "drop 3" is λ3İ}
presumably there's a shorter way to write it but anyway you'd need to like dip
or swap
oh yeah
ALSO ¬ should be a modifier
i mean we just need a composition modifier
a whar
...that's just ϩ isn't it
7:06 PM
yeah :p
something like Ω"frob"c¬}h could be /¬"frob"ch if ¬ were a modifier
makes arity grouping more effective, is my point
7:20 PM
yeah but then not becomes ¬id or something?
i guess just have both
bothisgood.gif
 
2 hours later…
8:51 PM
digraph for reduce from the right?
 
2 hours later…
10:58 PM
@Ginger is there not an all natural numbers built in?
@Ginger I look into this
@lyxal I may be stupid
possibly
:p
@Ginger it's hard to tell given that I know I missed a few important things in v3 :p
(there is)
see also: my various suggestions above
Yeah
Probably won't add a structure for it (codepage space) but function overload for sure
+ given the "group until a thing with a function overload" modifier that could be good
Effectively a structure without having to be actual syntax
btw the highlighting for is broken since the editor doesn't know that it can be an element
11:07 PM
@Ginger I would have thought both are an option
And that drop does type switching
and I think _ doesn't show up in autocomplete? but that's probably my fault
Gotta love things that are syntax and function at the same time
are lists not highlighted correctly?? what
Example program?
those aren't white
@lyxal ...apparently it does? but that's not mentioned in the overloads list
11:14 PM
@Ginger a: str|lst, b: num -> a[b:]
There's a lot of things implicitly type switched where it makes sense to
And where it wouldn't make sense to have it the other way around
@Ginger that seems to be intentional
Normal # colour is a shade of yellow
@Ginger ginger. Did you forget to add a colour for list stuff to the typescript file?
@Ginger syntax info is outdated
Things like records and extensions were changed to two colons to be consistent with each other
Docs have been updated

« first day (1614 days earlier)      last day (28 days later) »