autumnai / collenchyma

Extendable HPC-Framework for CUDA, OpenCL and common CPU
http://autumnai.github.io/collenchyma
Apache License 2.0
475 stars 33 forks source link

refactor/export: export important functionality from main module #40

Closed hobofan closed 8 years ago

mitchmindtree commented 8 years ago

Just thought I'd mention that personally I'm not a fan of the glob imports, mainly for reasons you've probably already heard before :smile_cat:

Although it saves a step for the writer, it puts an extra step in the process of determining where names are being imported from, which imported names are actually being used and what traits might different methods be coming from. Normally I like to opt for moving as much of the burden from the reader to the writer as possible, but everyone has their own opinion here so feel free to disregard this comment!

hobofan commented 8 years ago

@mitchmindtree : I mean in the end you don't have to use use collenchyma::*;, but I think it is important that all important parts are exported from the root module, so you don't have to know how Collenchyma is structured internally (which also allows us more freedom in refactoring).

It's also just a first step, I just put in what I knew from experience you would usually need to use Collenchyma, but there might be a one or two that aren't really needed. So on one side we might clean that up a bit more once we start approaching a 1.0 state, on the other hand I would also like to add another module, which exports everything that is important for plugin developers (this was focused on plugin-users).

hobofan commented 8 years ago

@homu r+

homu commented 8 years ago

:pushpin: Commit 4aea78d has been approved by hobofan

homu commented 8 years ago

:zap: Test exempted - status

hobofan commented 8 years ago

@mitchmindtree: Sorry if that sounded a bit too dismissive, but I think Collenchyma has some deficiencies on the user side, and this was definitely one of them. I've recently opened up a few issues to try and address that, but if anything comes to your mind, we would love your feedback :)

hobofan commented 8 years ago

This was changed a bit in #42. I forgot that a glob import of the root module would also import all the modules in it, some of which have names prone to colission (e.g. framework, plugin), especially with our plugins. This is now handled via a "prelude" module.