Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: AZ on August 30, 2012, 05:24:42 am

Title: addition of a nother language
Post by: AZ on August 30, 2012, 05:24:42 am
Hello,
 is it possible to add the support (editor + compile, debug) of another C-like language? I primarily interested in GO ( golang.org)
Thank you
AZ
Title: Re: addition of a nother language
Post by: Alpha on September 01, 2012, 01:54:56 pm
Yes, see: Adding support for non C/C++ files to the build system (http://wiki.codeblocks.org/index.php?title=Adding_support_for_non_C/C%2B%2B_files_to_the_build_system).
Title: Re: addition of a nother language
Post by: AZ on September 14, 2012, 07:59:57 pm
Yes, see: Adding support for non C/C++ files to the build system (http://wiki.codeblocks.org/index.php?title=Adding_support_for_non_C/C%2B%2B_files_to_the_build_system).

Thank you Alpha,
 how about syntax highlighting and code competition ?
Title: Re: addition of a nother language
Post by: Alpha on September 15, 2012, 04:14:30 pm
Syntax highlighting, yes: Creating a custom lexer for Code::Blocks editor (http://wiki.codeblocks.org/index.php?title=Creating_a_custom_lexer_for_Code::Blocks_editor).  If GO is similar in syntax to C, it would probably be easiest to just copy lexer_cpp.xml, and edit the filemasks and keywords.

Code completion is a little more difficult :).  The current Code Completion plugin will provide suggestions based on the keywords in the current lexer.  If you want more than that, it would require writing your own code completion plugin.
Title: Re: addition of a nother language
Post by: oBFusCATed on September 15, 2012, 04:23:58 pm
Code completion is a little more difficult :).  The current Code Completion plugin will provide suggestions based on the keywords in the current lexer.  If you want more than that, it would require writing your own code completion plugin.
And it will require changing some API interfaces here and there to minimize code and UI duplication between the different CC plugins.

You can always look at the Fortran plugins. I think they have implemented a CC for Fortran -> http://darmar.vgtu.lt/
Title: Re: addition of a nother language
Post by: AZ on September 15, 2012, 04:53:08 pm
...
You can always look at the Fortran plugins. I think they have implemented a CC for Fortran -> http://darmar.vgtu.lt/

There is gocode (https://github.com/nsf/gocode) daemon already. it's real good and widely used in the GO community. How difficult will be to integrate it ?

GO is C-like language, so i'll look into modifiyng the existing template as suggested. Thank you!

Another question how to add the parsing of the packages and jummps to definitions/ declarations?


Andrew
Title: Re: addition of a nother language
Post by: oBFusCATed on September 15, 2012, 05:20:03 pm
There is gocode (https://github.com/nsf/gocode) daemon already. it's real good and widely used in the GO community. How difficult will be to integrate it ?
Probably it won't be too hard to integrate. The problem is that there will be some fighting between the CC for C++ and CC for Go, but I've not dug too much into the codebase.
Please take a look at the Fortran's plugin and our codecompletion plugins.
Title: Re: addition of a nother language
Post by: LMS-PT on November 09, 2023, 05:40:10 pm
Hello,

I am not a developer.
I am just a mechanical engineer we works on product design... and nowadays almost every product/machine we design has to include some embedded electronics (Sensors, Microcontrollers, SBC's, etc...)
[Other colleagues do that work... But I like to learn/know a little bit of that too]...

Recently, I've heard of a new language (Zig) that is trying to address the space where C/C++ are kings, but it follows a pragmatic approach of working together with C/C++, so that it's compiler can even complile C/C++ code...
Since I like Code::Blocks as my IDE for simple C tutorials/exercises, I think it would also be a great fit for the Zig Language...

Can someone add this feature [plugins] or reach someone in the Zig comunity for them to develop it?
Thanks.
Title: Re: addition of a nother language
Post by: stahta01 on November 09, 2023, 07:53:48 pm
Hello,

I am not a developer.
I am just a mechanical engineer we works on product design... and nowadays almost every product/machine we design has to include some embedded electronics (Sensors, Microcontrollers, SBC's, etc...)
[Other colleagues do that work... But I like to learn/know a little bit of that too]...

Recently, I've heard of a new language (Zig) that is trying to address the space where C/C++ are kings, but it follows a pragmatic approach of working together with C/C++, so that it's compiler can even complile C/C++ code...
Since I like Code::Blocks as my IDE for simple C tutorials/exercises, I think it would also be a great fit for the Zig Language...

Can someone add this feature [plugins] or reach someone in the Zig comunity for them to develop it?
Thanks.

I think adding Zig to scintilla https://www.scintilla.org/Lexilla.html (https://www.scintilla.org/Lexilla.html) would be a good step to do by someone in the Zig community.
I am downloading Zig right now to see if it looks easy to add to the CB list of compilers for doing C or C++ programming.
Edit: The build system is not like that of GCC; using an CB custom makefile might allow building under CB.
Edit2: I figured out how to get it to act like an normal GCC like compiler.
Code
zig cc --help
shows the C Compiler like options.

Tim S.