1 Modules and Exports
Rhombus and Racket modules exist in the same module system with the same filesystem- and collection-based paths, so a Rhombus module can import a Racket module, and a Racket module can require a Rhombus module.
Relative-path module references and Rhombus file or Racket file paths work the same, where a ".rhm" or ".rkt" file suffix can be used in either language.
A module name in Rhombus without quotes, such as rhombus/random, implicitly gets a ".rhm" suffix or refers to a "main.rhm" file (when there is no /), while a similar Racket module name like racket/math implicitly gets a ".rkt" suffix or refers to a "main.rkt" file.
To refer to a collection-based ".rkt" file from Rhombus, use the lib form, as in lib("racket/math.rkt"). To refer to a collection-based ".rhm" file from Racket, use the lib form as in (lib "rhombus/random.rhm").
While importing bindings from one language into the other is relatively straightforward, not all imported bindings can be used directly:
A Racket binding can be used in a Rhombus expression if it corresponds to a non-macro definition or if it is an identifier macro that can be used alone as an expression.
A Racket binding for a syntactic form (i.e., a macro) cannot be used directly in a Rhombus expression. Even though a use of the syntactic form in Racket looks like a function call, the Rhombus function call form does not (necessarily) expand to a Racket form with a function-call shape.
Using a Racket syntactic form from Rhombus requires a Rhombus macro that expands to the Racket form. See Racket Expressions from Rhombus for more information.
A Rhombus binding can be used in a Racket expression if it corresponds to a fun definition or a def form where the binding is just an identifier or parenthesized identifiers values. Other def binding forms may work, but there is no guarantee, so do not rely on current behavior. Note that many Rhombus binding forms define identifiers that can be used as expressions, but they are implemented as syntactic forms; notably, the constructor bound by a class definition is not like a fun binding.
To use a Rhombus binding form Racket in general, use rhombus-expression from rhombus/parse.