5 ms·
is it practical in any way?
by funkisjazz 6y ago
is it practical in any way?
- mythz 6y agoYes, for winning IOCCC competitions! Which would normally be a great CV badge to demonstrate your skills to prospective employers, but likely of little consequence if you're Fabrice.
- jacquesm 6y ago> Which would normally be a great CV badge to demonstrate your skills to prospective employers Not many employers would know of the IOCCC.
- bregma 6y ago> Not many employers would know of the IOCCC. Sure. But who wants to work flipping burgers, greeting shoppers, or doing web front-ends for the rest of their life?
- regularfry 6y agoIf you have the sort of brain that makes winning IOCCC entries, it is highly probable that a candidate employer who has not heard of it is not, in fact, prospective.
- bidirectional 6y agoAnyone interviewing an IOCCC winner probably has.
- f00zz 6y agocan confirm source: won the IOCCC
- em500 6y agoIt's probably of little consequence for his employment, but Bellard has won a few IOCCC prices: https://www.ioccc.org/winners.html#B https://www.ioccc.org/winners.html#B
- scruffyherder 6y agoAt one point a variation of it could compile a Linux kernel (very fast too!) and boot from the same ISO. Of course GCC or LLVM produced better optimised code, but TCC, being so small runs so much faster.
- notorandit 6y agoIt isn't as it compiles a subset of c. Nonetheless it's a gem!
- wolf550e 6y agoSuppose you want to defeat a "Reflections on Trusting Trust" attack and bootstrap a toolchain source code you believe is clean to produce binaries that are clean. You need to compile llvm/clang (or gcc). You start with something small you can audit manually, use it to build binaries that can compile llvm, then use llvm to build itself to get an optimized compiler that doesn't have malicious code to recognize the password check inside the login binary and emit machine code that is not faithful to the source code.
- Drakim 6y agoHow do you know that your text editors aren't compiled to hide the payload when examining this compiler, thus perpetuating the hidenness?
- xmodem 6y agoIf you wanted to solve for that, you would have to build a computer like the monster6502 [1] to run the compiler on, and visually inspect the memory contents. 1: https://monster6502.com/ https://monster6502.com/
- MawKKe 6y agoHow do you know the person who designed that isn't in on it?
- archi42 6y agoThe thing is pretty easy to verify. The ultimate question is: How far do you need to go until you believe that the earth is indeed not flat? Do you trust your teachers? Stand on a tall building? Take a balloon ride? A plane? A spaceship? Then still, at which point can you rule out that the earth just appears to be a ball due to some yet-to-be-explained phenomenon (gravitational anomaly?) but is indeed flat? (The correct answer of course is "turtles all the way down").
- 6y ago
- cb321 6y agoAnother practical application is using tinycc as a backend compiler for Nim [1]. I set up my nim.cfg to default to this for a rapid edit-compile-test cycle (usually under 250 millisec), with a quick define switch to move to gcc-optimized code. Similar is likely possible for other prog.langs that emit C. One helpful feature for the full round-trip to an executable file is a built-in object file linker. Also, libtcc can be used as a library to "compile a string" and then run it which is the JIT application mentioned elsewhere in this thread. [1] https://nim-lang.org https://nim-lang.org
- caf 6y agoAndroid once included a library "libacc", (the Android "Almost" C Compiler") which was based on the deobfuscated version of this. https://android.googlesource.com/platform/system/core/+/eclair-release/libacc/acc.cpp https://android.googlesource.com/platform/system/core/+/ecla...