From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3962 Path: news.gmane.org!not-for-mail From: Paul Sokolovsky Newsgroups: gmane.linux.lib.musl.general Subject: Re: Squirrel - no-bloat scripting language with sane syntax and semantics Date: Sun, 25 Aug 2013 22:40:39 +0300 Message-ID: <20130825224039.62330f52@x34f> References: <20130824001118.5be5b3d7@x34f> <1377423273.2737.120@driftwood> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1377459660 16425 80.91.229.3 (25 Aug 2013 19:41:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Aug 2013 19:41:00 +0000 (UTC) Cc: musl@lists.openwall.com To: Rob Landley Original-X-From: musl-return-3966-gllmg-musl=m.gmane.org@lists.openwall.com Sun Aug 25 21:41:02 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1VDgBF-00071i-T8 for gllmg-musl@plane.gmane.org; Sun, 25 Aug 2013 21:40:58 +0200 Original-Received: (qmail 12216 invoked by uid 550); 25 Aug 2013 19:40:56 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 12204 invoked from network); 25 Aug 2013 19:40:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=R+93L5bnBuDyUH6qMB54/JpMVqcrMmVZ5ABSKLfd28w=; b=Vscan8JQNbaRF1+Hmed1eIwzWsQU/4hgydpEX/xL+wSLsaPinj7uhEnYHRjeXqoUSC i6N47qN/jyf6r3DT7KbNl3lfcvIxoyVLRLEmOiWcxh2KvcypB282AeofDOeoSp+CzsaL UjbvzvwoEstRkvyecaI6CNAtS4FY+gOkNuweWiPAZBRC7HggDTLcvTJFY3hezaB+BGUz J0jy0lHfHJUuZGulyOWRKpx7ksuyZjyfagM2s44IUYVsG/dn3g2rDrRI8DvUYpGC6QCB QeJY78RktbkpzwnNkqJY6H9FIE32yWPvqGUm8kLKQh/DZ/vvfbaDQttXmH09k6Q656ry WjaA== X-Received: by 10.14.218.197 with SMTP id k45mr15846390eep.32.1377459644125; Sun, 25 Aug 2013 12:40:44 -0700 (PDT) In-Reply-To: <1377423273.2737.120@driftwood> X-Mailer: Claws Mail 3.9.1 (GTK+ 2.24.10; i686-pc-linux-gnu) Xref: news.gmane.org gmane.linux.lib.musl.general:3962 Archived-At: Hello, On Sun, 25 Aug 2013 04:34:33 -0500 Rob Landley wrote: > On 08/23/2013 04:11:18 PM, Paul Sokolovsky wrote: > > Hello, > > > > I apologize if this message can be considered off-topic. However, my > > reading thru mailing list archive showed that there's favorable > > attitude to generic no-bloat stuff, so I hope this message may be of > > interest to some readers. > > We have a list of random packages in the musl wiki, but I stopped > paying attention to it when people started adding GNU projects to it. > I don't understand what it's for at that point. Yeah, like you shared sentiment that there should be site for embedded beginners, apparently lot of people feel that there should be community-driven (vs personal orthodoxy) site for unbloated software, and took that musl page as a lure ;-). > > I'd like to draw attention to small very high level (meaning that > > there's native support for lists and maps) language "Squirrel", > > http://squirrel-lang.org/ . It compiles below 300K (dynamic linking) > > with -O2 and can be gotten under 200K with -Os -flto (sizes are for > > i386). It uses C-like syntax, so should be a quick start for many > > folks. > > Normally people use lua for this, which has around 100k of > interpreter. Surely they use lua out of desperation and lack of alternatives? (Like, maybe if they knew about Brainfuck, they'd use it instead?) As for the code size, Squirrel can be slimmed down. For example, default config includes garbage collector - it's not used by VM, which uses strictly reference counting for more predictable timing, but user can call GC at suitable times either to debug cycles, or just clean cruft if they don't feel like using weakrefs. For well-behaving app, VM can be built without GC and without bytecode compiler. > > The downside of lua is it doesn't have a full standard posix C > binding library. Lua, just as Squirrel, are embedable languages and by definition don't need any "standard library bindings", it itself is bound to an app. Out of desperation for unbloated solution, people wrote lot of modules for Lua to make it a standalone general-purpose language, which exposed lot of issues in Lua semantics, which weren't critical for original embedded usage in games, but are pretty critical for a gen-purp language. > (It has a nonstandard one you can add on, but when I > looked at writing a busybox clone in it, I needed to install > something like 7 packages to get all the libraries I needed. Then > again, most people aren't implementing their own "ifconfig", "mount", > and "taskset"...) Installing 7 (small) packages is the way to go for unbloated language, otherwise it all will end up like Python - its vast, user-friendly, all-encompassing library is also its curse when it comes to embedded usage. > I note that lua is heavily used in the gaming industry, half of > World of Warcraft is written in it, for example. Poor fellas, I agree. > > > The language was created in 2003, and now at 3.0.4, but it's mostly > > one-man project, and the maintainer is not interested in its usage > > beyond "embed in C/C++ application" pattern. > > So he's been doing it for 10 years and nobody's heard about it. Everybody heard about busybox, nobody heard about toybox, go fight that, Rob ;-). Besides, as was pointed out, the gaming industry is well aware of it and even risked using it in few high-profile (as they say, I don't play ;-( ) projects - that's in the industry which is just condemned to use Lua. But what you say is exactly the problem - the author, Alberto Demichelis appear to be pretty satisfied with this niche role. Which is all understood, because there're so many general-purpose language that fighting against them is futile. Just the same as there's already uclibc, busybox, gcc and even llvm, and buildroot has been building your embedded distro for ages - well, you got the idea... > > > After some poking around > > for alternative small scripting languages and even considering > > writing web apps in C++, I gave up and decided to take solution of > > the "last mile" problem myself - to turn it into standalone > > general-purpose language, so it was suitable for arbitrary > > applications and wide audience (which means resolving few warts the > > original language does have). > > Back in the Fidonet days I downloaded a list of 2500 programming > languages. The vast majority of them were one person projects, often > some graduate student who did it as a class project. > > (Heck, I wrote one myself back in 1991 when I was first getting into > C. I did a bytecode interpreter with an assembler for the bytecode; > didn't have a libc because the interpreter had bytecodes for things > like "open file".) Every schoolboy writes his own language. Very few write *high-level* language, and almost none debug all the memory issues with it. That's why I figured it's nice idea not to write my own language, and take core from the guy who debugged it fro 10 years... > > What I have done so far is at > > https://github.com/pfalcon/squirrel-modules and > > https://github.com/pfalcon/squirrel-lang/tree/squirrel3-pfalcon . > > So, if you ever dreams of sane unbloated scripting language, > > It's called lua. (Ken Thompson has similar dreams for go, but I'm > not convinced.) Rob, you may be missing with Lua just like Ken ;-). > > > please give it > > a try. And of course, I couldn't lead it to general-purposed'ness > > myself, so if you find the idea neat, please consider joining the > > effort ;-). > > Python is now at least two incompatible languages. I've seen > applications implemented in standalone PHP, games written in Ruby, > more than one attempt to come up with an embedded subset of perl, at > least three special purpose lithp engines, javascript used outside > the browser _or_ server, more languages repurposing Java's Virtual > Machine than I can track, people still doing new stuff in tcl for > some reason, my ubuntu install has Haskell presumably because of some > dependency, OpenFirmware is implemented in fourth so that's still > around... My criteria for selecting Squirrel was simple and clear: sanity and syntax familiarity as invariants, enough maturity, then minimal size. Know better alternatives? But otherwise, you're right - in the world where JavaScript curse broke out of browsers and threatens to drown entire IT in itself, one can't be shy to do things which he thinks are right ;-). > > I note that this is off the top of my head. (I'm off in a corner of > the university out of the range of wireless signal, replying into my > outbox queue.) > > > Example no-nonsense script written in (general-purpose) Squirrel: > > There was a fun gallery of decss implementations written in various > languages a decade and change ago. I vaguely recall he had a couple > hundred, although a lot of those were things like cobol and pascal > and fortran and visual basic that we can only _hope_ are dead now... I share the sentiment - we barely finished funeral for Perl (hurrah), like other roobie-javascreeptie-looa plague spreads around... Kinda more modern variant of such shootout is http://rigaux.org/language-study/scripting-language/ . Still pretty subjective IMHO, who said that *scripting* language should munge files like sh? Somebody should do better... > > Rob P.S. Yeah, this gets pretty offtopic... -- Best regards, Paul mailto:pmiscml@gmail.com