« first day (2369 days earlier)      last day (2457 days later) » 

4:08 AM
does anyone here know C pretty well?
 
I don't know. Maybe there's someone here who knows whether there's anyone who knows C pretty well?
 
the reason I ask is because I found a really weird C quine:
main(){printf("main(){printf(%c%s%c,34,%c%c+8,34,34,34);}",34,""+8,34,34,34);}
 
@ConorO'Brien MDXF likes C a lot
 
@MDXF Say, do you know why ^^ works?
I guess it's because the strings are stored more or less consecutively in memory
whatever it is, I know have the shortest C quine
*now, I always type that wrong
 
4:35 AM
@ConorO'Brien really?? How many bytes?
 
Also, I'm on my phone and I can't see the whole code for some reason, can you send a tio link?
78 is not the shortest C quine
 
Huh
Pretty sure that's a memory thing but I'll look closer
 
@MDXF 70
I updated it
0
A: Golf you a quine for great good!

Conor O'BrienC (gcc), 78 70 bytes main(){printf("main(){printf(%c%s%c,34,4195728,34);}",34,4195728,34);} I have no idea why this works, 100% honest here. But dang, is it short. Try it online! Old version, 78: main(){printf("main(){printf(%c%s%c,34,%c%c+8,34,34,34);}",34,""+8,34,34,34);} Try it onli...

 
4:43 AM
That's really weird, how did you find it?
(still not the shortest btw, shortest is 60)
 
on complete accident, actually. I was slicing through a string through STRING + offset when I forgot to check for the end of the string, so offset > strlen(STRING). It then printed my debug printf command from earlier
@MDXF soul crushes slowly
 
Huh
I'm gonna experiment with that tomorrow when I'm not sleep deprived
 
please do, I'd love to see 60 be broken (also your repo for C quines is out of date, it says 64 is the shortest)
 
Also I golfed yours (see comment)
Oh whoops, I'll go fix that
 
what is that wizardry
 
4:50 AM
@ConorO'Brien well so is yours in the first place... :P
 
what does %1$c do? (like what does it mean?) I gather that it's the first arg but wow
 
1$ just means use the first argument after the format specifier
The %c around it means print as character
 
too bad %0$s doesn't work, that'd be great for a quine
 
Yeah I've spent hours trying to find how to do that
Also your quine could be shorter if you found a shorter way of writing 4195728, like using bitshifts and such
 
It's 10000000000010110010000 in binary, it looks like it's possible
 
5:02 AM
It's longer in hex unfortunately
 
If you're going to hard-code addresses, why don't you go all the way and find a compiler than includes source lines in its debug info.
Then you would do puts(0x12345) and be done.
 
I've tried that
It's very very difficult to access debugging symbols from inside the program
 
No, you are not understading.
Not debugging symbols, source text.
 
Well yeah that too. But technically debugging symbols contain the program source
 
Wrong.
 
5:07 AM
Then how does gdb print the program source line by line - waittt... it reads the source file doesn't it
I've always suspected that
 
Yes, but I think there should be some that store a separate copy of it.
 
There likely are
With enough GCC flags and compiler voodoo I bet it could be done
 
@MDXF Do you know why I can write '@\x05\x90' but not with those characters literally?
 
@ConorO'Brien what do you mean?
You mean you can't use the actual ASCII 0x05 and 0x90?
 
yeah
the ascii 0x90 rather
 
5:16 AM
Might be TIO
Try it locally if you can
 
Just did, same result
I mean I can use them, it just provides inaccurate results
 
Hmm
 
'@\220' works and '@\x90' works but not '@'
 
How the heck are you fitting multiple characters into single quotes anyway?!?
 
it's a gcc specific implementation, it's interpreted as a base 256 number
and I think I figured out why, it's because the source is interpreted as utf-8, which means the sequence is 64 5 194 144 instead of 64 5 144
bingo
 
5:22 AM
Oh good job
 
now to make TIO accept ansi encoded
 
I think you've shortened the quine :P I wonder if you've beat mine...
 
I can locally get it down to 62 bytes: main(){printf("main(){printf(%c%s%1$c,34,'@@0');}",34,'@@0');} (the address is different on mine)
 
Dang!
That's really good. Nice job
 
do you have a windows machine? idk if this is portable beyond my computer
 
5:30 AM
I do, but not rn
 
ok, cool
 
You can include it in your answer and I'll mess with it tomorrow (probably)
 
alright, sounds good
 
I'm actually going to sleep now. Good luck with the quine
 
ok, night
 
5:49 AM
I've implemented a very strange way to make Lambdas in lua.
require("equa")

local eq = #gsub(a, "[a-z]", "%0%0")

print(
	eq("This Is A Cooool Test!")
)
Outputs "Thhiiss Iss A Cooooooooll Teesstt!"
It also implicitly curry's.
require("equa")

local eq = #(x + y)

print(
	eq(1, 2), eq(1)()(2)
)
Outputs 3 3
 
This would look so much better with LaTeX... :/
 
 
1 hour later…
7:17 AM
2
Q: The infinite power tower

GravitonThe challenge Quite simple, given an input x, calculate it's infinite power tower! x^x^x^x^x^x... For you math-lovers out there, this is x's infinite tetration. Keep in mind the following: x^x^x^x^x^x... = x^(x^(x^(x^(x...)))) != (((((x)^x)^x)^x)^x...) Surprised we haven't had a "simple" ...

 
7:33 AM
@Dennis this is so great, I just had to port it.
 
8:19 AM
@feersum As in NUL etc?
 
@ASCII-only Yup
 
> METH
what is this :O
@feersum somewhere here, i'll try to find the specific location
 
Have we had a challenge with the sum of the absolute deltas of a list?
[1, 3, 5, 2, -1, 8] -> absolute deltas: [2, 2, 3, 3, 9] -> 19
 
8:37 AM
I have a similar but harder challenge in mind
 
Oh, there are SO elections right now
 
@feersum O_o python looks like it's weirdly semi-bootstrapped, apparently it uses the io module, i've looked at the import function and that uses __import__ haha
 
@Mr.Xcoder Braingolf can do it in 3 bytes
as of... 2 minutes ago
 
@Mayube Can you give me the code?
(I won't post that challenge)
 
f&+
wont' work in TIO
Also yes, my bash prompt is "bash: "
 
8:43 AM
Nice
 
@Mayube it's supposed to be What do you want to bash today? (with trailing space)
 
f is documented now
 
@Mayube Pyth is double! s.aM.+
Fancy 2-byte built-ins built-ins
 
I mean I cheated by adding f as soon as I saw the idea :P
if Pyth had a 1 byte "absolute deltas of stack" builtin it'd probably get it in 2 bytes
in fact maybe I'll make f just push deltas, not absolute
hmm.. although absing the whole stack is (!s*), which is 5 whole bytes
 
@Mayube If Pyth had 1-byte absolute deltas, assuming it's $,It would be like this: s$
 
8:48 AM
what's the dot?
 
Okx
Neim is 2 bytes buti cannot be bothered to do it as i am on mobile
 
@Mayube Nothing, just ends the comment
 
@Okx does 𝐝 get absolute deltas?
 
Okx
On mobile, cannot see :P
It would be deltas builtin, then abs builtin
 
don't you need sum builtin as well?
 
Okx
8:50 AM
Oh hes did. Ot see that
Oh hes did not see that
Oh yes did.not see that
Oh yes did not see that
 
You got there
 
Okx
Only took 5tries
 
Also according to the docs, abs builtin takes an int, not a list
 
Okx
Only took 5 tries
Neim has automatic vectorisation
 
Additionally, if a token takes a list but instead an int is popped, the int will be exploded into a list and vice versa oh yeah my bad
 
9:02 AM
Hmm
I was gunna post a challenge to output the sum of the absolute deltas of the sourcecode
but I realised most languages would just do 2 bytes
Braingolf, 2 bytes: 00
 
I didn't refer to "code archaeology" for nothing.
 
@feersum Found it finally, here, here for utf-16
You probably wanted ASCII though
 
We need an OEIS sequence that is the first element from OEIS sequence An
 
@Mayube Pyth in 5: .aM.+
 
@Mr.Xcoder Are you sure about that?
 
9:09 AM
@Mayube Absolute deltas? Yeah
 
oh well you responded to my "Sum of absolute deltas of sourcecode" response, so I was confused
because it definitely doesn't do that
 
Oh, I didn't read it carefully, sorry
 
CMC: in 2 identical bytes in your language of choice, output a single zero
 
@feersum For ASCII at least, control chars aren't handled specially
 
Pyth can't do that with 00 or ZZ :(
 
9:11 AM
rip
in that case, CMC: In at least 2 bytes of code, output the sum of the absolute deltas of the sourcecode
 
@ASCII-only This finding has an unfortunate conflict with reality.
 
@Mayube Charcoal, 1 byte: 0 :P
 
oh right yeah forgot "minimum 2 bytes" :P
otherwise there are no deltas
 
@feersum Well depending on the problem it might be handled by the parser/lexer?
@Mayube 00 :P
 
9:13 AM
yep
Polyglot, works in Braingolf too
except works better in Braingolf cos no leading zero
alternatively, 01
 
@ASCII-only You can actually see lines that have been pasted together or had parts deleted when parse errors are reported.
So it seems to be at the level of decoding and reading a line from the file.
 
@Mayube Non-identical bytes: eT
Non-identical bytes: yZ
Non-indetical bytes: lY
Non-identical bytes: lH
And there are lots of them...
 
@feersum how exactly does that work
 
I don't know, that's why we are doing archaeology.
 
9:50 AM
@feersum nvm, getpreferredencoding() says utf-8
 
10:01 AM
hi
 
The default encoding is ASCII. You can't use code points above 127 without declaring an encoding.
 
10:27 AM
@TheLethalCoder Tbh, I'm not sure how exactly ¹^*1 would be counted in Carrot
 
10:40 AM
Can anyone explain how .t works in Pyth?
 
@Cowsquack I don't know what encoding do you use for it?
 
it only uses ASCII characters, I didn't specify any specific encoding
by the way, do you want to see the output from the parser for a test program?
 
Yeah sure
 
the program:
asd
sad sad
^+"multi
line"5-5-3-9- "a"/'/reg[']ex/flag'5^^^multi
line^K{"arrays"{'/are/'5}"C"0 0}+$-5.5*#^hi#asd$3.4$^/'/regex/flags'S"cool"v^v+(hey$1^+"5")-5
^#spooky(#^F+($^-2-2))me^t'//'[-1s^5^f]
 
Mayube's back at it again, making a new language
 
10:49 AM
the AST:
PROGRAM
├─CARET: ^
│ └─LITERAL: (CARET_DATA) asd
sad sad

├─NORMAL
│ ├─FUNCTION_CALL: +
│ │ ├─LITERAL: (STRING) "multi
line"
│ │ ├─LITERAL: (FLOAT) 5
│ │ ├─LITERAL: (FLOAT) -5
│ │ ├─LITERAL: (FLOAT) -3
│ │ └─LITERAL: (FLOAT) -9
│ ├─FUNCTION_CALL: -
│ │ └─LITERAL: (STRING) "a"
│ └─FUNCTION_CALL: /
│   ├─LITERAL: (REGEX) '/reg[']ex/flag'
│   └─LITERAL: (FLOAT) 5
├─CARET: ^
├─NORMAL
├─CARET: ^
│ └─LITERAL: (CARET_DATA) multi
line
├─NORMAL
│ ├─FUNCTION_CALL: K
│ │ └─ARRAY
│ │   ├─LITERAL: (STRING) "arrays"
(I just realised I forgot to add LOOPs to the parser)
 
So have you gone with one command multiple arguments then? It's looking good though I can't read it that well :P What is K?
 
that's just a command
well the output looks prettier on my terminal :P
 
It looks fine I just meant the code because it's used to test everything haha!
 
the code's not meant to do anything useful (and I haven't started with the interpreter yet), it's just to test the limits of the parser :P
 
Oh I know
It's looking good
 
11:05 AM
So.. new language, should I write it in js or python?
 
Python
 
Why?
 
@Mayube Because I like Python. You should choose the one you feel more comfortable with.
 
11:20 AM
@Mayube Is it for you or do you have a target audience?
 
@Mayube APL: 00
 
@Adám I know you were responding to my CMC, but maybe I should make it in APL
@trichoplax mostly for me
 
@Mayube Whatever you'd like to fix bugs in then...
 
I'm a little bored of making languages in python tbh
and I'm supposedly working on porting braingolf over to js
so maybe I'll make it in js
Right now I'm writing up an actual language spec before I actually start working on anything, which is a first for me
 
Nim looks like python but optionally compiles to JS, if that's of interest. Also compiles to C and then runs at C speed
 
11:27 AM
@Mayube That's what I do with Cthulhu too
 
@Mayube APL does come with some neat tools for creating languages. I'll be happy to assist. Which kind of features are you envisioning?
 
@Adám it's a sort of joke language that's designed to be very verbose
 
Starting making languages in a language you've never used before?
Doesn't sound incredibly fun
 
@Mayube Well, here are some resources to get you started: BF, Joy, Lisp, infix.
 
0
A: Sandbox for Proposed Challenges

Caleb KleveterInvisible Ink, Easy code-golf In the physical world, invisible ink usually becomes invisible when it dries, and is then is readable if it is exposed to heat or chemicals of some kind. The invisible ink in this challenge will be readable when exposed to highlighting. Create a full program or fun...

0
A: Sandbox for Proposed Challenges

Caleb KleveterInvisible Ink, Hard code-golf In the physical world, invisible ink usually becomes invisible when it dries, and is then is readable if it is exposed to heat or chemicals of some kind. The invisible ink in this challenge will be readable when exposed to highlighting. Create a full program or fun...

 
11:33 AM
This is my general plan for the language
 
@NewSandboxedPosts Are you feeling alright?
@Mayube Heh, almost all of that could be added to APL just by making a few definitions.
@Mayube What is the difference between is and is equal to?
 
@Adám Probably type checking / identity checking. Type checking: "abc" is String, comparison:is equal to would compare two values or identity checking: "abc" is variable_1
 
Memory address comparison I think
 
My 2 CnR threads have been there for 19 hours
 
@programmer5000 PPCG always lies on top of that list
 
11:46 AM
Yep. We get the HNQs, Code Review gets the design :(
3
 
@programmer5000 We will get a design too on November 1st, IIRC
 
Really? Where did SE say that?
 
SOGL y u have ["a"] == ["b"] -_-
 
because JS?
wait that is false in JS
 
my = code doesn't check for arrays and just returns true ..
 
11:51 AM
APL has (identical to) and = (equals)
 
@Adám the problem is that any array equals to any array
 
@Adám Like js's === and ==?
CMC: Vote on or comment on everything on the first page of the sandbox. We need more feedback on our sandbox!
 
@programmer5000 Don't know enough JS. looks if two things are completely identical in all aspects, = does recursive element by element comparison.
 
Oh. === is strict equality (actually equal), and == is weird equality
In JS, [] === [] is false. Arrays never equal arrays, and objects never equal objects.
 
11:59 AM
@programmer5000 But in APL, two identical arrays are identical. Two refs, otoh, are never identical/equal (objects are scalar) except if they actually ref the same object.
 
arrays and objects still equal themselves, though
var a = 0; a===a // true
 
@Adám I'm making a language and one of my goals for it is to have == work for arbitrary user-created objects (with the ability for the objects to define their ==) and === being reference equal
 
Look at Ruby
== is user-defined equality (defaults to eql?), eql? is object identity and barely ever used. === is "matches" (membership or equality depending on context)
 
Quick somebody gimme a good Unicode character for fetch
 
@totallyhuman fetch in what sense?
 
12:06 PM
Fetch a webpage
 
 
this is not sandbox
 
@totallyhuman ⍗ ⍌
 
oh wait they are in context
xd
 
📃
📥
 
12:09 PM
@Adám is everything in apl inside a box
 
emojipedia.org/objects has more, but I don't want to flood the chat
 
is there a dog emoji?
use that
 
@DestructibleLemon I wanted to suggest a bone emoji :p
 
🐶
🐕
 
12:11 PM
I'm not making emojicode ><
 
@totallyhuman No, only six of Dyalog's glyphs are: ⎕ ⍞ ⌹ ⍠ ⌸ ⌺
 
well, emoji is unicode.
 
@JanDvorak well this is false and that's what I want to be true
 
@dzaima You can use struct: repl.it/JhVU/2
 
12:14 PM
yay I do have docs for array elementwise equal :D
 
@dzaima You can define your own ==, too repl.it/JhVU/4
Example where Tclass only equals other Tclass: repl.it/JhVU/5
 
@JanDvorak That much I found (I don't know ruby :p), but that's 3 wasted lines.
 
Is Struct an option?
You can write it as one line, too, with semicolons
def ==(other); other.is_a? Tclass; end
 
well even if rubys structs do what I want I'm still making that language as it has a few other cool quirks too (for example this I want to be true)
 
Then there is OpenStruct, which is like Struct but you can add extra properties on the fly.
You could have == return self, which is still truthy. It's kind of a hack, though
I wasn't suggesting you to drop your language, though - just to use Ruby for inspiration.
 
12:25 PM
@Mayube Done!
 
Wat
Why aren't you making more languages?!
 
@totallyhuman Who?
 
@Adám impressive!
 
@Adám you, in apl
That's nuts
 
@Mayube Now you just need to run source through some text-replace to fix up the syntax and replace some spaces with underscores, and you're done.
 
12:30 PM
is to = what === is to == in other languages?
 
@totallyhuman No need to create any other languages; I have APL!
@Mayube does a complete compare in all respects, yielding a scalar Boolean. = compares element by element and returns a Boolean superset structure of the structures of its arguments. TryAPL!
 
also what's ? Seems to be used quite often
 
@Mayube Comment :-)
 
ooh ok
so like half of that APL code is comments :O
 
@Adám Is there any reason why looks like how it looks?
 
12:35 PM
@Mayube Right. I just took your specs, modified what I needed, and commented out the rest.
@Fatalize Yes, it is a lamp (or bulb filament?) to enlighten you.
 
From my experience of developping, comments usually endarken me…
 
haha that's awesome
 
APL was first used to describe a system (IBM System/360), which it is indeed very good at doing.
… Kind of interesting when you think about it from an incompleteness perspective. APL\360 fully described IBM/360. APL\360 ran on IBM/360!
 
Lies, damned lies, and comments.
 
@dzaima I think PHP has that ... at least two equal arrays with the same values are ==
 
12:40 PM
@Mayube So, what do you say? Do you want to make it in APL?
 
Perhaps
so is ⎕IO←0 basically saying take input and run it as APL code?
 
@Mayube I'd need to rewrite create_function. It was just a quick'n'dirty job.
 
and then most of the declarations look like they're basically just defining aliases
 
@Mayube No, no, it specifies 0-based indexing.
 
oh okay, so the input is implicitly taken and run as code?
 
12:43 PM
@Mayube That is indeed the case.
@Mayube Yup.
 
huh, interesting
 
@Mayube The only exception is the ⎕FX which formally fixes a function definition. We'd have to rewrite create_function like that too, to enable control structures.
 
I feel like it would be exceptionally awkward to write APL with a conventional keyboard, though
 
@Mayube Firstly, you could use an APL keyboard. Secondly, the RIDE interface allows you to use a prefix key, e.g. ` to enter APL chars, thirdly, APL interfaces come with a click-to-type language bar, and fourthly, you'd barely have to once you copy my code :-)
 
I could use an APL keyboard, but I don't own one
 
12:47 PM
@Titus :)
 
@Mayube No, I mean an APL keyboard layout. Physical APL keyboards can be bought too, but I can teach you the entire APL layout in an hour.
 
0
Q: Stop converting duplicate answers to comments

programmer5000In case you didn't know, whenever you post the exact same answer as was already posted, it gets converted to a comment. I had no idea before I posted a crack on a cops-and-robbers that someone had posted 5s before. I didn't know what happened before someone asked me why I commented on the quest...

 
Hmm, You said before that APL can compile to a binary executable, right? I'd prefer people don't have to setup APL to run the interpreter in the event that others want to use the language
 
Microsoft deprecated Ms paint :c
 
12:56 PM
@totallyhuman and Outlook Express
and Screensavers
 
@Mayube Correct.
 
Neat, Windows Task Manager now also shows GPU usage.
 
@mınxomaτ what where
 
1:24 PM
Anyone good with regexes here?
 
ish
 
Okay I'm trying to use a regex to get all the code outside of a string. I've managed to get all the contents of the string but I want the reverse.
 
example?
 
This is what I have: regexstorm.net/tester?p=%28%3f%3c!%28%3f%3c!%5c%5c%29%22%29.*%28%3f!%28%3‌​f%3c!%5c%5c%29%22%29&i=code%0d%0a%22string%22%0d%0a%5c%22escaped+string%5c%22%0d%‌​0a%40%22multiline%0d%0astring%22%0d%0acode+with+%22string%22%0d%0acode+with+%5c%2‌​2escaped%5c%22%0d%0a%22string+with+%5c%22+escaped+%5c%22%22%0d%0a%24%22interpolat‌​ed+string+%7bcode%7d%22&o=m
The links messed up...
 
...monospace the link
 
1:26 PM
regexstorm.net/tester?p=%28%3f%3c!%28%3f%3c!%5c%5c%29%22%29.*%28%3f!%28%3‌​f%3c!%5c%5c%29%22%29&i=code%0d%0a%22string%22%0d%0a%5c%22escaped+string%5c%22%0d%‌​0a%40%22multiline%0d%0astring%22&o=m
 
put it in ``
 
I thought I had -_-
http://regexstorm.net/tester?p=%28%3f%3c!%28%3f%3c!%5c%5c%29%22%29.*%28%3f!%28%‌​3f%3c!%5c%5c%29%22%29&i=code%0d%0a%22string%22%0d%0a%5c%22escaped+string%5c%22%0d‌​%0a%40%22multiline%0d%0astring%22%0d%0acode+with+%22string%22%0d%0acode+with+%5c%‌​22escaped%5c%22%0d%0a%22string+with+%5c%22+escaped+%5c%22%22&o=m
lol
That's matching everything can't seem to work it out yet
 
4
Q: Primitive Pythagorean Triples

AdmBorkBork(related) A Pythagorean Triple is a list (a, b, c) that satisfies the equation a2 + b2 = c2. A Primitive Pythagorean Triple (PPT) is one where a, b, and c are all coprime (i.e., the only common divisor between the three elements is 1). For example, the (3, 4, 5) right triangle is a famous Primi...

 
I see we're back to partitions
 
@TheLethalCoder btw there appears to be an unprintable after the %
 
1:30 PM
admborkbork is on a question streak
 
@Cowsquack Who'd have thought links would be such a pain in the arse
 
hey anybody know if there's a single character that's just {}
 
oh, that's the borked up link, I take it that it is supposed to be a ?
 
This is my pattern `(?<!(?<!\\)").*(?!(?<!\\)")`
With the test cases
code
"string"
\"escaped string\"
@"multiline
string"
code with "string"
code with \"escaped\"
"string with \" escaped \""
 
1:32 PM
Which ones most similar to .NET flavour?
 
PCRE has the most features of the ones they have I think
 
also you don't seem to be using any .NET specific features in the regex
so yeah, ^^ PCRE should work
 
I was just asking in case, I'm not the best with regexes :)
 
@TheLethalCoder goo.gl/XzWo8i
 
@Dennis Thanks :) Still borked I think but the regex101 one is fine.
 
1:36 PM
Well, you have the original link. :P
Pesky chat inserting zero-width whitespace...
 
the regex101 link is still matching everything...
 
I know... I don't think the SE folks looked at the main meta post about the zero wisth chars problem
I meant the link was working
 
it seems there's no single character that looks like {} ;-;
i wanted it to represent to JSON
 
How about stretching an 0: <-0-> :P
 
that's not a single character :P
 
1:41 PM
@totallyhuman Is something that looks like [] an acceptable alternative?
 
@totallyhuman ⦃⦄
 
@dzaima Still two chars.
@totallyhuman ⍬
 
oh
 
@Adám mm best alternative i guess
 
1:46 PM
@totallyhuman APL uses as a single symbol to denote (an alternative to) bracket indexing []. In fact, if you are in overwrite mode and go back to a [ and type ] you get a .
 
@StepHen that's just a letter :P
 
@totallyhuman JSON uses {name:value} and [value,value]. Put the colon from the objects into the brackets of the arrays [:], then close the horizontal gaps to form a whole character:
 
@TheLethalCoder I suggest turning on single-line mode for . to match newlines as well
 

« first day (2369 days earlier)      last day (2457 days later) »