[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Is C written in C?
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 84
Thread images: 11
File: 1447801104158.jpg (59 KB, 513x472) Image search: [Google]
1447801104158.jpg
59 KB, 513x472
Is C written in C?
>>
Assembly
>>
>>55447470
yes
>>
The ISO C standard is written in English
>>
>>55447470
Fuck me if I know so have some years of story
https://www.bell-labs.com/usr/dmr/www/chist.html
>>
It's a compiled language you mongoloid.

Interpreted languages are "written" in the language that their INTERPRETER program was written in.

By that notion, I suppose if you wanted to stretch the meaning into logical absurdity, then the original C compilers were written in assembly, but are now largely written in C, I believe.
>>
>If C is so great, why didn't they use it to write C?
>>
>>55447470
Most modern C compilers are written in C so yes
>>
>>55447786
Wouldn't that be a paradox?
>>
>>55447732
whay
>>
>>55447837
No.
>>
>>55447786
What are used to compile C compilers?
>>
>>55447857
C compilers
>>
>>55447837
>>55447857
Older C compilers are used to compile newer ones
The oldest one was written in assembly
The oldest assembler was written in machine code, probably
>>
>>55447837
We have C compilers right now. Compiling a C compiler written in C isn't as crazy as it sounds.
>>
>>55447837
Look up "self-hosting."

They write the initial compiler in assembly, and when this initial compiler can compile basic C, they start writing the compiler in basic C to create a C compiler that can support more features.

They repeat until they get a C compiler that supports the entirety of the C language spec.
>>
>>55447837
no, one of the progress marks of a compiler is being able to compile itself

https://en.wikipedia.org/wiki/Bootstrapping_(compilers)
>>
This thread is so troll
>>
>>55447893
That's like a creation with no creator. Theists BTFO
>>
>>55447470
C was written by Assembly and BCPL
>>
>>55447857
Compilers can bootstrap themselves with some assembly and then continue compiling themselves.
>>
>>55447470
The bare essentials of the compiler was written in assembly. They then used the newly generated c compiler to compile a higher functioning compiler. So yes and no.
>>
File: 112737474794964.jpg (93 KB, 802x842) Image search: [Google]
112737474794964.jpg
93 KB, 802x842
>>55447470
> yfw C was written in Swift from people from the future.
>>
What is C?
>>
>>55447921
It has a creation process which is much simpler. I guess sort of like our universe anyways
>>
I hope I die before people somehow manage to write C compilers in fucking node.js.
>>
>>55448769
if they can write binary data to a file, then any language can be used as a compiler for another language.

Just some extra stupidity for doing it in node.js
>>
>>55448769
>$ gcc.js fizzbuzz.c
>>
>>55448616
It was written in Javascript by a pajeet who accidentally sent it in the past along with his feces
>>
>>55447470
Fun fact: C Standard Library in Visual Studio is written in C++.
https://blogs.msdn.microsoft.com/vcblog/2014/06/10/the-great-c-runtime-crt-refactoring/
"We have converted most of the CRT sources to compile as C++, enabling us to replace many ugly C idioms with simpler and more advanced C++ constructs. The publicly callable functions are still declared as C functions, of course (extern "C" in C++), so they can still be called from C. But internally we now take full advantage of the C++ language and its many useful features.
We have eliminated most of the manual resource management in the code through the introduction of several special-purpose smart pointer and handle types. Enormous functions have been split into smaller, maintainable pieces. We have eliminated 75% of the conditional compilation preprocessor directives (#ifdef, #else, etc.) by converting internal implementation details to use C++ features like templates and overloading.
[...] As part of this work, we’ve completely rewritten the core implementations of the printf and scanf functions (now with no #ifdefs!). This has enabled us to implement the remaining C99 features for the stdio library, to improve correctness checks in the library, and to fix many conformance bugs and quirks. Just as importantly, this work has enabled us to discover and fix substantial performance issues in the library."
>>
File: 1467435060765.jpg (60 KB, 960x754) Image search: [Google]
1467435060765.jpg
60 KB, 960x754
Maude System is written in Maude System: http://maude.cs.illinois.edu/w/index.php?title=Maude_download_and_installation#Full_Maude_2.7
>>
>>55447786
nope - at least gcc, clang and visual c++ are written in c++
>>
>>55448769
I am going to write a terrible translator from C to node and let you know just before letting it loose on a small c compiler.
>>
>>55449804
I don't get it.
>>
How can C be real if the compiler isn't real?
>>
>>55447470

C was written in your moms juices.
>>
>>55450065
Really makes you think...
>>
GCC was written in BASIC. Fact.
>>
>>55447470
It's written in C++, if you consider the two main compilers, GCC and Clang/LLVM.
>>
>>55447470
is english written in english?

are eyes visible to eyes?

do mirrors mirror mirrors?
>>
>>55449804
bullshit, I love i3 and good luck starting that without the wiki/someone showing you the default keybinds
>>
>>55450763
i love i3 myself, but when it comes to throw away interfaces like on many websites, the quote is true

>tfw alt+shift+q doesnt work on windows
>>
File: 1350957123746.jpg (24 KB, 484x530) Image search: [Google]
1350957123746.jpg
24 KB, 484x530
>>55447748
>>
>>55447732
>the original C compilers were written in assembly
They were written in B, though.
>>
>>55447748
Well, they basically did. The early C compilers evolved along with the language they were written in.

Sun's Java, on the other hand, is written in C++.
>>
>>55449854
I don't know about CLang, but GCC is most certainly written in C. I'm sure the C++ front-end may be written in C++, though.

MSVC++ is a C++ compiler, so it wouldn't be strange at all if it is written in C++.
>>
>>55451339
there are many JVM implementations that are written in Java
>>
>>55447470
so how was the first C compiler compiled?
>>
>>55451424
I'm sure, but I don't think any of them are really competitive.
>>
>>55451442
>write the first one in assembly
>subsequent versions can compile with itself
>>
>>55447535
>>written
>>English

lmao
>>
>>55448635
The language of the gods.
>>
>>55447732
Confirmed for not understanding how this works.
>>
>>55447470
All languages start out in assembly. Most modules and compilers are written in the language that they use, because the basis for the language is already there,
>>
>>55452329
yea but how did they write assembly?
>>
OK fucking retards

A compiler compiles C into 1's and 0's.

Everything that is a program must be read as a 1 or 0

Thus, once you have one program (complier) that is now in 1 and 0 form you can compile the new compiler in C into 1's and 0's

UNDERSTAND THAT SHIT RUNS IN 1'S AND 0'S

NOT IN C

C is a way to make it easy to make the ones and zeros mean something and understand it
>>
>>55447470
C is not a program thus is a language so the answer is NO
>>
File: image.jpg (56 KB, 640x609) Image search: [Google]
image.jpg
56 KB, 640x609
>>55450763
its clearly talking about gooeys
i3 is TUI
>>
>>55452443
c compiles into assembler though
>>
>>55452443
Wow really makes you think
>>
>>55451453
>>>55451424
>I'm sure, but I don't think any of them are really competitive.
Dalvik/ART
>>
File: 1411794385255.png (90 KB, 500x500) Image search: [Google]
1411794385255.png
90 KB, 500x500
>>55447502
what's assembly written? binary?

what's binary written? switches going on and off? what's that written in?
>>
>>55452921
True although people couldn't understand so I made it as basic as possible

>>55454861
When you get down to that level you start to take into account circuit architecture, and switches turning on and off is not gates etc...

If you want to know more about how that works look into VHDL (very high speed descriptive launguage) which is basically a way of planning the architecture controller. It becomes electrical engineering etc...

I.e. Go to fucking university and learn this shit then come out and earn big bucks, it is not for simpletons

Source: umm I am electrical engineer it my job??
>>
>>55451357
>GCC is most certainly written in C
most certainly not:
https://lwn.net/Articles/542457/
>MSVC++ is a C++ compiler
it's both c and c++ compiler
>>
>>55447470
Yes. Thompson and Ritchie switched their compiler over from assembly to C as soon as they had a powerful enough compiler to do it.
>>
>>55454828
Neither Dalvik nor ART is written in Java.
>>
>>55452921
Only as an intermediate language, really. The primary output of the vast majority of C compilers is relocatable object code.
>>
>>55454861
>what's assembly written? binary?
Originally, yes, but these days there's no need to as there are many native code generation tools available to use instead. There's no reason to write an assembler directly in machine code when you can just write it in C instead.

>what's binary written? switches going on and off? what's that written in?
Originally, this is what front panel switches were used for. These days, you'd use a hex editor instead if you'd really need to do so for some reason instead of using a higher-level tool.
>>
File: c.jpg (4 MB, 4636x2173) Image search: [Google]
c.jpg
4 MB, 4636x2173
>>55456960
Forgot picture.
>>
>>55455240
Go back to quora
>>
File: c.jpg (977 KB, 3360x2248) Image search: [Google]
c.jpg
977 KB, 3360x2248
>>55456960
Into the micro era, you also have chip programmers like pic related.
>>
File: 1428972849003.jpg (20 KB, 500x500) Image search: [Google]
1428972849003.jpg
20 KB, 500x500
>>55447536
Nice read. Thanks, anon.
>>
>>55447470
You dumb is obvious
C is written in B
and B is written in A
>>
File: 1419319036984.jpg (29 KB, 300x260) Image search: [Google]
1419319036984.jpg
29 KB, 300x260
>>55449755
>Linus' face when
>>
>>55448769
and why not? i mean there is no point but what makes you pick node.js in particular? Its just a bad choice as python would be but it would still work and with enough effort possibly beat gcc.
>>
File: 1439096541854.jpg (49 KB, 540x540) Image search: [Google]
1439096541854.jpg
49 KB, 540x540
>>55455240
Thanks for the explanation, anon. It covered a gap or two.
>>
>>55450763
I wouldn't say that a window manager is the type of user interface that that's talking about.
>>
>>55447837
no, because adding support for new plaftorms is done via cross compilation, so no need to bootstrap them from scratch.
>>
>>55452368
Assembly just corresponds to a location in memory to write to or read from, and what to do with that data inside the execution unit.

The computer reads it as machine code, which is just 1s and 0s.

Assembly is usually written by the people that made the processor to correspond with the instruction set. Most assembly today is based off of the assembly written for the Intel 8086, which is why it's called x86.
>>
Dumb Lisp/Python/JS n00bs think C is magical because you can write a compiler that can compile itself.

CS students are fucking retarded these days, but that's what happens when schools fall for the SICP meme and think that's a legitimate way to teach CS.
>>
>>55447470
You write C
Then you compile by hand
Then you write some more C
And with the hand-compiled software you compile the new code
And repeat.

C is written in C.
>>
>>55460755
the idea shouldn't be magical to lispers, SICP has a whole section on the metacircular evaluator
>>
>>55447470

It was probably done in somethign similar to BASIC
>>
>>55455240
>Source: umm I am electrical engineer it my job??

and you were doing so well
Thread replies: 84
Thread images: 11

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.