LWN.net Logo

I personally like yum as well

I personally like yum as well

Posted Dec 2, 2003 4:48 UTC (Tue) by scottt (subscriber, #5028)
In reply to: I personally like yum as well by niemeyer
Parent article: New features in APT-RPM

First I would like to thank you personally for your python contributions. I was just using the bz2 module at work yesterday. I didn't recognize your name until I read your projects page.

My comments about the extra effort to support lua and the code size of apt-rpm is really just another way to say I think C/C++ is not the best choice for an implementation language in this case. Though 40000 lines isn't large for a C++ project, complexity still has its cost.The python culture favors C/C++ libraries having python bindings instead of embedding an interpreter in a C/C++ app for a reason.

About the lua code being too "imperative", what I ment was perhaps using a more "functional" style with "iterators" and "map" etc, instead of for-loops and "markinstall". ie. install_devel() in python using an imaginery library:

def devel_packages_to_install():
  def dev_pkgs(pkgs):
    for p in pkgs:
      try:
        yield package(p.name+'-deve')
        yield package(p.name+'-deve-static')
      except:
        pass
  return [ p for p in dev_pkgs(uptodate_packages())
    if not p.is_uptodate() ]
map(lambda p: p.install(),devel_packages_to_install())

As you can see I'm dying for generator comprehensions ;) By the way, does lua have a standard iterator/lazy-list interface?


(Log in to post comments)

I personally like yum as well

Posted Dec 2, 2003 5:10 UTC (Tue) by niemeyer (guest, #17169) [Link]

About the "imperativeness", I understand. Lua syntax is indeed a little bit more limited. OTOH, that's expected in a language for embedded environments.

About Lua iterators, yes, the generic 'for' loop allows the underlying function to provide data step-by-step. Lua also implements coroutines, which are the counterpart of Python's generators. For more information, please, check the Lua manual.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds