# Recommended AI engine for translating between Julia, Python and Wolfram Mathematica

**URL:** <https://discourse.julialang.org/t/recommended-ai-engine-for-translating-between-julia-python-and-wolfram-mathematica/109152>\
**Category:** New to Julia\
**Created:** [January 23, 2024, 3:24pm UTC](https://discourse.julialang.org/t/recommended-ai-engine-for-translating-between-julia-python-and-wolfram-mathematica/109152 "2024-01-23T15:24:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shamrock\_812](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/shamrock_812/32/52754_2.png) [@Shamrock\_812](https://discourse.julialang.org/u/Shamrock_812)\
**Post date:** [January 23, 2024, 3:24pm UTC](https://discourse.julialang.org/t/recommended-ai-engine-for-translating-between-julia-python-and-wolfram-mathematica/109152/1 "2024-01-23T15:24:54Z")

</div>

Hi,

New to Julia and trying to translate Julia code to Python and to Wolfram Mathematica and the other way around with ChatGPT however the result is buggy and requires too much overhead to deal with.

Any recommendation how to go about this? Or is the overhead inevitable?

Cheers  
Rami

---

<div class="post-metadata">

**Author:** ![Gast](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gast/32/206425_2.png) [@Gast](https://discourse.julialang.org/u/Gast)\
**Post date:** [January 23, 2024, 4:16pm UTC](https://discourse.julialang.org/t/recommended-ai-engine-for-translating-between-julia-python-and-wolfram-mathematica/109152/2 "2024-01-23T16:16:09Z")

</div>

I often use [Julia Hub’s AI engine](https://juliahub.com/ui/AskAI) or [Blackbox](https://www.blackbox.ai/) in VS

---

<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 23, 2024, 4:36pm UTC](https://discourse.julialang.org/t/recommended-ai-engine-for-translating-between-julia-python-and-wolfram-mathematica/109152/3 "2024-01-23T16:36:01Z")

</div>

There’s a tool somewhere to translate ("transpile/compile) Pythn to Julia somewhere. Though also consider just calling Python code from Julia, or in other direction with PythonCall.jl. It’s usually the best approach.

How you ask the models can matter, i.e. “Prompt Engineering”, but see new state-of-the-art (SOTA):

> **[Code Generation with AlphaCodium: From Prompt Engineering to Flow Engineering](https://arxiv.org/abs/2401.08500)**
>
> Code generation problems differ from common natural language problems - they require matching the exact syntax of the target language, identifying happy paths and edge cases, paying attention to numerous small details in the problem spec, and...

> We tested AlphaCodium on a challenging code generation dataset called CodeContests, which includes competitive programming problems from platforms such as Codeforces. The proposed flow consistently and significantly improves results. On the validation set, for example, GPT-4 accuracy (pass@5) increased from 19% with a single well-designed direct prompt to 44% with the AlphaCodium flow. Many of the principles and best practices acquired in this work, we believe, are broadly applicable to general code generation tasks. Full implementation is available at: [this https URL](https://github.com/Codium-ai/AlphaCodium)

> **[Next Generation of High-quality Code Generation | CodiumAI](https://www.codium.ai/products/alpha-codium/)**
>
> Building the next generation of high-quality code generation, we intend to publish. Want to be the first one who knows?

I think AlphaCodium (brand new so I’m not fully sure yet) is not a model, but something you use with a (default) model, or alternative, to boost them, and then with this one would be my suggestion to try:

See:

> ### [stabilityai/stable-code-3b · Hugging Face](https://huggingface.co/stabilityai/stable-code-3b)
> 
> `stable-code-3b` is trained on 18 programming languages (selected based on the 2023 StackOverflow Developer Survey) and demonstrates state-of-the-art performance (compared to models of similar size) on the MultiPL-E metrics across multiple programming languages tested using [BigCode’s Evaluation Harness](https://github.com/bigcode-project/bigcode-evaluation-harness/tree/main).

What I found today. Nobody can probably tell you which open source (or not; paid for) is best. See also there what they compare to. You can run smaller models locally.

The best model is probably GPT 4, i.e. paid version of ChatGPT, but I’ve not used myself. I’m not sure, but what you get at JuliaHub is it (free access to the better paid version?) or at least GPT 3.5, which isn’t as good. Open source models are better than the free version, at least for other languages.

Probably no one is going to tell you which is best for Julia, because few test for it. Also few, train for it, e.g. not mentioned for that model, thou Julia IS in its benchmark,

Mistral company has very good models, e.g. mistral-medium, I hear, and (but unclear to me none of below are made for code, could try):

> [mistralai/Mixtral-8x7B-v0.1 · Hugging Face](https://huggingface.co/mistralai/Mixtral-8x7B-v0.1)

Also e.g.:

> [mlabonne/NeuralBeagle14-7B · Hugging Face](https://huggingface.co/mlabonne/NeuralBeagle14-7B)

[![](https://global.discourse-cdn.com/julialang/original/3X/1/d/1d9b6811c67c0886b127aa17e3c371959e799cf1.jpeg "AlphaCodium - A new open-source by CodiumAI 💎") ](https://www.youtube.com/watch?v=AOqnJLBYon4)

> Inspired by DeepMind’s AlphaCode

better or already outdated, even in version 2 (version 1, previous SOTA, is outdated):

[![](https://global.discourse-cdn.com/julialang/original/3X/6/e/6eeb3889757c88480b538f2b008bb49bcca33109.jpeg "AlphaCode 2 Explained: The End of Traditional Programming Careers?") ](https://www.youtube.com/watch?v=kJ8MGqvxZ2M)

[https://alphacode.deepmind.com/](https://alphacode.deepmind.com/)

---

<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 23, 2024, 4:53pm UTC](https://discourse.julialang.org/t/recommended-ai-engine-for-translating-between-julia-python-and-wolfram-mathematica/109152/4 "2024-01-23T16:53:43Z")

</div>

Note, if you look at benchmarks, even if a model is claimed best for coding, it may not be for Julia.

Julia is a “low resource” language according to Google PaLM’s technical report, and e.g. Python high-resource. It may have been in PaLM 2 report, but both are old, and Gemini now their best, and despite Python high-resource/highest fraction in most if not all models, and C++ high too, that doesn’t mean best for either. Despite that C++ is known to be poor in some, or all models, and Julia good, better than Python.

It could help if Julia had a larger fraction of the training data, but it doesn’t seem to matter too much, likely because similar to Python, and being a simple language. Humans and AI apparently learn Julia/simpler languages faster, as opposed to e.g. C++.

[Given that Julia is low-resource, few percent, or was it 0.x% Mathematica is pretty close to be near zero. Though I haven’t confirmed, but don’t recall seeing it mention, or as a fraction, or even as part of AI coding benchmarks. I’m curious how well it’s handled already…]

It probably matters if Julia has a 0% fraction of the training data, none or very low.

From the awesome Julia AI list:

> - [ReplGPT.jl](https://github.com/ThatcherC/ReplGPT.jl) - Brings ChatGPT interface as a Julia REPL mode.
> - [HelpGPT.jl](https://github.com/FedeClaudi/HelpGPT.jl) - Calls ChatGPT to explain any errors in Julia code.
> - [GenGPT3.jl](https://github.com/probcomp/GenGPT3.jl) - A [Gen.jl](https://www.gen.dev/) generative function that wraps the OpenAI API.
> - [GPTCodingTools.jl](https://github.com/svilupp/GPTCodingTools) - Code generation tool for Julia language with useful prompt templates and self-healing features (ala OpenAI Code Interpreter). It does work, but development has been abandoned. (Disclaimer: I’m the author of this package.)
> - [PromptingTools.jl](https://github.com/svilupp/PromptingTools.jl) - Helps with everyday applications of Large Language Models in Julia by wrapping coming APIs, re-using prompts via templates, and enabling easy transition between different model providers (eg, OpenAI, Ollama). (Disclaimer: I’m the author of this package.)
> - [LLMTextAnalysis.jl](https://github.com/svilupp/LLMTextAnalysis.jl) - Leverage Large Language Models to uncover, evaluate, and label themes/concepts/spectra in large document collections.

Some of the tools there maybe be outdated because of better solutions I already pointed to.

---

<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 23, 2024, 5:00pm UTC](https://discourse.julialang.org/t/recommended-ai-engine-for-translating-between-julia-python-and-wolfram-mathematica/109152/5 "2024-01-23T17:00:12Z")

</div>

> **[ChatGPT performs better on Julia than Python (and R) for Large Language Model...](https://www.stochasticlifestyle.com/chatgpt-performs-better-on-julia-than-python-and-r-for-large-language-model-llm-code-generation-why/)**
>
> Machine learning is all about examples. The more data you have, the better it should perform, right? With the rise of ChatGPT and Large Language Models (LLMs) as a code helping tool, it was thus just an assumption that the most popular languages like...

Finally found the thread I was looking for:

> [@\[ANN\] Julia LLM Leaderboard - Help us make it more relevant for every day problems!](https://discourse.julialang.org/t/ann-julia-llm-leaderboard-help-us-make-it-more-relevant-for-every-day-problems/107319):
>
> Hello Julia Community! We’re excited to share with you the [“Julia LLM Leaderboard”](https://github.com/svilupp/Julia-LLM-Leaderboard) - a new project aimed at benchmarking various GenAI models for Julia code generation. While our approach is super simple (perhaps naive?) – generate code, run it, and see if it works – our goal is quite ambitious: to determine which GenAI models and prompting strategies excel in producing syntactically correct Julia code to help you with choosing your “default” approach. We’re calling on all of you to contribut…

Known best for Julia (but most likely outdated and needs to be updated):

> **[GitHub - svilupp/Julia-LLM-Leaderboard: Provides a platform for the Julia community to...](https://github.com/svilupp/Julia-LLM-Leaderboard)**
>
> Provides a platform for the Julia community to compare AI models' abilities in generating syntactically correct Julia code, featuring structured tests and automated evaluations for easy and collaborative benchmarking.

Brand new, not using latest AI models I just posted (but could?):

> [@\[ANN\] AIHelpMe.jl - AI-Enhanced Coding Assistance for Julia!](https://discourse.julialang.org/t/ann-aihelpme-jl-ai-enhanced-coding-assistance-for-julia/109130):
>
> Quick Intro glowing_starDiscover AIHelpMe, the new Julia package that turns your docstrings into a treasure trove of insights! Why AIHelpMe? thinkingBridging the gap between local knowledge and AI smarts, AIHelpMe brings personalized, AI-enhanced guidance straight from your code’s docs. And enables an unprecedented level of control and insight behind each answer. Easy Start rocketAdd AIHelpMe (it’s not registered yet), grab your Cohere and OpenAI keys (tiny costs!), and dive into a sm…
