# Julia vs C++ for Automated Reasoning

**URL:** https://discourse.julialang.org/t/julia-vs-c-for-automated-reasoning/109268
**Category:** General Usage
**Tags:** llm, graph
**Created:** [January 25, 2024, 6:00pm UTC](https://discourse.julialang.org/t/julia-vs-c-for-automated-reasoning/109268 "2024-01-25T18:00:20Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [January 26, 2024, 12:23pm UTC](https://discourse.julialang.org/t/julia-vs-c-for-automated-reasoning/109268/3 "2024-01-26T12:23:21Z")

</div>

> [@Rajaram\_Venkataraman](#):
>
> plan to use either C++ or Julia.

I would think Julia could very well work, like for RelationalAI, one of the main Julia companies. I note it doesn’t need to be either or, Julia could be your main language, but you can call C++ code. It’s very easy to call Python, C, R, Rust etc. to and from, and from C++. It’s a bit hard to call C++ from any language, e.g. because of its name mangling, but a solved problem. I think Julia does about as well as from other languages, as other languages do, e.g. from Python.

I googled a bit to see what’s out there:

> **[Building a RKGS in Julia - RelationalAI](https://relational.ai/blog/building-a-rkgms-in-julia)**
>
> Molham Aref and Nathan Daly describe their experience using Julia to build a next-generation knowledge graph database that combines reasoning and learning to solve problems that have historically been intractable.

> [videos]  
> Molham Aref and Nathan Daly describe their experience using Julia to build a next-generation knowledge graph **database** that combines reasoning and learning to solve problems that have historically been intractable. They explain how Julia’s unique features enabled them to build a high-performance database with less time and effort.

I bolded **database** there, and note it’s proprietary software, but their reasons for preferring Julia may apply to you, and possibly you could use their system…

I don’t know what’s available in C++, just showing first/very old hit I got:

> **[GitHub - kckishan/knowledgegraph: Knowlegde Graph Implementation in C++](https://github.com/kckishan/knowledgegraph)**
>
> Knowlegde Graph Implementation in C++. Contribute to kckishan/knowledgegraph development by creating an account on GitHub.

LLMs are much more used from Python still, implemented by C++, but you can reuse all of that from Julia, at least in theory, e.g. people adding such to Transformers.jl, so in practice too. I don’t hear _users_ using C++ much directly, for LLMs.

You can easily call all (LLM) models, using PythonCall.jl, see also @Tomas_Pevny’s about making it more user-friendly, integrating into Transformers.jl (most models are not there)

> [@A discrepancy in self-attention between python and Julia (Transformers)](https://discourse.julialang.org/t/a-discrepancy-in-self-attention-between-python-and-julia-transformers/109195):
>
> Hi, I am continuing the porting of microsoft Phi model to the Transformers.jl. The most complicated is the self-attention, where I am lost, but gradually removing abstraction layers of Neuralattentionlib.jl to get to the gist. Right now, I am stucked with a following problem of computing weights in self-attention. In Julia, I have julia\> size(query\_rot\_states) (64, 32, 6) julia\> size(key\_rot\_states) (64, 32, 6) julia\> attn\_weights = scaled\_dot\_product\_score(query\_rot\_states, key\_rot\_states)…

---

_[View the full topic](https://discourse.julialang.org/t/julia-vs-c-for-automated-reasoning/109268)._
