6 ms·
27th International Obfuscated C Code Contest winners published
- deleted 6y ago[deleted]
- deleted 6y ago[deleted]
- lldbg 6y agoThe highlights include a game of tic-tac-toe solely in several calls to printf(fmt, arg), where fmt and arg are carefully chosen. This made me reflect on whether good language design should limit expressiveness of code?
- nemo1618 6y agoMy latest PL idea, inspired by Rust's "unsafe {}" blocks is "expressive {}" blocks. The "base language" would be boring, pedestrian, optimizing for zero surprises. But inside an expressive{} block, you could have macros, operator overloading, DSLs, first-class continuations, you name it.
- owl57 6y agodragons {}
- bidirectional 6y agoI had a similar idea upon seeing the power of incredibly terse languages like k and q (both still used in a lot of investment banks). The core language would be boring and imperative, for plumbing, but you'd also be able to write and evaluate array language expressions as a first class construct.
- saagarjha 6y agoAccidental Turing completeness isn't necessarily a problem in a Turing complete language ;)
- schoen 6y agoThe author of this program also wrote a paper about the technique it uses https://www.usenix.org/system/files/conference/usenixsecurity15/sec15-paper-carlini.pdf https://www.usenix.org/system/files/conference/usenixsecurit... describing it as a way of circumventing security measures that try to ensure that a particular control flow is followed in a compiled binary. In that case the security goal could be seen as forcing the compiled program to behave in a way close to what a human writer (or reader) would expect, while this method gets around that. So in that way, it could still be a problem, because the programmer appeared to write specialized program X but it can potentially be induced to behave like unrelated program Y at run time.
- IQunder130 6y agoIt is a problem when the language is being used to get anything done in the real world.
- raverbashing 6y ago> This made me reflect on whether good language design should limit expressiveness of code? Yes, I think so. "Smart" code is smart for 5 min, after that it becomes a liability
- woofie11 6y agoThe former doesn't follow from the latter. For tools I use and places I want to work: * Programming languages should be general. * Programmers should be competent and disciplined enough not to misuse that generality. I absolutely hate programming in languages like Java, designed for idiot programmers. I understand their place -- there are a lot of incompetent programmers, and we need to constrain them, and a lot of places with boring IT problems who won't be able to hire competent people -- but it's not something I'd ever want to touch. That sort of workplace and that sort of language would make me miserable.
- qayxc 6y agoTo quote a man I consider to be both, very intelligent and wise: > Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
- woofie11 6y agoI don't consider that man particularly wise. Clever has many different axes. Compare debugging something like git or hg (clever, simple data structure) to cvs or svn (non-clever, standard data structure). Systems like git and hg don't just do more; they're also far more debuggable thanks to clever. That's not an IOCCC type of cleverness, but a deep, deep clever. Likewise, consider general-purpose data stores (such as a KVS or an RDBMS) compared to a one-off data structures mapping directly to your data. The design of the original RDBMS was hyper-clever. A wise man knows when to be clever and when not to be clever. I don't know of any programming language designer who can make that determination for me; it's too domain-specific. If you can rely on programmers to not be clever for inane reasons, you can allow them to be clever for architecturally-critical reasons.
- bawolff 6y ago%n has caused many a security vulnerability.
- Kalium 6y ago> This made me reflect on whether good language design should limit expressiveness of code? There's a magic to a sonnet that isn't found in blank verse. Limitations can do a lot to improve writing.
- mightybyte 6y agoHere's a nice talk that goes into this dichotomy a bit. https://www.youtube.com/watch?v=GqmsQeSzMdw https://www.youtube.com/watch?v=GqmsQeSzMdw
- deleted 6y ago[deleted]
- Stevvo 6y agoThe winning entry is very creative! https://www.ioccc.org/2020/carlini/prog.c https://www.ioccc.org/2020/carlini/prog.c
- ufo 6y agoOn the topic of printf("%n"), I remember hearing a fun story about that a while ago. It appears that in certain Mazda cars it was impossible to play the "99% invisible" podcast on the car stereo (and only that podcast), because attempting to do so would crash the software. https://99percentinvisible.org/episode/the-roman-mars-mazda-virus/ https://99percentinvisible.org/episode/the-roman-mars-mazda-...
- aidenn0 6y agoOh, I loaded up my music on a USB stick for my 2018 Mazda. I ended up having to strip most of the vorbis comments or really strange things would happen. I'd see things like contents of other comments appear inside the title or artist field; the implementation must be buggy as all hell. I wrote a program that strips it down to just album, artist, and replaygain tags, and that seems to not cause too many problems.
- stiray 6y agoBeautiful :D https://www.ioccc.org/2020/tsoj/prog.c https://www.ioccc.org/2020/tsoj/prog.c
- 37ef_ced3 6y ago"The code is made more difficult to read using an innovative, right justified, reverse indentation style."
- dane-pgp 6y agoIt's great that this contest has been running for so long and still produces interesting new approaches, but I wish there were more work being done in the field of underhanded code contests, e.g. [0]. One area of technology that seems to have continued the work of discovering underhanded techniques is the realm of cryptocurrency, specifically the "Solidity Underhanded Contest". The results for 2020 are here[1], which links to (spoiler alert) a great trick on line 65 here[2] (select the line character by character with a mouse to reveal it). [0] https://en.wikipedia.org/wiki/Underhanded_C_Contest https://en.wikipedia.org/wiki/Underhanded_C_Contest [1] https://blog.soliditylang.org/2020/12/03/solidity-underhanded-contest-winners/ https://blog.soliditylang.org/2020/12/03/solidity-underhande... [2] https://github.com/ethereum/solidity-underhanded-contest/blob/master/submissions_2020/submission11_RobertMCForster/contracts/TimelockUpgrade.sol#L65 https://github.com/ethereum/solidity-underhanded-contest/blo...
- jcranmer 6y agoOne of my favorite programs was one where every single variable looked like 'K' but was different (there's K, Κ, K, 𐌊, 𝖪, К, Ꮶ, Ⲕ, etc.), and all of the strings were encoded in Roman numerals, e.g. ⅲⅰⅶⅺⅲⅶⅳⅰⅰⅳ.
- kregasaurusrex 6y agoI agree wholeheartedly- found about the Underhanded C Contest through an HN thread and enjoyed reading through the submissions every year. Sadly it seems to have not been run since 2015.
- userbinator 6y agoGreat example of why Unicode and source code do not mix well... it reminds me of when I taught CS courses and had a few instances of very confused students who managed to somehow get one of those "invisible formatting characters" into their files. Fortunately, a hexdump --- or even just an "old school" ANSI-only editor --- reveals all.
- andreareina 6y agoEmacs and IIRC vim highlight control characters and nonstandard whitespace. I kinda thought it standard for code editors.
- x87678r 6y agoLooks like the pretty formatting is poplular. All the people that complain of Python layout should be jealous of this one: https://www.ioccc.org/2020/yang/prog.c https://www.ioccc.org/2020/yang/prog.c
- panic 6y agoMore by the same author: http://uguu.org/sources.html http://uguu.org/sources.html
- szc 6y agoSpeaking as a judge of the 27th competition, formatting doesn't give an entry as much of an advantage as you might think - what it does beyond the formatting has more influence. Code "quality" is always evaluated after pre-processing and restructuring. Credit is definitely given for compactness, functionality, uniqueness and the handling (exploitation) of boundary conditions. Quite often there is something that "has not been seen before" - those entries do have a greater chance of being picked. The Ig-Nobels are seen as anti-Nobels. It is somewhat ironic that one of the few programming accolades you can be awarded is for writing code that will win an IOCCC award. Of python: I am quite biased against the language - there are limited ways to speak or communicate it to a blind or deaf person. Python relies on the physical layout and structure to be semantically correct. (Python correctness does not survive whitespace or silence removal - which requires both working eyes and ears)
- Santosh83 6y agoCan you explain more about what you mean by silence removal and Python code's fragility? What does sound have to do with source code?
- ivanbakel 6y agoHow would a blind person code? They need a way to convert text on-screen to sound (or haptic feedback). Such a program can be easily used for C, because all the structure of C code is explicitly marked by its syntax - opening and closing braces, semicolons, macro beginnings and endings, etc. A C code reader can skip over any amount of whitespace, because none of it is semantic. A Python screen reader would not have the same power. It would somehow have to communicate the significant whitespace to the user through sound. You cannot "remove the silence" when listening to a Python program, in the same way that you cannot strip out whitespace without changing the behaviour of the program.