« first day (2586 days earlier)      last day (2260 days later) » 

ngn
2:01 PM
we should measure everything in number of and-gates :)
 
0
A: Sandbox for Proposed Challenges

LaikoniNon-discriminating Programming code-golf restricted-source decision-problem string We say a string is non-discriminating iff each of the string's characters appears the same number of times and at least twice. Examples aa!1 1 !a !1 is non-discriminating because each of the characters , !, a ...

 
@ngn And how would you go about and count those?
 
ngn
@Adám it would be very hard to do in retrospect, but theoretically it's possible to implement every algorithm with circuits consisting only of and- and or-gates
 
@ngn How do you implement NOT(x) using only AND and OR?
 
@ngn I think it's NAND and NOR gates which are capable of doing that (each on their own), not AND and OR
 
ngn
2:08 PM
@Adám ok, you caught me: we also need constants 0 and 1
 
@EriktheOutgolfer It is well known that either one of those two will do.
 
@Adám ah, you ninja'd my edit
 
ngn
@Adám if you have NOT, yes
 
@ngn No. NAND or NOR is enough. No NOT needed.
 
NAND(A,A) == NOT(A)
 
ngn
2:10 PM
@Adám you're right, I spoke unprepared
 
@ngn Highly unusual to see you blunder in CS/formal logic statements so thoroughly. Are you feeling ok today?
 
ngn
but still, circuits would be a genuine, almost physical measure of complexity
@Adám what!? I make mistakes all the time :)
 
@ngn Heresy!
@ngn But I was asking for a way to compare , not .
 
@Adám what, you never make mistakes? ;)
 
@EriktheOutgolfer Surely I do. Loads. But ngn‽
 
2:14 PM
Apr 23 '17 at 16:41, by Dennis
Everyone makes mistakes, no matter how closely they pay attention. Errare humanum est.
 
@EriktheOutgolfer humanum.
 
@EriktheOutgolfer There's a song by a brazilian artist called Errare humanum est.
 
@Adám Are you implying ngn is not totally human?
 
@Mr.Xcoder ⍤
 
@Mr.Xcoder ... when some users have annoying names ...
 
ngn
2:16 PM
@Mr.Xcoder oh, no, we've been discovered! fire up the spaceships, quick...
 
@user202729 annoying... Not at all!
 
@user202729 what is annoying in ngn's name? it's simply his initials...
 
(totallyhuman in this case)
 
@Mr.Xcoder @EriktheOutgolfer totallyhumanngn
 
I said totally human, not totallyhuman :P
 
2:18 PM
@Mr.Xcoder spaces are removed when referring to users.
 
@Adám yay I discovered a new species the ngns!
 
@ngn Can you fly over Rio so I can come with? ⍨
 
ngn
@J.Sallé sure, as long as Rio isn't covered with a metre of snow like my hometown is right now :)
 
@EriktheOutgolfer alienus ngnus
 
@ngn Hah! I wish. It's currently a mild 30ºC here :p
 
2:23 PM
 
@Adám why would you link to an image instead of the actual xkcd
 
@EriktheOutgolfer That's why ^^
 
@Adám you can reduce it by making it a link ;)
 
:43097607 that would remove most cities on that map :p
 
ngn
@Fatalize I went too far off-topic...
 
2:27 PM
politics is a dangerous subject to start here
 
ngn
so, seriously, I think we need a better measure of complexity than number of bytes in any language with any encoding
 
@ngn Why?
 
CMC: Implement XOR using only NOT and AND for computation.
 
ngn
@user202729 because instead of genuinely simplifying things (which I see as the goal of golfing), people tend to push complexity into their languages
 
@ngn You can make a language such that simpler code are shorter and invite people to use it.
(if it's sufficiently interesting to use people will use it)
 
ngn
2:31 PM
@user202729 and what will happen? languages that sweep complexity under the carpet would still win
 
@Adám uh, any proof that you can implement an OR gate with AND gates?
 
@ngn But competitions are not between languages, it's between people using the same language. What's the problem?
@EriktheOutgolfer There are NOT too.
 
@EriktheOutgolfer Yes, if you mean together with NOT.
 
ngn
@EriktheOutgolfer a or b = not(not(a) and not(b))
 
@EriktheOutgolfer You can construct every gate with NANDs
 
2:32 PM
@ngn ah, missed that
 
Then... x xor y = (x and not y) or (not x and y) = not(not(x and not y) and not(not x and y)).
5 nots, 2 ands.
 
@user202729 Right, but I want to see actual working code.
 
ngn
@user202729 if you put it that way, there's no problem; but in reality languages compete for attention/upvotes
 
Jelly:
 
@user202729 What?
 
2:34 PM
@user202729 that will always result in 0
 
@ngn Then the upvotes are problematic.
 
@ngn that's a long-discussed issue :)
 
136
Q: J and GolfScript suck all the enjoyment out of Code Golf

TimwiI have found code-golf a fascinating pastime for several weeks now. However, I’m already losing interest because the contests allow any language, and because of that it is pretty much impossible for anything other than J or GolfScript to get anywhere close to winning. As soon as I see a less-tha...

 
ngn
@user202729 "Apr 4 '11" - i knew it would be a very old post, just from reading the title :)
 
2:37 PM
@Fatalize What is .&?
 
lol . and & are two separate things
 
@ngn Yes, both J and GolfScript is not very competitive now.
 
@user202729 yeah, I downvoted that question solely because of the title.
 
@J.Sallé ...?
 
Stating your opinion as a given fact is bad.
 
ngn
2:38 PM
@J.Sallé are you stating that as a given fact? :)
 
@J.Sallé why? the point it tries to get across is still imminent today, even though J and GolfScript are not the example of sheer shortness of code anymore
 
of course, if you disagree with the content, you can downvote freely
 
@ngn that's kind of a scientific consensus >.>
 
Jello and 05UNABLE suck all the enjoyment out of Code Golf
 
2:40 PM
@user202729 I'm not sure which message you're responding too
 
@EriktheOutgolfer I think they are saying that "<the title>" is just the OP's own opinion, it's not a fact.
 
@EriktheOutgolfer yes, the point is valid. Phrasing it as if it were absolute truth is not.
 
@DJMcMayhem The one on the starboard about Grace Note.
@DJMcMayhem (why can't you just follow the response link?)
 
I don't have a response link
 
@Adám that's a lot of nots :p
 
2:41 PM
Maybe that's just mobile being weird
 
@J.Sallé Can you do the CMC shorter?
 
Ah yeah, that's it. Replies don't show up in the transcript
 
excuse me... what?
somebody should raise that to mother meta if it hasn't already been raised, this is a very serious issue
7
 
star for community attention
 
@DJMcMayhem You're right, they don't on mobile (only).
 
2:44 PM
@Adám probably not >.> I could try in a couple
 
⍨ nobody likes my CMC
 
ngn
@Adám too easy
 
@Adám it's very trivial
 
@ngn Oh yeah? You try.
@EriktheOutgolfer Remember you have to golf.
 
@Adám oh wait, should it be in code?
 
2:47 PM
@EriktheOutgolfer Yes. As CMCs always are. It says Implement, not Define.
 
Don't require unobservable behavior...
 
Python, trivial implementation: lambda x,y:not(not x and not y)and not(x and y)
 
@user202729 CMC; it's ok.
 
I have no idea what the challenge is, anyone can find the formula online
 
ngn
2:48 PM
ok, my turn to say the magic word: CMC: think of a better measure of complexity than "number of bytes in any language in any encoding"
 
Python, golfed implementation: lambda x,y:~-(~-x*~-y)*~-(x*y)
 
It's not ok. Wherever PPCG users are involved, they will do everything to shorten their code.
@ngn Define "better"?
 
@HyperNeutrino OK, * is indeed AND, but what are ~ and -?
 
ngn
@user202729 good point! :)
 
@ngn VTC as unclear.
 
2:49 PM
@Adám ~- is basically logical not. 1 -> 0 and 0 -> -1.
 
@user202729 One where APL wins :)
 
@ngn "number of bits in any language in any encoding"
well, it's certainly more specific
 
ngn
@H.PWiz I'm no longer affiliated with Dyalog, I don't care :)
 
@ngn Time spent golfing an initial solution to its final state
 
The problem is not the scoring, but the upvotes. As I have said.
 
2:50 PM
@Emigna lies, lies, all lies...
 
@ngn Time to implement solution.
 
(and the upvotes are based on HNQ visitors who say "Ohhh cool! That is a program??!??! Upvotes!!!" and don't read meta)
 
ngn
@Unihedron yeah, it's strange nobody has taken advantage of variable-length encodings (like Huffman's) yet
 
@Adám . is the output variable. & is ∧?, so and followed by input variable
 
@ngn Binary Lambda Calculus.
 
2:51 PM
@Fatalize OK, looks valid then.
 
ngn
@Adám that's not an objective criterion - it depends on the implementer
 
(00 is lambda, 01 is application, 111..110 is variable, IIRC)
 
@ngn Normalised of course ;-)
 
I'm frankly suprised that there isn't a language with tens of thousands of 2 byte built-ins yet
 
Well, you never mentioned neither objective nor observable :P
 
2:52 PM
@Adám ...I don't want to be "normalized" please, I'd rather be a human
 
@H.PWiz Pyth has 2 bytes builtin. Jelly too.
 
@H.PWiz there are many of them
 
Did someone say Pyth?
 
e.g. Jelly, 05AB1E, CJam, Pyth...
 
@H.PWiz I'm not. That would be very resource consuming to implement.
 
2:53 PM
The real problem is we can't think of anything to fill those 65536 slots.
(except Mathematica built in functions)
 
if it's done like that then every built-in will have to be 2 bytes
 
Implementing a lot of 2 byte commands take a lot of time and a lot of them may only be usable once or twice, so effort vs reward is probably pretty low
 
I think a reasonable 1-byte commands vs 1-byte prefixes for 2-byte functions would be 250 : 6.
 
More fun to find a way to make a smaller set of commands work for any challenge
 
Yes, that's the problem.
 
2:55 PM
...and we don't want to end up with something like Burlesque, do we?
 
@user202729 Even Mathematica doesn't have that many built-ins.
 
Yes, the more built-ins, the more boring
 
@Adám See? ...
 
Then go ahead and use Brain-flak! :)
 
@H.PWiz But Unary is also boring.
 
2:56 PM
Unary is basically brainfuck
 
I wonder what the optimal commands vs enjoyment ratio is...
 
I don't think there is one, since it varies by person.
 
Unwary is not one built-in though
 
I think > Triangularity but < Pyth...
 
@Emigna Define "enjoyment"? People enjoy Mathematica and minimal esoteric languages the different ways.
 
2:57 PM
Clearly Dennis and a lot of others enjoy jelly, but clearly me and wheatwizard and others enjoy BrainFlak
 
2 hours ago, by ngn
@Adám J = big vocabulary; k = small
 
Obviously there isn't a definitive answer. As DJ says, it will vary by person and likely by challenge as well as over time also
 
You also know Jelly ಠ_ಠ :P
 
@Emigna the question you should be asking is the optimal number of commands for golfiness, given that there are 256 different possible bytes
 
@EriktheOutgolfer That is definitely an interesting question
 
2:58 PM
(fact: most of the infinite bounties are about minimal languages)
@EriktheOutgolfer That varies for different challenges.
 
Sure they are, this site is esoteric :)
 
If I didn't feel like there were enough golfing languages already I'd probably make one of my own and try to find the optimal ones
 
looking forward to Jelly v2
 
ngn
@EriktheOutgolfer I expect to see one day: MySuperCoolLanguage, 2.125 bytes :)
 
@Emigna and maybe extend the question to also include predicting the future...ah, there isn't anything like "non-competing answers" anymore
 
2:59 PM
@ngn There had been some disputes about that.
 
@ngn How would you store fractions of bytes in a file though?
 
(fact: 7 (esoteric language by ais523 inspired by Underload) has 8 builtins and each take 3 bits)
 
@Emigna Use a file system that allocates bits.
 
ngn
@Emigna there's no requirement to store it in a file, is there?
 
@ngn Is there any other ways?
 
3:01 PM
@Adám Is there such file systems?
 
@ngn how would you store it anywhere, not just in a file
 
ngn
@user202729 you could store a file containing the length in bits, followed by the sequence of bits rounded to the nearest whole byte
 
@Emigna One could make such a system for the language.
 
> undefined bytes (it's complicated)
 
So... make a golfing OS. Anyone?
 
3:01 PM
Seems like a lot of work...
 
@user202729 as long as i don't have to write the bootloader (shiver) sure
 
@Mr.Xcoder 7 has 2 modes
 
ngn
@user202729 good idea :) I think I've seen such challenges - something to do with the numlock LED
 
@user202729 kOS
 
@ngn well, the numlock LED can be turned on in under 512 bytes using the BIOS
 
3:03 PM
@moonheart08 512 are a lot.
 
512 is the max size of the bootloader that the bios can see, so it's a good base mark
(Yes, BIOS is that far in the legacy chain.)
 
@Adám I love that this site's called vector.org
 
@J.Sallé Unfortunately it's dying. Nothing to publish…
 
@J.Sallé vector.org.uk
 
ngn
what I read in the past half hour or so makes me wonder: what is the purpose of golfing?
 
3:08 PM
@ngn fun
 
@ngn For fun, of course.
(nowadays there are more than enough memory such that real life doesn't need code golfing)
 
Fun –> A bit of joy in Life –> Why life? –> Depression :|
 
ngn
@user202729 I would argue, golfed code is better code as a side effect of the fun
 
@ngn Readable code is better.
 
I don't concur
 
ngn
3:10 PM
@user202729 "readable" is not the opposite of "golfed"
@user202729 readability is in the eye of the reader
 
For most languages it is.
 
... Ok, I can't read your C code. I won't argue about that.
 
ngn
@user202729 I can't read most of the languages used in ppcg, but I'm sure I'd be able to if I spend enough effort to learn them
 
@ngn Indeed it is. I'd say The Powder Toy is a good example of this, only half the codebase is readable from any one perspective at any time lol
 
3:12 PM
As long as the line is not too long, the code is pretty readable.
One of the problems with golfed code is useless variable names.
(which can be sort-of solved with a comment at the variable declaration with the long name)
 
ngn
@user202729 that's what I usually do, if it's not clear what the variable is for
 
Then anyone reading the code at another position need to look at the declaration if they find the code hard to understand. Without an IDE that's not too easy.
 
ngn
@user202729 However I don't understand why so many people like to sprinkle spaces everywhere to make their code more "readable".
@user202729 um... why do you need an ide to just look?
 
It may be more convenient for longer code.
 
ngn
@user202729 I assumed that the declaration would be on the same page as the use...
 
3:20 PM
tfw one of your sysadmins has their terminal colors set as white text on a pink background
7
wowsers
 
ngn
@user202729 if a function takes more than a pageful of code, it probably needs rewriting
 
@ngn unless you're trying to use an age-old framework to parse multidimensional cubes in Java.
 
@ngn do you work in a programming field?
 
Then, if your functions are shorter than a pageful of code, they probably won't work.
 
@ngn Who says it must be a function?
 
ngn
3:24 PM
@user202729 right, I shouldn't assume it's a function
@user202729 whatever unit of code is using the variable
 
... fine. I will try to golf my code and see what's the result.
 
@ngn probably for the same reason people use newlines
 
ngn
@Poke yes. do I sound like I'm not? :)
 
(but without using namespace std;. What do you think about define?)
@Poke Because code editors don't linewrap?
 
ngn
@Poke you mean superfluous empty lines?
 
3:27 PM
Thank god they don't
 
@ngn You sound like you do. I just wanted to point out that in your programming career you're going to see well written code but you're also going to see poorly written code. You're going to see functions that take more than a page and you're going to see functions which have the sole purpose of calling another function. Sure you can say it /should/ be written this way or that way but that doesn't mean it always will.
@user202729 I don't use newlines because editors don't linewrap, haha. I use them so that I can read what I'm writing :P
Personally I'd rather someone logically space things out to make it easier to read
for the same reason I'd prefer to have syntax highlighting whenever possible
now that doesn't mean add superfluous newlines or spaces
gotta hit that sweet spot
 
@Poke I don't think I can code without syntax highlighting
Well, I could, but goddamn it would be a pain
 
@J.Sallé Golfing languages never have syntax highlighting. AFAIK.
 
ngn
@Poke right, it's just that so many people err on the side of verbosity and too much whitespace everywhere
 
@ngn well that's subjective
int a;

a = 1;

a++;
 
ngn
3:32 PM
@J.Sallé I can't give up syntax highlighting either, though I've seen clever people refuse to use it
 
that's too much
but something like this:
int a = 0;

if (a == 0) {
...
}
is acceptable
 
int          a              =             0                 ;



if        (         a           ==        0       )        { ... }
 
ngn
@Poke I disagree on that one, but I get the point you're making - there's a balance and it depends on the taste of people who work with the code
 
Determining the proper amount of whitespace is similar to determining if something is obscene or not... I'll know it when I see it :P
 
@HyperNeutrino +1, clearly the best choice
 
ngn
3:35 PM
@Poke when you pack more stuff on a page, you are able to look at different parts of the code just by moving your eyes; you don't have to scroll to remind yourself what such-and-such function is doing - that's very precious when working with complex code
 
@user202729 that's why I exclusively golf in APL ⍨
 
@ngn are you an analyst or a coder :P
 
@ngn my boss sometimes codes on our shared Google Keep page. I can't even begin to comprehend how
 
ngn
@Poke currently an idle coder, reflecting on the art of coding :)
 
Personally I find that throwing more screen real-estate at a programming problem helps more than packing as much code onto one page as possible
 
3:37 PM
@Poke He was definitely a coder at Dyalog.
 
@ngn syntax highlighters aren't error-free
 
I'm curious how *much* syntax highlighting you guys typically need/look for. There are at least 3 distinct levels:
1. The basic, regex-based, "this is a keyword, this is not"
2. The context-sensitive, "This is referencing a local variable/global variable/function" or "I'm inside of a function" highlighting.
3. The full-blown, compiler required, "This is a variable of type X that has these functions"
 
@NathanMerrill Dyalog APL's is 2.
 
What about "I'd rather not use syntax highlighting"?
 
ngn
@EriktheOutgolfer they can work even if they're a bit faulty... my point was that some people say that colour distracts them
 
3:40 PM
@cairdcoinheringaahing you should have mentioned something like 20 chats ago :P
 
I don't pay that much attention when a conversation goes on (unless I'm involved) :P
 
@NathanMerrill This is the best kind of syntax highlighting IMO. I believe it fits somewhere between 2 and 3
 
ngn
@NathanMerrill I guess I use something close to 2.
 
Possibly my favorite java-ism
 
it's not spam, just delete-worthy
 
3:43 PM
 
@J.Sallé I believe that that is #2. #2 is able to take snippets of code and determine context. #3 is very much project-level type highlighting where you take lots of files and determine types and such
 
hint: that returns false
 
this is the IDE-required level of highlighting
 
@EriktheOutgolfer yep, I didn't say it was spam
but ty caird, adam
 
@NathanMerrill Yeah, that's basically what it does.
@Poke eclipse ftw
 
3:44 PM
@NathanMerrill I think by this definition, PowerShell ISE (what I code in) is somewhere between 2 and 3, and I rather like it.
 
@J.Sallé :D I've since moved over to intellij at work
but i use eclipse keymaps
 
ngn
in k I find it appealing to highlight monadic verbs / dyadic verbs / adverbs differently
 
@Poke I actually tried to use IntelliJ for a week, and I just couldn't. I even had the same exact theme I use in eclipse, but it just didn't work for me
 
@J.Sallé i figured i may as well use the license, haha
 
@J.Sallé s/eclipse/vim/
 
3:47 PM
I don't really think that there's an in-between for 2 and 3. If it can take a function, and identify (or guess) the return type, and offer suggestions on what you can do with that type, then its a 3. If it can't, then its a 2 :P
 
@NieDzejkob HERESY!
 
0
A: Sandbox for Proposed Challenges

Kevin CruijssenFix it with Tape or a Rubber Band code-golfstringmatrix Challenge: Given a String only containing upper- or lowercase letters (whichever you prefer), spaces and new-lines, put tape horizontally or a rubber band vertically to fix it. We do this by checking the difference of two adjacent letters...

 
@J.Sallé I started with eclipse, then moved to intellij, and now I'm on visual studio. Moving between IDEs is tough because all of the keyboard shortcuts are different.
 
My main issue with Eclipse, in addition to lots of other problems, is that it has it's own build system that it forces on you that essentially requires you to have Eclipse in order to build a project made in Eclipse.
 
Jetbrains made it easier for me with resharper, but there's still lots of things I try to do the wrong way
 
3:50 PM
@NathanMerrill yes! Can visual studio do Java though, or only C#?
 
@J.Sallé what feature is there in eclipse that vim lacks?
 
minby=(xs,f)=>{
    var Ox=xs[0];var Of=f(Ox);
    for(var x of xs){
        var f1=f(x);if(f1<Of){Of=f1;Ox=x;}
    }return Ox;
}
 
@J.Sallé visual studio can do pretty much any language
 
Better code now?
 
@NathanMerrill Dyalog's editor has level 2 syntax colouring, but some level 3 checking when tokenising attempting to save.
 
3:50 PM
@NieDzejkob vim is not an IDE? :p
 
@J.Sallé Is using VS for Java a sign of insanity? Yes. Is it doable? Also yes.
 
@J.Sallé this term is very fuzzy and arguable. Anything specific?
 
@NathanMerrill ah, I see. A friend of mine aptly surmised to me that he's not at all a C# coder, he just knows how to fiddle with resharper :p
 
@NieDzejkob see #3 above. In essence, vim doesn't type-hint
 
@NieDzejkob no idea. vim is not at all intuitive though
 
3:52 PM
@J.Sallé As with everything you have to learn it.
 
@J.Sallé yes, you need to learn a bit. But the ROI is similar to the one of touch typing, IMO
 
@user202729 Why would you put the return on the same line as the }.
 
@user202729 well yeah, but you have to agree it's much easier to learn something that's designed to be intuitive, no?
 
@Pavel Avoid unnecessary newline?
 
@NieDzejkob this is true of any editor with sufficiently advanced features
 
ngn
3:53 PM
@NathanMerrill there are ways to make vim autocomplete, but when I'm forced to use Java, I prefer IntelliJ
 
@J.Sallé Intuitive is objective.
 
@user202729 I think you just solved a nonissue and mode your code ugly af
 
After I knew how to use esc in Vim I find it pretty intuitive.
 
It's not unreadable or anything. It just straight-up looks unpleasant.
 
(e.g., quit for quit, undo for undo)
 
3:54 PM
Also, you not only used an if and it's statement on the same line (acceptable), you use braces for that single statement, on the same line.
 
@user202729 you mean subjective? Either way, I definitely think that is can be objective: if you measure average time it takes a beginner to do a particular coding task in two different editors,
@ngn really? Do you have to hook it up to the language's compiler (or a third party one)?
 
@NathanMerrill Vim has plugins for everything
 
no, I get that, but those plugins would have to hook up to a compiler to get proper type-hinting
 
ngn
@NathanMerrill there are a few different ways - one is with a headless eclipse, another is with exuberant ctags
@NathanMerrill but you don't get the in-depth understanding of syntax and refactorings that eclipse or especially intellij give you
@NathanMerrill "every feature of your ide is a defect of your language" - i forgot who said that... someone famous
 
DNF just gave me updates for 60 packages named abrt-*.
 

« first day (2586 days earlier)      last day (2260 days later) »