Community
    • Login

    Which lang other then c/cpp to build plugins

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    4 Posts 3 Posters 47 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • h-jangraH
      h-jangra
      last edited by

      I tried go with cgo and it didn’t work.
      Is there any way where I can use cpp wrapper and main logic in golang.

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @h-jangra
        last edited by

        @h-jangra ,

        Any language that can create a DLL and provide the various function hooks that Notepad++ requires can be used. There are plugin templates available for C++, C#, Ada, D, and Delphi. But I know that @Ekopalypse has made a plugin in the V programming language, even though there’s no template for that language. So it should be easily doable in golang, especially for someone who can read/understand one of the templates in another language, and make similar hooks in the destination language (like golang).

        You shouldn’t need to do a “wrapper” from C++ around the golang (or other) solution. It should be natively doable, assuming golang can make a DLL (which I presume it can).

        h-jangraH 1 Reply Last reply Reply Quote 1
        • h-jangraH
          h-jangra @PeterJones
          last edited by

          @PeterJones
          Thanks, I checked V is simpler and similiar like go. So I can go with V for my plugin.

          EkopalypseE 1 Reply Last reply Reply Quote 0
          • EkopalypseE
            Ekopalypse @h-jangra
            last edited by

            @h-jangra

            Be careful when using V, as it has made some decisions, such as removing the option for users to create a dllmain, that are… strange. In addition, at least during the time I worked with V, there were repeated problems with the various compilers.
            Gcc did this, but msvc did not, clang always caused problems, especially in release mode, and tcc does not work at all in this area. Don’t get me wrong, you can get them all to work, but you’ll end up spending more time working around the obstacles than working on the plugin, and unfortunately, there is no win32 library yet. So you have to write every Win32 function you use yourself and hope that it doesn’t conflict with the ones V uses internally.
            So if you want to use a new language, I would recommend Rust, C#, Delphi, Odin, or Zig.
            With the exception of Delphi, I created plugins in all the other languages for testing and ultimately decided on Rust for the LSP client plugin.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors