Hacker News new | ask | show | jobs
by ksec 3189 days ago
>I'd really love to see languages like Ruby tackle this next. It's sorely needed.

Could you expand on that? Why Ruby?

1 comments

not OP, but ruby's current "modules" are just namespaces.

What jigsaw and rust call modules are isolated components that you can plug and connect in various configurations, and that declare public interfaces both as dependencies and as exported symbols. Consider a module configuration like

  module java.sql {
    requires public java.logging;
    requires public java.xml;
    exports java.sql;
    exports javax.sql;
    exports javax.transaction.xa;
  }
So, they are actually slightly closer to rubygems + bundler, but ruby is always "promiscuous", i.e. code from one library can trivially mess up with code from other gems, while some isolation would be nice.

Also, by default ruby does not namespace things by package/module/gem so it's easy to have collisions, while in a more robust system this would/should be under the control of the calling code.