On 01/22/2015 10:15 AM, dmccunney wrote:
> On Thu, Jan 22, 2015 at 10:54 AM, stephen Turner
> <stephen.n.tur...@gmail.com> wrote:
>> so Gnu make isnt bad but it isnt that great either, I found what looks like
>> it might be a nice little make program but the depressing down side is it
>> uses a new language tcl. its so simple! I dont understand why stuff like
>> this doesnt catch on unless its not as good as they are making it out to be?
>>
>> http://wiki.tcl.tk/9293
>>
>> on a plus side it sounds like tcl is easy to learn. albiet its not as simple
>> as just writing a shell script for a makefile

Way back when I was looking at rewriting toybox in lua, but having to
cross compile a language runtime to a new architecture wasn't a huge
step up from having to cross compile a C binary.

I have a todo item to write a "make", either for toybox for for my
proposed qcc project (my old tcc fork + qemu's tcg Tiny Code Generator).
In either case, it's not until after 1.0.

I tried to build toybox under the bsd make in pcbsd, and... it did not
go well. Just getting kconfig (menuconfig) to build was enough of a
blocker I wandered off and did other things. My approach to gmake is
similar to my approach to bash: clone one that does enough of the same
stuff to migrate the existing users off, regardless of what subset may
be "standardized". If the standard isn't enough to support actual use
cases, then the standard is merely a frame of reference to diverge from
and from there you debug the use cases and add the things they need.

> Tcl is a scripting language created by John Ousterhout when he was a
> Professor of Computer Science at UC.  His students were developing a
> network operating system called Amoeba.  Dr. Ousterhout wrote Tcl to
> be a glue language.  Tk was added later as a means of providing
> graphical widgets, and has been used in other efforts as well.
> 
> Tcl underlies Done Libes' Expect utility, which is just the thing if
> you need to automate processes that are normally run interactively.

I've meant to write an "expect" in C for years as well, but I don't use
the existing expect enough to just knock off a version with the
semantics its existing users want.

To be honest when confronted with expect, I wrote my own version in
python because it was easier than learning anything about tcl. Since
then I've written shell and C versions, but I haven't tried to publish
them because I dunno how to use the existing tcl one. (I remember poking
at it for 15 minutes and being confused, and then writing a new one in
like 5. It's not that it's hard to learn, just that it really didn't
seem _worth_ it for what it was doing...)

(Yes, getting it to work in shell was fiddly: I had to use mkfifo.
There's almost certainly a better way but that's the one I got working
first. For years I've wanted a shell command called 'loop' that pipes
the output at the end of the command line back into the input at the
beginning. Maybe I'll put it in toysh.)

(Ok, "for years" turns out to be "for well over a decade":
http://osdir.com/ml/linux.busybox/2004-01/msg00048.html . Sheesh, why
don't people steal my ideas and _implement_ them more often, so I don't
have to?)

The basic functionality is trivial to do in toybox because I already
wrote the hard bits in lib/xwrap.c function xpopen_both(). Example
usages (through two different wrappers) are in mount.c to call losetup
and swapon. But it parses some sort of config file and then maybe needs
regex searches to match things? And does it extract data from its input
and process it to produce output, or something?

Again: a possible todo item after 1.0. Not because it's hard to write
but because I don't know what the command should _do_. Expect has a
command script that apparently you can embed tcl snippets into, or
something? (I should go look at it, but it's waaaaaay down the todo list.)

> You could probably use Tcl to implement make functionality (though I'm
> not aware of anyone who has), but that requires you to have Tcl
> available.  It's available for Linux, but not all distros include it
> as a default.

I need to add awk to toybox because posix and because ./configure stages
of lots of packages use it.

But tcl is out of scope. (And only seems to be used for two things:
tcl/tk graphics whatsis that python finally mostly weaned itself off of,
and expect.)

> I recommend Brent Welch's "Practical Programming in Tcl and Tk" from
> Prentice Hall as the best Tcl book I'm aware of.  For Expect, you want
> Don Libes' "Exploring Expect" published by O'Reilly.
> 
>> https://lkubuntu.wordpress.com/2013/01/09/shbuild-an-alternative-to-gnu-make-using-shell-scripts/

I forget where I posted my make rant. Might have been a year or two back
on the toybox list? Ah no, it was on the aboriginal list (in two parts):

http://lists.landley.net/pipermail/aboriginal-landley.net/2011-June/000859.html
http://lists.landley.net/pipermail/aboriginal-landley.net/2011-June/000860.html

(And yes, I found that by googling for "landley make rant".)

>> am i missing something or is gnu make the only Makefile processing make
>> program without adding additional dependencies like perl?
> 
> Another popular alternative is Scons (http://www.scons.org/), but
> Scons requires Python.

Requiring python is pretty much a deal breaker. (As mercurial seems to
have discovered, having about 5% of the market share of git at this point.)

But the big problem is that rewriting the makefiles of existing projects
is a flaming pain. (As I'm sure enh could tell you, since Android is
apparently doing it. I'm not convinced their way of doing it is _better_
since it's still based on make, but I haven't looked too deeply yet.)

> Wikipedia has a list of build automation software -
> http://en.wikipedia.org/wiki/List_of_build_automation_software

We need a rethink of build systems the way git/mercurial was a rethink
of cvs and svn. Unfortunately, there's a network effects thing where
crap like CVS being standardized outweighed the benefits of the new
thing unless you had a flagship like linux-kernel that can get you a
critical mass of new developers. We haven't got that for make. X11 tried
its own make for a while (imake?), Apache had Ant, and so on, but none
of it really made a dent.

Android could lead us to a new make system, but instead they layered
"repo" on top of git, rewrote existing makefiles but still did so using
"make", and gave us a bsd-style giant hairball build I'm still trying to
pick apart and extract individual packages and build flow from.

So "could", but "isn't yet". Maybe when their current build collapses
under its own weight and they do a 2.0 version, but given the amount of
engineering time they (and other companies) are throwing at it I expect
that's at least 5 years away, and there could still be an incremental
cleanup ala Joel Spolsky's advice from
http://www.joelonsoftware.com/articles/fog0000000069.html

(Also, we need to rethink all three stages, configure, make, and
install. But I've got my plate full just now...)

Rob
_______________________________________________
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to