# Why is ccall syntax?

**URL:** <https://discourse.julialang.org/t/why-is-ccall-syntax/72427>\
**Category:** General Usage\
**Tags:** ccall\
**Created:** [December 2, 2021, 4:41am UTC](https://discourse.julialang.org/t/why-is-ccall-syntax/72427 "2021-12-02T04:41:16Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![c42f](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/c42f/32/52842_2.png) [@c42f](https://discourse.julialang.org/u/c42f)\
**Post date:** [December 2, 2021, 7:13am UTC](https://discourse.julialang.org/t/why-is-ccall-syntax/72427/3 "2021-12-02T07:13:05Z")

</div>

Good question. There’s a few possible answers…

#### The basic answer

It doesn’t need to be syntax. `@ccall` is a more recent and much more attractive syntax for the same thing which doesn’t need special support from the parser or lowering.

#### The historical answer

`ccall` dates from _very_ early in Julia’s development. Perhaps around [this commit](https://github.com/JuliaLang/julia/commit/18f456233b280f2b5649c033c1977133c73bfd88) where it was first added to the runtime or [this commit](https://github.com/JuliaLang/julia/commit/e9fbc5c52ff123da27b9cc368b77372fa0618574) where the syntax became more similar to its current form.

This was back when Julia source code was still stored in `.j` files, and the first `ccall` commit was before macros were even implemented as part of [this commit](https://github.com/JuliaLang/julia/commit/a1b9fee4e72e8438693eddc25d769fab4cc98c9d).

#### The pedantic answer

`ccall` is parsed in the same way as a normal function call and it’s represented the same way in the AST. So it’d be somewhat reasonable to say it’s _not_ special syntax at all. (This is almost true, though I admit there’s some special processing for the name `ccall` as part of syntax lowering. I’m not 100% sure whether this is essential or just a convenient place to put this.)

---

_[View the full topic](https://discourse.julialang.org/t/why-is-ccall-syntax/72427)._
