« first day (3827 days earlier)      last day (1018 days later) » 

2:00 PM
@AaronMiller Should be fixed, let me know if you find any other bugs, I'm coding on my phone :P
 
@RedwolfPrograms yes, would be useful
 
@thedefault. Thanks for your comment, completely correct on all counts and now I've fixed it
 
2:16 PM
in Attempt This Online, 16 secs ago, by pxeger
I've made some UI changes which are now live on https://staging.ato.pxeger.com so any feedback would be appreciated!
 
server down?
 
oh yeah, it's not finished upgrading lol
it'll be done in 2 minutes
 
@Bubbler Sounds like risky sort of
It had 15 commands with, funnily enough, an identical number of overloads (depending on how you counted them)
 
@rak1507 finished!
 
Although its approach was quite different
 
2:20 PM
ok it's not doing that dumb moving around thing so 10/10
 
@rak1507 there's a new layout option in Preferences, what do you think of that?
 
looks good to me
 
would you keep that option on or off? That's the real question lol
 
I would do whatever the default is :P
 
what is the purpose of font ligatures? (they look like weird Unicode characters to me, and 0xFF doesn't become any more clear when the x becomes a multiplication sign)
 
2:29 PM
I was about to ask that exact thing lol
 
0xFF is supposed to be a hexadecimal value, and with the ligatures it looks much better to me
 
Why does x becoming × look any better at all though?
To me it looks way worse
 
but it changes from 'accepted notation' to 'can be simplified to zero'
 
Plus if it turns 0x into , it breaks the connection between 0x and 0o or 0b
 
it's not actually a multiplication sign you realise
 
2:31 PM
But it looks like one
 
anyway, that's why I put the option there
it's more useful for things like >>= IMO
 
I probably wouldn't figure out that it's a right shift operator just by looking at it
 
Yeah IMO that looks more like some sort of weird arrow thing. I guess it's just personal preference though, I really like the look of code (and things like ++ or !=), but some people might not I guess.
 
bad challenge idea: Hello, World! but every character must be part of an ato.pxeger.com font ligature
 
The main thing that annoys me is the inconsistency. /= and |= have their spacing changed, but not += or -= or &=
 
2:40 PM
@thedefault. it uses Fira Code, btw
obviously the most important thing with the ligatures is that you can make really long arrows
 
Ew gross
I love how combining the = signs together actually makes a readability issue for languages like JS, so they have to stack an additional line on top of it and make it look silly
It's just like a weird uncanny valley of badly handwritten code and a real font
 
@Bubbler Does it shadow or error? (I assume error, but idk Rust or sanity)
 
@pxeger so why would it be displayed more like one
 
oh ffs stop asking me these questions
I like it, so I use it
You don't, so don't use it
 
2:57 PM
i get the case for most of the ligatures even though i wouldn't want to use them myself but the x just seems plain wrong
 
@RedwolfPrograms Wait, why do they do that?
Why not just have them be separate?
 
...yeah some of those particular ligature glyphs are kinda questionable even where the ligatures themselves make sense
 
@pxeger (btw I'm not directing my criticism of the ligatures at you at all; I love that the option's there, since more customizability's never a bad thing)
 
considering the handling of &&, ||, ** etc. they could probably have just done something similar with like a broken pipe aesthetic almost
 
@RedwolfPrograms Sorry, I just got fed up of being asked questions that I blatantly could not answer when the fix you wanted was right in front of you
 
3:02 PM
could stack two of the --es
 
I really don't like the long narow ||, it looks like you're writing code in Arial or something :p
 
the |> {[ ]} #[ ]# *** are actually super clean
 
{[ and ]} aren't ligatures, are they?
 
I'm guessing you meant {| and |}?
 
3:19 PM
@UnrelatedString A long == with no space in between would actually look kinda nice
 
yeah {| |}
 
3:50 PM
Oh, BMG is starting in 10m
 
10 minutes until BMG
 
Where's the drafts room?
Found it

 BMG Drafts

Draft voting for Biweekly Mini Golf
We'll need to draft quickly
 
yikes lmao
 
Voting has begun in BMG Drafts! Vote quickly.
Welcome to the 6th Biweekly Mini Golf! During this event, we'll post some CMCs (Chat Mini Challenges) for you all to solve. A new one will be added every 5 to 10 minutes. If you have any questions, don't be afraid to ask. Good luck!
in BMG Drafts, 8 mins ago, by Redwolf Programs
Draft: Compare two numbers: if the first is smaller, return -1. If they are identical, return 0. If the first is larger, return 1. The reverse is also fine.
 
@RedwolfPrograms Python 2, 3 bytes: cmp
 
4:02 PM
@RedwolfPrograms JS: x=>y=>Math.sign(x-y)
 
@RedwolfPrograms Java, 15 bytes: Long::compareTo
 
APL: ×-
 
@RedwolfPrograms or: x=>y=>x-y&&(x<y)*2-1
 
@RedwolfPrograms Scala 2.13+ -language:postfixOps or Scala 2.12, 8 bytes: _-_ sign
 
in BMG Drafts, 11 mins ago, by user
Draft: Check if a number exists in a nested, possibly jagged list. (e.g. [[[1, 2, [3, 4], [5]], [-1, 123123]], [1, 2]]
@RedwolfPrograms JS, 38 bytes: n=>(g=j=>j.some(x=>x==n||x.map&&g(x)))
(BTW if any of y'all think the pace is too fast or slow let me know)
 
4:11 PM
@RedwolfPrograms APL: ∊∘∊ Try it online!
 
@RedwolfPrograms Ash, 2: V↔
 
Recursive functions are hard :(
 
I'm guessing most golfing languages will be able to get 2 bytes
 
It's been 8 minutes, should I post another? (not mine)
 
in BMG Drafts, 20 mins ago, by Redwolf Programs
Draft: Return any set of directions which will allow you to navigate from the top left to the bottom right of a maze, made up of any two characters
@user ninja'd :p
 
@RedwolfPrograms Whoa, that's for main.
 
@RedwolfPrograms I'm not sure I understand this
 
@RedwolfPrograms what do you mean by a maze, and what do you mean by "any set"?
VTC as unclear :þ
 
Yeah.
 
wait so can we walk through walls
 
4:16 PM
@pxeger Just any list of directions in any format you want
Maybe we should skip this one
 
@RedwolfPrograms Would this work? _=>List('U', 'D', 'L', 'R')
 
and I'm assuming the "any two characters" represent moving right and upwards? so therefore the "maze" is very constrained?
 
in BMG Drafts, 15 mins ago, by Razetime
Draft: dereference a null pointer
 
Yes, please.
 
@RedwolfPrograms Great, let's do Razetime's :P
 
4:17 PM
@user I don't know what that means.
 
@Adám It's a joke
 
@pxeger No, I meant one char for the walls and one for the not-walls
 
in BMG Drafts, 20 mins ago, by user
Draft: Sort a list of positive integers according to the order of another list (same length)
^ This is a more realistic challenge
 
@user J: /:
 
BMG with Jelly might not be great on mobile :P
 
4:18 PM
@user APL: ⎕[⍋⎕]
@user Extended Dyalog APL: ⍋⍛⊇
 
JS: o=>s=>o.map((x,i)=>[x,i]).sort((a,b)=>a[0]-b[0]).map(i=>s[i[1]])
 
surely a shorter way, but I don't like ctypes much
 
in BMG Drafts, 27 mins ago, by Redwolf Programs
Draft: Take a string of parentheses, and add opening parentheses to the start or closing parentheses to the end in order to make it balanced
Example: ) would become (), (() would become (()), )( would become ()()
 
@RedwolfPrograms APL, 37: {(0⌊v)⌽⍵,(|v)⍴'()'⊃⍨0<v←+/-⌿'()'∘.=⍵} Try it online!
 
4:24 PM
@RedwolfPrograms Does it have to be the minimal number of parentheses?
 
Might be golfable.
 
@cairdcoinheringaahing Yes
Actually, no
It's a CMC
 
31: {0(⌊⌽⍵,⊢∘|⍴p⊃⍨<)+/-/⍵∘.=p←'()'} Try it online!
@RedwolfPrograms It is trivial to get the minimal number.
 
Since this is more of a trivial CMC:
in BMG Drafts, 34 mins ago, by Razetime
Draft: Sleep for 10 minutes.
 
@RedwolfPrograms Any modern APL: ⎕DL 600
 
4:30 PM
@RedwolfPrograms in that case, utterly untested Haskell: f x=(g[]'('x):x:(cycle")")where g a[]x=a;g a _:c x=g x:a c x
 
@RedwolfPrograms JS: n=Date.now;u=n()+6e5;while(n()<u);
(assuming setTimeout is invalid)
 
@RedwolfPrograms APL\360: 5⌶108E4
 
@pxeger in Human terms: "(" * len(input) + input + ")" * infinity (i.e. definitely cheating)
 
@RedwolfPrograms You could do this much more nicely in an async function with await new Promise(r=>setTimeout(r,6e5))
 
@RedwolfPrograms can't you point-free-ify that by returning a promise with just ()=>new Promise(r=>setTimeout(r,6e5))?
 
4:32 PM
I think you have to await it.
 
The await is what's actually making it wait, but you could have a function that returns that promise and requires the user to await it
 
@RedwolfPrograms Jelly, 5 bytes: 6ȷ2œS
 
@RedwolfPrograms But I'd consider that a bit cheaty
 
Because yay JavaScript.
 
The await new Promise with setTimeout setup is actually really elegant, especially for JS
 
4:35 PM
So does this mean BMG is over?
 
No, we've still got an hour left in theory
And there's plenty more CMCs
Should I post one?
 
Uh, I thought we were at the end of starred drafts.
 
Only the two-starred ones
Actually there's one of mine left:
in BMG Drafts, 40 mins ago, by Redwolf Programs
Draft: Sort a list of numbers or strings so that no two identical numbers or strings are adjacent
 
Question is, what is better: code golfing or feeding my family…
 
You probably don't want our answers to that :p
 
4:36 PM
@RedwolfPrograms NP-hard?
 
@RedwolfPrograms (pre-emptive clarification: you choose numbers or strings, there's not both)
 
@Adám don't you golf so you can feed your family?
 
Indirectly, yes, so why do they complain that they're hungry‽ I mean, there's money in the bank!
@RedwolfPrograms Brute force or random-until-ok is surely shortest here.
6
Q: Efficient algorithm for ordering different types of objects

Yohan LiyanageGiven that we have a collection of videos of different types (say types A,B and C,...), we are looking for an efficient algorithm to order these objects into a playlist so that we have maximum dispersion. That is, we want to make sure that two videos from A will not be placed back to back, if tha...

 
@RedwolfPrograms Ash: Ḥqα=Y}O
 
@RedwolfPrograms Seriously‽
 
4:41 PM
Finds a permutation where no overlapping pairs are equal
 
Ah, so get all permutations?
 
@RedwolfPrograms Are you saying that we can choose which type our program takes, between strings and numbers?
 
Yeah
@RedwolfPrograms Ḥ } is find, O is permutations, Y is overlapping pairs, and qα=is a sneaky trick to check if all pairs are identical
 
@RedwolfPrograms Jelly, 8 bytes Œ!nƝẠ$ƇḢ
 
Actually I think there's a builtin for the qα=
 
4:42 PM
@RedwolfPrograms APL: {⍵[?⍨≢⍵]}⍣{~1∊2=/⍺}
Random shuffle until ok.
 
Ash: ḤIY}O
 
Hi, yo!
 
@pxeger much shorter (and tested): f x=('('<$x)++x++cycle")"
 
That } is annoying, wonder if there's any way I can get rid of it
No, probably not :/
 
Œ!nɲƇḢ (6 bytes) in my fork
 
4:44 PM
How long do all these solutions take for a length 10 list? How about a length 15 list?
 
@Adám Very
 
Stupidly long :P
 
I can get three bytes in my upcoming language I think
 
I wonder if Prolog/Brachylog can do it.
If you can test one permutation per microsecond, length 15 should only take two weeks.
Length 100 would take 10¹⁵⁰ years, though.
OK, both kids are here next to me complaining of hunger. Gotta go!
 
o/
in BMG Drafts, 50 mins ago, by Redwolf Programs
Draft: Vectorize addition, with inputs potentially being: a number and a list of numbers (in either order), two identically long lists of numbers, or two numbers
 
4:50 PM
@RedwolfPrograms Jelly, 24 bytes :P
 
The naive JS solution is 66 :/
x=>y=>x.map?x.map((n,i)=>y.map?n+y[i]:n+y):y.map?y.map(n=>n+x):x+y
-1 if I can return x+y as [x+y]
By doing [y].flat().map(...)
 
Ugh, Jelly has basically no way to distinguish [x] and x aside from the depth atom :/
 
Ash has a few different solutions with varying levels of cheatiness: + (addition, vectorizes this way by default), β+ (vectorize addition), or the actual solution which would probably be very difficult (depending on whether the version of Ash had the recursion operator or not)
 
@RedwolfPrograms Probably something like Ẉτ+ẏ01[ṅ
That'd infinite loop though since Ash wasn't lazy
And it'd also probably not work at all since I doubt (zipwith) worked as expected when one input was a number
in BMG Drafts, 35 mins ago, by caird coinheringaahing
Draft: Dot product between two lists of same length
 
4:59 PM
@cairdcoinheringaahing ಠ_ಠ Fricking bug with makes this invalid
 
@RedwolfPrograms JS, naive solution (35 bytes): x=>y=>x.reduce((t,n,i)=>t+n*y[i],0)
 
@RedwolfPrograms Built-in + in all APLs and derivatives.
If that is unacceptable:
 
@RedwolfPrograms Ash: u*
 
@RedwolfPrograms Vyxal: v*
 
Guessing v is sum?
 
5:03 PM
Hi
 
@RedwolfPrograms +.× in APL.
 
Mathematica: Dot (also the . operator)
 
Just hit 950 rep on Math stack exchange
Almost at 1k
:)
 
I think * in MatLab.
 
5:04 PM
@RedwolfPrograms Thanks!
 
@thedefault. Don't you have to write something silly like Dot#?
 
On the topic of dot product, worthwhile golfing language built-in or no?
 
@RedwolfPrograms Oh, wait I misread the challenge. I did cartesian product (I think)
 
@Adám Dot is the function name, so this is technically a function submission. (but if I used the . operator I'd need to do something like #.#2&)
 
@RedwolfPrograms Yes, because the sum of the product of two lists is very commonly needed.
 
5:06 PM
@RedwolfPrograms Jelly, 1 byte: :P
 
non-builtin for jelly would just be ×S i think :p
 
dotted "d for dot". Hm.
 
in BMG Drafts, 1 hour ago, by Redwolf Programs
Draft: Implement a stack based language, with + (addition), _ (negate), : (duplicate), 0 (push 0), and 1 (push 1)
You can choose how I/O works
No input is necessary, although brownie points for allowing you to start the stack with something :p
 
oh allowing input can probably save me a byte or two
 
Same here actually
 
5:09 PM
should 01_ be 1 or -1
 
should be [0, -1] as far as I understand
 
^
It's negate not subtraction
 
wait
i misread that lol
 
@RedwolfPrograms Vyxal, 7 bytes: \_\NĿṄĖ
 
5:11 PM
I wish JS was lazy, rather than its designers :/
 
@cairdcoinheringaahing 22 bytes :D
 
Ooh nice
 
@RedwolfPrograms Jelly, 38 bytes: ;Ṫ+ṪƊ$;ṪN$$;ṛ/$;V}¥⁼”:$}?⁼”_$}?⁼”+$}?ƒ (Try It Online!)
unfortunately, i cannot just substitute and eval so easily like vyxal can :p
without starting value, just place “” to the right for 40 bytes
 
@AaronMiller translate+eval?
 
in BMG Drafts, 1 hour ago, by pxeger
Draft: Given a list of programming languages, remove the bad ones. All inputs will be in this (space-separated) list; casing is up to you: PHP Python Ruby Zsh JavaScript Java C++ C C# HTML Jelly Vyxal Brainfuck Malbolge. Good languages are: PHP Python Ruby Zsh JavaScript Java C++ C C# HTML Jelly Brainfuck Malbolge.
Final CMC
 
5:19 PM
@Razetime Change all _ to N, which is the command for negate, insert spaces between everything so that e.g. 1011 will push each number separately, then execute as Vyxal code.
 
Damn, missed most of the BMG :(
 
oh, everything else in the same?
mad convenient
 
@RedwolfPrograms JS: i=>i.filter(l=>l[0]!="V")
 
@RedwolfPrograms Scala: _-"Vyxal"
 
Too bad Zsh is in the list, or I could use < for a huge byte save
 
5:21 PM
nvm i dum
 
@RedwolfPrograms Vyxal, 6 bytes
 
@RedwolfPrograms K:(~"V"=*)#
 
@AaronMiller :P
 
@RedwolfPrograms Vyxal, 5 bytes: 'h\V≠ (Try it Online!)
 
Ash, 5: Ḷ≠⌊‘V
Probably an identical approach
 
5:23 PM
> All inputs will be in this (space-separated) list
 
the vyxal is just "filter lambda: head "V" !="
 
Yeah, mine's just filter where first character isn't "V"
 
@AaronMiller I am pretty sure that is just indicating how the list of valid languages is presented in the problem statement. The first line says "Given a list of programming languages" so I think it's reasonable to assume we are given a list.
 
@RedwolfPrograms So same approach, same byte count
 
@hyper-neutrino Ah, then I guess mine is 5 bytes too.
 
5:25 PM
@RedwolfPrograms QuadR, 40 bytes. Try it online! Always starts with empty stack. Reads instructions from right to left.
 
wait did we actually just have bmg
at not 3 in the morning
 
@Adám woo string replacement
 
Might actually be shorter to implement it properly.
 
but it's funnier so you definitely get bonus points
 
@RedwolfPrograms Vyxal, 4 bytes: Try it Online!
 
5:28 PM
Ooh, good idea
 
anyone know how to make the git tab stick to the right in atom?
i remember being able to have it on the right even if no files were open
 
BMG is officially over...now!
 
but now whenever i close the last file it just fills the screen and then when i open a file it puts it in one of the git tabs' panes which is exactly what i don't want it to do
 
@RedwolfPrograms you could also do i=>i.filter(l=>l[2]<"x") if C and C# weren't in there
 
Thanks, everyone!
 
5:34 PM
@UnrelatedString Yeah. Too bad Python's there, or l[1]<"y" would work too
 
yep
except it would also probably have the same C issue that was my first thought
 
Oh, true
 
@cairdcoinheringaahing I'm not entirely sure, but I think the yggdrasil program ;;!!!<+$ should print 66, right? The <> commands don't seem to be moving the pointer.
 
5:59 PM
@RedwolfPrograms I added it for precisely that reason :)
@RedwolfPrograms Haskell: sum.zipWith(*)
 
@AaronMiller ngl, I sort of just hacked it together in an afternoon cause hyper mentioned Branch (another lang based on binary trees), so it's probably super buggy. I can take a proper look at the source code when I can, and feel free to make any pull requests if you see problems that you can fix, but it's not exactly a top priority thing for me tbh :P
 
@cairdcoinheringaahing Sure, I'll see if I can fix it. I just wasn't sure if I misunderstood how it worked. For a while, I was really confused about how a lot of the language works, but I think it finally clicked, so I think it'll be fun to try and fix it.
 
6:46 PM
CMQ: What are the most cursed things for a programming language to have/do?
 
Very strange type casting that happens automatically
 
@AaronMiller The loop thing with JS and Python
 
Arrays that can have negative or fractional indices
 
@AaronMiller Allowing XML literals
 
That's a good one
Having string replacement based macros
 
6:47 PM
@user What loop thing would that be?
 
Not having TCO is another
 
@AaronMiller Allowing a completely different syntax depending on some little setting
 
Switch statements
 
@AaronMiller The thing where you do for a[3] in a: a and go crazy
@RedwolfPrograms Switch statements can be useful, but proper pattern matching is waayyy better
 
Switch statements with their C/JS syntax, I mean
Labeled for loops is a good one
 
6:49 PM
@AaronMiller Turning \uxxxx into the corresponding Unicode character anywhere, even in comments (looking at you, Java, you sneaky little ********)
 
Ah, so many ideas!
 
@user It's fine in strings
 
caird was working on a language called Hatred, go look at it
 
Java does it in the code itself too
 
"\uxxxx" and "\u{xxxx}" are both good
 
6:50 PM
@RedwolfPrograms Definitely, but it's cursed when you do it anywhere
 
@hyper-neutrino Oh...oh no
That's not good
 
@hyper-neutrino That's exactly why it's cursed
 
Using UTF-16 and having all of the loops and string methods treat UTF-16 characters individually so higher unicode stuff breaks is another
 
I once made a program to crash my CS teacher's computer when run by hiding that stuff in the comments, then crashed my own computer, then realized it wouldn't crash anyone else's computer :(
 
6:51 PM
brilliant
 
@AaronMiller Letting you change the encoding halfway
@AaronMiller Having all variables be global
 
Having defining an undeclared variable make it global
 
@hyper-neutrino That is so cursed and I love it :)
 
Having a global variable that contains all global variables as properties
 
6:52 PM
@AaronMiller Not being able to declare variables like Python, so you never know if you're setting a global/nonlocal variable or making a new one
 
Oh I hate that one
Yeah that's a good idea
 
oh yeah that's cursed
 
@AaronMiller Functions being able to access the variables of where they were called from instead of where they were defined (dynamic scope instead of the sane lexical scope most languages use)
 
the fact that accessing a variable works except if later in the function body you assign, then it becomes local scoped and you get a reference error
 
Having everything have a constructor and various properties except null where trying to access a property errors
Having both null and undefined
 
6:53 PM
Not being able to differentiate between a property being null and a property not being defined
 
Having two function syntices but one of them is subtly different from the other
 
Alternatively, having N/A, None, null, undefined, NaN, Empty, and other
@RedwolfPrograms I'm happy you're using syntices :)
 
NaN should be different from the rest
 
Okay yeah
 
Having floats as the only number type is a good one though
And if you do add other number types, make +x error for them
 
6:55 PM
Aaron are you collecting ideas for a new language...
 
Having strict typing for numbers (integers, whole numbers, float64s, float32s, fixed point numbers, booleans) but being unable to tell which type a number is, errorring on certain operations on numbers of different types but doing type coercion sometimes
 
Having dictionaries and objects be the same, and having properties on dictionaries by default
 
Not having lambdas, array literals, or object literals
 
@hyper-neutrino Maybe…
 
6:56 PM
Having classes just be functions called with new
 
Quick, burn this conversation before Aaron makes it!
 
I was just thinking about how cursed Keg is and realized that it could be a lot worse.
 
Ah, well luckily all of these ideas are more oriented at practical languages
 
@AaronMiller Occasionally turning into a cow because its users keep cursing it
 
Maybe I should burn this conversation with lots of fire though to protect us just in case :p
 
6:57 PM
Move it to a room where normal people can't see it
 
@RedwolfPrograms Too late, I took screenshots.
 
@hyper-neutrino ^^
 
too late, the nukes are already armed and counting down
 
Yes, please nuke Aaron Miller
 
Oh, no! D:
At least I’m at work, so my fridge will be safe.
 
6:58 PM

Cursed programming language features

12 mins ago, 11 minutes total – 61 messages, 4 users, 0 stars

Bookmarked 5 secs ago by Redwolf Programs

 
@user In fact, nuke their entire continent so backups are also destroyed
 
@user But HN is on the same continent. :p
 
perfect
3
 
@AaronMiller Hmm, so am I then
 
Same here D:
 

« first day (3827 days earlier)      last day (1018 days later) »