From owner-freebsd-hackers@FreeBSD.ORG Sat Mar 15 00:21:34 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84C30DF7 for ; Sat, 15 Mar 2014 00:21:34 +0000 (UTC) Received: from nm33.bullet.mail.bf1.yahoo.com (nm33.bullet.mail.bf1.yahoo.com [72.30.238.133]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 30A70B4 for ; Sat, 15 Mar 2014 00:21:33 +0000 (UTC) Received: from [66.196.81.171] by nm33.bullet.mail.bf1.yahoo.com with NNFMP; 15 Mar 2014 00:18:53 -0000 Received: from [98.139.211.199] by tm17.bullet.mail.bf1.yahoo.com with NNFMP; 15 Mar 2014 00:18:53 -0000 Received: from [127.0.0.1] by smtp208.mail.bf1.yahoo.com with NNFMP; 15 Mar 2014 00:18:53 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1394842733; bh=z3vGaRIXcSqpW6w91bPi+CktHLlokN5ifk9hYQjMXGc=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type:Content-Disposition:Content-Transfer-Encoding:In-Reply-To:User-Agent; b=PvXSkb15zPbE79SNzl8yu9HK8JBCjOF+6/gxdShJoTJHMfa/TN1+EdMbz5Bgr07L6ExYjjiMFRI85Vp/4H4zAfM0bSnjx6bg48c8MCoPR532JgSVhRTzNHnM6Is9n1jKA/0DjBqth7GyZB5aab71CIsKwPRkJYboE6xdauxIeFw= X-Yahoo-Newman-Id: 907049.92111.bm@smtp208.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: C9byG3UVM1kvty0ofddJkkVnQ7DeMkELrRzJxgppx46Tzmm Zmgc.OEQp51Z4MUx0oyNVIGtVs8pToejn1IRtCrZeOg9Jb0CUzwS5u.P2B.J IYJB8fc.Jn27shgi9p3nzkJwXzCNPc7HSl1Y2HOHyrcDPTlio0QnlCJuYkQf mOtaTdE83vH7XE6S.XAPISm29VsZKHb0pSMrF7JL1QZR8001jErJl7gcGGuk 9dpOmaKl.FVgh1Z19cu1qpK4nx82a04ef3DY1PcowxnYxnNA1csgD3FuLNCh 1huVlhvgkA9.LFzTOCFoOETmYQc96BM4e_sdghL4TKiUl1U0r0wmU8GpORff 7ew6JBnGx12zFQ3ACEAWM1DXrVvKPsj44Kczd_1i0lN0CJVLlcuGv5imjpzo ydHj.CZJzIfEly9VSC0P4pxxsn8hwekdQPspyLeNJBiwpV.E5oeIgON4jbUR MttFL1K99.gDPFEMSOUb3_y72vHFcfCoa0o_fr2iIfx.JtByhbYK54ZEqozI 4gXBR9RQUn25hqOebVX2jRozrAujvYCssiiQiBZ466xbBs517resuTqfWfoG VgazUN69KW6iis3lCLj.eqvBiYs9QDXvqqwPRCN0RpW9VB7Cbw_RlCK_Xk02 Ec7ArUSKO_dYSRRhvtsFhhqzvBV3m890TTRN1nFzUEGplHfWwWtxOkE7BXYU IfWb1Kjcy1TiMPDQV_.OIO5NA.O5QA5E- X-Yahoo-SMTP: yVvIDoOswBD5zOzqXnwUE.yVSR2Kvw-- X-Rocket-Received: from nbu (walt.ford@71.168.199.64 with plain [98.138.105.22]) by smtp208.mail.bf1.yahoo.com with SMTP; 14 Mar 2014 17:18:53 -0700 PDT Date: Fri, 14 Mar 2014 20:18:20 -0400 From: Walt Ford To: =?utf-8?B?5pyx5rGf?= Subject: Re: Overhaul the config system with Lua Message-ID: <20140315001820.GB5765@nbu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Mailman-Approved-At: Sat, 15 Mar 2014 02:07:01 +0000 Cc: freebsd-hackers X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2014 00:21:34 -0000 On Sat, Mar 15, 2014 at 01:11:03AM +0800, 朱江 wrote: > I want to overhaul the config system with Lua, and it will be my GSoC 2014 > project. Here is the > proposal That's an excellent project. I've had Lua in my own base system for years and have converted the rc system to use it at various times, along with some base utilities. I've been considering posting a Kickstarter project to finally finish it all, but Lua isn't the most popular language, and FreeBSD isn't the most popular OS. The main goal of my work was to present a more uniform userland. Everybody hacks on the kernel, but userland gets a little ignored. There's not much uniformity between command-line options, interactivity, color, scriptability, layout, and naming of utilities, and Lua was a great fit to clean it up. I even got it to the point of generating utilities on its own. When Robert Watson imported audit(2) it was able to crawl the headers and generate a utility in the style of top(1) that showed the most active audit record types as colorized output like gstat(8). Lua could get to the point where it automatically generates entire applications with uniform command-line options, interactivity, color, and scriptability, just based on kernel subsystem definitions in header files plus a little glue. Unfortunately, I've never had the time or money to finish it all. That audit utility is dated 2007. > I will create a wiki in my site soon. Please let me know if you have any > good ideas about the new config system. They will not be a part of my GSoC > project, however, I will do this work continuously after GSoC. I converted a lot of FreeBSD to Lua, but never config(8). Some build issues to figure out how to solve are: * the differences and sloppiness in how userland and kernel options are handled kernel options are manually documented in sys/conf/options* and have no man page share/examples/etc/kern.conf doesn't exist userland options are documented in tools/build/options and the man page, src.conf, is generated using a shell script share/examples/etc/src.conf doesn't exist share/examples/etc/make.conf is manually updated and often out-of-date * generate GENERIC config files currently things are copied and pasted for every arch would need to account for DEFAULTS * automatic generation of OptionalObsoleteFiles.inc must be manually updated and has never been complete a make target could build twice with and without option then find the missing files probably a better job for jenkins and make, but Lua could help I'm sure there are other ways to improve the build system as a whole using Lua, as long as you don't confine yourself to reimplementing config(8) only. The information about options currently stored in tools/build/options and sys/conf/options should really be part of config(8), along with the architecture information necessary to generate documentation or source files automatically. Lua would make a great kernel language as well, another one of the projects I started and haven't had time to play with. -- Walt