Open timotheecour opened 4 years ago
Nah. Recursive dependencies between fusion and std mean there is no point in "fusion". And maybe indeed there isn't but then argue for that instead. :-)
can we at least agree on compiler/
, tools/
and anything except koch and stdlib can import fusion?
Note that a recursive dependency between fusion and std doesn't imply cyclic module dependencies; it does add some package-level complexity but reduces likelihood of duplication.
argue for that instead
the way I see it, fusion is useful for following reasons:
instead of
copyDir(distDir / "fusion" / "src" / "fusion", "lib" / "fusion")
, we should probably use the usual nimble logic which allows adding import dirs to nim's--path
, so thatnimble develop
fusion works as intended (NIMBLE_DIR=customdir
can always be used during bootstrap to avoid user's environment messing up with bootstrap)
I decided against this and make use of copyDir
simply because nimble
does not support "system-installed" dependencies. Also it's widely incompatible with how Linux distributions package Nim, so unless we got those sorted out copying is the foolproof way.
can we at least agree on compiler/, tools/ and anything except koch and stdlib can import fusion?
tools are fine, I don't see why the compiler needs it just yet, maybe once fusion becomes more useful with support for compression etc.
The absolutely simplest and most obvious solution here is that the compiler starts using a package manager - this solves pretty much everything and absolves the need for fusion
and similar ideas that rest on contradictory premises.
packager_manager vendor
command is used to copy the locked version of all those dependencies to get a "full, package-manager-free, offline, independent" version of the compiler at release time or whenever desiredConsider gcc
and glibc
- there's no expectation that one follows the other, and indeed, they each support a range of versions of the other. This flexibility allows them to progress at different paces - when a critical issue is identified in one, the other doesn't have to rush to make a release etc.
edit: It's important to point out that some of these packages can live in a single git repo as long as the PM supports it
/cc @Araq
rationale
avoid code duplication and re-inventing the wheel
how it'd work
build_all.sh
builds csourcesthe it builds koch
then it calls
koch boot
koch boot clones dependencies in dist including fusion at a fixed hash baked in koch.nim (equivalent to a git submodule)
import fusion/foo
is made available for import, in fact it already is implemented in:then
nim c compiler/nim
can useimport fusion/foo
likewise with stdlib modules; it's just a question of avoiding cyclic dependencies as usual except now there are 2 base dirs.
koch importing fusion
build_all.sh
; see for example https://github.com/nim-lang/RFCs/issues/261 where kochdocs couldimport fusion/globs
note
instead of
copyDir(distDir / "fusion" / "src" / "fusion", "lib" / "fusion")
, we should probably use the usual nimble logic which allows adding import dirs to nim's--path
, so thatnimble develop
fusion works as intended (NIMBLE_DIR=customdir
can always be used during bootstrap to avoid user's environment messing up with bootstrap)