# Is Julia able to replace C?

**URL:** https://discourse.julialang.org/t/is-julia-able-to-replace-c/45178
**Category:** New to Julia
**Tags:** question
**Created:** [August 18, 2020, 8:01pm UTC](https://discourse.julialang.org/t/is-julia-able-to-replace-c/45178 "2020-08-18T20:01:19Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Steve.jl](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@Steve.jl](https://discourse.julialang.org/u/Steve.jl)
#### Post date: [August 18, 2020, 8:01pm UTC](https://discourse.julialang.org/t/is-julia-able-to-replace-c/45178/1 "2020-08-18T20:01:19Z")

</div>

AFAIK some things are written in C to build up the foundation for Julia. Could this stuff be replaced such that everything is written in Julia and a whole OS could be written in Julia? And if so, what’s the reason for stopping it?

---

<div class="post-metadata">

### Author: ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)
#### Post date: [August 18, 2020, 8:06pm UTC](https://discourse.julialang.org/t/is-julia-able-to-replace-c/45178/2 "2020-08-18T20:06:20Z")

</div>

Previous discussions of this:

- [https://groups.google.com/g/julia-users/c/6FJ65U7n73M/discussion?pli=1](https://groups.google.com/g/julia-users/c/6FJ65U7n73M/discussion?pli=1)
- [https://github.com/JuliaLang/JuliaParser.jl/issues/78](https://github.com/JuliaLang/JuliaParser.jl/issues/78)
- [Julia written in Julia? - #13 by yuyichao](https://discourse.julialang.org/t/julia-written-in-julia/25781/13)

I think a fair summary is that implementing Julia in Julia is possible but would require a lot of effort without a clearly worthwhile reward.

---

<div class="post-metadata">

### Author: ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)
#### Post date: [August 18, 2020, 8:09pm UTC](https://discourse.julialang.org/t/is-julia-able-to-replace-c/45178/3 "2020-08-18T20:09:06Z")

</div>

It’s also worth noting that — unlike other languages — the _vast_ majority of Julia (and nearly all the important parts) are indeed written in Julia.

---

<div class="post-metadata">

### Author: ![anon37204545](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@anon37204545](https://discourse.julialang.org/u/anon37204545)
#### Post date: [August 18, 2020, 8:46pm UTC](https://discourse.julialang.org/t/is-julia-able-to-replace-c/45178/4 "2020-08-18T20:46:19Z")

</div>

While Julia is a general-purpose language, compared to C it has a less direct interface to the low-level manipulations. Those are required to build an operating system for example. Julia even has a direct interface to C, but why write C in Julia for those purposes when you can just write C? Or as an analogy, why cut a paper with a machette when you can just use scissors?

Based on my limited understanding of Julia’s source code, Julia is built from a very minimal and rather lightweight C/C++ implementation of basic routines and hardware support, and a syntax parser written in Scheme. Everything on top of that is Julia with a some C calls here and there.

---

<div class="post-metadata">

### Author: ![pixel27](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pixel27/32/8902_2.png) [@pixel27](https://discourse.julialang.org/u/pixel27)
#### Post date: [August 19, 2020, 12:48am UTC](https://discourse.julialang.org/t/is-julia-able-to-replace-c/45178/5 "2020-08-19T00:48:17Z")

</div>

As far as replace everything written in C with Julia…For a desktop/server computer yes I guess you could. Embedded programmers however don’t really like Garbage Collection since it’s not deterministic. Also I’ve never heard of an OS that uses a Garbage Collection for memory management.

---

<div class="post-metadata">

### Author: ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)
#### Post date: [August 19, 2020, 4:34am UTC](https://discourse.julialang.org/t/is-julia-able-to-replace-c/45178/6 "2020-08-19T04:34:08Z")

</div>

Reference counting is a form of garbage collection techniques. Tracing GC is probably less common but I won’t be surprised at all if it is used in OS kernel in some ways and in some limited scope.

---

<div class="post-metadata">

### Author: ![Steve.jl](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@Steve.jl](https://discourse.julialang.org/u/Steve.jl)
#### Post date: [August 19, 2020, 4:42pm UTC](https://discourse.julialang.org/t/is-julia-able-to-replace-c/45178/7 "2020-08-19T16:42:55Z")

</div>

To summatize: it is possible but not really feasible and nobody has the intention to replace C for OSs. Moreover, since other OSs are written in C it’s much easier to keep the base in C. Got it! Thx 🙂

---

<div class="post-metadata">

### Author: ![Juan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juan/32/7657_2.png) [@Juan](https://discourse.julialang.org/u/Juan)
#### Post date: [August 19, 2020, 7:37pm UTC](https://discourse.julialang.org/t/is-julia-able-to-replace-c/45178/8 "2020-08-19T19:37:52Z")

</div>

But not its compiler, LLVM.

In future it could be easier to find compilers made with Rust.

---

<div class="post-metadata">

### Author: ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)
#### Post date: [August 19, 2020, 11:08pm UTC](https://discourse.julialang.org/t/is-julia-able-to-replace-c/45178/9 "2020-08-19T23:08:54Z")

</div>

He said “nearly”. There are many exceptions, but the compiler, especially llvm itself is the one that makes almost the least sense to replace, at least not for this reason.
