A Chat with ChatGPT: Peerless Intelligence

Click For Summary
SUMMARY

This discussion centers on the capabilities and limitations of ChatGPT, particularly in converting code from Matlab and Fortran to Julia. The conversation highlights tools such as "MATLAB.jl" for interfacing with MATLAB and mentions the community-driven "f2j" tool for Fortran, although it clarifies that no official "f2j" tool exists. The user emphasizes the importance of manual conversion for accuracy and understanding, while also noting ChatGPT's tendency to provide misleading information and its potential improvements through integration with Wolfram Alpha.

PREREQUISITES
  • Understanding of Julia programming language
  • Familiarity with Matlab and Fortran programming languages
  • Knowledge of code conversion techniques
  • Basic experience with AI language models
NEXT STEPS
  • Research the "MATLAB.jl" package for integrating MATLAB with Julia
  • Explore community projects for Fortran to Julia conversion
  • Investigate general-purpose code translation tools available online
  • Learn about the integration of Wolfram Alpha with AI models like ChatGPT
USEFUL FOR

Software developers, data scientists, and researchers involved in programming language translation and those interested in the capabilities of AI in code conversion tasks.

Messages
15,596
Reaction score
10,357
I recently ran a chat session with ChatGPT. For me, ChatGPT is best used in searching for things and having the results presented in a conversational readable manner.

In my chat, I was curious about conversion tools for other code into Julia code. I asked ChatGPT and got these responses:

NOTE: (The dialog below was also run through Grammarly in preparation for this post which caught some minor mistakes and rewrote a couple of sentences)

---- ChatGPT session ------------------------------

How to convert MatLab code to Julia?


Converting Matlab code to Julia code can be done manually by going through the Matlab code and rewriting it in Julia. However, there are also tools available that can assist in this process. One such tool is the "MATLAB-to-Julia" tool, a Python script that converts a subset of Matlab code to Julia.

Another alternative is using the package "MATLAB.jl," which provides a Julia interface to MATLAB using the MATLAB Engine API for Python.

It's recommended to test the code after conversion and ensure it runs correctly and produces the same output as the original Matlab code.

How to convert FORTRAN code to Julia?

Converting Fortran code to Julia code can be done manually by going through the Fortran code and rewriting it in Julia. However, there are also tools available that can assist in this process.

One such tool is the "f2j" tool, a Fortran to Julia translator. It's a python script that can convert a subset of Fortran code to Julia. Another alternative is using the package "Fortran.jl" which aims to provide an easy and efficient way to call Fortran code from Julia.

It's recommended to test the code after conversion and ensure it runs correctly and produces the same output as the original Fortran code.

It's also good to be aware that Julia and Fortran have some differences in syntax and behavior so that you might encounter some compatibility issues.

What is the URL of the f2j tool?

I apologize for the confusion. There isn't an official "f2j" tool for converting Fortran code to Julia. It was a mistake in my previous response. Some community-made projects might help with this task, but it needs to be an official tool.

A possible alternative is using a general-purpose code translator such as "Translate" from Rosetta Code. It's a tool that allows you to translate code from one programming language to another.

It's also good to note that manually converting the code might be the best option, as it will give you a better understanding of the code and ensure that it works correctly in Julia.

What is the URL for the rosetta code translate tool?

I'm very sorry for my previous statement. Rosetta Code does not have a tool for code translation. Rosetta Code is a website that provides a collection of example code snippets for different programming languages. The website can be accessed at the following URL:

https://rosettacode.org/

Other general-purpose code translator tools are available, such as "code translator" or "code converter," that can be found with a simple web search. Still, they might need help to handle all the specificities of Fortran and Julia, and you should expect some errors or compatibility issues when using them.

It's also good to note that manually converting the code might be the best option, as it will give you a better understanding of the code and ensure that it works correctly in Julia.

What is the URL for MATLAB-to-Julia" tool?

I'm very sorry for any confusion. The MATLAB-to-Julia tool I mentioned in the previous response is not an official tool or a specific package, it was a mistake in my previous response. Some community-made projects might help with this task, but they are not official tools. Some of these projects can be found on GitHub or other open-source platforms.

An alternative to this would be using the package "MATLAB.jl," which provides a Julia interface to MATLAB by using the MATLAB Engine API for Python. This package allows you to call MATLAB functions and scripts directly from Julia, which can help convert MATLAB code to Julia code. You can find more information on how to use the package and its documentation on the following link:

https://github.com/JuliaInterop/MATLAB.jl

It's also good to note that manually converting the code might be the best option, as it will give you a better understanding of the code and ensure that it works correctly in Julia.

---- End of ChatGPT session ------------------------------

You can see that ChatGPT rephrases the question and then proceeds to answer it. I suspect that fits in with the predictive generative text algorithm ie special logic rephrases the question followed by using it as a seed to begin the generative/predictive part.

ChatGPT has no problem giving you believable but demonstrably false information and then apologizes for it when called out, as seen in its providing URL's for non-existent code conversion tools.
 
  • Like
Likes anorlunda and jack action
Computer science news on Phys.org
jedishrfu said:
ChatGPT has no problem giving you believable but demonstrably false information and then apologizes for it when called out, as seen in its providing URL's for non-existent code conversion tools.
That seems consistent with the language basis for ChatGPT. When answers need language and regurgitated advice, it does well. I read in the news that ChatGPT did well on bar exams, medical licensing exams, and MBA graduate exams. When answers require specific facts , or analysis, it is weak. In some...hat union may fortify the AI's weakest areas.
 
We had a tour guide who told us to feel free to ask him anything. If he knows the answer he'll tell us and if not he'll make something up.
 
  • Like
Likes sbrothy, Wrichik Basu and Vanadium 50
Here’s Sixty Symbols take on ChatGPT using GCSE questions from physics and math

 
  • Like
  • Haha
Likes Jarvis323, gleem and Tom.G
I am having a hell of a time finding a good all-in-one inkjet printer. I must have gone through 5 Canon, 2 HP, one Brother, one Epson and two 4 X 6 photo printers in the last 7 yrs. all have all sort of problems. I don't even know where to start anymore. my price range is $180-$400, not exactly the cheapest ones. Mainly it's for my wife which is not exactly good in tech. most of the problem is the printers kept changing the way it operate. Must be from auto update. I cannot turn off the...

Similar threads

  • · Replies 21 ·
Replies
21
Views
3K
Replies
18
Views
7K
  • · Replies 3 ·
Replies
3
Views
1K
Replies
7
Views
3K
Replies
10
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
883
  • · Replies 29 ·
Replies
29
Views
3K
Replies
6
Views
3K
Replies
7
Views
2K