« first day (4436 days earlier)      last day (71 days later) » 
00:00 - 18:0018:00 - 00:00

12:35 AM
At Some Point™ I'll come back to writing challenges. I have a list.
Same here
At least 3 of my sandbox challenges are in the state of "post when I get around to it"
12:50 AM
Imagine taking a long break
Made by addiction to code golf gang
I blame university, stealing my code golf time
I have university too and you don't see me taking long breaks
Get good nerd :p
imagine doing schoolwork when you can codegolf
I do both
one desktop is a uni assignment due sunday, the other is here
@lyxal same lol
1:05 AM
@lyxal Ah, the trick is that I'm passing :P
Also, you don't see my flag handling stats :P
in 2023, I've handled 75% of all flags
@cairdcoinheringaahing only passing?
that shouldn't account for long breaks :p
1:25 AM
meanwhile me ignoring my schoolwork while also failing to codegolf
Am I the first person on the site to ever codegolf in PIC16 machine code?
the only architectures i'm sure i've seen are x86 and z80
and i'm not sure i've even heard of pic16 lmao
1:37 AM
We're using a PIC16F886 for my embedded systems class so
Before I do anything else with it, I have a question: am I allowed to assume the function exists at a specific point in memory? In this machine code, an absolute jump is one word, but a relative jump is two and it clobbers the accumulator
2:02 AM
@lyxal "lonig" being like 3 months
@Bbrk24 How so?
In order to do a relative jump, you have to load a number into the accumulator and then add the accumulator to the PC
vs an absolute jump is just a single instruction, GOTO
But, what do you mean by "assume the function exists at a specific point in memory"?
Which function?
the one I'm writing, the answer to the question
In assembly it isn't a problem because I just use labels and the linker positions it for me. But in machine code I don't have that luxury
As in, your submission is a full program, with a function at a specific point and more code outside it at other points in memory?
No that's the thing. The submission would be just a function, not a full program, but in order to work in machine code I have to know at which address it resides
The answer length would be the same no matter what that address is, but I have to know what it is in order to hardcode the GOTO addresses
2:08 AM
I think that's acceptable?
@UnrelatedString I know I've seen MIPS and 6502
oh yeah i've also definitely seen mips
I've also seen that 1-bit Motorola processor
I've probably seen a lot more assembly langs than most people here tho since they come first alphabetically and I had to sort through them all for the ranking script lol
not as sure about 6502 but it's just a hard name to remember :P
2:18 AM
@Bbrk24 wat
The MC14500B Industrial Control Unit (ICU) is a CMOS one-bit microprocessor designed by Motorola for simple control applications in 1977. == Overview == MC14500B (ICU) is well-suited to the implementation of ladder logic, and thus could be used to replace relay systems and programmable logic controllers, also intended for serial data manipulation. The processor supports 16 commands, operating at a frequency of 1 MHz. The MC14500B unit does not include a program counter (PC); instead, a clock signal drives a separate PC chip; therefore the size of supported memory is dependent on the implementation...
3 hours later…
5:11 AM
A: Sandbox for Proposed Challenges

Parcly TaxelDraw the GKMS aperiodic tile code-golfgraphical-outputgeometrytiling Chaim Goodman-Strauss, Craig Kaplan, Joseph Myers and David Smith found the following simple (both objectively and subjectively) polygon that tiles the plane, but only aperiodically: Indeed they found a one-parameter family of ...

^ someone review the above proposal please?
2 hours later…
7:42 AM
@Bbrk24 If your machine code uses relative offsets, problem solved. If it uses absolute addresses, moving to different addresses won't change the binary size anyway, so I guess you can assume some specific address, say 0x00c0ffee
8:31 AM
@Bubbler coffee????
9:13 AM
Q: Is it a Frog List?

Kevin CruijssenChallenge: A Frog List is defined by certain rules: Each frog within a Frog List has an unique positive digit [1-9] as id (any 0 in a list is basically an empty spot, which can mostly be ignored). A Frog List will always have exactly one Lazy Frog. A Lazy Frog will remain at its position. Every ...

3 hours later…
12:28 PM
@Bubbler I get what you’re saying, but I can’t use 0xc0ffee on a machine with an 11-bit PC
rabbit go brr
LDQ: Should I differentiate between floats and ints?
12:43 PM
that's a tricky one
on one hand, a unified number type would be cool
even JS does now
on the other hand, being able to tell them apart by types is cool
I lean towards no
Swift has a generic Numeric protocol to which both floats and ints conform, so you can make your function generic over it if need be
I believe Numeric offers:
ach can’t I just get a newline on mobile? I can’t shift-enter
put it in something like tio.run in any language and copy paste
that's how I do it
@Ginger also, third option: have a single Real type that can hold rationals and irrational. No need for floats and ints.
@Ginger yes
12:47 PM
Anyway, numeric offers the operators + - * and their assignment counterparts, static properties .zero and .one, and a conversion from (but not to) integers. It’s intentionally that little so that it can represent things like square matrices
requiring a whole number can be useful oftimes
Then, there are more specific protocols that derive from it to provide a more comprehensive interface
@Bbrk24 java has Number
okay how tf does struct construction work
I think I can figure this out
LDQ: What should max and min do on numbers that isn't return greatest/smallest digit?
12:53 PM
so a struct type's fields can have default values, which can be overridden upon instantiation, unless the field is a function
@lyxal Return the max/min number of that type.
But say there's no number limit
which there isn't
(Radvylf, if you're reading this putting functions inside a struct is Rabbit's version of Rust's impl blocks)
@lyxal I don’t understand the premise of the question. I would expect max to return the largest of a set of numbers, not return the largest digit of a single number
@Bbrk24 max(3423) and min(3423)
what should those return?
12:54 PM
@lyxal Max/min number with same count of digits. E.g. max(123)→999, min(123)→100.
waiiiiiiit frick
@Bbrk24 that's not good for a golfing language
it looks like Rust lets you just implement whatever you want on any struct as long as it's in the same module
@Adám this on the other hand is good for a golfing language. Thanks!
12:55 PM
which means multiple impl blocks, which I have no syntax for
I like Swift’s extension
the syntax Rabbit uses for extension functions is function foo for Bar... so I guess I can make something like this syntactic sugar for that:
struct Bar:

for Bar:
	function foo():
I think that works
protocol Foo {
  func frobnicate1()

protocol Bar {
  func frobnicate2()

struct Baz: Foo {
  func frobnicate1() { /* implementation for Foo */ }

extension Baz: Bar {
  func frobnicate2() { /* implementation for Bar */ }
is a protocol Swift's version of a trait?
You can make a single struct or extension block declare as few or as many protocol conformances as you'd like, even zero
@Ginger Yeah, it's called "protocol" because that's what Objective-C called them
1:00 PM
Until 2014, ObjC was really the only way to write iOS apps
also, you know how Rabbit's supposed to be "Python but better"? well it turns out someone already tried to do that
Rabbit's better, but still
I would assume a lot of people have tried python but better
also lmao ^^^ is written in Rust... but is an object-oriented language
so close and yet so far
huh, I have 5301 rep on CGCC
@Ginger the transpiler is in Rust
1:03 PM
oh right it transpiles to Python
it's just python with extra bits :p
which really does make it python but a bit better
Rabbit isn't even turned into python
@Ginger ^ describes you
1:04 PM
b i n g u s
Presenting, the maximally golfed Rabbit hello world (technically RSH, but the syntax is still Rabbit so I think it counts):
schema module
function run():
	print("Hello, World!")
I doubt it can get much shorter than that
hmm, wait
@Ginger rsh?
@Seggan Rabbit Script Host
a tool for running arbitrary Rabbit scripts using the schema module system
I described it a while ago
ah yes i remember
module e
main function e():
	print("Hello, world!")
that's technically shorter
module e
main function e():print("Hello, World!")
1:12 PM
invalid syntax with the current parser
cry about it
I won't
→ No U
good luck replicating that one :P
← No U
get dunked on
well you see that wasn't a move away
so it's not the same
1:17 PM
You played a blue card on a yellow one, don't talk to me about breaking rules
that's literally uno rules.
you can play a blue reverse on a yellow
[citation needed]
like how you can play a blue 4 on a red 4
shit, you're right
My family used to allow playing a skip on a zero of a different color, or a +2 on a 2 of a different color
1:19 PM
I concede defeat
A: Sandbox for Proposed Challenges

Kip the MalamuteRecord Least Uncommon Multiple Counts The Greatest Common Divisor, or gcd, of two positive integers x and y is the largest positive integer that divides both x and y. The Least Common Multiple, or lcm, of two positive integers x and y is the smallest positive integer that is a multiple of x and y...

1:52 PM
Q: Draw the GKMS aperiodic tile

Parcly TaxelChaim Goodman-Strauss, Craig Kaplan, Joseph Myers and David Smith found the following simple (both objectively and subjectively) polygon that tiles the plane, but only aperiodically: Indeed they found a one-parameter family of such aperiodic monotiles or "einsteins". The edges of all tiles in th...

@NewPosts @ParclyTaxel You should typically leave posts in the sandbox for a few days
2:10 PM
Kotlin delegation seems super cool
it is
@Ginger Is this for Rabbit?
how does it... work tho
If so, you should
Swift has a nearly identical feature with a completely different syntax called property wrappers
2:11 PM
delegated properties are even cooler
@RydwolfPrograms ok cool
Property wrappers are just a limited macro system tbh
ohhhhhhhh shit I get it
IMO the best option for a high level language is either floats and bigints, or floats, pointer-size-ints, and bigints
2:12 PM
delegation is cool, and I'm sure I can use it somewhere in Rabbit :p
so you basically wrap an object, and use that object to default methods
its an alternative to inheritance
@Bbrk24 no, the thing ginger posted is different
delegation and delegated properties are different things
Of course they are
capslock moment
Anyone want to guess what number this command outputs for MinGW? which man 2>&1 | wc -c
2:18 PM
that sure is a number
See, MinGW's which produces this output on failure: $0: no $1 in $PATH
My $PATH contains a lot of duplicates for some reason
@mousetail I already know how questions on this site work, don't ask
Besides I already saw 2 upvotes
bit agressive
I can get this number down to 1137 if I filter out the duplicates first, but still
So, here's an excerpt from my .bash_profile:
# $PATH contains duplicates and nonexistent directories. Fix that.
PATH=$(echo "${PATH//:/
}" | sort -f | uniq -i | while IFS= read -r dir
    test -d "$dir" && echo "$dir"
done | paste -sd:)
export PATH
2:20 PM
By your standards only the one with Parcly's cutie mark would be considered normal – I was genuinely unsure if "self-promotion" was allowed
@Bbrk24 ಠ_ಠ
No, it ends in a smiley face, see?
still ಠ_ಠ
2:25 PM
I'd love to participate but I have to leave for lab soon
Plus, we already did this once, and it ended in a stalemate
pretty sure I won that, but whatever
You tried an italic emoji but the device I was on couldn't render italic emoji
@Seggan ohhhh no
ik people use copilot by giving it comments and telling it to make code... but i just use it as a better autocomplete
and i think that i think it should stay that way
2:26 PM
you missed the bit where you can say "hey github" and it'll talk to you
yeah but thats using it more like gpt3
wait what i just realised what you said
i didnt know that existed
you can use voice commands to write code
I really don't know what to say about that
@Ginger im talking about the copilot rn
Question: at what point is code minification worth it? I hadn't been minifying one of my JS files, but I just tried it and that reduced the gzip size of that file by 35%. On the other hand, even without minification or gzip, the raw source is less than 10kB.
@Bbrk24 beyond a few MB
2:30 PM
@ParclyTaxel 2 upvotes doesn't mean much, it's quite common for new people to upvote a post even if they haven't read it properly or don't understand it
You should leave it in the sandbox for a few days regardless of votes
@Seggan Makes sense. There's another JS file I have that I am minifying already, but the minifier reduces it from 153kB to 27kB, so that's more substantial
why are you using js anyway
2:52 PM
What if significant whitespace could be used to modify precedence
1 + 2 * 4 + 6 would be 1 + (2 * 4) + 6 but 1 + 2 * 4 + 6 would be (1 + 2) * (4 + 6)
How do i check if a circle and a line have collided? (from just the equations of the line and the circle)
@zoomlogo Find a line perpenducular to the line that passes through the circle, find the intersection with that point and the line, get the distance between that point and the circle, the calculate if that distance is less than the radius of the circle
@zoomlogo What kind of resources do you have? Are you trying to do this by hand?
i was just wondering how to do it
(by hand for now)
@zoomlogo Calculate the closest distance the line passes from the center of the circle
If it's equal to the circle's radius, it touches it once. If it's less than it, it touches it twice. If it's more, it doesnt touch it.
You can find the closest approach using vector projection IIRC
3:04 PM
@zoomlogo Couldn‘t you set equation of line=equation of circle and then simplify?
@mathscat how would i simplify that ?
for example how would i calculate it for this?
Okay so pick a point on the line, call it A
Pick another, B
Call the center of the circle C
You now have two vectors, A->C and A->B, call these vectors a and b respectively
Now compute the projection of a onto b, and subtract that from a, giving you a vector
Take the length of that vector
Lemme write a formula for this
Okay the formula is giant and ugly
Since there's six input variables
But the process is pretty straightforward
@zoomlogo good question
@RydwolfPrograms i understand now
Vector projection is so overpowered
3:15 PM
i just need to now rewatch 3b1b on that topic :p
@mathscat i will attempt that in the future when i have gained more knowledge :P
I dunno if it’s possible by hand, I assumed the circle was placed at (0,0)
3:49 PM
hey guys do you think IANA will accept a registration for the rabbit URI scheme
Vector b is supposed to be A->B
Nvm I can‘t read lol
I just checked: rabbit isn't actually registered by anyone
this means I can use it as the URI scheme for my websocket-based package repository communication protocol!
> websocket based
Why does it need a custom URI then
because I can
3:53 PM
Fair enough
and also because the format, despite using websockets for communication, does not use valid websocket URIs
I'm still figuring out the exact format to use, but whatever
Yup, works
actually, I might use something like FTP for the downloads and websockets just for communication
FTP's geriatric, sockets are better
Why websockets out of interest
because that lets the client and server talk to each other, which is an important part of the protocol
I don't really have any concrete specs yet, but I imagine it will look something like this:
4:02 PM
Yeah but...will this be interacted with using browsers?
If not, there's no point in the overhead of HTTP
Just use a raw TCP socket
wait, what do you mean "overhead of HTTP"?
The whole point of WS is that they simulate a TCP socket over HTTP
that's cursed
4:03 PM
You don't need HTTP, just use a TCP socket
yeah okay I'm just going to use a TCP socket
thank you for telling me that lol
so basically it'll look like this:
the client opens the connection and waits for the server to send a "hello" packet with info about the server as well as a (limited-length) human-readable greeting message
the client then responds with a greeting packet of its own containing information about itself
from this point on the client is the initiator of any further exchanges
Wouldn't it make more sense to send the client hello first?
That way it's the initiator for that too
hmm, good point
Also you should probably consider TLS now rather than later
remind me what that is
4:05 PM
One thing you lose without websockets is that you don't get HTTPS free
right, the TCP security thing
that'll be part of this too, although I'm not quite sure how it'll work
TLS is basically just another network layer
so once it's done the hello the client can do a few things, such as search for packages or request downloads
Once you do the TLS handshakes and stuff you can use it just like a plain socket
okay cool
4:07 PM
And you can get libraries to do all that
the downloads mechanism is the part I'm not sure about; the client will either open a new socket for each download or re-use the current one
Reusing the current one saves overhead and has fewer points of failure
either way, once the client starts a download the server will send it lots of packets containing chunks of the file being downloaded; it may also send some "are you getting all that" packets that the client has to respond to for the download to continue
Part II's not necessary
TCP will make sure they don't get dropped
at the end there's a final exchange of checksums to make sure the data's good and then it's done
4:10 PM
Although it might be worth making the client be the one who asks for each chunk
That way the client can stop the download and restart it later without needing to redownload half the file
good idea
the client can request multiple downloads at the same time, as well as initiate other transactions like searches or whatever; this functionality has limited use in a console but will be great if I ever decide to make a GUI app, which I probably will :p
there will, of course, be a download cap to prevent DOSes
That should be a server-side thing
the cap? yeah of course
doing it client-side would be stupid
Well I mean like, a server-operator-problem not a language-designer-problem
4:13 PM
Also keep in mind the cap just makes DDoSes easier
Since you don't need as many requests at once before the server hits an artificial limit
I'd like to make this system as resilient as possible; I don't want to have to disable my search endpoint because of people flooding it with requests
Yeah and the cap just makes that happen quicker
Unless it's per-connection in which case all it hurts is legitimate users
Since the whole point of a DDoS is that it's distributed
4:47 PM
@RydwolfPrograms ok so like what do I do to keep that from happening
oh also there's actually another protocol: direct download
the internals are mostly the same, but the URI describes a single action (like "install this module") and everything is automated with no user input (except for presumably a confirmation)
nothing like trying to write jelly on my phone
5:03 PM
for example, if you had carrot installed the URI rabbit://packages.rabbitlang.dev/rabbit/colorspaces/latest?install would install the latest version of rabbit.colorspaces from packages.rabbitlang.dev
5:13 PM
I'd love to register this URI... but I'd have to dox myself to do it :|
also carrot, and therefore rabbit, need to be finished and functional but whatever that's easy :p
lmao this scheme registration cites Wikipedia as a source
rdar:// doesn't seem to be registered there, yet Apple uses it all the time
5:29 PM
guess Apple couldn't be bothered to register it
okay so I have done a little trolling thinking and figured out Rabbit's standard library model
there will be two sets of modules: A set of 10ish "core modules", which provide essential services like a thread interface and OS info and are released with the interpreter, and a larger set of "standard modules", which are maintained by me but updated on their own schedules
@RydwolfPrograms ok what's wrong with ^
LDQ: Should functions always be immutable? (also, should I have a concept of mutability?)
@Ginger Vaguely reminds me of Swift: the standard library is part of the Swift repo and is implicitly imported in every file, while there are other libraries maintained by Apple but not included by default (e.g. swift-collections)
00:00 - 18:0018:00 - 00:00

« first day (4436 days earlier)      last day (71 days later) »