Author Topic: Code::Blocks Rust integration  (Read 13020 times)

Offline Barracuda72

  • Single posting newcomer
  • *
  • Posts: 4
Code::Blocks Rust integration
« on: May 04, 2019, 12:06:27 pm »
Hello!
I've started learning Rust programming language some time ago and just discovered that there is no good IDE for that (Vim is my favorite editor, but it's still not an IDE).
I've done many C++ projects in C::B, so I decided to throw a bunch of stuff together and make C::B usable with Rust.
Here's the results:

https://github.com/Barracuda72/Codeblocks-Rust

It's still lacking many things. Syntax highlighting isn't pretty as I'm just lacking aestetics, and there are quite a bit hardcoded things here and there in scripts, but overall it's usable. You can create new projects/files, build/rebuild/clean them, compiler messages are parsed and recognized by IDE.

I'd be happy to hear some suggestions on this (PRs will be even better), and hope that Rust support will be integrated in C::B one day.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Code::Blocks Rust integration
« Reply #1 on: May 04, 2019, 12:18:57 pm »
Can you explain how you're handling all the cargo stuff? Are you using custom makefile project or using the C::B's build system? I'm mildly interested in rust, but I cannot find the time to try it in something more complex...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Barracuda72

  • Single posting newcomer
  • *
  • Posts: 4
Re: Code::Blocks Rust integration
« Reply #2 on: May 05, 2019, 12:07:28 pm »
Can you explain how you're handling all the cargo stuff?

I'm not actually handling ALL the cargo stuff, just the project creation and building/cleaning.

Are you using custom makefile project or using the C::B's build system?

Yep, I'm setting up custom makefile project with custom build commands ("cargo build" etc). Cargo is Rust default build system, and while it's possible to use compiler directly and integrate it into C::B build system it's actually not worth it, I think. I don't like Cargo myself (just what the hell with all this "package manager - build system - project configuration - etcetcetc" all-in-one goddamn ugly designed thing in modern programming languages?!), but it's official way to go, unfortunately. You could always just write good ol' Makefile and use it (I usually do that).
« Last Edit: May 05, 2019, 12:26:40 pm by Barracuda72 »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Code::Blocks Rust integration
« Reply #3 on: May 05, 2019, 02:02:03 pm »
Quote
just what the hell with all this "package manager - build system - project configuration - etcetcetc" all-in-one goddamn ugly designed thing in modern programming languages?!
+1

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Code::Blocks Rust integration
« Reply #4 on: May 05, 2019, 02:34:25 pm »
(just what the hell with all this "package manager - build system - project configuration - etcetcetc" all-in-one goddamn ugly designed thing in modern programming languages?!)
Removes opinion, variation and make sharing code to be an easier task, so I think it is a good design decision to have one. No idea if the implementation is good.

If you look at C/C++ you'll see the other way to do it and we already know it is bad and causes tons of problems. For example good luck using a lib that is using some different build system from yours. It is total PITA. Especially if you have to build it regularly.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline sodev

  • Regular
  • ***
  • Posts: 497
Re: Code::Blocks Rust integration
« Reply #5 on: May 05, 2019, 06:48:52 pm »
just what the hell with all this "package manager - build system - project configuration - etcetcetc" all-in-one goddamn ugly designed thing in modern programming languages?!)

Because code sharing and collaboration is a big topic in these environments. A not so big java application of ours uses just about 5 libraries but these pull in about 40 transitive dependencies, you dont want to manage these manually.

Offline Barracuda72

  • Single posting newcomer
  • *
  • Posts: 4
Re: Code::Blocks Rust integration
« Reply #6 on: May 05, 2019, 07:09:31 pm »
Removes opinion, variation and make sharing code to be an easier task, so I think it is a good design decision to have one.

No, you are just plain wrong - it's actually _increasing_ opinion and variation. We already have _dozens_ (if not _hundreds_) of package managers and build systems, and the only thing different about them is authors lists and main repo URL. That's just bizzare. Everyone sane would probably choose existing one and contribute to it adjusting existing code to fit their needs... But this tale is not about sanity. Writing cross-platform Makefile even for large-scale multi-language project isn't all that hard (even considering all tips and tricks required for NMake), but today it's considered some kind of forgotten black magick art just because nobody is able to read Make manual. Ehhh, whatever...

If you look at C/C++ you'll see the other way to do it and we already know it is bad and causes tons of problems. For example good luck using a lib that is using some different build system from yours. It is total PITA. Especially if you have to build it regularly.

EXACTLY. And there's one more thing: there shouldn't be mix between package manager and build system. If I want to _use_ library, I should be able to just install it (together with docs and other developer things) and use it. User of my app should be able to install library too (probably without dev stuff) and then use it. We are both not interested in the inner things; we just want the library. Developer (and user all the more so) don't even need to know that build system project uses until they participate in it. As a primarily Gentoo user I'm blessed with Portage that abstracts all this build zoo to simple "emerge that-awesome-lib" (althou sometimes I have to write ebuilds myself, but that's a different story), but same isn't true for billions of humans around the globe who suffer in pain because of some developers' incompetence, and that's more hack than an actual solution.

Because code sharing and collaboration is a big topic in these environments. A not so big java application of ours uses just about 5 libraries but these pull in about 40 transitive dependencies, you dont want to manage these manually.

I'm not against collaboration, code sharing, etc, per se - I just hate that instead of using (and maybe extending) existing solutions developers prefer to invent brand-new, unique, their own 100% incompatible wheels.

The point I'm trying to make here is that it would be beneficial for everyone if Rust guys had just picked some well-maintained build system and relied on default system PM to install libraries. But they've chosen their own path... Well, shame on them.

But this disscussion has gone quite off-topic, heh (of course, it's holy war, after all =D). Let's stay close to OP.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Code::Blocks Rust integration
« Reply #7 on: May 05, 2019, 08:02:06 pm »
No, you are just plain wrong - it's actually _increasing_ opinion and variation. We already have _dozens_ (if not _hundreds_) of package managers and build systems, and the only thing different about them is authors lists and main repo URL.
I'm not sure why you misinterpreted my post. I was talking about cargo. As far as I know there is only one package manager and only one build system for rust. Are there more popular build systems/package managers for rust? I know they try to make it easy to integrate rust in other build systems, but this is different thing.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Barracuda72

  • Single posting newcomer
  • *
  • Posts: 4
Re: Code::Blocks Rust integration
« Reply #8 on: May 17, 2019, 08:31:34 pm »
I'm not sure why you misinterpreted my post. I was talking about cargo. As far as I know there is only one package manager and only one build system for rust. Are there more popular build systems/package managers for rust? I know they try to make it easy to integrate rust in other build systems, but this is different thing.
No, I think I didn't make myself clear. I wasn't talking about different PMs for Rust; I grumbled about 1) the fact that instead adopting some existing tools Rust crew desided to roll out their own for no apparent reason and 2) the enourmous problem that every, every tiny language nowadays does the same; at the end of the day we are left with dozens PMs and BSs (cabal, composer, gradle, sbt, pip, npm, go, mvn, nuget, cargo, etcetcetc) that do _exactly_ the same jobs but for different languages and there seems to be no end for this insanity.